commit 760ff716328d212eddeecf570c0a35a223c4ddb4
parent 7f113d1cdc301738d658414e4234ee717bd1ca03
Author: nolash <dev@holbrook.no>
Date: Fri, 15 Oct 2021 22:40:22 +0200
rehabilitate socket server
Diffstat:
8 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/MANIFEST.in b/MANIFEST.in
@@ -1 +1 @@
-include *requirements*
+include *requirements* funga/eth/data/config/**
diff --git a/README b/README
diff --git a/funga/eth/cli/socket.py b/funga/eth/cli/socket.py
@@ -5,7 +5,7 @@ import socket
import stat
# local imports
-from crypto_dev_signer.error import SignerError
+from funga.error import SignerError
from .handle import SignRequestHandler
logg = logging.getLogger(__name__)
diff --git a/config/database.ini b/funga/eth/data/config/database.ini
diff --git a/config/config.ini b/funga/eth/data/config/signer.ini
diff --git a/funga/eth/keystore/keyfile.py b/funga/eth/keystore/keyfile.py
@@ -140,7 +140,6 @@ def from_dict(o, passphrase=''):
pk = m(ciphertext_bytes, decryption_key[:16], iv)
except AssertionError as e:
raise DecryptError('could not decrypt keyfile: {}'.format(e))
- logg.debug('bar')
return pk
diff --git a/funga/eth/runnable/signer.py b/funga/eth/runnable/signer.py
@@ -12,14 +12,16 @@ import confini
from jsonrpc.exceptions import *
# local imports
-from crypto_dev_signer.eth.signer import ReferenceSigner
-from crypto_dev_signer.keystore.reference import ReferenceKeystore
-from crypto_dev_signer.cli.handle import SignRequestHandler
+from funga.eth.signer import EIP155Signer
+from funga.eth.keystore.sql import SQLKeystore
+from funga.eth.cli.handle import SignRequestHandler
logging.basicConfig(level=logging.WARNING)
logg = logging.getLogger()
-config_dir = '.'
+script_dir = os.path.dirname(os.path.realpath(__file__))
+data_dir = os.path.join(script_dir, '..', 'data')
+config_dir = os.path.join(data_dir, 'config')
db = None
signer = None
@@ -27,6 +29,7 @@ session = None
chainId = 8995
socket_path = '/run/crypto-dev-signer/jsonrpc.ipc'
+
argparser = argparse.ArgumentParser()
argparser.add_argument('-c', type=str, default=config_dir, help='config file')
argparser.add_argument('--env-prefix', default=os.environ.get('CONFINI_ENV_PREFIX'), dest='env_prefix', type=str, help='environment prefix for variables to overwrite configuration')
@@ -85,8 +88,8 @@ def main():
kw = {
'symmetric_key': secret,
}
- SignRequestHandler.keystore = ReferenceKeystore(dsn, **kw)
- SignRequestHandler.signer = ReferenceSigner(SignRequestHandler.keystore)
+ SignRequestHandler.keystore = SQLKeystore(dsn, **kw)
+ SignRequestHandler.signer = EIP155Signer(SignRequestHandler.keystore)
arg = None
try:
@@ -97,19 +100,19 @@ def main():
if socket_url.scheme != '':
scheme = socket_url.scheme
if re.match(re_tcp, socket_url.scheme):
- from crypto_dev_signer.cli.socket import start_server_tcp
+ from funga.eth.cli.socket import start_server_tcp
socket_spec = socket_url.netloc.split(':')
host = socket_spec[0]
port = int(socket_spec[1])
start_server_tcp((host, port))
elif re.match(re_http, socket_url.scheme):
- from crypto_dev_signer.cli.http import start_server_http
+ from funga.eth.cli.http import start_server_http
socket_spec = socket_url.netloc.split(':')
host = socket_spec[0]
port = int(socket_spec[1])
start_server_http((host, port))
else:
- from crypto_dev_signer.cli.socket import start_server_unix
+ from funga.eth.cli.socket import start_server_unix
start_server_unix(socket_url.path)
sys.exit(0)
diff --git a/setup.py b/setup.py
@@ -1,6 +1,6 @@
from setuptools import setup
-f = open('README.md', 'r')
+f = open('README', 'r')
long_description = f.read()
f.close()
@@ -33,7 +33,7 @@ f.close()
setup(
name="funga-eth",
- version="0.5.1a1",
+ version="0.5.1a2",
description="Ethereum implementation of the funga keystore and signer",
author="Louis Holbrook",
author_email="dev@holbrook.no",
@@ -58,4 +58,5 @@ setup(
],
},
url='https://gitlab.com/chaintool/funga-eth',
+ include_package_data=True,
)