From 5b8ea95a8efcb8a79c9f40f336eb59657eee779d Mon Sep 17 00:00:00 2001 From: nolash Date: Fri, 17 Sep 2021 08:12:51 +0200 Subject: [PATCH] Bump chainlib to take dynamic arg vector for argparse --- apps/cic-eth/cic_eth/cli/rpc.py | 4 ++-- apps/cic-eth/cic_eth/runnable/daemons/tasker.py | 7 ++++++- apps/contract-migration/config.sh | 2 +- apps/contract-migration/envlist | 1 + apps/contract-migration/requirements.txt | 2 +- apps/contract-migration/reset.sh | 5 +++-- apps/contract-migration/run_job.sh | 2 +- apps/contract-migration/seed_cic_eth.sh | 1 + docker-compose.yml | 5 +++-- 9 files changed, 19 insertions(+), 10 deletions(-) diff --git a/apps/cic-eth/cic_eth/cli/rpc.py b/apps/cic-eth/cic_eth/cli/rpc.py index 25e28f9b..c695402f 100644 --- a/apps/cic-eth/cic_eth/cli/rpc.py +++ b/apps/cic-eth/cic_eth/cli/rpc.py @@ -35,14 +35,14 @@ class RPC: def from_config(config, use_signer=False, default_label='default', signer_label='signer'): chain_spec = ChainSpec.from_chain_str(config.get('CHAIN_SPEC')) - RPCConnection.register_location(config.get('RPC_HTTP_PROVIDER'), chain_spec, default_label) + RPCConnection.register_location(config.get('RPC_PROVIDER'), chain_spec, default_label) if use_signer: RPCConnection.register_constructor(ConnType.UNIX, EthUnixSignerConnection, signer_label) RPCConnection.register_constructor(ConnType.HTTP, EthHTTPSignerConnection, signer_label) RPCConnection.register_constructor(ConnType.HTTP_SSL, EthHTTPSignerConnection, signer_label) RPCConnection.register_location(config.get('SIGNER_PROVIDER'), chain_spec, signer_label) - rpc = RPC(chain_spec, config.get('RPC_HTTP_PROVIDER'), signer_provider=config.get('SIGNER_PROVIDER')) + rpc = RPC(chain_spec, config.get('RPC_PROVIDER'), signer_provider=config.get('SIGNER_PROVIDER')) logg.info('set up rpc: {}'.format(rpc)) return rpc diff --git a/apps/cic-eth/cic_eth/runnable/daemons/tasker.py b/apps/cic-eth/cic_eth/runnable/daemons/tasker.py index fab470f3..feb1915c 100644 --- a/apps/cic-eth/cic_eth/runnable/daemons/tasker.py +++ b/apps/cic-eth/cic_eth/runnable/daemons/tasker.py @@ -69,10 +69,15 @@ from cic_eth.registry import ( ) from cic_eth.task import BaseTask - logging.basicConfig(level=logging.WARNING) logg = logging.getLogger() +env = list(os.environ.keys()) +env.sort() +for k in env: + logg.debug("env {} {}".format(k, os.environ[k])) + + arg_flags = cic_eth.cli.argflag_std_read local_arg_flags = cic_eth.cli.argflag_local_task argparser = cic_eth.cli.ArgumentParser(arg_flags) diff --git a/apps/contract-migration/config.sh b/apps/contract-migration/config.sh index 3831ce7e..858eaf85 100644 --- a/apps/contract-migration/config.sh +++ b/apps/contract-migration/config.sh @@ -36,7 +36,7 @@ export TOKEN_SINK_ADDRESS=${TOKEN_SINK_ADDRESS:-$DEV_ETH_ACCOUNT_CONTRACT_DEPLOY # Migration variable processing -confini-dump --schema-module chainlib.eth.data.config --schema-module cic_eth.data.config --schema-dir ./config --prefix export > ${DEV_DATA_DIR}/env_reset +confini-dump -vv --schema-module chainlib.eth.data.config --schema-module cic_eth.data.config --schema-dir ./config --prefix export > ${DEV_DATA_DIR}/env_reset cat ${DEV_DATA_DIR}/env_reset diff --git a/apps/contract-migration/envlist b/apps/contract-migration/envlist index 8613215b..d68d9f44 100644 --- a/apps/contract-migration/envlist +++ b/apps/contract-migration/envlist @@ -56,6 +56,7 @@ ETH_PROVIDER ETH_ABI_DIR SIGNER_SOCKET_PATH SIGNER_SECRET +SIGNER_PROVIDER CELERY_BROKER_URL CELERY_RESULT_URL META_PROVIDER diff --git a/apps/contract-migration/requirements.txt b/apps/contract-migration/requirements.txt index 01f09527..0e62e29a 100644 --- a/apps/contract-migration/requirements.txt +++ b/apps/contract-migration/requirements.txt @@ -1,5 +1,5 @@ cic-eth[tools]==0.12.4a8 -chainlib-eth>=0.0.9a9,<0.1.0 +chainlib-eth>=0.0.9a14,<0.1.0 eth-erc20>=0.1.2a3,<0.2.0 erc20-demurrage-token>=0.0.5a2,<0.1.0 eth-accounts-index>=0.1.2a2,<0.2.0 diff --git a/apps/contract-migration/reset.sh b/apps/contract-migration/reset.sh index b9cd99d5..728356ce 100755 --- a/apps/contract-migration/reset.sh +++ b/apps/contract-migration/reset.sh @@ -3,8 +3,8 @@ set -a . ${DEV_DATA_DIR}/env_reset -WAIT_FOR_TIMEOUT=${WAIT_FOR_TIMEOUT:-60} +WAIT_FOR_TIMEOUT=${WAIT_FOR_TIMEOUT:-60} set -e @@ -109,7 +109,8 @@ giftable-token-minter -s -u $fee_price_arg -w -y $WALLET_KEY_FILE -e $DEV_RESERV #echo "export CIC_DEFAULT_TOKEN_SYMBOL=$TOKEN_SYMBOL" >> ${DEV_DATA_DIR}/env_reset export CIC_DEFAULT_TOKEN_SYMBOL=$TOKEN_SYMBOL -confini-dump --schema-module chainlib.eth.data.config --schema-module cic_eth.data.config --schema-dir ./config --prefix export > ${DEV_DATA_DIR}/env_reset + +confini-dump -vv --schema-module chainlib.eth.data.config --schema-module cic_eth.data.config --schema-dir ./config --prefix export > ${DEV_DATA_DIR}/env_reset confini-dump --schema-module chainlib.eth.data.config --schema-module cic_eth.data.config --schema-dir ./config set +a diff --git a/apps/contract-migration/run_job.sh b/apps/contract-migration/run_job.sh index fcb62d7e..0df34361 100644 --- a/apps/contract-migration/run_job.sh +++ b/apps/contract-migration/run_job.sh @@ -1,7 +1,7 @@ #! /bin/bash >&2 echo -e "\033[;96mRUNNING\033[;39m configurations" -. ./config.sh +./config.sh if [ $? -ne "0" ]; then >&2 echo -e "\033[;31mFAILED\033[;39m configurations" exit 1; diff --git a/apps/contract-migration/seed_cic_eth.sh b/apps/contract-migration/seed_cic_eth.sh index eb1bfd59..30c68cb8 100755 --- a/apps/contract-migration/seed_cic_eth.sh +++ b/apps/contract-migration/seed_cic_eth.sh @@ -78,6 +78,7 @@ export DEV_ETH_SARAFU_TOKEN_ADDRESS=$DEV_ETH_RESERVE_ADDRESS >&2 erc20-transfer -s -u -y $WALLET_KEY_FILE -i $CHAIN_SPEC -p $RPC_PROVIDER --fee-limit 100000 -e $reserve_address -w $debug -a $DEV_ETH_ACCOUNT_SARAFU_GIFTER ${DEV_TOKEN_AMOUNT:0:-1} # Remove the SEND (8), QUEUE (16) and INIT (2) locks (or'ed), set by default at migration +echo "cic-eth-ctl -i $CHAIN_SPEC unlock INIT" cic-eth-ctl -i $CHAIN_SPEC unlock INIT cic-eth-ctl -i $CHAIN_SPEC unlock SEND cic-eth-ctl -i $CHAIN_SPEC unlock QUEUE diff --git a/docker-compose.yml b/docker-compose.yml index 563e8621..f66814f6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -262,8 +262,9 @@ services: CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://redis} CELERY_RESULT_URL: ${CELERY_RESULT_URL:-redis://redis} CELERY_DEBUG: ${CELERY_DEBUG:-1} - SIGNER_SOCKET_PATH: ${SIGNER_SOCKET_PATH:-http://cic-eth-signer:8000} - SIGNER_PROVIDER: ${SIGNER_SOCKET_PATH:-http://cic-eth-signer:8000} + #SIGNER_SOCKET_PATH: ${SIGNER_SOCKET_PATH:-http://cic-eth-signer:8000} + SIGNER_PROVIDER: ${SIGNER_PROVIDER:-http://cic-eth-signer:8000} + SIGNER_PROVIDER: http://cic-eth-signer:8000 SIGNER_SECRET: ${SIGNER_SECRET:-deadbeef} ETH_ACCOUNT_ACCOUNTS_INDEX_WRITER: ${DEV_ETH_ACCOUNT_ACCOUNTS_INDEX_WRITER:-0xACB0BC74E1686D62dE7DC6414C999EA60C09F0eA} TASKS_TRACE_QUEUE_STATUS: ${TASKS_TRACE_QUEUE_STATUS:-1}