diff --git a/apps/cic-eth/cic_eth/runnable/daemons/tasker.py b/apps/cic-eth/cic_eth/runnable/daemons/tasker.py index b0c736f8..d17a1038 100644 --- a/apps/cic-eth/cic_eth/runnable/daemons/tasker.py +++ b/apps/cic-eth/cic_eth/runnable/daemons/tasker.py @@ -15,8 +15,10 @@ from chainlib.connection import RPCConnection from chainlib.eth.connection import EthUnixSignerConnection from chainlib.chain import ChainSpec from chainqueue.db.models.otx import Otx +from cic_eth_registry.error import UnknownContractError import liveness.linux + # local imports from cic_eth.eth import ( erc20, @@ -169,7 +171,11 @@ def main(): rpc = RPCConnection.connect(chain_spec, 'default') - connect_registry(rpc, chain_spec, config.get('CIC_REGISTRY_ADDRESS')) + try: + connect_registry(rpc, chain_spec, config.get('CIC_REGISTRY_ADDRESS')) + except UnknownContractError as e: + logg.exception('Registry contract connection failed for {}: {}'.format(config.get('CIC_REGISTRY_ADDRESS'), e)) + sys.exit(1) trusted_addresses_src = config.get('CIC_TRUST_ADDRESS') if trusted_addresses_src == None: @@ -178,6 +184,7 @@ def main(): trusted_addresses = trusted_addresses_src.split(',') for address in trusted_addresses: logg.info('using trusted address {}'.format(address)) + connect_declarator(rpc, chain_spec, trusted_addresses) connect_token_registry(rpc, chain_spec)