cic-cli/cic/cmd/ext.py
William Luke 4f219e3d18
Some checks reported errors
continuous-integration/drone/pr Build encountered an error
continuous-integration/drone/push Build is failing
fix: broken imports
2022-03-01 11:17:17 +03:00

31 lines
976 B
Python

# standard imports
import importlib
# external imports
from chainlib.chain import ChainSpec
# local imports
from cic.contract.components.network import Network
def process_args(argparser):
argparser.add_argument('--registry', required=True, type=str, help='contract registry address')
argparser.add_argument('-d', '--directory', type=str, dest='directory', default='.', help='directory')
argparser.add_argument('-p', type=str, help='RPC endpoint')
argparser.add_argument('-i', type=str, help='chain spec string')
argparser.add_argument('target', help='target to initialize')
def validate_args(args):
pass
def execute(config, eargs):
cn = Network(eargs.directory, targets=eargs.target)
cn.load()
chain_spec = ChainSpec.from_chain_str(eargs.i)
m = importlib.import_module(f'cic.ext.{eargs.target}.start')
m.extension_start(cn, registry_address=eargs.registry, chain_spec=chain_spec, rpc_provider=config.get('RPC_PROVIDER'))