feat: add interactive deployment and switch to poetry #2
@ -60,6 +60,9 @@ below are limited to the context of the EVM.
|
|||||||
poetry run cic -h
|
poetry run cic -h
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
poetry run cic wizard ./somewhere -c ./config/dev-docker
|
||||||
|
```
|
||||||
### Tests
|
### Tests
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -109,19 +109,32 @@ def generate_contract(
|
|||||||
CIC_REGISTRY_ADDRESS: {config.get("CIC_REGISTRY_ADDRESS")}
|
CIC_REGISTRY_ADDRESS: {config.get("CIC_REGISTRY_ADDRESS")}
|
||||||
CHAIN_SPEC: {config.get("CHAIN_SPEC")}
|
CHAIN_SPEC: {config.get("CHAIN_SPEC")}
|
||||||
RPC_PROVIDER: {config.get("RPC_PROVIDER")}
|
RPC_PROVIDER: {config.get("RPC_PROVIDER")}
|
||||||
AUTH_KEY: {config.get("AUTH_KEY")}
|
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
for target in targets:
|
for target in targets:
|
||||||
|
# TODO Clean this up
|
||||||
|
modname = f"cic.ext.{target}"
|
||||||
|
cmd_mod = importlib.import_module(modname)
|
||||||
|
signer_hint = config.get("WALLET_KEY_FILE")
|
||||||
|
keys = cmd_mod.list_keys(config, signer_hint)
|
||||||
|
for idx, key in enumerate(keys):
|
||||||
|
print(f"{idx} - {key} ")
|
||||||
|
selecting_key = True
|
||||||
|
while selecting_key:
|
||||||
|
idx = int(input("Select key: "))
|
||||||
|
if keys[idx] is not None:
|
||||||
|
key_account_address = keys[idx]
|
||||||
|
selecting_key = False
|
||||||
|
else:
|
||||||
|
print("Invalid key, try again")
|
||||||
|
|
||||||
m = importlib.import_module(f"cic.ext.{target}.start")
|
m = importlib.import_module(f"cic.ext.{target}.start")
|
||||||
m.extension_start(
|
m.extension_start(
|
||||||
network,
|
network,
|
||||||
registry_address=config.get("CIC_REGISTRY_ADDRESS"),
|
registry_address=config.get("CIC_REGISTRY_ADDRESS"),
|
||||||
chain_spec=ChainSpec.from_chain_str(config.get("CHAIN_SPEC")),
|
chain_spec=ChainSpec.from_chain_str(config.get("CHAIN_SPEC")),
|
||||||
rpc_provider=config.get("RPC_PROVIDER"),
|
rpc_provider=config.get("RPC_PROVIDER"),
|
||||||
key_account_address=config.get(
|
key_account_address=key_account_address
|
||||||
"AUTH_KEY"
|
|
||||||
), # TODO this should come from the wallet keystore
|
|
||||||
)
|
)
|
||||||
network.load()
|
network.load()
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ from giftable_erc20_token import GiftableToken
|
|||||||
from hexathon import add_0x, strip_0x
|
from hexathon import add_0x, strip_0x
|
||||||
|
|
||||||
# local imports
|
# local imports
|
||||||
from cic.ext.eth.rpc import parse_adapter
|
from cic.ext.eth.rpc import parse_adapter, list_keys
|
||||||
from cic.extension import Extension
|
from cic.extension import Extension
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,3 +52,17 @@ def parse_adapter(config, signer_hint):
|
|||||||
rpc.connect_by_config(config)
|
rpc.connect_by_config(config)
|
||||||
|
|
||||||
return (rpc.conn, signer)
|
return (rpc.conn, signer)
|
||||||
|
|
||||||
|
# TODO Find a better place for this
|
||||||
|
def list_keys(config, signer_hint):
|
||||||
|
keystore = None
|
||||||
|
if signer_hint is None:
|
||||||
|
logg.info("signer hint missing")
|
||||||
|
return None
|
||||||
|
st = os.stat(signer_hint)
|
||||||
|
if stat.S_ISDIR(st.st_mode):
|
||||||
|
logg.debug("signer hint is directory")
|
||||||
|
keystore = EthKeystoreDirectory()
|
||||||
|
keystore.process_dir(signer_hint, default_password=config.get('WALLET_PASSPHRASE', ''))
|
||||||
|
|
||||||
|
return keystore.list()
|
Loading…
Reference in New Issue
Block a user