Skip to content

Commit

Permalink
release: v0.6.1 (#208)
Browse files Browse the repository at this point in the history
* feat: add debug support for scripts

* feat: add config for timeout_commit
  • Loading branch information
jrriehl authored Jan 16, 2023
1 parent 27f99ad commit 53d3933
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/jenesis/cmd/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ def run(args: argparse.Namespace):

with network_context(profile.network, cfg.project_name, profile.name):
shell_globals = load_shell_globals(cfg, profile)
with open(args.script_path, encoding="utf-8") as script:
exec(script.read(), shell_globals)
with open(args.script_path, encoding="utf-8") as file:
code = compile(
file.read(),
os.path.basename(args.script_path),
'exec',
)
exec(code, shell_globals)


def add_run_command(parser):
Expand Down
6 changes: 5 additions & 1 deletion src/jenesis/network/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
DEFAULT_GENESIS_ACCOUNT = "fetch1gns5lphdk5ew5lnre7ulzv8s8k9dr9eyqvgj0w"
DEFAULT_DENOMINATION = "atestfet"
DEFAULT_CLI_BINARY = "fetchd"
DEFAULT_TIMEOUT_COMMIT = "5s"


LOCALNODE_CONFIG_DIR = os.path.join(os.getcwd(), ".localnode")
Expand All @@ -44,6 +45,7 @@ def __init__(
password: Optional[str] = None,
moniker: Optional[str] = None,
genesis_accounts: Optional[List[str]] = None,
timeout_commit: Optional[str] = None,
debug_trace: bool = True,
):
super().__init__(
Expand All @@ -64,6 +66,7 @@ def __init__(
self.password = password or DEFAULT_PASSWORD
self.moniker = moniker or DEFAULT_MONIKER
self.genesis_accounts = genesis_accounts or [DEFAULT_GENESIS_ACCOUNT]
self.timeout_commit = timeout_commit or DEFAULT_TIMEOUT_COMMIT
self.debug_trace = debug_trace

@classmethod
Expand Down Expand Up @@ -141,8 +144,9 @@ def _make_entrypoint_script(self) -> List[str]:
f'echo "$PASSWORD" |{self.network.cli_binary} add-genesis-account $({self.network.cli_binary} keys show $VALIDATOR_KEY_NAME -a) 100000000000000000000000$DENOM',
f'echo "$PASSWORD" |{self.network.cli_binary} gentx $VALIDATOR_KEY_NAME 10000000000000000000000$DENOM --chain-id $CHAIN_ID',
f"{self.network.cli_binary} collect-gentxs",
f'sed -i "s/stake/{self.network.fee_denomination}/" ~/.{self.network.cli_binary}/config/genesis.json',
f'''sed -i 's/timeout_commit = "5s"/timeout_commit = "{self.network.timeout_commit}"/' ~/.{self.network.cli_binary}/config/config.toml''',
# Enable rest-api
f'sed -i "s/stake/atestfet/" ~/.{self.network.cli_binary}/config/genesis.json',
f'sed -i "s/enable = false/enable = true/" ~/.{self.network.cli_binary}/config/app.toml',
f'sed -i "s/swagger = false/swagger = true/" ~/.{self.network.cli_binary}/config/app.toml',
'fi',
Expand Down

0 comments on commit 53d3933

Please sign in to comment.