funga-eth

Ethereum implementation of the funga keystore and signer
Log | Files | Refs | README | LICENSE

commit 1a0f32687c8afa36f219d3920fa5dfb919936114
parent 240cbbf372da62257abbf65ddb115ef229e6695c
Author: lash <dev@holbrook.no>
Date:   Sat,  3 Jun 2023 13:28:33 +0100

Make dict keystore default for signer daemon

Diffstat:
MCHANGELOG | 4++++
MMANIFEST.in | 2+-
DREADME | 0
MREADME.md | 21+++++++++++++++++++--
Mfunga/eth/runnable/signer.py | 11+++++++++--
Msetup.py | 14+++++++-------
6 files changed, 40 insertions(+), 12 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG @@ -1,3 +1,7 @@ +* 0.7.0 + - Make dict keystore default for signer daemon +* 0.6.7 + - Add package description * 0.6.6 - EIP712 Typed data signer support * 0.6.5 diff --git a/MANIFEST.in b/MANIFEST.in @@ -1 +1 @@ -include *requirements* LICENSE WAIVER WAIVER.asc funga/eth/data/config/** +include *requirements* LICENSE WAIVER WAIVER.asc funga/eth/data/config/** README* diff --git a/README b/README diff --git a/README.md b/README.md @@ -1,15 +1,32 @@ -# Funga - Ethereum implementation +# funga-eth + +Ethereum implementation of the `funga` signer interface. See https://git.defalsify.org/funga for more details. ## Tools -When installed with pip/setuptools, this package provides a Unix socket IPC server as `funga-ethd` implementing the following web3 json-rpc methods: +When installed as a python package, three tools are installed in the python executable script path. + +* `funga-ethd` - Signer daemon (see below for details). +* `eth-keyfile` - Ethereum keyfile en- and decoder, and en- and decrypter. +* `eth-msg-sign` - Signer tool for arbitrary messages ([ERC-191](https://eips.ethereum.org/EIPS/eip-191)). + + +### funga-ethd + +A Unix socket IPC server as `funga-ethd` implementing the following web3 json-rpc methods: * web3.eth.personal.newAccount * web3.eth.personal.signTransaction * web3.eth.signTransaction + +### CLI tools + +Please use `--help` as argument to the `eth-keyfile` and `eth-msg-sign` tools to learn the arguments the tools accept. + + ## Funga interface implementations - **ReferenceKeystore**: Implements the `Keystore` interface, with a postgresql backend expecting sql schema as defined in `ReferenceKeystore.schema` diff --git a/funga/eth/runnable/signer.py b/funga/eth/runnable/signer.py @@ -13,7 +13,6 @@ from jsonrpc.exceptions import * # local imports 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) @@ -34,6 +33,7 @@ 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') argparser.add_argument('-i', type=int, help='default chain id for EIP155') +argparser.add_argument('-k', '--keystore-type', dest='keystore_type', type=str, choices=['dict', 'sql'], default='dict', help='keystore backend type') argparser.add_argument('-s', type=str, help='socket path') argparser.add_argument('-v', action='store_true', help='be verbose') argparser.add_argument('-vv', action='store_true', help='be more verbose') @@ -88,7 +88,14 @@ def main(): kw = { 'symmetric_key': secret, } - SignRequestHandler.keystore = SQLKeystore(dsn, **kw) + if args.keystore_type == 'sql': + logg.info('using sql keystore: ' + dsn) + from funga.eth.keystore.sql import SQLKeystore + SignRequestHandler.keystore = SQLKeystore(dsn, **kw) + else: + logg.warning('using volatile dict keystore - all keys will be lost when you quit') + from funga.eth.keystore.dict import DictKeystore + SignRequestHandler.keystore = DictKeystore() SignRequestHandler.signer = EIP155Signer(SignRequestHandler.keystore) arg = None diff --git a/setup.py b/setup.py @@ -1,9 +1,5 @@ from setuptools import setup -f = open('README', 'r') -long_description = f.read() -f.close() - requirements = [] f = open('requirements.txt', 'r') while True: @@ -31,9 +27,13 @@ while True: test_requirements.append(l.rstrip()) f.close() +f = open('README.md', 'r') +description = f.read() +f.close() + setup( name="funga-eth", - version="0.6.6", + version="0.7.0", description="Ethereum implementation of the funga keystore and signer", author="Louis Holbrook", author_email="dev@holbrook.no", @@ -49,8 +49,6 @@ setup( 'sql': sql_requirements, }, tests_require=test_requirements, - long_description=long_description, - long_description_content_type='text/markdown', entry_points = { 'console_scripts': [ 'funga-ethd=funga.eth.runnable.signer:main', @@ -60,4 +58,6 @@ setup( }, url='https://git.defalsify.org/funga-eth', include_package_data=True, + long_description=description, + long_description_content_type='text/markdown', )