diff --git a/.changelog/unreleased/breaking-changes/ibc-relayer-cli/2239-changed-args-to-flags.md b/.changelog/unreleased/breaking-changes/ibc-relayer-cli/2239-changed-args-to-flags.md new file mode 100644 index 0000000000..e024f5c75f --- /dev/null +++ b/.changelog/unreleased/breaking-changes/ibc-relayer-cli/2239-changed-args-to-flags.md @@ -0,0 +1,2 @@ +- Updated all CLI commands to take flags instead of positional arguments. + ([#2239](https://github.com/informalsystems/ibc-rs/issues/2239)) \ No newline at end of file diff --git a/ci/e2e.sh b/ci/e2e.sh index cd8b26a387..5047e2745c 100755 --- a/ci/e2e.sh +++ b/ci/e2e.sh @@ -16,7 +16,7 @@ echo "-------------------------------------------------------------------------- echo "Show relayer version" echo "-----------------------------------------------------------------------------------------------------------------" echo Config: "$CONFIG_PATH" -$RELAYER_CMD -c "$CONFIG_PATH" version +$RELAYER_CMD --config "$CONFIG_PATH" version echo "-----------------------------------------------------------------------------------------------------------------" echo "Setting up chains" echo "-----------------------------------------------------------------------------------------------------------------" @@ -34,10 +34,10 @@ echo "========================================================================== echo "-----------------------------------------------------------------------------------------------------------------" echo "Add keys for chains" echo "-----------------------------------------------------------------------------------------------------------------" -hermes -c "$CONFIG_PATH" keys add "$CHAIN_A" -f user_seed_"$CHAIN_A".json -hermes -c "$CONFIG_PATH" keys add "$CHAIN_B" -f user_seed_"$CHAIN_B".json -hermes -c "$CONFIG_PATH" keys add "$CHAIN_A" -f user2_seed_"$CHAIN_A".json -k user2 -hermes -c "$CONFIG_PATH" keys add "$CHAIN_B" -f user2_seed_"$CHAIN_B".json -k user2 +hermes --config "$CONFIG_PATH" keys add --chain "$CHAIN_A" --key-file user_seed_"$CHAIN_A".json +hermes --config "$CONFIG_PATH" keys add --chain "$CHAIN_B" --key-file user_seed_"$CHAIN_B".json +hermes --config "$CONFIG_PATH" keys add --chain "$CHAIN_A" --key-file user2_seed_"$CHAIN_A".json --key-name user2 +hermes --config "$CONFIG_PATH" keys add --chain "$CHAIN_B" --key-file user2_seed_"$CHAIN_B".json --key-name user2 echo "=================================================================================================================" echo " END-TO-END TESTS " diff --git a/docs/architecture/adr-010-unified-cli-arguments-hermes.md b/docs/architecture/adr-010-unified-cli-arguments-hermes.md index f39aea60b5..8d98fe2053 100644 --- a/docs/architecture/adr-010-unified-cli-arguments-hermes.md +++ b/docs/architecture/adr-010-unified-cli-arguments-hermes.md @@ -15,7 +15,7 @@ To avoid confusion, all the parameters should take long flags. The following app * Only long flags are used in order to avoid having nonintuitive flags or conflicting flags. * Any parameter ending with `_id` should have the `_id` removed from the flag to shorten it. For example the flag for `chain_id` should only be `chain`. -* Flags which can be shortened and still be meaningful should be shortened. This is done for `connection`, `channel` and `sequence`, which become respectively `conn`, `chan` and `seq`. +* Flags which can be shortened and still be meaningful should have a shortened alias. This is done for `connection`, `channel` and `sequence`, which have respectively `conn`, `chan` and `seq` aliases. * For the channel and connection creation CLIs, the objects at the two ends are prefixed by `--a-` and `--b-`. Example `--a-chain` and `--b-chain`. * Whenever `chain`, `conn`, `chan` and `port` flags have to be disambiguated with a specifier, the specifier will be a prefix. Example of specifiers we currently use are `host`, `reference`, `a`, `b` and `counterparty`. @@ -50,7 +50,7 @@ The following commands are implemented, with the binary name `hermes` often omit ### Create a channel -* `create channel --a-chain --a-conn --a-port --b-port ` +* `create channel --a-chain --a-connection --a-port --b-port ` * Optional: `[--chan-version ] [--order ]` * `create channel --a-chain --b-chain --a-port --b-port --new-client-conn` @@ -73,7 +73,7 @@ The following commands are implemented, with the binary name `hermes` often omit ### Listen * `listen --chain ` - * Optional: `[--event ]` + * Optional: `[--events ...]` ### Misbehaviour @@ -86,7 +86,7 @@ The following commands are implemented, with the binary name `hermes` often omit ### Clear packets -* `clear packets --chain --port --chan ` +* `clear packets --chain --port --channel ` ### Queries @@ -109,22 +109,22 @@ __Client__ __Connection__ -* `query connection channels --chain --conn ` +* `query connection channels --chain --connection ` -* `query connection end --chain --conn ` +* `query connection end --chain --connection ` * Optional: `[--height ]` * `query connections --chain ` - * Optional: `[--chain-counterparty ] [--verbose]` + * Optional: `[--counterparty-chain ] [--verbose]` __Channel__ -* `query channel client --chain --port --chan ` +* `query channel client --chain --port --channel ` -* `query channel end --chain --port --chan ` +* `query channel end --chain --port --channel ` * Optional: `[--height ]` -* `query channel full --chain --port --chan ` +* `query channel full --chain --port --channel ` * Optional: `[--height ] [--verbose]` * `query channels --chain ` @@ -132,21 +132,25 @@ __Channel__ __Packet__ -* `query packet ack --chain --port --chan --seq ` +* `query packet ack --chain --port --channel --sequence ` * Optional: `[--height ]` -* `query packet acks --chain --port --chan ` +* `query packet acks --chain --port --channel ` -* `query packet commitment --chain --port --chan --seq ` +* `query packet commitment --chain --port --channel --sequence ` * Optional: `[--height ]` -* `query packet commitments --chain --port --chan ` +* `query packet commitments --chain --port --channel ` + +* `query packet pending --chain --port --channel ` + +* `query packet unreceived-acks --chain --port --channel ` -* `query packet pending --chain --port --chan ` +* `query packet unreceived-packets --chain --port --channel ` -* `query packet unreceived-acks --chain --port --chan ` +__Transfer__ -* `query packet unreceived-packets --chain --port --chan ` +* `query transfer denom-trace --chain --hash ` __Tx__ diff --git a/e2e/e2e/channel.py b/e2e/e2e/channel.py index 90921aff7b..5abd1df205 100644 --- a/e2e/e2e/channel.py +++ b/e2e/e2e/channel.py @@ -27,9 +27,9 @@ class TxChanOpenInit(Cmd[TxChanOpenInitRes]): ordering: Optional[Ordering] = None def args(self) -> List[str]: - args = [self.dst_chain_id, self.src_chain_id, - self.connection_id, - self.dst_port_id, self.src_port_id] + args = ["--dst-chain", self.dst_chain_id, "--src-chain", self.src_chain_id, + "--dst-conn", self.connection_id, + "--dst-port", self.dst_port_id, "--src-port", self.src_port_id] if self.ordering is not None: args.extend(['--ordering', str(self.ordering)]) @@ -65,10 +65,10 @@ class TxChanOpenTry(Cmd[TxChanOpenTryRes]): ordering: Optional[Ordering] = None def args(self) -> List[str]: - args = [self.dst_chain_id, self.src_chain_id, - self.connection_id, - self.dst_port_id, self.src_port_id, - "-s", self.src_channel_id] + args = ["--dst-chain", self.dst_chain_id, "--src-chain", self.src_chain_id, + "--dst-conn", self.connection_id, + "--dst-port", self.dst_port_id, "--src-port", self.src_port_id, + "--src-chan", self.src_channel_id] if self.ordering is not None: args.extend(['--ordering', str(self.ordering)]) @@ -104,11 +104,11 @@ class TxChanOpenAck(Cmd[TxChanOpenAckRes]): src_channel_id: ChannelId def args(self) -> List[str]: - args = [self.dst_chain_id, self.src_chain_id, - self.connection_id, - self.dst_port_id, self.src_port_id, - "-d", self.dst_channel_id, - "-s", self.src_channel_id] + args = ["--dst-chain", self.dst_chain_id, "--src-chain", self.src_chain_id, + "--dst-conn", self.connection_id, + "--dst-port", self.dst_port_id, "--src-port", self.src_port_id, + "--dst-chan", self.dst_channel_id, + "--src-chan", self.src_channel_id] return args @@ -141,11 +141,11 @@ class TxChanOpenConfirm(Cmd[TxChanOpenConfirmRes]): src_channel_id: ChannelId def args(self) -> List[str]: - args = [self.dst_chain_id, self.src_chain_id, - self.connection_id, - self.dst_port_id, self.src_port_id, - "-d", self.dst_channel_id, - "-s", self.src_channel_id] + args = ["--dst-chain", self.dst_chain_id, "--src-chain", self.src_chain_id, + "--dst-conn", self.connection_id, + "--dst-port", self.dst_port_id, "--src-port", self.src_port_id, + "--dst-chan", self.dst_channel_id, + "--src-chan", self.src_channel_id] return args @@ -177,11 +177,11 @@ class TxChanCloseInit(Cmd[TxChanCloseInitRes]): src_chan_id: ChannelId def args(self) -> List[str]: - args = [self.dst_chain_id, self.src_chain_id, - self.dst_conn_id, - self.dst_port_id, self.src_port_id, - "-d", self.dst_chan_id, - "-s", self.src_chan_id] + args = ["--dst-chain", self.dst_chain_id, "--src-chain", self.src_chain_id, + "--dst-conn", self.dst_conn_id, + "--dst-port", self.dst_port_id, "--src-port", self.src_port_id, + "--dst-chan", self.dst_chan_id, + "--src-chan", self.src_chan_id] return args @@ -214,11 +214,11 @@ class TxChanCloseConfirm(Cmd[TxChanCloseConfirmRes]): src_chan_id: ChannelId def args(self) -> List[str]: - args = [self.dst_chain_id, self.src_chain_id, - self.dst_conn_id, - self.dst_port_id, self.src_port_id, - "-d", self.dst_chan_id, - "-s", self.src_chan_id] + args = ["--dst-chain", self.dst_chain_id, "--src-chain", self.src_chain_id, + "--dst-conn", self.dst_conn_id, + "--dst-port", self.dst_port_id, "--src-port", self.src_port_id, + "--dst-chan", self.dst_chan_id, + "--src-chan", self.src_chan_id] return args @@ -267,7 +267,7 @@ class QueryChannelEnd(Cmd[ChannelEnd]): channel_id: ChannelId def args(self) -> List[str]: - return [self.chain_id, self.port_id, self.channel_id] + return ["--chain", self.chain_id, "--port", self.port_id, "--chan", self.channel_id] def process(self, result: Any) -> ChannelEnd: return from_dict(ChannelEnd, result) @@ -280,7 +280,7 @@ class QueryChannelEnds(Cmd[ChannelEnds]): channel_id: ChannelId def args(self) -> List[str]: - return [self.chain_id, self.port_id, self.channel_id] + return ["--chain", self.chain_id, "--port", self.port_id, "--chan", self.channel_id] def process(self, result: Any) -> ChannelEnds: return from_dict(ChannelEnds, result) diff --git a/e2e/e2e/client.py b/e2e/e2e/client.py index fd71a5ae18..c1b853c494 100644 --- a/e2e/e2e/client.py +++ b/e2e/e2e/client.py @@ -19,7 +19,7 @@ class TxCreateClient(Cmd[ClientCreated]): src_chain_id: ChainId def args(self) -> List[str]: - return [self.dst_chain_id, self.src_chain_id] + return ["--host-chain", self.dst_chain_id, "--reference-chain", self.src_chain_id] def process(self, result: Any) -> ClientCreated: return from_dict(ClientCreated, result['CreateClient']) @@ -43,7 +43,7 @@ class TxUpdateClient(Cmd[ClientUpdated]): dst_client_id: ClientId def args(self) -> List[str]: - return [self.dst_chain_id, self.dst_client_id] + return ["--host-chain", self.dst_chain_id, "--client", self.dst_client_id] def process(self, result: Any) -> ClientUpdated: return from_dict(ClientUpdated, result[-1]['UpdateClient']['common']) @@ -86,7 +86,7 @@ def args(self) -> List[str]: if self.proof: args.append('--proof') - args.extend([self.chain_id, self.client_id]) + args.extend(["--chain", self.chain_id, "--client", self.client_id]) return args diff --git a/e2e/e2e/cmd.py b/e2e/e2e/cmd.py index 6750aab58b..bc2ef64953 100644 --- a/e2e/e2e/cmd.py +++ b/e2e/e2e/cmd.py @@ -55,7 +55,7 @@ def to_cmd(self) -> str: return f"{self.name} {' '.join(self.args())}" def run(self, config: Config, retries: int = 0) -> CmdResult[T]: - full_cmd = f'{config.relayer_cmd} -c {config.config_file} --json'.split(' ') + full_cmd = f'{config.relayer_cmd} --config {config.config_file} --json'.split(' ') full_cmd.extend(self.name.split(' ')) full_cmd.extend(self.args()) l.debug(' '.join(full_cmd)) diff --git a/e2e/e2e/connection.py b/e2e/e2e/connection.py index 834cfb6440..bfd15e1ef7 100644 --- a/e2e/e2e/connection.py +++ b/e2e/e2e/connection.py @@ -22,8 +22,8 @@ class TxConnInit(Cmd[TxConnInitRes]): src_client_id: ClientId def args(self) -> List[str]: - return [self.dst_chain_id, self.src_chain_id, - self.dst_client_id, self.src_client_id] + return ["--dst-chain", self.dst_chain_id, "--src-chain", self.src_chain_id, + "--dst-client", self.dst_client_id, "--src-client", self.src_client_id] def process(self, result: Any) -> TxConnInitRes: return from_dict(TxConnInitRes, result['OpenInitConnection']) @@ -46,9 +46,9 @@ class TxConnTry(Cmd[TxConnTryRes]): src_conn_id: ConnectionId def args(self) -> List[str]: - return [self.dst_chain_id, self.src_chain_id, - self.dst_client_id, self.src_client_id, - "-s", self.src_conn_id] + return ["--dst-chain", self.dst_chain_id, "--src-chain", self.src_chain_id, + "--dst-client", self.dst_client_id, "--src-client", self.src_client_id, + "--src-conn", self.src_conn_id] def process(self, result: Any) -> TxConnTryRes: return from_dict(TxConnTryRes, result['OpenTryConnection']) @@ -72,10 +72,10 @@ class TxConnAck(Cmd[TxConnAckRes]): src_conn_id: ConnectionId def args(self) -> List[str]: - return [self.dst_chain_id, self.src_chain_id, - self.dst_client_id, self.src_client_id, - "-d", self.dst_conn_id, - "-s", self.src_conn_id] + return ["--dst-chain", self.dst_chain_id, "--src-chain", self.src_chain_id, + "--dst-client", self.dst_client_id, "--src-client", self.src_client_id, + "--dst-conn", self.dst_conn_id, + "--src-conn", self.src_conn_id] def process(self, result: Any) -> TxConnAckRes: return from_dict(TxConnAckRes, result['OpenAckConnection']) @@ -99,10 +99,10 @@ class TxConnConfirm(Cmd[TxConnConfirmRes]): src_conn_id: ConnectionId def args(self) -> List[str]: - return [self.dst_chain_id, self.src_chain_id, - self.dst_client_id, self.src_client_id, - "-d", self.dst_conn_id, - "-s", self.src_conn_id] + return ["--dst-chain", self.dst_chain_id, "--src-chain", self.src_chain_id, + "--dst-client", self.dst_client_id, "--src-client", self.src_client_id, + "--dst-conn", self.dst_conn_id, + "--src-conn", self.src_conn_id] def process(self, result: Any) -> TxConnConfirmRes: return from_dict(TxConnConfirmRes, result['OpenConfirmConnection']) @@ -139,7 +139,7 @@ class QueryConnectionEnd(Cmd[ConnectionEnd]): connection_id: ConnectionId def args(self) -> List[str]: - return [self.chain_id, self.connection_id] + return ["--chain", self.chain_id, "--conn", self.connection_id] def process(self, result: Any) -> ConnectionEnd: return from_dict(ConnectionEnd, result) diff --git a/e2e/e2e/packet.py b/e2e/e2e/packet.py index 278aaf1f04..84f0c705ea 100644 --- a/e2e/e2e/packet.py +++ b/e2e/e2e/packet.py @@ -36,19 +36,19 @@ class TxPacketSend(Cmd[TxPacketSendRes]): def args(self) -> List[str]: args = [ - self.dst_chain_id, - self.src_chain_id, - self.src_port, - self.src_channel, - str(self.amount), - "-o", str(self.height_offset), + "--dst-chain", self.dst_chain_id, + "--src-chain", self.src_chain_id, + "--src-port", self.src_port, + "--src-chan", self.src_channel, + "--amount", str(self.amount), + "--timeout-height-offset", str(self.height_offset), ] if self.number_msgs != None: - args.extend(['-n', str(self.number_msgs)]) + args.extend(['--number-msgs', str(self.number_msgs)]) if self.key != None: - args.extend(['-k', str(self.key)]) + args.extend(['--key-name', str(self.key)]) return args @@ -75,7 +75,7 @@ class TxPacketRecv(Cmd[TxPacketRecvRes]): src_channel: ChannelId def args(self) -> List[str]: - return [self.dst_chain_id, self.src_chain_id, self.src_port, self.src_channel] + return ["--dst-chain", self.dst_chain_id, "--src-chain", self.src_chain_id, "--src-port", self.src_port, "--src-chan", self.src_channel] def process(self, result: Any) -> TxPacketRecvRes: entry = find_entry(result, 'WriteAcknowledgement') @@ -99,7 +99,7 @@ class TxPacketTimeout(Cmd[TxPacketTimeoutRes]): src_channel: ChannelId def args(self) -> List[str]: - return [self.dst_chain_id, self.src_chain_id, self.src_port, self.src_channel] + return ["--dst-chain", self.dst_chain_id, "--src-chain", self.src_chain_id, "--src-port", self.src_port, "--src-chan", self.src_channel] def process(self, result: Any) -> TxPacketTimeoutRes: entry = find_entry(result, 'TimeoutPacket') @@ -124,7 +124,7 @@ class TxPacketAck(Cmd[TxPacketAckRes]): src_channel: ChannelId def args(self) -> List[str]: - return [self.dst_chain_id, self.src_chain_id, self.src_port, self.src_channel] + return ["--dst-chain", self.dst_chain_id, "--src-chain", self.src_chain_id, "--src-port", self.src_port, "--src-chan", self.src_channel] def process(self, result: Any) -> TxPacketAckRes: entry = find_entry(result, 'AcknowledgePacket') @@ -141,7 +141,7 @@ class QueryUnreceivedPackets(Cmd[List[int]]): channel: ChannelId def args(self) -> List[str]: - return [self.chain, self.port, self.channel] + return ["--chain", self.chain, "--port", self.port, "--chan", self.channel] def process(self, result: Any) -> List[int]: return from_dict(List[int], result) @@ -169,7 +169,7 @@ class QueryUnreceivedAcks(Cmd[List[int]]): channel: ChannelId def args(self) -> List[str]: - return [self.chain, self.port, self.channel] + return ["--chain", self.chain, "--port", self.port, "--chan", self.channel] def process(self, result: Any) -> List[int]: return from_dict(List[int], result) diff --git a/e2e/e2e/relayer.py b/e2e/e2e/relayer.py index 1f72d09c11..a475819775 100644 --- a/e2e/e2e/relayer.py +++ b/e2e/e2e/relayer.py @@ -6,6 +6,6 @@ def start(c: Config) -> Popen: - full_cmd = f'{c.relayer_cmd} -c {c.config_file} -j start'.split(' ') + full_cmd = f'{c.relayer_cmd} --config {c.config_file} --json start'.split(' ') l.debug(' '.join(full_cmd)) return Popen(full_cmd) diff --git a/guide/src/SUMMARY.md b/guide/src/SUMMARY.md index 4a280075fc..bbe6b14757 100644 --- a/guide/src/SUMMARY.md +++ b/guide/src/SUMMARY.md @@ -56,6 +56,7 @@ - [Channel Open](./commands/raw/channel-open.md) - [Channel Close](./commands/raw/channel-close.md) - [Packet](./commands/raw/packet.md) + - [Upgrade](./commands/raw/upgrade.md) - [Help](./help.md) - [Glossary](./glossary.md) --- diff --git a/guide/src/commands/config.md b/guide/src/commands/config.md index e00fa93f84..6a25b37682 100644 --- a/guide/src/commands/config.md +++ b/guide/src/commands/config.md @@ -6,7 +6,7 @@ your configuration file. ```shell USAGE: - hermes config validate + hermes config validate DESCRIPTION: validate the relayer configuration @@ -30,13 +30,13 @@ Success: "validation passed successfully" Validate a config file at an arbitrary location: ```shell -hermes -c ./config.toml config validate +hermes --config ./config.toml config validate ``` This one fails validation because we mistakenly added two separate sections for the same chain `ibc-1`: ```text -hermes -c ./config.toml config validate +hermes --config ./config.toml config validate error: hermes fatal error: config error: config file has duplicate entry for the chain with id ibc-1 ``` diff --git a/guide/src/commands/global.md b/guide/src/commands/global.md index 6c302987f0..6f588a7583 100644 --- a/guide/src/commands/global.md +++ b/guide/src/commands/global.md @@ -8,8 +8,8 @@ Informal Systems Implementation of `hermes`, an IBC Relayer developed in Rust. FLAGS: - -c, --config CONFIG path to configuration file - -j, --json enable JSON output + --config Path to configuration file + --json Enable JSON output ``` The flags must be specified right after the `hermes` command and before any subcommand. @@ -19,7 +19,7 @@ __Example__ To start the relayer using the configuration file at `/home/my_chain.toml` and enable JSON output: ```shell -hermes -c /home/my_chain.toml --json start +hermes --config /home/my_chain.toml --json start ``` ## JSON output @@ -34,7 +34,7 @@ To process all the output using `jq`, one can redirect `stderr` to `stdout` with __Example__ ```shell -hermes -c /home/my_chain.toml --json create client ibc-0 ibc-1 +hermes --config /home/my_chain.toml --json create client --host-chain ibc-0 --reference-chain ibc-1 ``` ```json @@ -51,7 +51,7 @@ __Example__ To improve the readability, pipe all of the output to `jq`: ``` -hermes -c /home/my_chain.toml --json create client ibc-0 ibc-1 2>&1 | jq +hermes --config /home/my_chain.toml --json create client --host-chain ibc-0 --reference-chain ibc-1 2>&1 | jq ``` ```json @@ -105,7 +105,7 @@ __Example__ To extract the identifer of the newly created client above: ``` -hermes -c /home/my_chain.toml --json create client ibc-0 ibc-1 | jq '.result.CreateClient.client_id' +hermes --config /home/my_chain.toml --json create client --host-chain ibc-0 --reference-chain ibc-1 | jq '.result.CreateClient.client_id' ``` ``` diff --git a/guide/src/commands/keys/index.md b/guide/src/commands/keys/index.md index e246d0ef4a..f91153961c 100644 --- a/guide/src/commands/keys/index.md +++ b/guide/src/commands/keys/index.md @@ -62,63 +62,63 @@ The command outputs a JSON similar to the one below. } ``` -You can save this to a file (e.g. `key_seed.json`) and use it to add to the relayer with `hermes keys add -f key_seed.json`. See the `Adding Keys` section for more details. +You can save this to a file (e.g. `key_seed.json`) and use it to add to the relayer with `hermes keys add --chain --key-file key_seed.json`. See the `Adding Keys` section for more details. ### Adding and restoring Keys The command `keys add` has two exclusive flags, `--key-file` and `--mnemonic-file` which are respectively used to add and restore a key. ```shell - hermes keys add [OPTIONS] --key-file --mnemonic-file + hermes keys add [OPTIONS] --chain --key-file --mnemonic-file DESCRIPTION: Adds key to a configured chain or restores a key to a configured chain using a mnemonic -ARGS: - chain_id identifier of the chain - FLAGS: - -f, --key-file + --chain + identifier of the chain + + --key-file path to the key file - -m, --mnemonic-file + --mnemonic-file path to file containing mnemonic to restore the key from OPTIONS: - -k, --key-name + --key-name name of the key (defaults to the `key_name` defined in the config) - -p, --hd-path + --hd-path derivation path for this key [default: m/44'/118'/0'/0/0] ``` #### Add a private key to a chain from a key file ```shell - hermes keys add [OPTIONS] --key-file + hermes keys add [OPTIONS] --chain --key-file DESCRIPTION: Adds key to a configured chain or restores a key to a configured chain using a mnemonic -ARGS: - chain_id identifier of the chain - FLAGS: - -f, --key-file + --chain + identifier of the chain + + --key-file path to the key file OPTIONS: - -k, --key-name + --key-name name of the key (defaults to the `key_name` defined in the config) - -p, --hd-path + --hd-path derivation path for this key [default: m/44'/118'/0'/0/0] ``` To add a private key file to a chain: ```shell -hermes -c config.toml keys add [CHAIN_ID] -f [PRIVATE_KEY_FILE] +hermes --config config.toml keys add --chain [CHAIN_ID] --key-file [PRIVATE_KEY_FILE] ``` The content of the file key should have the same format as the output of the `gaiad keys add` command: @@ -144,36 +144,36 @@ Success: Added key testkey ([ADDRESS]) on [CHAIN ID] chain > To use a different key name, specify the `--key-name` option when invoking `keys add`. > > ``` -> hermes -c config.toml keys add [CHAINID] -f [PRIVATE_KEY_FILE] -k [KEY_NAME] +> hermes --config config.toml keys add --chain [CHAINID] --key-file [PRIVATE_KEY_FILE] --key-name [KEY_NAME] > ``` #### Restore a private key to a chain from a mnemonic ```shell - hermes keys add [OPTIONS] --mnemonic-file + hermes keys add [OPTIONS] --chain --mnemonic-file DESCRIPTION: Adds key to a configured chain or restores a key to a configured chain using a mnemonic -ARGS: - chain_id identifier of the chain - FLAGS: - -m, --mnemonic-file + --chain + identifier of the chain + + --mnemonic-file path to file containing mnemonic to restore the key from OPTIONS: - -k, --key-name + --key-name name of the key (defaults to the `key_name` defined in the config) - -p, --hd-path + --hd-path derivation path for this key [default: m/44'/118'/0'/0/0] ``` To restore a key from its mnemonic: ```shell -hermes -c config.toml keys add [CHAIN_ID] -m "[MNEMONIC_FILE]" +hermes --config config.toml keys add --chain [CHAIN_ID] --mnemonic-file "[MNEMONIC_FILE]" ``` or using an explicit [derivation path](https://github.com/satoshilabs/slips/blob/master/slip-0044.md), for example @@ -181,7 +181,7 @@ an Ethereum coin type (used for Evmos, Injective, Umee, Cronos, and possibly other networks): ```shell -hermes -c config.toml keys add --mnemonic-file --hd-path "m/44'/60'/0'/0/0" +hermes --config config.toml keys add --chain --mnemonic-file --hd-path "m/44'/60'/0'/0/0" ``` The mnemonic file needs to have the 24 mnemonic words on the same line, separated by a white space. So the content should have the following format: @@ -200,7 +200,7 @@ Success: Restore key testkey ([ADDRESS]) on [CHAIN ID] chain > To use a different key name, specify the `--key-name` option when invoking `keys add`. > > ``` -> hermes -c config.toml keys add [CHAINID] -m "[MNEMONIC_FILE]" -k [KEY_NAME] +> hermes --config config.toml keys add --chain [CHAINID] --mnemonic-file "[MNEMONIC_FILE]" --key-name [KEY_NAME] > ``` ### Delete keys @@ -209,17 +209,17 @@ In order to delete the private keys added to chains use the `keys delete` comman ```shell USAGE: - hermes keys delete + hermes keys delete [OPTIONS] --chain DESCRIPTION: Delete key(s) from a configured chain -POSITIONAL ARGUMENTS: - chain_id identifier of the chain - FLAGS: - -n, --name NAME name of the key - -a, --all delete all keys + --chain Identifier of the chain + +OPTIONS: + --key-name Name of the key + --all Delete all keys ``` #### Delete private keys that was previously added to a chain @@ -227,13 +227,13 @@ FLAGS: To delete a single private key by name: ```shell -hermes -c config.toml keys delete [CHAIN_ID] -n [KEY_NAME] +hermes --config config.toml keys delete --chain [CHAIN_ID] --key-name [KEY_NAME] ``` Alternatively, to delete all private keys added to a chain: ```shell -hermes -c config.toml keys delete [CHAIN_ID] -a +hermes --config config.toml keys delete --chain [CHAIN_ID] --all ``` ### List keys @@ -242,13 +242,13 @@ In order to list the private keys added to chains use the `keys list` command ```shell USAGE: - hermes keys list + hermes keys list --chain DESCRIPTION: List keys configured on a chain -POSITIONAL ARGUMENTS: - chain_id identifier of the chain +FLAGS: + --chain Identifier of the chain ``` #### Listing the private key that was added to a chain @@ -256,7 +256,7 @@ POSITIONAL ARGUMENTS: To list the private key file that was added to a chain: ```shell -hermes -c config.toml keys list [CHAIN_ID] +hermes --config config.toml keys list --chain [CHAIN_ID] ``` If the command is successful a message similar to the one below will be displayed: @@ -270,7 +270,7 @@ Success: **JSON:** ```shell -hermes --json -c config.toml keys list [CHAIN_ID] | jq +hermes --json --config config.toml keys list --chain [CHAIN_ID] | jq ``` If the command is successful a message similar to the one below will be displayed: @@ -302,16 +302,16 @@ In order to retrieve the balance of an account associated with a key use the `ke ```shell USAGE: - hermes keys balance [OPTIONS] + hermes keys balance [OPTIONS] --chain DESCRIPTION: Query balance for a key from a configured chain. If no key is given, the key is retrieved from the configuration file -ARGS: - chain_id identifier of the chain +FLAGS: + --chain Identifier of the chain OPTIONS: - -k, --key-name (optional) name of the key (defaults to the `key_name` defined in the config) + --key-name (optional) name of the key (defaults to the `key_name` defined in the config) ``` If the command is successful a message with the following format will be displayed: @@ -323,12 +323,7 @@ Success: balance for key `KEY_NAME`: 100000000000 stake **JSON:** ```shell - hermes --json keys balance [OPTIONS] -``` -or - -```shell - hermes -j keys balance [OPTIONS] +hermes --json keys balance [OPTIONS] --chain ``` If the command is successful a message with the following format will be displayed: diff --git a/guide/src/commands/listen/index.md b/guide/src/commands/listen/index.md index dd4fc8472d..fc1bf0d8a1 100644 --- a/guide/src/commands/listen/index.md +++ b/guide/src/commands/listen/index.md @@ -4,16 +4,16 @@ The relayer can be started in `listen` mode to display the events emitted by a g ```shell USAGE: - hermes listen + hermes listen [OPTIONS] --chain DESCRIPTION: Listen to and display IBC events emitted by a chain -POSITIONAL ARGUMENTS: - chain_id Identifier of the chain to listen for events from - FLAGS: - -e, --event EVENT Add an event type to listen for, can be repeated. Listen for all events by default (available: Tx, NewBlock) + --chain Identifier of the chain to listen for events from + +OPTIONS: + --events ... Add an event type to listen for, can be repeated. Listen for all events by default (available: Tx, NewBlock) ``` __Example__ @@ -21,7 +21,7 @@ __Example__ Start the relayer in listen mode for all `ibc-0` events and observe the output: ```shell -hermes listen ibc-0 +hermes listen --chain ibc-0 ``` ```json @@ -155,8 +155,8 @@ At the moment, two event types are available: The `--event` flag can be repeated to specify more than one event type. -- To listen for only `NewBlock` events on `ibc-0`, invoke `hermes listen ibc-0 --event NewBlock` -- To listen for only `Tx` events on `ibc-0`, invoke `hermes listen ibc-0 --event Tx` -- To listen for both `NewBlock` and `Tx` events on `ibc-0`, invoke `hermes listen ibc-0 --e NewBlock --event Tx` +- To listen for only `NewBlock` events on `ibc-0`, invoke `hermes listen --chain ibc-0 --events NewBlock` +- To listen for only `Tx` events on `ibc-0`, invoke `hermes listen --chain ibc-0 --events Tx` +- To listen for both `NewBlock` and `Tx` events on `ibc-0`, invoke `hermes listen --chain ibc-0 --events NewBlock Tx` If the `--event` flag is omitted, the relayer will subscribe to all event types. diff --git a/guide/src/commands/misbehaviour/index.md b/guide/src/commands/misbehaviour/index.md index 1d7f48cbad..18ef25ffa2 100644 --- a/guide/src/commands/misbehaviour/index.md +++ b/guide/src/commands/misbehaviour/index.md @@ -10,14 +10,15 @@ cannot be relayed using the frozen client. ```shell USAGE: - hermes misbehaviour + hermes misbehaviour --chain --client DESCRIPTION: Listen to client update IBC events and handles misbehaviour -POSITIONAL ARGUMENTS: - chain_id identifier of the chain where client updates are monitored for misbehaviour - client_id identifier of the client to be monitored for misbehaviour +FLAGS: + --chain Identifier of the chain where client updates are monitored for + misbehaviour + --client Identifier of the client to be monitored for misbehaviour ``` The misbehaviour monitor starts by analyzing all headers used in prior client updates. @@ -53,7 +54,7 @@ __Example__ The `hermes misbehaviour` outputs an error message displaying `MISBEHAVIOUR DETECTED`: ```shell -hermes misbehaviour ibc-0 07-tendermint-0 +hermes misbehaviour --chain ibc-0 --client 07-tendermint-0 ``` ```json @@ -85,7 +86,7 @@ Success: Some( Querying client state from this point will show the client is in frozen state, with `frozen_height` indicating the height at which the client was frozen: ```shell -hermes query client state ibc-0 07-tendermint-0 | jq +hermes query client state --chain ibc-0 --client 07-tendermint-0 | jq ``` ```json { diff --git a/guide/src/commands/path-setup/channels.md b/guide/src/commands/path-setup/channels.md index ca47b1c116..975f5107fc 100644 --- a/guide/src/commands/path-setup/channels.md +++ b/guide/src/commands/path-setup/channels.md @@ -10,24 +10,29 @@ Use the `create channel` command to establish a new channel. ```shell USAGE: - hermes create channel [OPTIONS] --port-a --port-b [CONNECTION_A] + hermes create channel [OPTIONS] --a-chain --a-port --b-port DESCRIPTION: Create a new channel between two chains using a pre-existing connection. - Alternatively, create a new client and a new connection underlying the new channel if a pre-existing connection is not provided. -POSITIONAL ARGUMENTS: - Identifier of the side `a` chain for the new channel - Identifier of the connection on chain `a` to use in creating the new channel + Alternatively, create a new client and a new connection underlying the new channel if a pre-existing + connection is not provided. FLAGS: - -c, --chain-b Identifier of the side `b` chain for the new channel - -h, --help Print help information - --new-client-connection Indicates that a new client and connection will be created underlying the new channel - -o, --order The channel ordering, valid options 'unordered' (default) and 'ordered' [default: ORDER_UNORDERED] - --port-a Identifier of the side `a` port for the new channel - --port-b Identifier of the side `b` port for the new channel - -v, --channel-version The version for the new channel + --a-chain Identifier of the side `a` chain for the new channel + --a-port Identifier of the side `a` port for the new channel + --b-port Identifier of the side `b` port for the new channel + +OPTIONS: + + --a-connection Identifier of the connection on chain `a` to use in creating + the new channel. + --b-chain Identifier of the side `b` chain for the new channel + --chan-version The version for the new channel + --new-client-connection Indicates that a new client and connection will be created + underlying the new channel + --order The channel ordering, valid options 'unordered' (default) and + 'ordered' [default: ORDER_UNORDERED] ``` ## Examples @@ -42,7 +47,7 @@ specifically the one we just created in the example above, with port name `transfer` on both sides: ```shell -hermes create channel ibc-0 --connection-a connection-0 --port-a transfer --port-b transfer -o unordered +hermes create channel --a-chain ibc-0 --a-connection connection-0 --a-port transfer --b-port transfer --order unordered ``` Notice that one can omit the destination chain parameter, as Hermes will automatically @@ -205,7 +210,7 @@ interactive prompt that pops up notifying you that a new client and a new connection will be initialized as part of the process: ```shell -hermes create channel ibc-0 --chain-b ibc-1 --port-a transfer --port-b transfer -o unordered --new-client-connection +hermes create channel --a-chain ibc-0 --b-chain ibc-1 --a-port transfer --b-port transfer --order unordered --new-client-conn ``` ```json diff --git a/guide/src/commands/path-setup/clients.md b/guide/src/commands/path-setup/clients.md index bfecbc7913..025ae08d80 100644 --- a/guide/src/commands/path-setup/clients.md +++ b/guide/src/commands/path-setup/clients.md @@ -11,17 +11,17 @@ tracking the state of the source chain. ```shell USAGE: - hermes create client [OPTIONS] + hermes create client [OPTIONS] --host-chain --reference-chain -ARGS: - - identifier of the destination chain +FLAGS: + --host-chain + identifier of the chain that hosts the client - - identifier of the source chain + --reference-chain + identifier of the chain targeted by the client OPTIONS: - -d, --clock-drift + --clock-drift The maximum allowed clock drift for this client. The clock drift is a correction parameter. It helps deal with clocks that are only @@ -31,13 +31,13 @@ OPTIONS: option is not specified, a suitable clock drift value is derived from the chain configurations. - -p, --trusting-period + --trusting-period Override the trusting period specified in the config. The trusting period specifies how long a validator set is trusted for (must be shorter than the chain's unbonding period). - -t, --trust-threshold + --trust-threshold Override the trust threshold specified in the configuration. The trust threshold defines what fraction of the total voting power of a known and @@ -49,7 +49,7 @@ __Example__ Create a new client on `ibc-0` which tracks `ibc-1`: ```shell -hermes create client ibc-0 ibc-1 +hermes create client --host-chain ibc-0 --reference-chain ibc-1 ``` ```json @@ -81,16 +81,21 @@ Specific update and trusted heights can be specified. ```shell USAGE: - hermes update client [OPTIONS] + hermes update client [OPTIONS] --host-chain --client -ARGS: - identifier of the destination chain - identifier of the client to be updated on destination chain +FLAGS: + --host-chain + identifier of the chain that hosts the client + + --client + identifier of the chain targeted by the client OPTIONS: - -h, --help Print help information - -H, --target-height the target height of the client update - -t, --trusted-height the trusted height of the client update + --height + the target height of the client update + + --trusted-height + the trusted height of the client update ``` __Update client with latest header__ @@ -98,7 +103,7 @@ __Update client with latest header__ the client on `ibc-0` with latest header of `ibc-1`: ```shell -hermes update client ibc-0 07-tendermint-9 +hermes update client --host-chain ibc-0 --client 07-tendermint-9 ``` ```json @@ -126,7 +131,7 @@ The client with identifier `07-tendermint-1` has been updated with the consensus __Update a client to a specific target height__ ```shell -hermes update client ibc-0 07-tendermint-1 --target-height 320 --trusted-height 293 +hermes update client --host-chain ibc-0 --client 07-tendermint-1 --height 320 --trusted-height 293 ``` ```json diff --git a/guide/src/commands/path-setup/connections.md b/guide/src/commands/path-setup/connections.md index 2c8ec5a735..0918a6b10e 100644 --- a/guide/src/commands/path-setup/connections.md +++ b/guide/src/commands/path-setup/connections.md @@ -9,19 +9,22 @@ Use the `create connection` command to create a new connection. ```shell USAGE: - hermes create connection + hermes create connection [OPTIONS] --a-chain DESCRIPTION: Create a new connection between two chains -POSITIONAL ARGUMENTS: - chain_a_id identifier of the side `a` chain for the new connection - chain_b_id identifier of the side `b` chain for the new connection - FLAGS: - --client-a CLIENT-A identifier of client hosted on chain `a`; default: None (creates a new client) - --client-b CLIENT-B identifier of client hosted on chain `b`; default: None (creates a new client) - --delay DELAY delay period parameter for the new connection (seconds) (default: 0) + --a-chain Identifier of the side `a` chain for the new connection + +OPTIONS: + --a-client Identifier of client hosted on chain `a`; default: None (creates + a new client) + --b-chain Identifier of the side `b` chain for the new connection + --b-client Identifier of client hosted on chain `b`; default: None (creates + a new client) + --delay Delay period parameter for the new connection (seconds) + [default: 0] ``` ## Examples @@ -31,7 +34,7 @@ FLAGS: Create a new connection between `ibc-0` and `ibc-1` over new clients: ```shell -hermes create connection ibc-0 ibc-1 +hermes create connection --a-chain ibc-0 --b-chain ibc-1 ``` ```json @@ -202,11 +205,9 @@ Create a new connection between `ibc-0` and `ibc-1` over existing clients, both with client id `07-tendermint-0`: ```shell -hermes create connection ibc-0 --client-a 07-tendermint-0 --client-b -07-tendermint-0 +hermes create connection --a-chain ibc-0 --a-client 07-tendermint-0 --b-client 07-tendermint-0 ``` - Notice that one can omit the destination chain parameter, as Hermes will automatically figure it out by looking up the given client on `ibc-0`. diff --git a/guide/src/commands/path-setup/index.md b/guide/src/commands/path-setup/index.md index ae654ca77a..84a8408425 100644 --- a/guide/src/commands/path-setup/index.md +++ b/guide/src/commands/path-setup/index.md @@ -21,10 +21,10 @@ DESCRIPTION: Create objects (client, connection, or channel) on chains SUBCOMMANDS: - help Get usage information - client Create a new IBC client - connection Create a new connection between two chains - channel Create a new channel between two chains + channel Create a new channel between two chains using a pre-existing connection + client Create a new IBC client + connection Create a new connection between two chains + help Print this message or the help of the given subcommand(s) ``` ## Update diff --git a/guide/src/commands/queries/channel.md b/guide/src/commands/queries/channel.md index fed5deb4ea..a0a397c24f 100644 --- a/guide/src/commands/queries/channel.md +++ b/guide/src/commands/queries/channel.md @@ -8,13 +8,19 @@ Use the `query channels` command to query the identifiers of all channels on a g ```shell USAGE: - hermes query channels + hermes query channels [OPTIONS] --chain DESCRIPTION: Query the identifiers of all channels on a given chain -POSITIONAL ARGUMENTS: - chain_id identifier of the chain to query +FLAGS: + --chain + identifier of the chain to query + +OPTIONS: + --verbose + enable verbose output, displaying the client and connection ids for each channel in the + response ``` __Example__ @@ -22,7 +28,7 @@ __Example__ Query all channels on `ibc-1`: ```shell -hermes query channels ibc-1 +hermes query channels --chain ibc-1 ``` ```json @@ -69,18 +75,18 @@ Use the `query channel end` command to query the channel end: ```shell USAGE: - hermes query channel end + hermes query channel end [OPTIONS] --chain --port --channel DESCRIPTION: Query channel end -POSITIONAL ARGUMENTS: - chain_id identifier of the chain to query - port_id identifier of the port to query - channel_id identifier of the channel to query - FLAGS: - -H, --height HEIGHT height of the state to query + --chain Identifier of the chain to query + --channel Identifier of the channel to query + --port Identifier of the port to query + +OPTIONS: + --height Height of the state to query ``` __Example__ @@ -88,7 +94,7 @@ __Example__ Query the channel end of channel `channel-1` on port `transfer` on `ibc-1`: ```shell -hermes query channel end ibc-1 transfer channel-1 +hermes query channel end --chain ibc-1 --port transfer --channel channel-1 ``` ```json @@ -121,19 +127,20 @@ Use the `query channel ends` command to obtain both ends of a channel: ```shell USAGE: - hermes query channel ends + hermes query channel ends [OPTIONS] --chain --port --channel DESCRIPTION: Query channel ends and underlying connection and client objects -POSITIONAL ARGUMENTS: - chain_id identifier of the chain to query - port_id identifier of the port to query - channel_id identifier of the channel to query - FLAGS: - -H, --height HEIGHT height of the state to query - -v, --verbose enable verbose output, displaying all details of channels, connections & clients + --chain Identifier of the chain to query + --channel Identifier of the channel to query + --port Identifier of the port to query + +OPTIONS: + --height Height of the state to query + --verbose enable verbose output, displaying all details of channels, + connections & clients ``` __Example__ @@ -141,7 +148,7 @@ __Example__ Query the channel end of channel `channel-1` on port `transfer` on `ibc-0`: ```shell -hermes query channel ends ibc-0 transfer channel-1 +hermes query channel ends --chain ibc-0 --port transfer --channel channel-1 ``` ```json @@ -181,7 +188,7 @@ Success: ChannelEndsSummary { } ``` -Passing the `-v` flag will additionally print all the details of the +Passing the `--verbose` flag will additionally print all the details of the channel, connection, and client on both ends. ## Query the channel client state @@ -190,17 +197,15 @@ Use the `query channel client` command to obtain the channel's client state: ```shell USAGE: - hermes query channel client --port-id --channel-id + hermes query channel client --chain --port --channel DESCRIPTION: Query channel's client state -ARGS: - identifier of the chain to query - FLAGS: - --channel-id identifier of the channel to query - --port-id identifier of the port to query + --chain Identifier of the chain to query + --channel Identifier of the channel to query + --port Identifier of the port to query ``` If the command is successful a message with the following format will be displayed: @@ -309,12 +314,7 @@ Success: Some( **JSON:** ```shell - hermes --json query channel client --port-id --channel-id -``` -or - -```shell - hermes -j query channel client --port-id --channel-id + hermes --json query channel client --chain --port --channel ``` If the command is successful a message with the following format will be displayed: diff --git a/guide/src/commands/queries/client.md b/guide/src/commands/queries/client.md index 1603f8332e..ff09bd3f08 100644 --- a/guide/src/commands/queries/client.md +++ b/guide/src/commands/queries/client.md @@ -5,21 +5,26 @@ # Query Clients -Use the `query clients` command to query the identifiers of all clients on a given chain. +Use the `query clients` command to query the identifiers of all clients on a given chain, called +the _host_ chain. ```shell USAGE: - hermes query clients + hermes query clients [OPTIONS] --host-chain DESCRIPTION: Query the identifiers of all clients on a chain -POSITIONAL ARGUMENTS: - chain_id identifier of the chain to query - FLAGS: - -s, --src-chain-id ID filter for clients which target a specific chain id (implies '-o') - -o, --omit-chain-ids omit printing the source chain for each client (default: false) + --host-chain + identifier of the chain to query + +OPTIONS: + --omit-chain-ids + omit printing the reference (or target) chain for each client + + --reference-chain + filter for clients which target a specific chain id (implies '--omit-chain-ids') ``` __Example__ @@ -27,7 +32,7 @@ __Example__ Query all clients on `ibc-1`: ```shell -hermes query clients ibc-1 +hermes query clients --host-chain ibc-1 ``` ```json @@ -53,10 +58,10 @@ Success: [ ] ``` -Query all clients on `ibc-1` having `ibc-2` as their source chain: +Query all clients on `ibc-1` having `ibc-2` as their reference chain: ```shell -hermes query clients ibc-1 -s ibc-2 +hermes query clients --host-chain ibc-1 --reference-chain ibc-2 ``` ```json @@ -79,9 +84,10 @@ DESCRIPTION: Query information about clients SUBCOMMANDS: - state query client full state - consensus query client consensus - connections query client connections + connections Query the client connections + consensus Query the client consensus state + header Query for the header used in a client update at a certain height + state Query the client full state ``` ## Query the client state @@ -90,17 +96,17 @@ Use the `query client state` command to query the client state of a client: ```shell USAGE: - hermes query client state + hermes query client state [OPTIONS] --chain --client DESCRIPTION: - Query client full state - -POSITIONAL ARGUMENTS: - chain_id identifier of the chain to query - client_id identifier of the client to query + Query the client state FLAGS: - -H, --height HEIGHT the chain height which this query should reflect + --chain Identifier of the chain to query + --client Identifier of the client to query + +OPTIONS: + --height HEIGHT The chain height which this query should reflect ``` __Example__ @@ -108,7 +114,7 @@ __Example__ Query the state of client `07-tendermint-2` on `ibc-1`: ```shell -hermes query client state ibc-1 07-tendermint-1 +hermes query client state --chain ibc-1 --client 07-tendermint-1 ``` ```json @@ -147,19 +153,27 @@ Use the `query client consensus` command to query the consensus states of a give ```shell USAGE: - hermes query client consensus + hermes query client consensus [OPTIONS] --chain --client DESCRIPTION: Query client consensus state -POSITIONAL ARGUMENTS: - chain_id identifier of the chain to query - client_id identifier of the client to query - FLAGS: - -c, --consensus-height CONSENSUS-HEIGHT - -s, --heights-only show only consensus heights - -H, --height HEIGHT the chain height context to be used, applicable only to a specific height + --chain + identifier of the chain to query + + --client + identifier of the client to query + +OPTIONS: + --consensus-height + height of the client's consensus state to query + + --height + the chain height context to be used, applicable only to a specific height + + --heights-only + show only consensus heights ``` __Example__ @@ -167,7 +181,7 @@ __Example__ Query the states of client `07-tendermint-0` on `ibc-0`: ```shell -hermes query client consensus ibc-0 07-tendermint-0 --heights-only +hermes query client consensus --chain ibc-0 --client 07-tendermint-0 --heights-only ``` ```json @@ -202,7 +216,7 @@ Success: [ Query `ibc-0` at height `2800` for the consensus state for height `2724`: ```shell -hermes query client consensus ibc-0 07-tendermint-0 -c 2724 -h 2800 +hermes query client consensus --chain ibc-0 --client 07-tendermint-0 --consensus-height 2724 --height 2800 ``` ```json @@ -225,17 +239,17 @@ Use the `query client connections` command to query the connections associated w ```shell USAGE: - hermes query client connections + hermes query client connections [OPTIONS] --chain --client DESCRIPTION: Query client connections -POSITIONAL ARGUMENTS: - chain_id identifier of the chain to query - client_id identifier of the client to query - FLAGS: - -H, --height HEIGHT the chain height which this query should reflect + --chain Identifier of the chain to query + --client Identifier of the client to query + +OPTIONS: + --height The chain height which this query should reflect ``` __Example__ @@ -243,7 +257,7 @@ __Example__ Query the connections of client `07-tendermint-0` on `ibc-0`: ```shell -hermes query client connections ibc-0 07-tendermint-0 +hermes query client connections --chain ibc-0 --client 07-tendermint-0 ``` ```json @@ -257,18 +271,18 @@ Success: [ ``` USAGE: - hermes query client header + hermes query client header [OPTIONS] --chain --client --consensus-height DESCRIPTION: Query for the header used in a client update at a certain height -POSITIONAL ARGUMENTS: - chain_id identifier of the chain to query - client_id identifier of the client to query - consensus_height height of header to query - FLAGS: - -H, --height HEIGHT the chain height context for the query + --chain Identifier of the chain to query + --client Identifier of the client to query + --consensus-height Height of header to query + +OPTIONS: + --height The chain height context for the query ``` __Example__ @@ -276,7 +290,7 @@ __Example__ Query for the header used in the `07-tendermint-0` client update at height 2724 on `ibc-0`: ```shell -hermes query client header ibc-0 07-tendermint-0 2724 +hermes query client header --chain ibc-0 --client 07-tendermint-0 --consensus-height 2724 ``` ```json diff --git a/guide/src/commands/queries/connection.md b/guide/src/commands/queries/connection.md index 2f2c4ad61f..2d8b505fca 100644 --- a/guide/src/commands/queries/connection.md +++ b/guide/src/commands/queries/connection.md @@ -8,13 +8,13 @@ Use the `query connections` command to query the identifiers of all connections ```shell USAGE: - hermes query connections + hermes query connections --chain DESCRIPTION: Query the identifiers of all connections on a chain -POSITIONAL ARGUMENTS: - chain_id identifier of the chain to query +FLAGS: + --chain Identifier of the chain to query ``` __Example__ @@ -22,7 +22,7 @@ __Example__ Query all connections on `ibc-1`: ```shell -hermes query connections ibc-1 +hermes query connections --chain ibc-1 ``` ```json @@ -58,17 +58,17 @@ Use the `query connection end` command to query the connection end: ```shell USAGE: - hermes query connection end + hermes query connection end [OPTIONS] --chain --connection DESCRIPTION: - query connection end - -POSITIONAL ARGUMENTS: - chain_id identifier of the chain to query - connection_id identifier of the connection to query + Query connection end FLAGS: - -H, --height HEIGHT height of the state to query + --chain Identifier of the chain to query + --connection Identifier of the connection to query + +OPTIONS: + --height Height of the state to query ``` __Example__ @@ -76,7 +76,7 @@ __Example__ Query the connection end of connection `connection-1` on `ibc-1`: ```shell -hermes query connection end ibc-1 connection-1 +hermes query connection end --chain ibc-1 --connection connection-1 ``` ```json @@ -115,14 +115,14 @@ Use the `query connection channels` command to query the identifiers of the chan ```shell USAGE: - hermes query connection channels + hermes query connection channels --chain --connection DESCRIPTION: - query connection channels + Query connection channels -POSITIONAL ARGUMENTS: - chain_id identifier of the chain to query - connection_id identifier of the connection to query +FLAGS: + --chain Identifier of the chain to query + --connection Identifier of the connection to query ``` __Example__ @@ -130,7 +130,7 @@ __Example__ Query the channels associated with connection `connection-1` on `ibc-1`: ```shell -hermes query connection channels ibc-1 connection-1 +hermes query connection channels --chain ibc-1 --connection connection-1 ``` ```json diff --git a/guide/src/commands/queries/index.md b/guide/src/commands/queries/index.md index 67eeeba748..0acae2dc33 100644 --- a/guide/src/commands/queries/index.md +++ b/guide/src/commands/queries/index.md @@ -13,7 +13,8 @@ The `query` command provides the following sub-commands: | `channel` | [Query information about channels](./channel.md) | | `channels` | [Query the identifiers of all channels on a given chain](./channel.md) | | `packet` | [Query information about packets](./packet.md) | -| `tx` | [Query information about transactions](./tx.md) | +| `transfer` | [Query information about token transfers](./transfer.md) | +| `tx` | [Query information about transactions](./tx.md) | ## Usage @@ -32,4 +33,6 @@ SUBCOMMANDS: channel Query information about channels channels Query the identifiers of all channels on a given chain packet Query information about packets + transfer Query information about token transfers + tx Query information about transactions ``` diff --git a/guide/src/commands/queries/packet.md b/guide/src/commands/queries/packet.md index fa7b8a9b5f..357a360c8b 100644 --- a/guide/src/commands/queries/packet.md +++ b/guide/src/commands/queries/packet.md @@ -19,7 +19,6 @@ SUBCOMMANDS: pending Output a summary of pending packets in both directions unreceived-acks Query unreceived acknowledgments unreceived-packets Query unreceived packets - help Print this message or the help of the given subcommand(s) ``` ## Table of Contents @@ -33,12 +32,12 @@ Use the `query packet pending` command to query the sequence numbers of all pack ```shell USAGE: - hermes query packet pending + hermes query packet pending --chain --port --channel -ARGS: - identifier of the chain at one end of the channel - port identifier on the chain given by - channel identifier on the chain given by +FLAGS: + --chain Identifier of the chain at one end of the channel + --channel Channel identifier on the chain given by + --port Port identifier on the chain given by ``` __Example__ @@ -46,7 +45,7 @@ __Example__ Query the sequence numbers of all packets that either not yet been received or not yet been acknowledged, at both ends of the channel `channel-1`. ```shell -$ hermes query packet pending ibc-0 tranfer channel-1 +$ hermes query packet pending --chain ibc-0 --port transfer --channel channel-1 ``` ```json @@ -85,15 +84,15 @@ Use the `query packet commitments` command to query the sequence numbers of all ```shell USAGE: - hermes query packet commitments + hermes query packet commitments --chain --port --channel DESCRIPTION: Query packet commitments -POSITIONAL ARGUMENTS: - chain_id identifier of the chain to query - port_id identifier of the port to query - channel_id identifier of the channel to query +FLAGS: + --chain Identifier of the chain to query + --channel Identifier of the channel to query + --port Identifier of the port to query ``` __Example__ @@ -101,7 +100,7 @@ __Example__ Query `ibc-0` for the sequence numbers of packets that still have commitments on `ibc-0` and that were sent on `transfer` port and `channel-0`: ```shell -hermes query packet commitments ibc-0 transfer channel-0 +hermes query packet commitments --chain ibc-0 --port transfer --channel channel-0 ``` ```json @@ -124,19 +123,19 @@ Use the `query packet commitment` command to query the commitment value of a pac ```shell USAGE: - hermes query packet commitment + hermes query packet commitment [OPTIONS] --chain --port --channel --sequence DESCRIPTION: Query packet commitment -POSITIONAL ARGUMENTS: - chain_id identifier of the chain to query - port_id identifier of the port to query - channel_id identifier of the channel to query - sequence sequence of packet to query - FLAGS: - -H, --height HEIGHT height of the state to query + --chain Identifier of the chain to query + --channel Identifier of the channel to query + --port Identifier of the port to query + --sequence Sequence of packet to query + +OPTIONS: + --height Height of the state to query ``` __Example__ @@ -144,7 +143,7 @@ __Example__ Query `ibc-0` for the commitment of packet with sequence `3` sent on `transfer` port and `channel-0`: ```shell -hermes query packet commitment ibc-0 transfer channel-0 3 +hermes query packet commitment --chain ibc-0 --port transfer --channel channel-0 --sequence 3 ``` ```json @@ -157,15 +156,15 @@ Use the `query packet acknowledgments` command to query the sequence numbers of ```shell USAGE: - hermes query packet acks + hermes query packet acks --chain --port --channel DESCRIPTION: Query packet acknowledgments -POSITIONAL ARGUMENTS: - chain_id identifier of the chain to query - port_id identifier of the port to query - channel_id identifier of the channel to query +FLAGS: + --chain Identifier of the chain to query + --channel Identifier of the channel to query + --port Identifier of the port to query ``` __Example__ @@ -173,7 +172,7 @@ __Example__ Query `ibc-1` for the sequence numbers of packets acknowledged that were received on `transfer` port and `channel-1`: ```shell -hermes query packet acks ibc-1 transfer channel-1 +hermes query packet acks --chain ibc-1 --port transfer --channel channel-1 ``` ```json @@ -196,19 +195,19 @@ Use the `query packet acknowledgment` command to query the acknowledgment value ```shell USAGE: - hermes query packet ack + hermes query packet ack [OPTIONS] --chain --port --channel --sequence DESCRIPTION: Query packet acknowledgment -POSITIONAL ARGUMENTS: - chain_id identifier of the chain to query - port_id identifier of the port to query - channel_id identifier of the channel to query - sequence sequence of packet to query - FLAGS: - -H, --height HEIGHT height of the state to query + --chain Identifier of the chain to query + --channel Identifier of the channel to query + --port Identifier of the port to query + --sequence Sequence of packet to query + +OPTIONS: + --height Height of the state to query ``` __Example__ @@ -216,7 +215,7 @@ __Example__ Query `ibc-1` for the acknowledgment of packet with sequence `2` received on `transfer` port and `channel-1`: ```shell -hermes query packet ack ibc-1 transfer channel-1 2 +hermes query packet ack --chain ibc-1 --port transfer --channel channel-1 --sequence 2 ``` ```json @@ -229,15 +228,15 @@ Use the `query packet unreceived-packets` command to query the sequence numbers ```shell USAGE: - hermes query packet unreceived-packets + hermes query packet unreceived-packets --chain --port --channel DESCRIPTION: Query unreceived packets -POSITIONAL ARGUMENTS: - chain_id identifier of the chain for the unreceived sequences - port_id port identifier - channel_id channel identifier +FLAGS: + --chain Identifier of the chain for the unreceived sequences + --channel Channel identifier + --port Port identifier ``` __Example__ @@ -245,7 +244,7 @@ __Example__ Query `transfer` port and `channel-1` on `ibc-1` for the sequence numbers of packets sent on `ibc-0` but not yet received: ```shell -hermes query packet unreceived-packets ibc-1 transfer channel-1 +hermes query packet unreceived-packets --chain ibc-1 --port transfer --channel channel-1 ``` ```json @@ -262,15 +261,15 @@ Use the `query packet unreceived-acks` command to query the sequence numbers of ```shell USAGE: - hermes query packet unreceived-acks + hermes query packet unreceived-acks --chain --port --channel DESCRIPTION: Query unreceived acknowledgments -POSITIONAL ARGUMENTS: - chain_id identifier of the chain to query the unreceived acknowledgments - port_id port identifier - channel_id channel identifier +FLAGS: + --chain Identifier of the chain to query the unreceived acknowledgments + --channel Channel identifier + --port Port identifier ``` __Example__ @@ -278,7 +277,7 @@ __Example__ Query `transfer` port and `channel-0` on `ibc-0` for the sequence numbers of packets received by `ibc-1` but not yet acknowledged on `ibc-0`: ```shell -hermes query packet unreceived-acks ibc-0 transfer channel-0 +hermes query packet unreceived-acks --chain ibc-0 --port transfer --channel channel-0 ``` ```json diff --git a/guide/src/commands/queries/transfer.md b/guide/src/commands/queries/transfer.md index 5176fdc2c7..abede54f6c 100644 --- a/guide/src/commands/queries/transfer.md +++ b/guide/src/commands/queries/transfer.md @@ -29,8 +29,8 @@ DESCRIPTION: Query the denomination trace info from a trace hash FLAGS: - --chain identifier of the chain - --hash trace hash to query + --chain Identifier of the chain + --hash Trace hash to query ``` __Example__ diff --git a/guide/src/commands/queries/tx.md b/guide/src/commands/queries/tx.md index 7af7c4c2a4..c0fb5917b3 100644 --- a/guide/src/commands/queries/tx.md +++ b/guide/src/commands/queries/tx.md @@ -26,14 +26,14 @@ delivering a transaction. ```shell USAGE: - hermes query tx events + hermes query tx events --chain --hash DESCRIPTION: Query the events emitted by transaction -POSITIONAL ARGUMENTS: - chain_id identifier of the chain to query - hash transaction hash to query +FLAGS: + --chain Identifier of the chain to query + --hash Transaction hash to query ``` __Example__ @@ -42,7 +42,7 @@ Query chain `ibc-0` for the events emitted due to transaction with hash `6EDBBCBCB779F9FC9D6884ACDC4350E69720C4B362E4ACE6C576DE792F837490`: ```shell -hermes query tx events ibc-0 6EDBBCBCB779F9FC9D6884ACDC4350E69720C4B362E4ACE6C576DE792F837490 +hermes query tx events --chain ibc-0 --hash 6EDBBCBCB779F9FC9D6884ACDC4350E69720C4B362E4ACE6C576DE792F837490 ``` ```json diff --git a/guide/src/commands/raw/channel-close.md b/guide/src/commands/raw/channel-close.md index b04befeeb0..16bddfbf38 100644 --- a/guide/src/commands/raw/channel-close.md +++ b/guide/src/commands/raw/channel-close.md @@ -12,27 +12,25 @@ Use the `chan-close-init` command to initialize the closure of a channel. ```shell USAGE: - hermes tx raw chan-close-init + hermes tx raw chan-close-init --dst-chain --src-chain --dst-conn --dst-port --src-port --dst-chan --src-chan DESCRIPTION: Initiate the closing of a channel (ChannelCloseInit) -POSITIONAL ARGUMENTS: - dst_chain_id identifier of the destination chain - src_chain_id identifier of the source chain - dst_conn_id identifier of the destination connection - dst_port_id identifier of the destination port - src_port_id identifier of the source port - FLAGS: - -d, --dst-chan-id ID identifier of the destination channel (required) - -s, --src-chan-id ID identifier of the source channel (required) + --dst-chain Identifier of the destination chain + --dst-chan Identifier of the destination channel (required) + --dst-conn Identifier of the destination connection + --dst-port Identifier of the destination port + --src-chain Identifier of the source chain + --src-chan Identifier of the source channel (required) + --src-port Identifier of the source port ``` __Example__ ```shell -hermes tx raw chan-close-init ibc-0 ibc-1 connection-0 transfer transfer -d channel-0 -s channel-1 +hermes tx raw chan-close-init --dst-chain ibc-0 --src-chain ibc-1 --dst-conn connection-0 --dst-port transfer --src-port transfer --dst-chan channel-0 --src-chan channel-1 ``` ```json @@ -73,27 +71,26 @@ Use the `chan-close-confirm` command to confirm the closure of a channel. ```shell USAGE: - hermes tx raw chan-close-confirm + hermes tx raw chan-close-confirm --dst-chain --src-chain --dst-conn --dst-port --src-port --dst-chan --src-chan DESCRIPTION: Confirm the closing of a channel (ChannelCloseConfirm) -POSITIONAL ARGUMENTS: - dst_chain_id identifier of the destination chain - src_chain_id identifier of the source chain - dst_conn_id identifier of the destination connection - dst_port_id identifier of the destination port - src_port_id identifier of the source port - FLAGS: - -d, --dst-chan-id ID identifier of the destination channel (required) - -s, --src-chan-id ID identifier of the source channel (required) + --dst-chain Identifier of the destination chain + --dst-chan Identifier of the destination channel (required) + --dst-conn Identifier of the destination connection + --dst-port Identifier of the destination port + --src-chain Identifier of the source chain + --src-chan Identifier of the source channel (required) + --src-port Identifier of the source port + ``` __Example__ ```shell -hermes tx raw chan-close-confirm ibc-1 ibc-0 connection-1 transfer transfer -d channel-1 -s channel-0 +hermes tx raw chan-close-confirm --dst-chain ibc-1 --src-chain ibc-0 --dst-conn connection-1 --src-port transfer --dst-port transfer --dst-chan channel-1 --src-chan channel-0 ``` ```json diff --git a/guide/src/commands/raw/channel-open.md b/guide/src/commands/raw/channel-open.md index 86bfb569d1..6dc106cfe1 100644 --- a/guide/src/commands/raw/channel-open.md +++ b/guide/src/commands/raw/channel-open.md @@ -35,20 +35,21 @@ Use the `chan-open-init` command to initialize a new channel. ```shell USAGE: - hermes tx raw chan-open-init + hermes tx raw chan-open-init [OPTIONS] --dst-chain --src-chain --dst-conn --dst-port --src-port DESCRIPTION: Initialize a channel (ChannelOpenInit) -POSITIONAL ARGUMENTS: - dst_chain_id identifier of the destination chain - src_chain_id identifier of the source chain - dst_conn_id identifier of the destination connection - dst_port_id identifier of the destination port - src_port_id identifier of the source port - FLAGS: - -o, --order ORDER the channel ordering, valid options 'unordered' (default) and 'ordered' + --dst-chain Identifier of the destination chain + --dst-conn Identifier of the destination connection + --dst-port Identifier of the destination port + --src-chain Identifier of the source chain + --src-port Identifier of the source port + +OPTIONS: + --order The channel ordering, valid options 'unordered' (default) and + 'ordered' [default: ORDER_UNORDERED] ``` __Example__ @@ -56,7 +57,7 @@ __Example__ First, let's initialize the channel on `ibc-0` using an existing connection identified by `connection-0`: ```shell -hermes tx raw chan-open-init ibc-0 ibc-1 connection-0 transfer transfer +hermes tx raw chan-open-init --dst-chain ibc-0 --src-chain ibc-1 --dst-conn connection-0 --dst-port transfer --src-port transfer ``` ```json @@ -98,20 +99,21 @@ Use the `chan-open-try` command to establish a counterparty to the channel on th ```shell USAGE: - hermes tx raw chan-open-try + hermes tx raw chan-open-try [OPTIONS] --dst-chain --src-chain --dst-conn --dst-port --src-port --src-chan DESCRIPTION: Relay the channel attempt (ChannelOpenTry) -POSITIONAL ARGUMENTS: - dst_chain_id identifier of the destination chain - src_chain_id identifier of the source chain - dst_conn_id identifier of the destination connection - dst_port_id identifier of the destination port - src_port_id identifier of the source port - FLAGS: - -s, --src-chan-id ID identifier of the source channel (required) + --dst-chain Identifier of the destination chain + --dst-conn Identifier of the destination connection + --dst-port Identifier of the destination port + --src-chain Identifier of the source chain + --src-chan Identifier of the source channel (required) + --src-port Identifier of the source port + +OPTIONS: + --dst-chan Identifier of the destination channel (optional) ``` __Example__ @@ -119,7 +121,7 @@ __Example__ Let's now create the counterparty to `channel-0` on chain `ibc-1`: ```shell -hermes tx raw chan-open-try ibc-1 ibc-0 connection-1 transfer transfer -s channel-0 +hermes tx raw chan-open-try --dst-chain ibc-1 --src-chain ibc-0 --dst-conn connection-1 --dst-port transfer --src-port transfer --src-chan channel-0 ``` ```json @@ -165,21 +167,19 @@ Use the `chan-open-ack` command to acknowledge the channel on the initial chain. ```shell USAGE: - hermes tx raw chan-open-ack + hermes tx raw chan-open-ack --dst-chain --src-chain --dst-conn --dst-port --src-port --dst-chan --src-chan DESCRIPTION: Relay acknowledgment of a channel attempt (ChannelOpenAck) -POSITIONAL ARGUMENTS: - dst_chain_id identifier of the destination chain - src_chain_id identifier of the source chain - dst_conn_id identifier of the destination connection - dst_port_id identifier of the destination port - src_port_id identifier of the source port - FLAGS: - -d, --dst-chan-id ID identifier of the destination channel (required) - -s, --src-chan-id ID identifier of the source channel (required) + --dst-chain Identifier of the destination chain + --dst-chan Identifier of the destination channel (required) + --dst-conn Identifier of the destination connection + --dst-port Identifier of the destination port + --src-chain Identifier of the source chain + --src-chan Identifier of the source channel (required) + --src-port Identifier of the source port ``` __Example__ @@ -187,7 +187,7 @@ __Example__ We can now acknowledge on `ibc-0` that `ibc-1` has accepted the opening of the channel: ```shell -hermes tx raw chan-open-ack ibc-0 ibc-1 connection-0 transfer transfer -d channel-0 -s channel-1 +hermes tx raw chan-open-ack --dst-chain ibc-0 --src-chain ibc-1 --dst-conn connection-0 --dst-port transfer --src-port transfer --dst-chan channel-0 --src-chan channel-1 ``` ```json @@ -232,21 +232,19 @@ and finish the handshake, after which the channel is open on both chains. ```shell USAGE: - hermes tx raw chan-open-confirm + hermes tx raw chan-open-confirm --dst-chain --src-chain --dst-conn --dst-port --src-port --dst-chan --src-chan DESCRIPTION: Confirm opening of a channel (ChannelOpenConfirm) -POSITIONAL ARGUMENTS: - dst_chain_id identifier of the destination chain - src_chain_id identifier of the source chain - dst_conn_id identifier of the destination connection - dst_port_id identifier of the destination port - src_port_id identifier of the source port - FLAGS: - -d, --dst-chan-id ID identifier of the destination channel (required) - -s, --src-chan-id ID identifier of the source channel (required) + --dst-chain Identifier of the destination chain + --dst-chan Identifier of the destination channel (required) + --dst-conn Identifier of the destination connection + --dst-port Identifier of the destination port + --src-chain Identifier of the source chain + --src-chan Identifier of the source channel (required) + --src-port Identifier of the source port ``` __Example__ @@ -255,7 +253,7 @@ Confirm on `ibc-1` that `ibc-0` has accepted the opening of the channel, after which the channel is open on both chains. ```shell -hermes tx raw chan-open-confirm ibc-1 ibc-0 connection-1 transfer transfer -d channel-1 -s channel-0 +hermes tx raw chan-open-confirm --dst-chain ibc-1 --src-chain ibc-0 --dst-conn connection-1 --dst-port transfer --src-port transfer --dst-chan channel-1 --src-chan channel-0 ``` ```json diff --git a/guide/src/commands/raw/client.md b/guide/src/commands/raw/client.md index b0041246ef..6d35f638ef 100644 --- a/guide/src/commands/raw/client.md +++ b/guide/src/commands/raw/client.md @@ -9,14 +9,27 @@ Use the `create-client` command to create a new client. ```shell USAGE: - hermes tx raw create-client + hermes tx raw create-client [OPTIONS] --host-chain --reference-chain DESCRIPTION: Create a client for source chain on destination chain -POSITIONAL ARGUMENTS: - dst_chain_id identifier of the destination chain - src_chain_id identifier of the source chain +FLAGS: + --host-chain + identifier of the chain that hosts the client + + --reference-chain + identifier of the chain targeted by the client + +OPTIONS: + --clock-drift + The maximum allowed clock drift for this client + + --trust-threshold + Override the trust threshold specified in the configuration + + --trusting-period + Override the trusting period specified in the config ``` @@ -25,7 +38,7 @@ __Example__ Create a new client of `ibc-1` on `ibc-0`: ```shell -hermes tx raw create-client ibc-0 ibc-1 +hermes tx raw create-client --host-chain ibc-0 --reference-chain ibc-1 ``` ```json @@ -53,18 +66,25 @@ Specific update and trusted heights can be specified. ```shell USAGE: - hermes tx raw update-client + hermes tx raw update-client [OPTIONS] --host-chain --client DESCRIPTION: Update the specified client on destination chain -POSITIONAL ARGUMENTS: - dst_chain_id identifier of the destination chain - dst_client_id identifier of the client to be updated on destination chain - FLAGS: - -H, --target-height TARGET-HEIGHT - -t, --trusted-height TRUSTED-HEIGHT + --host-chain + identifier of the chain that hosts the client + + --client + identifier of the chain targeted by the client + +OPTIONS: + + --height + the target height of the client update + + --trusted-height + the trusted height of the client update ``` __Example__ @@ -72,7 +92,7 @@ __Example__ Update the client on `ibc-0` with latest header of `ibc-1` ```shell -hermes tx raw update-client ibc-0 07-tendermint-0 +hermes tx raw update-client --host-chain ibc-0 --client 07-tendermint-0 ``` ```json diff --git a/guide/src/commands/raw/connection.md b/guide/src/commands/raw/connection.md index ce20d223fd..276fcc0cea 100644 --- a/guide/src/commands/raw/connection.md +++ b/guide/src/commands/raw/connection.md @@ -35,16 +35,16 @@ Use the `conn-init` command to initialize a new connection on a chain. ```shell USAGE: - hermes tx raw conn-init + hermes tx raw conn-init --dst-chain --src-chain --dst-client --src-client DESCRIPTION: Initialize a connection (ConnectionOpenInit) -POSITIONAL ARGUMENTS: - dst_chain_id identifier of the destination chain - src_chain_id identifier of the source chain - dst_client_id identifier of the destination client - src_client_id identifier of the source client +FLAGS: + --dst-chain Identifier of the destination chain + --dst-client Identifier of the destination client + --src-chain Identifier of the source chain + --src-client Identifier of the source client ``` __Example__ @@ -55,7 +55,7 @@ identifier `07-tendermint-1` on chain `ibc-1`, we can initialize a connection be First, let's initialize the connection on `ibc-0`: ```shell -hermes tx raw conn-init ibc-0 ibc-1 07-tendermint-0 07-tendermint-1 +hermes tx raw conn-init --dst-chain ibc-0 --src-chain ibc-1 --dst-client 07-tendermint-0 --src-client 07-tendermint-1 ``` ```json @@ -94,19 +94,20 @@ Use the `conn-try` command to establish a counterparty to the connection on the ```shell USAGE: - hermes tx raw conn-try + hermes tx raw conn-try [OPTIONS] --dst-chain --src-chain --dst-client --src-client --src-conn DESCRIPTION: Relay the connection attempt (ConnectionOpenTry) -POSITIONAL ARGUMENTS: - dst_chain_id identifier of the destination chain - src_chain_id identifier of the source chain - dst_client_id identifier of the destination client - src_client_id identifier of the source client - FLAGS: - -s, --src-conn-id ID identifier of the source connection (required) + --dst-chain Identifier of the destination chain + --dst-client Identifier of the destination client + --src-chain Identifier of the source chain + --src-client Identifier of the source client + --src-conn Identifier of the source connection (required) + +OPTIONS: + --dst-conn Identifier of the destination connection (optional) ``` __Example__ @@ -114,7 +115,7 @@ __Example__ Let's now create the counterparty to `connection-0` on chain `ibc-1`: ```shell -hermes tx raw conn-try ibc-1 ibc-0 07-tendermint-1 07-tendermint-0 -s connection-0 +hermes tx raw conn-try --dst-chain ibc-1 --src-chain ibc-0 --dst-client 07-tendermint-1 --src-client 07-tendermint-0 --src-conn connection-0 ``` ```json @@ -157,20 +158,18 @@ Use the `conn-ack` command to acknowledge the connection on the initial chain. ```shell USAGE: - hermes tx raw conn-ack + hermes tx raw conn-ack --dst-chain --src-chain --dst-client --src-client --dst-conn --src-conn DESCRIPTION: Relay acknowledgment of a connection attempt (ConnectionOpenAck) -POSITIONAL ARGUMENTS: - dst_chain_id identifier of the destination chain - src_chain_id identifier of the source chain - dst_client_id identifier of the destination client - src_client_id identifier of the source client - FLAGS: - -d, --dst-conn-id ID identifier of the destination connection (required) - -s, --src-conn-id ID identifier of the source connection (required) + --dst-chain Identifier of the destination chain + --dst-client Identifier of the destination client + --dst-conn Identifier of the destination connection (required) + --src-chain Identifier of the source chain + --src-client Identifier of the source client + --src-conn Identifier of the source connection (required) ``` __Example__ @@ -178,7 +177,7 @@ __Example__ We can now acknowledge on `ibc-0` that `ibc-1` has accepted the connection attempt: ```shell -hermes tx raw conn-ack ibc-0 ibc-1 07-tendermint-0 07-tendermint-1 -d connection-0 -s connection-1 +hermes tx raw conn-ack --dst-chain ibc-0 --src-chain ibc-1 --dst-client 07-tendermint-0 --src-client 07-tendermint-1 --dst-conn connection-0 --src-conn connection-1 ``` ```json @@ -220,20 +219,18 @@ and finish the handshake, after which the connection is open on both chains. ```shell USAGE: - hermes tx raw conn-confirm + hermes tx raw conn-confirm --dst-chain --src-chain --dst-client --src-client --dst-conn --src-conn DESCRIPTION: Confirm opening of a connection (ConnectionOpenConfirm) -POSITIONAL ARGUMENTS: - dst_chain_id identifier of the destination chain - src_chain_id identifier of the source chain - dst_client_id identifier of the destination client - src_client_id identifier of the source client - FLAGS: - -d, --dst-conn-id ID identifier of the destination connection (required) - -s, --src-conn-id ID identifier of the source connection (required) + --dst-chain Identifier of the destination chain + --dst-client Identifier of the destination client + --dst-conn Identifier of the destination connection (required) + --src-chain Identifier of the source chain + --src-client Identifier of the source client + --src-conn Identifier of the source connection (required) ``` __Example__ @@ -241,7 +238,7 @@ __Example__ Confirm on `ibc-1` that `ibc-0` has accepted the connection attempt. ```shell -hermes tx raw conn-confirm ibc-1 ibc-0 07-tendermint-1 07-tendermint-0 -d connection-1 -s connection-0 +hermes tx raw conn-confirm --dst-chain ibc-1 --src-chain ibc-0 --dst-client 07-tendermint-1 --src-client 07-tendermint-0 --dst-conn connection-1 --src-conn connection-0 ``` ```json diff --git a/guide/src/commands/raw/index.md b/guide/src/commands/raw/index.md index c4c4093015..5da87a9130 100644 --- a/guide/src/commands/raw/index.md +++ b/guide/src/commands/raw/index.md @@ -15,12 +15,15 @@ The `tx raw` command provides the following sub-commands: | `chan-open-init` | [Initialize a channel (ChannelOpenInit)](./channel-open.md#channel-open-init) | | `chan-open-try` | [Relay the channel attempt (ChannelOpenTry)](./channel-open.md#channel-open-try) | | `chan-open-ack` | [Relay acknowledgment of a channel attempt (ChannelOpenAck)](./channel-open.md#channel-open-ack) | -| `chan-open-close` | [Confirm opening of a channel (ChannelOpenConfirm)](./channel-open.md#channel-open-close) | +| `chan-open-confirm` | [Confirm opening of a channel (ChannelOpenConfirm)](./channel-open.md#channel-open-close) | | `chan-close-init` | [Initiate the closing of a channel (ChannelCloseInit)](./channel-close.md#channel-close-init) | | `chan-close-confirm` | [Confirm the closing of a channel (ChannelCloseConfirm)](./channel-close.md#channel-close-confirm) | -| `ft-transfer` | [Send a fungible token transfer test transaction (ICS20 MsgTransfer](./packet.md#fungible-token-transfer) | +| `ft-transfer` | [Send a fungible token transfer test transaction (ICS20 MsgTransfer](./packet.md#fungible-token-transfer) | | `packet-recv` | [Relay receive or timeout packets](./packet.md#relay-receive-and-timeout-packets) | | `packet-ack` | [Relay acknowledgment packets](./packet.md#relay-acknowledgment-packets) | +| `upgrade-chain` | [Send an IBC upgrade plan](./upgrade.md) +| `upgrade-client` | [Upgrade the specified client on destination chain](./upgrade.md) +| `upgrade-clients` | [Upgrade all IBC clients that target a specific chain](./upgrade.md) The main purpose of these commands is to support development and testing, and continuous integration. These CLIs take quite a few parameters and they are explained in the individual sub-sections. @@ -55,6 +58,7 @@ In the command template above: - [Channel Open](./channel-open.md) - [Channel Close](./channel-close.md) - [Packet](./packet.md) + - [Upgrade](./upgrade.md) ## Usage @@ -82,4 +86,7 @@ SUBCOMMANDS: ft-transfer Send a fungible token transfer test transaction (ICS20 MsgTransfer) packet-recv Relay receive or timeout packets packet-ack Relay acknowledgment packets + upgrade-chain Send an IBC upgrade plan + upgrade-client Upgrade the specified client on destination chain + upgrade-clients Upgrade all IBC clients that target a specific chain ``` diff --git a/guide/src/commands/raw/packet.md b/guide/src/commands/raw/packet.md index e87bbacf29..5522eac79a 100644 --- a/guide/src/commands/raw/packet.md +++ b/guide/src/commands/raw/packet.md @@ -11,25 +11,45 @@ __NOTE:__ This command is mainly used for testing the packet features of the rel ```shell USAGE: - hermes tx raw ft-transfer + hermes tx raw ft-transfer [OPTIONS] --dst-chain --src-chain --src-port --src-chan --amount DESCRIPTION: Send a fungible token transfer test transaction (ICS20 MsgTransfer) -POSITIONAL ARGUMENTS: - dst_chain_id identifier of the destination chain - src_chain_id identifier of the source chain - src_port_id identifier of the source port - src_channel_id identifier of the source channel - amount amount of coins (samoleans, by default) to send (e.g. `100000`) - FLAGS: - -o, --timeout-height-offset TIMEOUT-HEIGHT-OFFSET timeout in number of blocks since current - -t, --timeout-seconds TIMEOUT-SECONDS timeout in seconds since current - -r, --receiver RECEIVER receiving account address on the destination chain - -d, --denom DENOM denomination of the coins to send (default: samoleans) - -n, --number-msgs NUMBER-MSGS number of messages to send - -k, --key KEY use the given signing key (default: `key_name` config) + --amount + amount of coins (samoleans, by default) to send (e.g. `100000`) + + --dst-chain + identifier of the destination chain + + --src-chain + identifier of the source chain + + --src-chan + identifier of the source channel + + --src-port + identifier of the source port + +OPTIONS: + --denom + denomination of the coins to send [default: samoleans] + + --key-name + use the given signing key name (default: `key_name` config) + + --number-msgs + number of messages to send + + --receiver + receiving account address on the destination chain + + --timeout-height-offset + timeout in number of blocks since current [default: 0] + + --timeout-seconds + timeout in seconds since current [default: 0] ``` __Example__ @@ -37,7 +57,7 @@ __Example__ Send two transfer packets from the `transfer` module and `channel-0` of `ibc-0` to `ibc-1`. Each transfer if for `9999` samoleans (default denomination) and a timeout offset of `10` blocks. The transfer fee is paid by the relayer account on `ibc-1`. ```shell -hermes tx raw ft-transfer ibc-1 ibc-0 transfer channel-0 9999 -o 1000 -n 2 +hermes tx raw ft-transfer --dst-chain ibc-1 --src-chain ibc-0 --src-port transfer --src-chan channel-0 --amount 9999 --timeout-height-offset 1000 --number-msgs 2 ``` ```json @@ -65,10 +85,10 @@ Success: [ The transfer packets are stored on `ibc-0` and can be relayed. -> To send transfer packets with a custom receiver address use the `--receiver | -r` flag. +> To send transfer packets with a custom receiver address use the `--receiver` flag. ```shell -hermes tx raw ft-transfer ibc-1 ibc-0 transfer channel-0 9999 -o 1000 -n 1 -r board:1938586739 +hermes tx raw ft-transfer --dst-chain ibc-1 --src-chain ibc-0 --src-port transfer --src-chan channel-0 --amount 9999 --timeout-height-offset 1000 --number-msgs 1 --receiver board:1938586739 ``` ```json @@ -91,16 +111,16 @@ Use the `tx raw packet-recv` command to relay the packets sent but not yet recei ```shell USAGE: - hermes tx raw packet-recv + hermes tx raw packet-recv --dst-chain --src-chain --src-port --src-chan DESCRIPTION: Relay receive or timeout packets -POSITIONAL ARGUMENTS: - dst_chain_id identifier of the destination chain - src_chain_id identifier of the source chain - src_port_id identifier of the source port - src_channel_id identifier of the source channel +FLAGS: + --dst-chain Identifier of the destination chain + --src-chain Identifier of the source chain + --src-chan Identifier of the source channel + --src-port Identifier of the source port ``` __Example__ @@ -110,7 +130,7 @@ Send the two transfer packets to the `ibc-1` module bound to the `transfer` port __NOTE__: The relayer prepends a client update message before the receive messages. ```shell -hermes tx raw packet-recv ibc-1 ibc-0 transfer channel-0 +hermes tx raw packet-recv --dst-chain ibc-1 --src-chain ibc-0 --src-port transfer --src-chan channel-0 ``` ```json @@ -203,16 +223,16 @@ Use the `tx raw packet-ack` command to relay acknowledgments to the original sou ```shell USAGE: - hermes tx raw packet-ack + hermes tx raw packet-ack --dst-chain --src-chain --src-port --src-chan DESCRIPTION: Relay acknowledgment packets -POSITIONAL ARGUMENTS: - dst_chain_id identifier of the destination chain - src_chain_id identifier of the source chain - src_port_id identifier of the source port - src_channel_id identifier of the source channel +FLAGS: + --dst-chain Identifier of the destination chain + --src-chain Identifier of the source chain + --src-chan Identifier of the source channel + --src-port Identifier of the source port ``` __Example__ @@ -222,7 +242,7 @@ Send the acknowledgments to the `ibc-0` module bound to the `transfer` port and __NOTE__: The relayer prepends a client update message before the acknowledgments. ```shell -hermes tx raw packet-ack ibc-0 ibc-1 transfer channel-1 +hermes tx raw packet-ack --dst-chain ibc-0 --src-chain ibc-1 --src-port transfer --src-chan channel-1 ``` ```json diff --git a/guide/src/commands/raw/upgrade.md b/guide/src/commands/raw/upgrade.md new file mode 100644 index 0000000000..c5b11b3290 --- /dev/null +++ b/guide/src/commands/raw/upgrade.md @@ -0,0 +1,162 @@ +# Upgrade Tx Commands + +## Table of Contents + + + +## Upgrade Client + +Use this to perform the upgrade for the given client. + +```shell +USAGE: + hermes tx raw upgrade-client --host-chain --client + +DESCRIPTION: + Upgrade the specified client on destination chain + +FLAGS: + --client Identifier of the client to be upgraded + --host-chain Identifier of the chain that hosts the client +``` + +__Example__ + +A given client is upgraded: + +```shell +hermes tx raw upgrade-client --host-chain ibc-1 --client 07-tendermint-0 +```` + +``` +Success: [ + UpdateClient( + h: 1-101, cs_h: 07-tendermint-0(0-84), + ), + UpgradeClient( + UpgradeClient( + Attributes { + height: Height { + revision: 1, + height: 101, + }, + client_id: ClientId( + "07-tendermint-0", + ), + client_type: Tendermint, + consensus_height: Height { + revision: 0, + height: 85, + }, + }, + ), + ), +] +``` + +## Upgrade Clients + +Use this to perform the upgrade on all the clients. + +```shell +USAGE: + hermes tx raw upgrade-clients --reference-chain + +DESCRIPTION: + Upgrade all IBC clients that target a specific chain + +FLAGS: + --reference-chain + identifier of the chain that underwent an upgrade; all clients targeting this chain will + be upgraded +``` + +__Example__ + +All the clients are upgraded: + +```shell +hermes tx raw upgrade-clients --reference-chain ibc-1 +```` + +``` +Success: [ + [ + UpdateClient( + h: 1-111, cs_h: 07-tendermint-0(0-108), + ), + UpgradeClient( + UpgradeClient( + Attributes { + height: Height { + revision: 1, + height: 111, + }, + client_id: ClientId( + "07-tendermint-0", + ), + client_type: Tendermint, + consensus_height: Height { + revision: 0, + height: 109, + }, + }, + ), + ), + ], +] +``` + +## Upgrade Chain + +Use this to make an upgrade proposal. + +```shell +USAGE: + hermes tx raw upgrade-chain [OPTIONS] --dst-chain --src-chain --src-client --amount --height-offset + +DESCRIPTION: + Send an IBC upgrade plan + +FLAGS: + --amount + amount of stake + + --dst-chain + identifier of the chain to upgrade + + --height-offset + upgrade height offset in number of blocks since current + + --src-chain + identifier of the source chain + + --src-client + identifier of the client on source chain from which the plan is created + +OPTIONS: + --denom + denomination for the deposit (default: 'stake') + + --new-chain + new chain identifier to assign to the upgrading chain (optional) + + --new-unbonding + new unbonding period to assign to the upgrading chain, in seconds (optional) + + --upgrade-name + a string to name the upgrade proposal plan (default: 'plan') + +``` + +__Example__ + +An upgrade proposal is made for `ibc-0`, for height `300` blocks from latest height, with `10000000stake` deposited. The proposal will include the upgraded client state constructed from the state of `07-tendermint-0` client on `ibc-1`. + +```shell +hermes tx raw upgrade-chain --dst-chain ibc-0 --src-chain ibc-1 --src-client 07-tendermint-0 --amount 10000000 --height-offset 300 +``` + +``` +Success: transaction::Hash(779713508B6103E37FADE60483BEE964A90BD67E5F20037B2CC4AE0E90B707C3) +``` \ No newline at end of file diff --git a/guide/src/commands/relaying/clear.md b/guide/src/commands/relaying/clear.md index a9f2c581cf..1211137f53 100644 --- a/guide/src/commands/relaying/clear.md +++ b/guide/src/commands/relaying/clear.md @@ -9,20 +9,18 @@ and [packet-acks](../raw/packet.md#relay-acknowledgment-packets). ### Usage ``` -Clear outstanding packets (i.e. packet-recv and packet-ack) on a given channel in both directions. - -The channel is identified by the chain, port, and channel IDs at one of its ends - USAGE: - hermes clear packets + hermes clear packets --chain --port --channel + +DESCRIPTION: + Clear outstanding packets (i.e. packet-recv and packet-ack) on a given channel in both directions. -ARGS: - identifier of the chain - identifier of the port - identifier of the channel + The channel is identified by the chain, port, and channel IDs at one of its ends -OPTIONS: - -h, --help Print help information +FLAGS: + --chain Identifier of the chain + --channel Identifier of the channel + --port Identifier of the port ``` ### Example @@ -30,7 +28,7 @@ OPTIONS: 1. Without Hermes running, send 3 packets over a channel, here `channel-13`: ``` -❯ hermes tx raw ft-transfer ibc1 ibc0 transfer channel-13 9999 -o 1000 -n 3 +❯ hermes tx raw ft-transfer --dst-chain ibc1 --src-chain ibc0 --src-port transfer --src-chan channel-13 --amount 9999 --timeout-height-offset 1000 --number-msgs 3 2022-02-24T14:16:28.295526Z INFO ThreadId(01) using default configuration from '/Users/coromac/.hermes/config.toml' 2022-02-24T14:16:28.330860Z INFO ThreadId(15) send_tx{id=ibc0}: refresh: retrieved account sequence=61 number=1 2022-02-24T14:16:28.350022Z INFO ThreadId(15) wait_for_block_commits: waiting for commit of tx hashes(s) AE4C3186778488E45670EB7303FA77E69B39F4E7C7494B05EC51E55136A373D6 id=ibc0 @@ -141,7 +139,7 @@ Success: [ as can be seen with the `query packet unreceived-packets` command: ``` -❯ hermes query packet unreceived-packets ibc1 transfer channel-13 +❯ hermes query packet unreceived-packets --chain ibc1 --port transfer --channel channel-13 2022-02-24T14:21:28.874190Z INFO ThreadId(01) using default configuration from '/Users/coromac/.hermes/config.toml' Success: [ 14, @@ -153,7 +151,7 @@ Success: [ 3. We can clear them manually using the `clear packets` command: ``` -❯ hermes clear packets ibc0 transfer channel-13 +❯ hermes clear packets --chain ibc0 --port transfer --channel channel-13 2022-02-24T14:17:25.748422Z INFO ThreadId(01) using default configuration from '/Users/coromac/.hermes/config.toml' 2022-02-24T14:17:25.799704Z INFO ThreadId(01) PacketRecvCmd{src_chain=ibc0 src_port=transfer src_channel=channel-13 dst_chain=ibc1}: found unprocessed SendPacket events for [Sequence(14), Sequence(15), Sequence(16)] (first 10 shown here; total=3) 2022-02-24T14:17:25.827177Z INFO ThreadId(01) PacketRecvCmd{src_chain=ibc0 src_port=transfer src_channel=channel-13 dst_chain=ibc1}: ready to fetch a scheduled op. data with batch of size 3 targeting Destination @@ -435,7 +433,7 @@ Success: [ 4. The packets have now been successfully relayed: ``` -❯ hermes query packet unreceived-packets ibc1 transfer channel-13 +❯ hermes query packet unreceived-packets --chain ibc1 --port transfer --channel channel-13 2022-02-24T14:21:28.874190Z INFO ThreadId(01) using default configuration from '/Users/coromac/.hermes/config.toml' Success: [] ``` diff --git a/guide/src/commands/relaying/index.md b/guide/src/commands/relaying/index.md index c9d4d06b06..db7fe96326 100644 --- a/guide/src/commands/relaying/index.md +++ b/guide/src/commands/relaying/index.md @@ -11,10 +11,13 @@ The `start` command can be used to start hermes in IBC event listen mode. ```shell USAGE: - hermes start + hermes start [OPTIONS] DESCRIPTION: Start the relayer in multi-chain mode. Relays packets and channel handshake messages between all chains in the config. + +OPTIONS: + --full-scan Force a full scan of the chains for clients, connections and channels ``` As described in next sub-sections, the type of relaying can be configured in the `global` section of the configuration file, by specifying different values in `strategy` field. diff --git a/guide/src/commands/upgrade/index.md b/guide/src/commands/upgrade/index.md index 135d9c137e..0d974602c1 100644 --- a/guide/src/commands/upgrade/index.md +++ b/guide/src/commands/upgrade/index.md @@ -6,14 +6,14 @@ Use the `upgrade client` command to upgrade a client after a chain upgrade. ```shell USAGE: - hermes upgrade client + hermes upgrade client --host-chain --client DESCRIPTION: Upgrade an IBC client -POSITIONAL ARGUMENTS: - dst_chain_id identifier of the destination chain - dst_client_id identifier of the client to be upgraded on destination chain +FLAGS: + --host-chain Identifier of the chain that hosts the client + --client Identifier of the client to be upgraded ``` __Example__ diff --git a/guide/src/commands/upgrade/test.md b/guide/src/commands/upgrade/test.md index 56a2f3ccb3..5f38ece8e0 100644 --- a/guide/src/commands/upgrade/test.md +++ b/guide/src/commands/upgrade/test.md @@ -17,17 +17,27 @@ commit: 535be14a8bdbfeb0d950914b5baa2dc72c6b081c ## Testing procedure -1. Start two gaia instances and initialize hermes: +### Setup - ```shell - ./scripts/dev-env ~/.hermes/config.toml ibc-0 ibc-1 - ``` - The `one-chain` script is invoked for each chain and modifies the `genesis.json` file to use a short window for governance proposals (`200s` for `max_deposit_period` and `voting_period`). Therefore, an upgrade proposal can be submitted, voted on and accepted within a short time. +__With dev-env__ + +```shell +./scripts/dev-env ~/.hermes/config.toml ibc-0 ibc-1 +``` +The `one-chain` script is invoked for each chain and modifies the `genesis.json` file to use a short window for governance proposals (`200s` for `max_deposit_period` and `voting_period`). Therefore, an upgrade proposal can be submitted, voted on and accepted within a short time. + + +__With gm__ +* Run the command `gm start` +* Go to the file `$HOME/.gm/ibc-0/config/genesis.json` and change `max_deposit_period` and `voting_period` to a lower value, such as 200s +* Run the commands: `gm reset`, `gm hermes config` and `gm keys` -2. Create one client on `ibc-1` for `ibc-0`: +### Test upgrading chain and client + +1. Create one client on `ibc-1` for `ibc-0`: ```shell - hermes create client ibc-1 ibc-0 + hermes create client --host-chain ibc-1 --reference-chain ibc-0 ``` ```json @@ -45,13 +55,13 @@ commit: 535be14a8bdbfeb0d950914b5baa2dc72c6b081c ) ``` -3. Create and submit an upgrade plan for chain `ibc-0`: +2. Create and submit an upgrade plan for chain `ibc-0`: Use the hermes test command to make an upgrade proposal. In the example below a software upgrade proposal is made for `ibc-0`, for the height `300` blocks from latest height. `10000000stake` is deposited. The proposal includes the upgraded client state constructed from the state of `07-tendermint-0` client on `ibc-1` that was created in the previous step. In addition, the `unbonding_period` of the client is set to some new value (`400h`) ```shell - hermes tx raw upgrade-chain ibc-0 ibc-1 07-tendermint-0 10000000 300 + hermes tx raw upgrade-chain --dst-chain ibc-0 --src-chain ibc-1 --src-client 07-tendermint-0 --amount 10000000 --height-offset 300 ``` ```text @@ -60,14 +70,22 @@ commit: 535be14a8bdbfeb0d950914b5baa2dc72c6b081c Note that the height offset should be picked such that the proposal plan height is reached after the `200s` voting period. - 4. Verify that the proposal was accepted: + 3. Verify that the proposal was accepted: Query the upgrade plan to check that it was submitted correctly. Note the `height` at which the proposal will take effect (chain halts). Also `status: PROPOSAL_STATUS_VOTING_PERIOD`. + Setup done with dev-env: + ```shell gaiad query gov proposal 1 --home data/ibc-0/ ``` + Setup done with gm: + + ```shell + gaiad --node tcp://localhost: query gov proposal 1 --home $HOME/.gm/ibc-0/ + ``` + ```text content: '@type': /cosmos.upgrade.v1beta1.SoftwareUpgradeProposal @@ -149,14 +167,21 @@ commit: 535be14a8bdbfeb0d950914b5baa2dc72c6b081c voting_start_time: "2021-04-12T16:30:17.187389Z" ``` - 5. Vote on the proposal + 4. Vote on the proposal The parameter `1` should match the `proposal_id:` from the upgrade proposal submitted at step 3. This command must be issued while the proposal status is `PROPOSAL_STATUS_VOTING_PERIOD`. Confirm transaction when prompted. + Setup done with dev-env: + ```shell gaiad tx gov vote 1 yes --home data/ibc-0/data/ --keyring-backend test --keyring-dir data/ibc-0/ --chain-id ibc-0 --from validator ``` + Setup done with gm: + + ```shell + gaiad --node tcp://localhost: tx gov vote 1 yes --home $HOME/.gm/ibc-0/data/ --keyring-backend test --keyring-dir $HOME/.gm/ibc-0/ --chain-id ibc-0 --from validator + ``` ```text confirm transaction before signing and broadcasting [y/N]: y @@ -164,12 +189,19 @@ commit: 535be14a8bdbfeb0d950914b5baa2dc72c6b081c {"height":"85","txhash":"AC24D80B1BFE0832769DECFDD3B3DF999A363D5E4390B0B673344FFDED9150B2","codespace":"","code":0,"data":"0A060A04766F7465","raw_log":"[{\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"vote\"},{\"key\":\"module\",\"value\":\"governance\"},{\"key\":\"sender\",\"value\":\"cosmos1srfzw0jkyyn7wf0ps4zy0tuvdaclfj2ufgp6w3\"}]},{\"type\":\"proposal_vote\",\"attributes\":[{\"key\":\"option\",\"value\":\"VOTE_OPTION_YES\"},{\"key\":\"proposal_id\",\"value\":\"1\"}]}]}]","logs":[{"msg_index":0,"log":"","events":[{"type":"message","attributes":[{"key":"action","value":"vote"},{"key":"module","value":"governance"},{"key":"sender","value":"cosmos1srfzw0jkyyn7wf0ps4zy0tuvdaclfj2ufgp6w3"}]},{"type":"proposal_vote","attributes":[{"key":"option","value":"VOTE_OPTION_YES"},{"key":"proposal_id","value":"1"}]}]}],"info":"","gas_wanted":"200000","gas_used":"43716","tx":null,"timestamp":""} ``` - 6. Wait approximately 200 seconds until the proposal changes status to `PROPOSAL_STATUS_PASSED`. + 5. Wait approximately 200 seconds until the proposal changes status to `PROPOSAL_STATUS_PASSED`. Note the `final tally_result` that includes the vote submitted in the previous step. + Setup done with dev-env + ```shell gaiad query gov proposal 1 --home data/ibc-0/ ``` + Setup done with gm: + + ```shell + gaiad --node tcp://localhost: query gov proposal 1 --home $HOME/.gm/ibc-0/ + ``` ```text content: @@ -197,7 +229,7 @@ commit: 535be14a8bdbfeb0d950914b5baa2dc72c6b081c and another for the upgraded state. ```shell - hermes upgrade client ibc-1 07-tendermint-0 + hermes upgrade client --host-chain ibc-1 --client 07-tendermint-0 ``` ```json Success: [ @@ -230,3 +262,17 @@ commit: 535be14a8bdbfeb0d950914b5baa2dc72c6b081c ), ] ``` + +If the command fails with the error: + +```shell +Error: failed while trying to upgrade client id 07-tendermint-0 for chain ibc-0: failed while fetching from chain the upgraded client state: conversion from a protobuf `Any` into a domain type failed: conversion from a protobuf `Any` into a domain type failed: error converting message type into domain type: the client state was not found +``` + +It might be due to the chain not being at the height defined for the upgrade. This can be checked with the INFO output of the command: + +```shell +INFO ThreadId(01) [ibc-0 -> ibc-1:07-tendermint-0] upgrade Height: 0-82 +``` + +Where in this case the chain is at height 82. \ No newline at end of file diff --git a/guide/src/config.md b/guide/src/config.md index cdde0904bd..756e39defb 100644 --- a/guide/src/config.md +++ b/guide/src/config.md @@ -6,14 +6,14 @@ The format supported for the configuration file is [TOML](https://toml.io/en/). By default, Hermes expects the configuration file to be located at `$HOME/.hermes/config.toml`. -This can be overridden by supplying the `-c` flag when invoking `hermes`, before the -name of the command to run, eg. `hermes -c my_config.toml query connection channels ibc-1 connection-1`. +This can be overridden by supplying the `--config` flag when invoking `hermes`, before the +name of the command to run, eg. `hermes --config my_config.toml query connection channels --chain ibc-1 --connection connection-1`. > The current version of Hermes does not support managing the configuration file programmatically. > You will need to use a text editor to create the file and add content to it. ```bash -hermes [-c CONFIG_FILE] COMMAND +hermes [--config CONFIG_FILE] COMMAND ``` ## Table of contents diff --git a/guide/src/help.md b/guide/src/help.md index e2e7bfcf45..a076612b70 100644 --- a/guide/src/help.md +++ b/guide/src/help.md @@ -46,10 +46,12 @@ DESCRIPTION: Create objects (client, connection, or channel) on chains SUBCOMMANDS: - help Get usage information - client Create a new IBC client - connection Create a new connection between two chains - channel Create a new channel between two chains + channel Create a new channel between two chains using a pre-existing connection. + Alternatively, create a new client and a new connection underlying the new + channel if a pre-existing connection is not provided + client Create a new IBC client + connection Create a new connection between two chains + help Print this message or the help of the given subcommand(s) ``` This can provide further specific guidance if we add additional parameters, e.g., @@ -60,21 +62,26 @@ hermes help create channel ``` USAGE: - hermes create channel + hermes create channel [OPTIONS] --a-chain --a-port --b-port DESCRIPTION: - Create a new channel between two chains - -POSITIONAL ARGUMENTS: - chain_a_id identifier of the side `a` chain for the new channel - chain_b_id identifier of the side `b` chain for the new channel (optional) + Create a new channel between two chains using a pre-existing connection. Alternatively, create a new + client and a new connection underlying the new channel if a pre-existing connection is not provided FLAGS: - -c, --connection-a CONNECTION-A - --port-a PORT-A identifier of the side `a` port for the new channel - --port-b PORT-B identifier of the side `b` port for the new channel - -o, --order ORDER the channel ordering, valid options 'unordered' (default) and 'ordered' - -v, --channel-version VERSION the version for the new channel + --a-chain Identifier of the side `a` chain for the new channel + --a-port Identifier of the side `a` port for the new channel + --b-port Identifier of the side `b` port for the new channel + +OPTIONS: + --a-connection Identifier of the connection on chain `a` to use in creating + the new channel. + --b-chain Identifier of the side `b` chain for the new channel + --chan-version The version for the new channel + --new-client-connection Indicates that a new client and connection will be created + underlying the new channel + --order The channel ordering, valid options 'unordered' (default) and + 'ordered' [default: ORDER_UNORDERED] ``` Additionally, the `-h`/`--help` flags typical for CLI applications work on @@ -84,7 +91,7 @@ all commands. The relayer configuration file permits parametrization of output verbosity via the knob called `log_level`. This file is loaded by default from `$HOME/.hermes/config.toml`, but can be overridden in all commands -with the `-c` flag, eg. `hermes -c ./path/to/my/config.toml some command`. +with the `--config` flag, eg. `hermes --config ./path/to/my/config.toml some command`. Relevant snippet: @@ -405,33 +412,33 @@ In order to test the correct operation during the channel close, perform the ste this path). ```shell - hermes tx raw ft-transfer ibc-0 ibc-1 transfer channel-1 5555 -o 1000 -n 1 -d samoleans + hermes tx raw ft-transfer --dst-chain ibc-0 --src-chain ibc-1 --src-port transfer --src-chan channel-1 --amount 5555 --timeout-height-offset 1000 --number-msgs 1 --denom samoleans ``` - now do the first step of channel closing: the channel will transition to close-open: ```shell - hermes -c config.toml tx raw chan-close-init ibc-0 ibc-1 connection-0 transfer transfer channel-0 channel-1 + hermes --config config.toml tx raw chan-close-init --dst-chain ibc-0 --src-chain ibc-1 --dst-conn connection-0 --dst-port transfer --src-port transfer --dst-chan channel-0 --src-chan channel-1 ``` - trigger timeout on close to ibc-1 ```shell - hermes -c config.toml tx raw packet-recv ibc-0 ibc-1 transfer channel-1 + hermes --config config.toml tx raw packet-recv --dst-chain ibc-0 --src-chain ibc-1 --src-port transfer --src-chan channel-1 ``` - close-close ```shell - hermes -c config.toml tx raw chan-close-confirm ibc-1 ibc-0 connection-1 transfer transfer channel-1 channel-0 + hermes --config config.toml tx raw chan-close-confirm --dst-chain ibc-1 --src-chain ibc-0 --dst-conn connection-1 --dst-port transfer --src-port transfer --dst-chan channel-1 --src-chan channel-0 ``` - verify that the two ends are in Close state: ```shell - hermes -c config.toml query channel end ibc-0 transfer channel-0 - hermes -c config.toml query channel end ibc-1 transfer channel-1 + hermes --config config.toml query channel end --chain ibc-0 --port transfer --channel channel-0 + hermes --config config.toml query channel end --chain ibc-1 --port transfer --channel channel-1 ``` @@ -512,7 +519,7 @@ the `profiling` feature and the [log level][log-level] should be `info` level or #### Example output for `tx raw conn-init` command ``` -hermes -c config.toml tx raw conn-init ibc-0 ibc-1 07-tendermint-0 07-tendermint-0 +hermes --config config.toml tx raw conn-init --dst-chain ibc-0 --src-chain ibc-1 --dst-client 07-tendermint-0 --src-client 07-tendermint-0 ``` ``` diff --git a/guide/src/installation.md b/guide/src/installation.md index 5a9bfe166f..75f1fcac24 100644 --- a/guide/src/installation.md +++ b/guide/src/installation.md @@ -155,21 +155,29 @@ hermes 0.15.0 Informal Systems USAGE: - hermes + hermes [OPTIONS] + +OPTIONS: + --config Path to configuration file + -h, --help Print help information + --json Enable JSON output + -V, --version Print version information SUBCOMMANDS: - help Get usage information - config Validate Hermes configuration file - keys Manage keys in the relayer for each chain - create Create objects (client, connection, or channel) on chains - update Update objects (clients) on chains - upgrade Upgrade objects (clients) after chain upgrade - start Start the relayer - query Query objects from the chain - tx Create and send IBC transactions - listen Listen to and display IBC events emitted by a chain - misbehaviour Listen to client update IBC events and handles misbehaviour - version Display version information + clear Clear objects, such as outstanding packets on a channel + config Validate Hermes configuration file + create Create objects (client, connection, or channel) on chains + health-check Performs a health check of all chains in the the config + help Print this message or the help of the given subcommand(s) + keys Manage keys in the relayer for each chain + listen Listen to and display IBC events emitted by a chain + misbehaviour Listen to client update IBC events and handles misbehaviour + query Query objects from the chain + start Start the relayer in multi-chain mode + tx Create and send IBC transactions + update Update objects (clients) on chains + upgrade Upgrade objects (clients) after chain upgrade + completions Generate auto-complete scripts for different shells ``` ### Creating an alias for the executable diff --git a/guide/src/tutorials/local-chains/identifiers.md b/guide/src/tutorials/local-chains/identifiers.md index b72682d7b1..e2dad5873f 100644 --- a/guide/src/tutorials/local-chains/identifiers.md +++ b/guide/src/tutorials/local-chains/identifiers.md @@ -14,7 +14,7 @@ __`07-tendermint-`__ for tendermint clients For example `07-tendermint-0` is assigned to the first client created on `ibc-1`: ```shell -hermes tx raw create-client ibc-1 ibc-0 +hermes tx raw create-client --host-chain ibc-1 --reference-chain ibc-0 ``` ```json @@ -47,7 +47,7 @@ __`connection-`__ for connections For example `connection-0` is assigned to the first connection created on `ibc-1`: ```shell -hermes tx raw conn-init ibc-1 ibc-0 07-tendermint-0 07-tendermint-0 +hermes tx raw conn-init --dst-chain ibc-1 --src-chain ibc-0 --dst-client 07-tendermint-0 --src-client 07-tendermint-0 ``` ```json @@ -83,7 +83,7 @@ We will create a second connection on `ibc-1` with identifier `connection-1` in For example `channel-0` is assigned to the first channel created on `ibc-1`: ```shell -hermes tx raw chan-open-init ibc-1 ibc-0 connection-0 transfer transfer +hermes tx raw chan-open-init --dst-chain ibc-1 --src-chain ibc-0 --dst-conn connection-0 --dst-port transfer --src-port transfer ``` ```json diff --git a/guide/src/tutorials/local-chains/raw/channel.md b/guide/src/tutorials/local-chains/raw/channel.md index 6902d98ae4..38b4c9263d 100644 --- a/guide/src/tutorials/local-chains/raw/channel.md +++ b/guide/src/tutorials/local-chains/raw/channel.md @@ -4,14 +4,14 @@ Initialize a new unordered channel on `ibc-0`: ```shell -hermes tx raw chan-open-init ibc-0 ibc-1 connection-0 transfer transfer -o UNORDERED +hermes tx raw chan-open-init --dst-chain ibc-0 --src-chain ibc-1 --dst-conn connection-0 --dst-port transfer --src-port transfer --order UNORDERED ``` ## 3.2 `chan-open-try` Send a channel open try to `ibc-1`: ```shell -hermes tx raw chan-open-try ibc-1 ibc-0 connection-1 transfer transfer -s channel-0 +hermes tx raw chan-open-try --dst-chain ibc-1 --src-chain ibc-0 --dst-conn connection-1 --dst-port transfer --src-port transfer --src-chan channel-0 ``` Take note of the ID allocated by the chain, e.g. `channel-1` on `ibc-1`. Use in the `chan-open-ack` CLI @@ -20,25 +20,25 @@ Take note of the ID allocated by the chain, e.g. `channel-1` on `ibc-1`. Use in Send a channel open acknowledgment to `ibc-0`: ```shell -hermes tx raw chan-open-ack ibc-0 ibc-1 connection-0 transfer transfer -d channel-0 -s channel-1 +hermes tx raw chan-open-ack --dst-chain ibc-0 --src-chain ibc-1 --dst-conn connection-0 --dst-port transfer --src-port transfer --dst-chan channel-0 --src-chan channel-1 ``` ## 3.4 `chan-open-confirm` Send the open confirmation to `ibc-1`: ```shell -hermes tx raw chan-open-confirm ibc-1 ibc-0 connection-1 transfer transfer -d channel-1 -s channel-0 +hermes tx raw chan-open-confirm --dst-chain ibc-1 --src-chain ibc-0 --dst-conn connection-1 --dst-port transfer --src-port transfer --dst-chan channel-1 --src-chan channel-0 ``` ## 3.5 `query channel` To verify that the two ends are in `Open` state: ```shell -hermes query channel end ibc-0 transfer channel-0 +hermes query channel end --chain ibc-0 --port transfer --channel channel-0 ``` ```shell -hermes query channel end ibc-1 transfer channel-1 +hermes query channel end --chain ibc-1 --port transfer --channel channel-1 ``` ## Next Steps diff --git a/guide/src/tutorials/local-chains/raw/client.md b/guide/src/tutorials/local-chains/raw/client.md index b29ebe1e08..ac8186889d 100644 --- a/guide/src/tutorials/local-chains/raw/client.md +++ b/guide/src/tutorials/local-chains/raw/client.md @@ -7,7 +7,7 @@ First you will need to create a client for each chain: This command submits a transaction to a destination chain (`ibc-0`) with a request to create a client for a source chain (`ibc-1`): ```shell -hermes tx raw create-client ibc-0 ibc-1 +hermes tx raw create-client --host-chain ibc-0 --reference-chain ibc-1 ``` if the command is successful a message similar to the one below will be displayed `status:success`: @@ -34,7 +34,7 @@ if the command is successful a message similar to the one below will be displaye You can also execute a __query__ to view the client state on destination chain `ibc-0` by specifying the `client_id` value `07-tendermint-0`: ```shell -hermes query client state ibc-0 07-tendermint-0 +hermes query client state --chain ibc-0 --client 07-tendermint-0 ``` which show a message similar to the one below: @@ -72,7 +72,7 @@ Success: ClientState { Now let's do the same for `ibc-1` as the destination chain: ```shell -hermes tx raw create-client ibc-1 ibc-0 +hermes tx raw create-client --host-chain ibc-1 --reference-chain ibc-0 ``` Take note of the `client_id` allocated for this client. In the examples we assume is `07-tendermint-1` (this client identity is obtained by creating two clients on ibc-1 for ibc-0). @@ -105,11 +105,11 @@ Success: CreateClient( Client states can be updated by sending an `update-client` transaction: ```shell -hermes tx raw update-client ibc-0 07-tendermint-0 +hermes tx raw update-client --host-chain ibc-0 --client 07-tendermint-0 ``` ```shell -hermes tx raw update-client ibc-1 07-tendermint-1 +hermes tx raw update-client --host-chain ibc-1 --client 07-tendermint-1 ``` ## Next Steps diff --git a/guide/src/tutorials/local-chains/raw/connection.md b/guide/src/tutorials/local-chains/raw/connection.md index f93c35e074..04224b2d6e 100644 --- a/guide/src/tutorials/local-chains/raw/connection.md +++ b/guide/src/tutorials/local-chains/raw/connection.md @@ -4,7 +4,7 @@ Initialize a new connection on `ibc-0`: ```shell -hermes tx raw conn-init ibc-0 ibc-1 07-tendermint-0 07-tendermint-1 +hermes tx raw conn-init --dst-chain ibc-0 --src-chain ibc-1 --dst-client 07-tendermint-0 --src-client 07-tendermint-1 ``` Take note of the ID allocated by the chain, e.g. `connection-0` on `ibc-0` in order to use it in the `conn-try` command below. @@ -13,7 +13,7 @@ Take note of the ID allocated by the chain, e.g. `connection-0` on `ibc-0` in or Send a connection try to `ibc-1`: ```shell -hermes tx raw conn-try ibc-1 ibc-0 07-tendermint-1 07-tendermint-0 -s connection-0 +hermes tx raw conn-try --dst-chain ibc-1 --src-chain ibc-0 --dst-client 07-tendermint-1 --src-client 07-tendermint-0 --src-conn connection-0 ``` Take note of the ID allocated by the chain, e.g. `connection-1` on `ibc-1`. Use in the `conn-ack` CLI @@ -22,14 +22,14 @@ Take note of the ID allocated by the chain, e.g. `connection-1` on `ibc-1`. Use Send a connection open acknowledgment to `ibc-0`: ```shell -hermes tx raw conn-ack ibc-0 ibc-1 07-tendermint-0 07-tendermint-1 -d connection-0 -s connection-1 +hermes tx raw conn-ack --dst-chain ibc-0 --src-chain ibc-1 --dst-client 07-tendermint-0 --src-client 07-tendermint-1 --dst-conn connection-0 --src-conn connection-1 ``` ## 2.4 `conn-confirm` Send the open confirmation to `ibc-1`: ```shell -hermes tx raw conn-confirm ibc-1 ibc-0 07-tendermint-1 07-tendermint-0 -d connection-1 -s connection-0 +hermes tx raw conn-confirm --dst-chain ibc-1 --src-chain ibc-0 --dst-client 07-tendermint-1 --src-client 07-tendermint-0 --dst-conn connection-1 --src-conn connection-0 ``` ## 2.5 `query connection` @@ -37,11 +37,11 @@ hermes tx raw conn-confirm ibc-1 ibc-0 07-tendermint-1 07-tendermint-0 -d connec To verify that the two ends are in `Open` state: ```shell -hermes query connection end ibc-0 connection-0 +hermes query connection end --chain ibc-0 --connection connection-0 ``` ```shell -hermes query connection end ibc-1 connection-1 +hermes query connection end --chain ibc-1 --connection connection-1 ``` diff --git a/guide/src/tutorials/local-chains/raw/packet.md b/guide/src/tutorials/local-chains/raw/packet.md index 426b374d50..d3030ef81b 100644 --- a/guide/src/tutorials/local-chains/raw/packet.md +++ b/guide/src/tutorials/local-chains/raw/packet.md @@ -23,45 +23,45 @@ First, we'll send `9999` `samoleans` from `ibc-0` to `ibc-1`. - start the transfer of 9999 samoleans from `ibc-0` to `ibc-1`. This sends a `MsgTransfer` in a transaction to `ibc-0` ```shell - hermes tx raw ft-transfer ibc-1 ibc-0 transfer channel-0 9999 -o 1000 -n 1 -d samoleans + hermes tx raw ft-transfer --dst-chain ibc-1 --src-chain ibc-0 --src-port transfer --src-chan channel-0 --amout 9999 --timeout-height-offset 1000 --number-msgs 1 --denom samoleans ``` - query packet commitments on `ibc-0` ```shell - hermes query packet commitments ibc-0 transfer channel-0 + hermes query packet commitments --chain ibc-0 --port transfer --channel channel-0 ``` - query unreceived packets on `ibc-1` ```shell - hermes query packet unreceived-packets ibc-1 transfer channel-1 + hermes query packet unreceived-packets --chain ibc-1 --port transfer --channel channel-1 ``` - send `recv_packet` to `ibc-1` ```shell - hermes tx raw packet-recv ibc-1 ibc-0 transfer channel-0 + hermes tx raw packet-recv --dst-chain ibc-1 --src-chain ibc-0 --src-port transfer --src-chan channel-0 ``` - query unreceived acks on `ibc-0` ```shell - hermes query packet unreceived-acks ibc-0 transfer channel-0 + hermes query packet unreceived-acks --chain ibc-0 --port transfer --channel channel-0 ``` - send acknowledgement to `ibc-0` ```shell - hermes tx raw packet-ack ibc-0 ibc-1 transfer channel-1 + hermes tx raw packet-ack --dst-chain ibc-0 --src-chain ibc-1 --src-port transfer --src-chan channel-1 ``` Send those samoleans back, from `ibc-1` to `ibc-0`. ```shell -hermes tx raw ft-transfer ibc-0 ibc-1 transfer channel-1 9999 -o 1000 -n 1 -d ibc/49D321B40FCF56B0370E5673CF090389C8E9CD185209FBE1BEE5D94E58E69BDC -hermes tx raw packet-recv ibc-0 ibc-1 transfer channel-1 -hermes tx raw packet-ack ibc-1 ibc-0 transfer channel-0 +hermes tx raw ft-transfer --dst-chain ibc-0 --src-chain ibc-1 --src-port transfer --src-chan channel-1 --amount 9999 --timeout-height-offset 1000 --number-msgs 1 --denom ibc/49D321B40FCF56B0370E5673CF090389C8E9CD185209FBE1BEE5D94E58E69BDC +hermes tx raw packet-recv --dst-chain ibc-0 --src-chain ibc-1 --src-port transfer --src-chan channel-1 +hermes tx raw packet-ack --dst-chain ibc-1 --src-chain ibc-0 --src-port transfer --src-chan channel-0 ``` The `ibc/49D321B40FCF56B0370E5673CF090389C8E9CD185209FBE1BEE5D94E58E69BDC` denominator above can be obtained by querying the balance at `ibc-1` after the transfer from `ibc-0` to `ibc-1` is concluded. @@ -70,23 +70,23 @@ Next we will test the packet timeouts. - send 1 packet with low timeout height offset to ibc-0 ```shell - hermes tx raw ft-transfer ibc-1 ibc-0 transfer channel-0 9999 -o 2 -n 1 + hermes tx raw ft-transfer --dst-chain ibc-1 --src-chain ibc-0 --src-port transfer --src-chan channel-0 --amount 9999 --timeout-height-offset 2 --number-msgs 1 ``` - send timeout to `ibc-0` ```shell - hermes tx raw packet-recv ibc-1 ibc-0 transfer channel-0 + hermes tx raw packet-recv --dst-chain ibc-1 --src-chain ibc-0 --src-port transfer --src-chan channel-0 ``` - send 1 packet with 2 second timeout to ibc-0 ```shell - hermes tx raw ft-transfer ibc-1 ibc-0 transfer channel-0 9999 -t 2 -n 1 + hermes tx raw ft-transfer --dst-chain ibc-1 --src-chain ibc-0 --src-port transfer --src-chan channel-0 --amount 9999 --timeout-seconds 2 --number-msgs 1 ``` - send timeout to `ibc-0` ```shell - hermes tx raw packet-recv ibc-1 ibc-0 transfer channel-0 + hermes tx raw packet-recv --dst-chain ibc-1 --src-chain ibc-0 --src-port transfer --src-chan channel-0 ``` \ No newline at end of file diff --git a/guide/src/tutorials/local-chains/relay-paths/create-new-path.md b/guide/src/tutorials/local-chains/relay-paths/create-new-path.md index 1ddc70699e..b6c2d3b456 100644 --- a/guide/src/tutorials/local-chains/relay-paths/create-new-path.md +++ b/guide/src/tutorials/local-chains/relay-paths/create-new-path.md @@ -3,7 +3,7 @@ Perform client creation, connection and channel handshake to establish a new path between the `transfer` ports on `ibc-0` and `ibc-1` chains. ```shell -hermes create channel ibc-0 -c ibc-1 --port-a transfer --port-b transfer --new-client-connection +hermes create channel --a-chain ibc-0 --b-chain ibc-1 --a-port transfer --b-port transfer --new-client-conn ``` If all the handshakes are performed successfully you should see a message similar to the one below: diff --git a/guide/src/tutorials/local-chains/relay-paths/multiple-paths.md b/guide/src/tutorials/local-chains/relay-paths/multiple-paths.md index e314197603..69d8aa2c9b 100644 --- a/guide/src/tutorials/local-chains/relay-paths/multiple-paths.md +++ b/guide/src/tutorials/local-chains/relay-paths/multiple-paths.md @@ -100,7 +100,7 @@ Follow the steps below to connect three chains together and relay packets betwee making an exception. Execute the following command: ```shell - hermes create channel ibc-0 --chain-b ibc-1 --port-a transfer --port-b transfer --new-client-connection + hermes create channel --a-chain ibc-0 --b-chain ibc-1 --a-port transfer --b-port transfer --new-client-conn ``` Then respond 'yes' to the prompt that pops up. Once the command has run to @@ -166,7 +166,7 @@ Follow the steps below to connect three chains together and relay packets betwee previous invocation we used to create a channel between `ibc-0` and `ibc-1`: ```shell - hermes create channel ibc-1 --chain-b ibc-2 --port-a transfer --port-b transfer --new-client-connection + hermes create channel --a-chain ibc-1 --b-chain ibc-2 --a-port transfer --b-port transfer --new-client-conn ``` ```json @@ -239,7 +239,7 @@ Follow the steps below to connect three chains together and relay packets betwee - Two packets from `ibc-0` to `ibc-1` from source channel `channel-0` ```shell - hermes tx raw ft-transfer ibc-1 ibc-0 transfer channel-0 9999 -o 1000 -n 2 + hermes tx raw ft-transfer --dst-chain ibc-1 --src-chain ibc-0 --src-port transfer --src-chan channel-0 --amount 9999 --timeout-height-offset 1000 --number-msgs 2 ``` ```json @@ -262,7 +262,7 @@ Follow the steps below to connect three chains together and relay packets betwee - Two packets from `ibc-1` to `ibc-2` from source channel `channel-1` ```shell - hermes tx raw ft-transfer ibc-2 ibc-1 transfer channel-1 9999 -o 1000 -n 2 + hermes tx raw ft-transfer --dst-chain ibc-2 --src-chain ibc-1 --src-port transfer --src-chan channel-1 --amount 9999 --timeout-height-offset 1000 --number-msgs 2 ``` ```json @@ -315,10 +315,10 @@ Follow the steps below to connect three chains together and relay packets betwee 8. Query the unreceived packets and acknowledgments on `ibc-1` and `ibc-2` from a different terminal: ```shell - hermes query packet unreceived-packets ibc-1 transfer channel-0 - hermes query packet unreceived-acks ibc-0 transfer channel-0 - hermes query packet unreceived-packets ibc-2 transfer channel-0 - hermes query packet unreceived-acks ibc-1 transfer channel-1 + hermes query packet unreceived-packets --chain ibc-1 --port transfer --channel channel-0 + hermes query packet unreceived-acks --chain ibc-0 --port transfer --channel channel-0 + hermes query packet unreceived-packets --chain ibc-2 --port transfer --channel channel-0 + hermes query packet unreceived-acks --chain ibc-1 --port transfer --channel channel-1 ``` If everything went well, each of these commands should result in: diff --git a/guide/src/tutorials/local-chains/start.md b/guide/src/tutorials/local-chains/start.md index 791d977fb3..d45c151e69 100644 --- a/guide/src/tutorials/local-chains/start.md +++ b/guide/src/tutorials/local-chains/start.md @@ -84,8 +84,8 @@ Our config file specifies two chains: `ibc-0` and `ibc-1`. We will need to speci previously mentioned, in this tutorial we will use the same private key for both chains. ```shell -hermes keys add ibc-0 -f key_seed.json -hermes keys add ibc-1 -f key_seed.json +hermes keys add --chain ibc-0 --key-file key_seed.json +hermes keys add --chain ibc-1 --key-file key_seed.json ``` If successful, both commands should show an output similar to: diff --git a/relayer-cli/src/commands/clear.rs b/relayer-cli/src/commands/clear.rs index eff01641da..df7d009b41 100644 --- a/relayer-cli/src/commands/clear.rs +++ b/relayer-cli/src/commands/clear.rs @@ -23,13 +23,29 @@ pub enum ClearCmds { #[derive(Debug, Parser)] pub struct ClearPacketsCmd { - #[clap(required = true, help = "identifier of the chain")] + #[clap( + long = "chain", + required = true, + value_name = "CHAIN_ID", + help = "Identifier of the chain" + )] chain_id: ChainId, - #[clap(required = true, help = "identifier of the port")] + #[clap( + long = "port", + required = true, + value_name = "PORT_ID", + help = "Identifier of the port" + )] port_id: PortId, - #[clap(required = true, help = "identifier of the channel")] + #[clap( + long = "channel", + alias = "chan", + required = true, + value_name = "CHANNEL_ID", + help = "Identifier of the channel" + )] channel_id: ChannelId, } diff --git a/relayer-cli/src/commands/completions.rs b/relayer-cli/src/commands/completions.rs index 392cd9bb13..bc7ca6c235 100644 --- a/relayer-cli/src/commands/completions.rs +++ b/relayer-cli/src/commands/completions.rs @@ -7,7 +7,7 @@ use std::io; #[derive(Debug, Parser)] pub struct CompletionsCmd { - #[clap(arg_enum)] + #[clap(long = "shell", value_name = "SHELL", arg_enum)] shell: Shell, } diff --git a/relayer-cli/src/commands/create.rs b/relayer-cli/src/commands/create.rs index f2e9ea3a95..d736d877ae 100644 --- a/relayer-cli/src/commands/create.rs +++ b/relayer-cli/src/commands/create.rs @@ -19,6 +19,7 @@ pub enum CreateCmds { Connection(CreateConnectionCommand), /// Create a new channel between two chains using a pre-existing connection. + /// /// Alternatively, create a new client and a new connection underlying /// the new channel if a pre-existing connection is not provided. Channel(CreateChannelCommand), diff --git a/relayer-cli/src/commands/create/channel.rs b/relayer-cli/src/commands/create/channel.rs index d4c6781795..0181586d9f 100644 --- a/relayer-cli/src/commands/create/channel.rs +++ b/relayer-cli/src/commands/create/channel.rs @@ -23,7 +23,7 @@ use crate::prelude::*; use ibc_relayer::config::default::connection_delay; static PROMPT: &str = "Are you sure you want a new connection & clients to be created? Hermes will use default security parameters."; -static HINT: &str = "Consider using the default invocation\n\nhermes create channel --port-a --port-b \n\nto re-use a pre-existing connection."; +static HINT: &str = "Consider using the default invocation\n\nhermes create channel --a-port --b-port --a-chain --a-connection \n\nto re-use a pre-existing connection."; /// The data structure that represents all the possible options when invoking /// the `create channel` CLI command. @@ -45,56 +45,65 @@ static HINT: &str = "Consider using the default invocation\n\nhermes create chan /// chain A and chain B might refer to the connection with different names, they are actually referring /// to the same connection. #[derive(Clone, Command, Debug, Parser)] -#[clap(disable_version_flag = true)] pub struct CreateChannelCommand { #[clap( + long = "a-chain", required = true, + value_name = "A_CHAIN_ID", help = "Identifier of the side `a` chain for the new channel" )] chain_a: ChainId, #[clap( - short, - long, + long = "b-chain", + value_name = "B_CHAIN_ID", help = "Identifier of the side `b` chain for the new channel" )] chain_b: Option, - /// Identifier of the connection on chain `a` to use in creating the new channel. + #[clap( + long = "a-connection", + alias = "a-conn", + value_name = "A_CONNECTION_ID", + help = "Identifier of the connection on chain `a` to use in creating the new channel." + )] connection_a: Option, #[clap( - long, + long = "a-port", required = true, + value_name = "A_PORT_ID", help = "Identifier of the side `a` port for the new channel" )] port_a: PortId, #[clap( - long, + long = "b-port", required = true, + value_name = "B_PORT_ID", help = "Identifier of the side `b` port for the new channel" )] port_b: PortId, #[clap( - short, - long, + long = "order", + value_name = "ORDER", help = "The channel ordering, valid options 'unordered' (default) and 'ordered'", default_value_t )] order: Order, #[clap( - short, long = "channel-version", - alias = "version", + alias = "chan-version", + value_name = "VERSION", help = "The version for the new channel" )] version: Option, #[clap( - long, + long = "new-client-connection", + alias = "new-client-conn", help = "Indicates that a new client and connection will be created underlying the new channel" )] new_client_conn: bool, diff --git a/relayer-cli/src/commands/create/connection.rs b/relayer-cli/src/commands/create/connection.rs index 86235840c9..83f48bc8a1 100644 --- a/relayer-cli/src/commands/create/connection.rs +++ b/relayer-cli/src/commands/create/connection.rs @@ -17,37 +17,46 @@ use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct CreateConnectionCommand { #[clap( + long = "a-chain", required = true, - help = "identifier of the side `a` chain for the new connection" + value_name = "A_CHAIN_ID", + help = "Identifier of the side `a` chain for the new connection" )] chain_a_id: ChainId, - #[clap(help = "identifier of the side `b` chain for the new connection")] + #[clap( + long = "b-chain", + value_name = "B_CHAIN_ID", + help = "Identifier of the side `b` chain for the new connection" + )] chain_b_id: Option, #[clap( - long, - help = "identifier of client hosted on chain `a`; default: None (creates a new client)" + long = "a-client", + value_name = "A_CLIENT_ID", + help = "Identifier of client hosted on chain `a`; default: None (creates a new client)" )] client_a: Option, #[clap( - long, - help = "identifier of client hosted on chain `b`; default: None (creates a new client)" + long = "b-client", + value_name = "B_CLIENT_ID", + help = "Identifier of client hosted on chain `b`; default: None (creates a new client)" )] client_b: Option, #[clap( - long, - help = "delay period parameter for the new connection (seconds)", + long = "delay", + value_name = "DELAY", + help = "Delay period parameter for the new connection (seconds)", default_value = "0" )] delay: u64, } -// cargo run --bin hermes -- create connection ibc-0 ibc-1 -// cargo run --bin hermes -- create connection ibc-0 ibc-1 --delay 100 -// cargo run --bin hermes -- create connection ibc-0 --client-a-id 07-tendermint-0 --client-b-id 07-tendermint-0 +// cargo run --bin hermes -- create connection --a-chain ibc-0 --b-chain ibc-1 +// cargo run --bin hermes -- create connection --a-chain ibc-0 --b-chain ibc-1 --delay 100 +// cargo run --bin hermes -- create connection --a-chain ibc-0 --a-client 07-tendermint-0 --b-client 07-tendermint-0 impl Runnable for CreateConnectionCommand { fn run(&self) { match &self.chain_b_id { @@ -67,11 +76,11 @@ impl CreateConnectionCommand { // Validate the other options. Bail if the CLI was invoked with incompatible options. if self.client_a.is_some() { - Output::error("Option `` is incompatible with `--client-a`".to_string()) + Output::error("Option `` is incompatible with `--a-client`".to_string()) .exit(); } if self.client_b.is_some() { - Output::error("Option `` is incompatible with `--client-b`".to_string()) + Output::error("Option `` is incompatible with `--b-client`".to_string()) .exit(); } @@ -107,7 +116,7 @@ impl CreateConnectionCommand { let client_a_id = match &self.client_a { Some(c) => c, None => Output::error( - "Option `--client-a` is necessary when is missing".to_string(), + "Option `--a-client` is necessary when is missing".to_string(), ) .exit(), }; @@ -138,7 +147,7 @@ impl CreateConnectionCommand { let client_b_id = match &self.client_b { Some(c) => c, None => Output::error( - "Option `--client-b` is necessary when is missing".to_string(), + "Option `--b-client` is necessary when is missing".to_string(), ) .exit(), }; diff --git a/relayer-cli/src/commands/keys/add.rs b/relayer-cli/src/commands/keys/add.rs index 1e85269899..d49a2b9d67 100644 --- a/relayer-cli/src/commands/keys/add.rs +++ b/relayer-cli/src/commands/keys/add.rs @@ -22,48 +22,48 @@ use crate::conclude::Output; /// /// The command to add a key from a file: /// -/// `keys add [OPTIONS] --key-file ` +/// `keys add [OPTIONS] --chain --key-file ` /// /// The command to restore a key from a file containing mnemonic: /// -/// `keys add [OPTIONS] --mnemonic-file ` +/// `keys add [OPTIONS] --chain --mnemonic-file ` /// /// The key-file and mnemonic-file flags can't be given at the same time, this will cause a terminating error. /// If successful the key will be created or restored, depending on which flag was given. -#[derive(Clone, Command, Debug, Parser)] +#[derive(Clone, Command, Debug, Parser, PartialEq)] pub struct KeysAddCmd { - #[clap(required = true, help = "identifier of the chain")] + #[clap(long = "chain", required = true, help = "Identifier of the chain")] chain_id: ChainId, #[clap( - short = 'f', - long, + long = "key-file", required = true, - help = "path to the key file", + value_name = "KEY_FILE", + help = "Path to the key file", group = "add-restore" )] key_file: Option, #[clap( - short, - long, + long = "mnemonic-file", required = true, - help = "path to file containing mnemonic to restore the key from", + value_name = "MNEMONIC_FILE", + help = "Path to file containing mnemonic to restore the key from", group = "add-restore" )] mnemonic_file: Option, #[clap( - short, - long, - help = "name of the key (defaults to the `key_name` defined in the config)" + long = "key-name", + value_name = "KEY_NAME", + help = "Name of the key (defaults to the `key_name` defined in the config)" )] key_name: Option, #[clap( - short = 'p', - long, - help = "derivation path for this key", + long = "hd-path", + value_name = "HD_PATH", + help = "Derivation path for this key", default_value = "m/44'/118'/0'/0/0" )] hd_path: String, @@ -107,7 +107,7 @@ impl Runnable for KeysAddCmd { Ok(result) => result, }; - // Check if --file or --mnemonic was given as input. + // Check if --key-file or --mnemonic-file was given as input. match (self.key_file.clone(), self.mnemonic_file.clone()) { (Some(key_file), _) => { let key = add_key(&opts.config, &opts.name, &key_file, &opts.hd_path); diff --git a/relayer-cli/src/commands/keys/balance.rs b/relayer-cli/src/commands/keys/balance.rs index 2b0558f27e..7473e22ea0 100644 --- a/relayer-cli/src/commands/keys/balance.rs +++ b/relayer-cli/src/commands/keys/balance.rs @@ -12,19 +12,24 @@ use crate::conclude::{exit_with_unrecoverable_error, json, Output}; /// /// The command has one argument and one optional flag: /// -/// `keys balance --key-name ` +/// `keys balance --chain --key-name ` /// /// If no key name is given, it will be taken from the configuration file. /// If successful the balance and denominator of the account, associated with the key name /// on the given chain, will be displayed. #[derive(Clone, Command, Debug, Parser)] pub struct KeyBalanceCmd { - #[clap(required = true, help = "identifier of the chain")] + #[clap( + long = "chain", + required = true, + value_name = "CHAIN_ID", + help = "Identifier of the chain" + )] chain_id: ChainId, #[clap( - long, - short, + long = "key-name", + value_name = "KEY_NAME", help = "(optional) name of the key (defaults to the `key_name` defined in the config)" )] key_name: Option, diff --git a/relayer-cli/src/commands/keys/delete.rs b/relayer-cli/src/commands/keys/delete.rs index 717f620b53..9d6430bbc8 100644 --- a/relayer-cli/src/commands/keys/delete.rs +++ b/relayer-cli/src/commands/keys/delete.rs @@ -12,13 +12,18 @@ use crate::conclude::Output; #[derive(Clone, Command, Debug, Parser)] pub struct KeysDeleteCmd { - #[clap(required = true, help = "identifier of the chain")] + #[clap( + long = "chain", + required = true, + value_name = "CHAIN_ID", + help = "Identifier of the chain" + )] chain_id: ChainId, - #[clap(short = 'n', long, help = "name of the key")] - name: Option, + #[clap(long = "key-name", value_name = "KEY_NAME", help = "Name of the key")] + key_name: Option, - #[clap(short = 'a', long, help = "delete all keys")] + #[clap(long = "all", help = "Delete all keys")] all: bool, } @@ -31,17 +36,15 @@ impl KeysDeleteCmd { .find_chain(&self.chain_id) .ok_or_else(|| format!("chain '{}' not found in configuration file", self.chain_id))?; - let id = match (self.all, &self.name) { + let id = match (self.all, &self.key_name) { (true, Some(_)) => { - return Err("cannot set both -n/--name and -a/--all".to_owned().into()); + return Err("cannot set both --key-name and --all".to_owned().into()); } (false, None) => { - return Err("must provide either -n/--name or -a/--all" - .to_owned() - .into()); + return Err("must provide either --key-name or --all".to_owned().into()); } (true, None) => KeysDeleteId::All, - (false, Some(ref name)) => KeysDeleteId::Named(name), + (false, Some(ref key_name)) => KeysDeleteId::Named(key_name), }; Ok(KeysDeleteOptions { @@ -80,10 +83,10 @@ impl Runnable for KeysDeleteCmd { } Err(e) => Output::error(format!("{}", e)).exit(), }, - KeysDeleteId::Named(name) => match delete_key(&opts.config, name) { + KeysDeleteId::Named(key_name) => match delete_key(&opts.config, key_name) { Ok(_) => Output::success_msg(format!( "Removed key ({}) on chain {}", - name, opts.config.id + key_name, opts.config.id )) .exit(), Err(e) => Output::error(format!("{}", e)).exit(), diff --git a/relayer-cli/src/commands/keys/list.rs b/relayer-cli/src/commands/keys/list.rs index b627fd77cb..7bd09db4eb 100644 --- a/relayer-cli/src/commands/keys/list.rs +++ b/relayer-cli/src/commands/keys/list.rs @@ -14,7 +14,12 @@ use crate::{application::app_config, conclude::json}; #[derive(Clone, Command, Debug, Parser)] pub struct KeysListCmd { - #[clap(required = true, help = "identifier of the chain")] + #[clap( + long = "chain", + required = true, + value_name = "CHAIN_ID", + help = "Identifier of the chain" + )] chain_id: ChainId, } diff --git a/relayer-cli/src/commands/listen.rs b/relayer-cli/src/commands/listen.rs index 9a5c448116..b183ca53c8 100644 --- a/relayer-cli/src/commands/listen.rs +++ b/relayer-cli/src/commands/listen.rs @@ -61,11 +61,12 @@ impl FromStr for EventFilter { #[derive(Debug, Parser)] pub struct ListenCmd { /// Identifier of the chain to listen for events from + #[clap(long = "chain", required = true, value_name = "CHAIN_ID")] chain_id: ChainId, /// Add an event type to listen for, can be repeated. /// Listen for all events by default (available: Tx, NewBlock). - #[clap(short = 'e', long = "event", value_name = "EVENT")] + #[clap(long = "events", value_name = "EVENT", multiple_values = true)] events: Vec, } diff --git a/relayer-cli/src/commands/misbehaviour.rs b/relayer-cli/src/commands/misbehaviour.rs index c5514f4155..d93f305789 100644 --- a/relayer-cli/src/commands/misbehaviour.rs +++ b/relayer-cli/src/commands/misbehaviour.rs @@ -17,14 +17,18 @@ use ibc::core::ics02_client::client_state::ClientState; #[derive(Clone, Command, Debug, Parser)] pub struct MisbehaviourCmd { #[clap( + long = "chain", required = true, - help = "identifier of the chain where client updates are monitored for misbehaviour" + value_name = "CHAIN_ID", + help = "Identifier of the chain where client updates are monitored for misbehaviour" )] chain_id: ChainId, #[clap( + long = "client", required = true, - help = "identifier of the client to be monitored for misbehaviour" + value_name = "CLIENT_ID", + help = "Identifier of the client to be monitored for misbehaviour" )] client_id: ClientId, } diff --git a/relayer-cli/src/commands/query.rs b/relayer-cli/src/commands/query.rs index c4486514ca..46baa272e1 100644 --- a/relayer-cli/src/commands/query.rs +++ b/relayer-cli/src/commands/query.rs @@ -59,7 +59,7 @@ pub enum QueryCmd { #[derive(Command, Debug, Parser, Runnable)] pub enum QueryClientCmds { - /// Query the client full state + /// Query the client state State(client::QueryClientStateCmd), /// Query the client consensus state diff --git a/relayer-cli/src/commands/query/channel.rs b/relayer-cli/src/commands/query/channel.rs index 44e748d0f9..a30c29ef69 100644 --- a/relayer-cli/src/commands/query/channel.rs +++ b/relayer-cli/src/commands/query/channel.rs @@ -13,16 +13,36 @@ use ibc::core::ics04_channel::channel::State; #[derive(Clone, Command, Debug, Parser)] pub struct QueryChannelEndCmd { - #[clap(required = true, help = "identifier of the chain to query")] + #[clap( + long = "chain", + required = true, + value_name = "CHAIN_ID", + help = "Identifier of the chain to query" + )] chain_id: ChainId, - #[clap(required = true, help = "identifier of the port to query")] + #[clap( + long = "port", + required = true, + value_name = "PORT_ID", + help = "Identifier of the port to query" + )] port_id: PortId, - #[clap(required = true, help = "identifier of the channel to query")] + #[clap( + long = "channel", + alias = "chan", + required = true, + value_name = "CHANNEL_ID", + help = "Identifier of the channel to query" + )] channel_id: ChannelId, - #[clap(short = 'H', long, help = "height of the state to query")] + #[clap( + long = "height", + value_name = "HEIGHT", + help = "Height of the state to query" + )] height: Option, } diff --git a/relayer-cli/src/commands/query/channel_client.rs b/relayer-cli/src/commands/query/channel_client.rs index fef376e3a7..9df2ff2c3a 100644 --- a/relayer-cli/src/commands/query/channel_client.rs +++ b/relayer-cli/src/commands/query/channel_client.rs @@ -11,18 +11,34 @@ use crate::conclude::{exit_with_unrecoverable_error, Output}; /// The data structure that represents the arguments when invoking the `query channel client` CLI command. /// -/// `query channel client --port-id --channel-id ` +/// `query channel client --chain --port --channel ` /// /// If successful the channel's client state is displayed. #[derive(Clone, Command, Debug, Parser)] pub struct QueryChannelClientCmd { - #[clap(required = true, help = "identifier of the chain to query")] + #[clap( + long = "chain", + required = true, + value_name = "CHAIN_ID", + help = "Identifier of the chain to query" + )] chain_id: ChainId, - #[clap(required = true, long, help = "identifier of the port to query")] + #[clap( + long = "port", + required = true, + value_name = "PORT_ID", + help = "Identifier of the port to query" + )] port_id: PortId, - #[clap(required = true, long, help = "identifier of the channel to query")] + #[clap( + long = "channel", + alias = "chan", + required = true, + value_name = "CHANNEL_ID", + help = "Identifier of the channel to query" + )] channel_id: ChannelId, } diff --git a/relayer-cli/src/commands/query/channel_ends.rs b/relayer-cli/src/commands/query/channel_ends.rs index ecde0dc54c..c667dcf6c4 100644 --- a/relayer-cli/src/commands/query/channel_ends.rs +++ b/relayer-cli/src/commands/query/channel_ends.rs @@ -19,22 +19,41 @@ use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct QueryChannelEndsCmd { - #[clap(required = true, help = "identifier of the chain to query")] + #[clap( + long = "chain", + required = true, + value_name = "CHAIN_ID", + help = "Identifier of the chain to query" + )] chain_id: ChainId, - #[clap(required = true, help = "identifier of the port to query")] + #[clap( + long = "port", + required = true, + value_name = "PORT_ID", + help = "Identifier of the port to query" + )] port_id: PortId, - #[clap(required = true, help = "identifier of the channel to query")] + #[clap( + long = "channel", + alias = "chan", + required = true, + value_name = "CHANNEL_ID", + help = "Identifier of the channel to query" + )] channel_id: ChannelId, - #[clap(short = 'H', long, help = "height of the state to query")] + #[clap( + long = "height", + value_name = "HEIGHT", + help = "Height of the state to query" + )] height: Option, #[clap( - short = 'v', - long, - help = "enable verbose output, displaying all details of channels, connections & clients" + long = "verbose", + help = "Enable verbose output, displaying all details of channels, connections & clients" )] verbose: bool, } diff --git a/relayer-cli/src/commands/query/channels.rs b/relayer-cli/src/commands/query/channels.rs index 2630c338b8..d68d0ff940 100644 --- a/relayer-cli/src/commands/query/channels.rs +++ b/relayer-cli/src/commands/query/channels.rs @@ -20,20 +20,25 @@ use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct QueryChannelsCmd { - #[clap(required = true, help = "identifier of the chain to query")] - chain_id: ChainId, - #[clap( - short = 'd', - long, - help = "identifier of the channel's destination chain" + long = "chain", + required = true, + value_name = "CHAIN_ID", + help = "Identifier of the chain to query" )] - destination_chain: Option, + chain_id: ChainId, + // TODO: Filtering by counterparty chain does not work currently. + // https://github.com/informalsystems/ibc-rs/issues/1132#issuecomment-1165324496 + // #[clap( + // long = "counterparty-chain", + // value_name = "COUNTERPARTY_CHAIN_ID", + // help = "Filter the query response by the this counterparty chain" + // )] + // dst_chain_id: Option, #[clap( - short = 'v', - long, - help = "enable verbose output, displaying all client and connection ids" + long = "verbose", + help = "Enable verbose output, displaying the client and connection ids for each channel in the response" )] verbose: bool, } @@ -89,7 +94,7 @@ fn run_query_channels( let channel_ends = query_channel_ends( &mut registry, &chain, - cmd.destination_chain.as_ref(), + None, channel_end, connection_id, chain_id, @@ -117,7 +122,7 @@ fn run_query_channels( fn query_channel_ends( registry: &mut Registry, chain: &Chain, - destination_chain: Option<&ChainId>, + dst_chain_id: Option<&ChainId>, channel_end: ChannelEnd, connection_id: ConnectionId, chain_id: ChainId, @@ -142,7 +147,7 @@ fn query_channel_ends( )?; let counterparty_chain_id = client_state.chain_id(); - if let Some(dst_chain_id) = destination_chain { + if let Some(dst_chain_id) = dst_chain_id { if dst_chain_id != &counterparty_chain_id { return Err(format!( "mismatch between supplied destination chain ({}) and counterparty chain ({})", diff --git a/relayer-cli/src/commands/query/client.rs b/relayer-cli/src/commands/query/client.rs index 06628c0dc7..9614085ea8 100644 --- a/relayer-cli/src/commands/query/client.rs +++ b/relayer-cli/src/commands/query/client.rs @@ -22,18 +22,32 @@ use crate::conclude::{exit_with_unrecoverable_error, Output}; /// Query client state command #[derive(Clone, Command, Debug, Parser)] pub struct QueryClientStateCmd { - #[clap(required = true, help = "identifier of the chain to query")] + #[clap( + long = "chain", + required = true, + value_name = "CHAIN_ID", + help = "Identifier of the chain to query" + )] chain_id: ChainId, - #[clap(required = true, help = "identifier of the client to query")] + #[clap( + long = "client", + required = true, + value_name = "CLIENT_ID", + help = "Identifier of the client to query" + )] client_id: ClientId, - #[clap(short = 'H', long, help = "the chain height context for the query")] + #[clap( + long = "height", + value_name = "HEIGHT", + help = "The chain height context for the query" + )] height: Option, } /// Command for querying a client's state. -/// hermes query client state ibc-1 07-tendermint-0 --height 3 +/// hermes query client state --chain ibc-1 --client 07-tendermint-0 --height 3 impl Runnable for QueryClientStateCmd { fn run(&self) { let config = app_config(); @@ -59,32 +73,42 @@ impl Runnable for QueryClientStateCmd { /// Query client consensus command #[derive(Clone, Command, Debug, Parser)] pub struct QueryClientConsensusCmd { - #[clap(required = true, help = "identifier of the chain to query")] + #[clap( + long = "chain", + required = true, + value_name = "CHAIN_ID", + help = "Identifier of the chain to query" + )] chain_id: ChainId, - #[clap(required = true, help = "identifier of the client to query")] + #[clap( + long = "client", + required = true, + value_name = "CLIENT_ID", + help = "Identifier of the client to query" + )] client_id: ClientId, #[clap( - short = 'c', - long, - help = "height of the client's consensus state to query" + long = "consensus-height", + value_name = "CONSENSUS_HEIGHT", + help = "Height of the client's consensus state to query" )] consensus_height: Option, - #[clap(short = 's', long, help = "show only consensus heights")] + #[clap(long = "heights-only", help = "Show only consensus heights")] heights_only: bool, #[clap( - short = 'H', - long, - help = "the chain height context to be used, applicable only to a specific height" + long = "height", + value_name = "HEIGHT", + help = "The chain height context to be used, applicable only to a specific height" )] height: Option, } /// Implementation of the query for a client's consensus state at a certain height. -/// hermes query client consensus ibc-0 07-tendermint-0 -c 22 +/// hermes query client consensus --chain ibc-0 --client 07-tendermint-0 --consensus-height 22 impl Runnable for QueryClientConsensusCmd { fn run(&self) { let config = app_config(); @@ -161,21 +185,40 @@ impl Runnable for QueryClientConsensusCmd { #[derive(Clone, Command, Debug, Parser)] pub struct QueryClientHeaderCmd { - #[clap(required = true, help = "identifier of the chain to query")] + #[clap( + long = "chain", + required = true, + value_name = "CHAIN_ID", + help = "Identifier of the chain to query" + )] chain_id: ChainId, - #[clap(required = true, help = "identifier of the client to query")] + #[clap( + long = "client", + required = true, + value_name = "CLIENT_ID", + help = "Identifier of the client to query" + )] client_id: ClientId, - #[clap(required = true, help = "height of header to query")] + #[clap( + long = "consensus-height", + required = true, + value_name = "CONSENSUS_HEIGHT", + help = "Height of header to query" + )] consensus_height: u64, - #[clap(short = 'H', long, help = "the chain height context for the query")] + #[clap( + long = "height", + value_name = "HEIGHT", + help = "The chain height context for the query" + )] height: Option, } /// Implementation of the query for the header used in a client update at a certain height. -/// hermes query client header ibc-0 07-tendermint-0 22 +/// hermes query client header --chain ibc-0 --client 07-tendermint-0 --consensus-height 22 impl Runnable for QueryClientHeaderCmd { fn run(&self) { let config = app_config(); @@ -227,21 +270,31 @@ impl Runnable for QueryClientHeaderCmd { /// Query client connections command #[derive(Clone, Command, Debug, Parser)] pub struct QueryClientConnectionsCmd { - #[clap(required = true, help = "identifier of the chain to query")] + #[clap( + long = "chain", + required = true, + value_name = "CHAIN_ID", + help = "Identifier of the chain to query" + )] chain_id: ChainId, - #[clap(required = true, help = "identifier of the client to query")] + #[clap( + long = "client", + required = true, + value_name = "CLIENT_ID", + help = "Identifier of the client to query" + )] client_id: ClientId, #[clap( - short = 'H', - long, - help = "the chain height which this query should reflect" + long = "height", + value_name = "HEIGHT", + help = "The chain height which this query should reflect" )] height: Option, } -// hermes query connections ibc-0 +// hermes query connections --chain ibc-0 impl Runnable for QueryClientConnectionsCmd { fn run(&self) { let config = app_config(); diff --git a/relayer-cli/src/commands/query/clients.rs b/relayer-cli/src/commands/query/clients.rs index bee5f9263c..5e5d310d67 100644 --- a/relayer-cli/src/commands/query/clients.rs +++ b/relayer-cli/src/commands/query/clients.rs @@ -15,18 +15,25 @@ use crate::prelude::*; /// Query clients command #[derive(Clone, Command, Debug, Parser)] pub struct QueryAllClientsCmd { - #[clap(required = true, help = "identifier of the chain to query")] + #[clap( + long = "host-chain", + required = true, + value_name = "HOST_CHAIN_ID", + help = "Identifier of the chain to query" + )] chain_id: ChainId, #[clap( - short, - long, - help = "filter for clients which target a specific chain id (implies '-o')", - value_name = "ID" + long = "reference-chain", + help = "Filter for clients which target a specific chain id (implies '--omit-chain-ids')", + value_name = "REFERENCE_CHAIN_ID" )] src_chain_id: Option, - #[clap(short, long, help = "omit printing the source chain for each client")] + #[clap( + long = "omit-chain-ids", + help = "Omit printing the reference (or target) chain for each client" + )] omit_chain_ids: bool, } @@ -37,7 +44,7 @@ struct ClientChain { } /// Command for querying all clients. -/// hermes -c cfg.toml query clients ibc-1 +/// hermes --config cfg.toml query clients --chain ibc-1 impl Runnable for QueryAllClientsCmd { fn run(&self) { let config = app_config(); diff --git a/relayer-cli/src/commands/query/connection.rs b/relayer-cli/src/commands/query/connection.rs index eea467d227..bce0250934 100644 --- a/relayer-cli/src/commands/query/connection.rs +++ b/relayer-cli/src/commands/query/connection.rs @@ -18,17 +18,32 @@ use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct QueryConnectionEndCmd { - #[clap(required = true, help = "identifier of the chain to query")] + #[clap( + long = "chain", + required = true, + value_name = "CHAIN_ID", + help = "Identifier of the chain to query" + )] chain_id: ChainId, - #[clap(required = true, help = "identifier of the connection to query")] + #[clap( + long = "connection", + alias = "conn", + required = true, + value_name = "CONNECTION_ID", + help = "Identifier of the connection to query" + )] connection_id: ConnectionId, - #[clap(short = 'H', long, help = "height of the state to query")] + #[clap( + long = "height", + value_name = "HEIGHT", + help = "Height of the state to query" + )] height: Option, } -// cargo run --bin hermes -- query connection end ibc-test connectionidone --height 3 +// cargo run --bin hermes -- query connection end --chain ibc-test --connection connectionidone --height 3 impl Runnable for QueryConnectionEndCmd { fn run(&self) { let config = app_config(); @@ -69,10 +84,21 @@ impl Runnable for QueryConnectionEndCmd { /// `cargo run --bin hermes -- query connection channels ibc-0 connection-0` #[derive(Clone, Command, Debug, Parser)] pub struct QueryConnectionChannelsCmd { - #[clap(required = true, help = "identifier of the chain to query")] + #[clap( + long = "chain", + required = true, + value_name = "CHAIN_ID", + help = "Identifier of the chain to query" + )] chain_id: ChainId, - #[clap(required = true, help = "identifier of the connection to query")] + #[clap( + long = "connection", + alias = "conn", + required = true, + value_name = "CONNECTION_ID", + help = "Identifier of the connection to query" + )] connection_id: ConnectionId, } diff --git a/relayer-cli/src/commands/query/connections.rs b/relayer-cli/src/commands/query/connections.rs index 72f04f433a..6b789ecf29 100644 --- a/relayer-cli/src/commands/query/connections.rs +++ b/relayer-cli/src/commands/query/connections.rs @@ -11,7 +11,12 @@ use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct QueryConnectionsCmd { - #[clap(required = true, help = "identifier of the chain to query")] + #[clap( + long = "chain", + required = true, + value_name = "CHAIN_ID", + help = "Identifier of the chain to query" + )] chain_id: ChainId, } diff --git a/relayer-cli/src/commands/query/packet/ack.rs b/relayer-cli/src/commands/query/packet/ack.rs index 9aca45eb3f..a7acd62e39 100644 --- a/relayer-cli/src/commands/query/packet/ack.rs +++ b/relayer-cli/src/commands/query/packet/ack.rs @@ -14,19 +14,45 @@ use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct QueryPacketAcknowledgmentCmd { - #[clap(required = true, help = "identifier of the chain to query")] + #[clap( + long = "chain", + required = true, + value_name = "CHAIN_ID", + help = "Identifier of the chain to query" + )] chain_id: ChainId, - #[clap(required = true, help = "identifier of the port to query")] + #[clap( + long = "port", + required = true, + value_name = "PORT_ID", + help = "Identifier of the port to query" + )] port_id: PortId, - #[clap(required = true, help = "identifier of the channel to query")] + #[clap( + long = "channel", + alias = "chan", + required = true, + value_name = "CHANNEL_ID", + help = "Identifier of the channel to query" + )] channel_id: ChannelId, - #[clap(required = true, help = "sequence of packet to query")] + #[clap( + long = "sequence", + alias = "seq", + required = true, + value_name = "SEQUENCE", + help = "Sequence of packet to query" + )] sequence: Sequence, - #[clap(short = 'H', long, help = "height of the state to query")] + #[clap( + long = "height", + value_name = "HEIGHT", + help = "Height of the state to query" + )] height: Option, } diff --git a/relayer-cli/src/commands/query/packet/acks.rs b/relayer-cli/src/commands/query/packet/acks.rs index d7179dc79d..0209faccf3 100644 --- a/relayer-cli/src/commands/query/packet/acks.rs +++ b/relayer-cli/src/commands/query/packet/acks.rs @@ -21,13 +21,29 @@ struct PacketSeqs { #[derive(Clone, Command, Debug, Parser)] pub struct QueryPacketAcknowledgementsCmd { - #[clap(required = true, help = "identifier of the chain to query")] + #[clap( + long = "chain", + required = true, + value_name = "CHAIN_ID", + help = "Identifier of the chain to query" + )] chain_id: ChainId, - #[clap(required = true, help = "identifier of the port to query")] + #[clap( + long = "port", + required = true, + value_name = "PORT_ID", + help = "Identifier of the port to query" + )] port_id: PortId, - #[clap(required = true, help = "identifier of the channel to query")] + #[clap( + long = "channel", + alias = "chan", + required = true, + value_name = "CHANNEL_ID", + help = "Identifier of the channel to query" + )] channel_id: ChannelId, } @@ -52,7 +68,7 @@ impl QueryPacketAcknowledgementsCmd { } } -// cargo run --bin hermes -- query packet acknowledgements ibc-0 transfer ibconexfer --height 3 +// cargo run --bin hermes -- query packet acknowledgements --chain ibc-0 --port transfer --connection ibconexfer --height 3 impl Runnable for QueryPacketAcknowledgementsCmd { fn run(&self) { match self.execute() { diff --git a/relayer-cli/src/commands/query/packet/commitment.rs b/relayer-cli/src/commands/query/packet/commitment.rs index 7c3178a243..3df8986f3c 100644 --- a/relayer-cli/src/commands/query/packet/commitment.rs +++ b/relayer-cli/src/commands/query/packet/commitment.rs @@ -22,19 +22,45 @@ struct PacketSeqs { #[derive(Clone, Command, Debug, Parser)] pub struct QueryPacketCommitmentCmd { - #[clap(required = true, help = "identifier of the chain to query")] + #[clap( + long = "chain", + required = true, + value_name = "CHAIN_ID", + help = "Identifier of the chain to query" + )] chain_id: ChainId, - #[clap(required = true, help = "identifier of the port to query")] + #[clap( + long = "port", + required = true, + value_name = "PORT_ID", + help = "Identifier of the port to query" + )] port_id: PortId, - #[clap(required = true, help = "identifier of the channel to query")] + #[clap( + long = "channel", + alias = "chan", + required = true, + value_name = "CHANNEL_ID", + help = "Identifier of the channel to query" + )] channel_id: ChannelId, - #[clap(required = true, help = "sequence of packet to query")] + #[clap( + long = "sequence", + alias = "seq", + required = true, + value_name = "SEQUENCE", + help = "Sequence of packet to query" + )] sequence: Sequence, - #[clap(short = 'H', long, help = "height of the state to query")] + #[clap( + long = "height", + value_name = "HEIGHT", + help = "Height of the state to query" + )] height: Option, } diff --git a/relayer-cli/src/commands/query/packet/commitments.rs b/relayer-cli/src/commands/query/packet/commitments.rs index 15dfcac521..c5258ebdc1 100644 --- a/relayer-cli/src/commands/query/packet/commitments.rs +++ b/relayer-cli/src/commands/query/packet/commitments.rs @@ -20,13 +20,29 @@ struct PacketSeqs { #[derive(Clone, Command, Debug, Parser)] pub struct QueryPacketCommitmentsCmd { - #[clap(required = true, help = "identifier of the chain to query")] + #[clap( + long = "chain", + required = true, + value_name = "CHAIN_ID", + help = "Identifier of the chain to query" + )] chain_id: ChainId, - #[clap(required = true, help = "identifier of the port to query")] + #[clap( + long = "port", + required = true, + value_name = "PORT_ID", + help = "Identifier of the port to query" + )] port_id: PortId, - #[clap(required = true, help = "identifier of the channel to query")] + #[clap( + long = "channel", + alias = "chan", + required = true, + value_name = "CHANNEL_ID", + help = "Identifier of the channel to query" + )] channel_id: ChannelId, } @@ -47,7 +63,7 @@ impl QueryPacketCommitmentsCmd { } } -// cargo run --bin hermes -- query packet commitments ibc-0 transfer ibconexfer --height 3 +// cargo run --bin hermes -- query packet commitments --chain ibc-0 --port transfer --channel ibconexfer --height 3 impl Runnable for QueryPacketCommitmentsCmd { fn run(&self) { match self.execute() { diff --git a/relayer-cli/src/commands/query/packet/pending.rs b/relayer-cli/src/commands/query/packet/pending.rs index e59a7a1986..12e1115a4e 100644 --- a/relayer-cli/src/commands/query/packet/pending.rs +++ b/relayer-cli/src/commands/query/packet/pending.rs @@ -32,20 +32,27 @@ struct Summary { #[derive(Clone, Command, Debug, Parser)] pub struct QueryPendingPacketsCmd { #[clap( + long = "chain", required = true, - help = "identifier of the chain at one end of the channel" + value_name = "CHAIN_ID", + help = "Identifier of the chain at one end of the channel" )] chain_id: ChainId, #[clap( + long = "port", required = true, - help = "port identifier on the chain given by " + value_name = "PORT_ID", + help = "Port identifier on the chain given by " )] port_id: PortId, #[clap( + long = "channel", + alias = "chan", required = true, - help = "channel identifier on the chain given by " + value_name = "CHANNEL_ID", + help = "Channel identifier on the chain given by " )] channel_id: ChannelId, } diff --git a/relayer-cli/src/commands/query/packet/unreceived_acks.rs b/relayer-cli/src/commands/query/packet/unreceived_acks.rs index a27ee607b3..c1a627d05f 100644 --- a/relayer-cli/src/commands/query/packet/unreceived_acks.rs +++ b/relayer-cli/src/commands/query/packet/unreceived_acks.rs @@ -18,15 +18,28 @@ use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct QueryUnreceivedAcknowledgementCmd { #[clap( + long = "chain", required = true, - help = "identifier of the chain to query the unreceived acknowledgments" + value_name = "CHAIN_ID", + help = "Identifier of the chain to query the unreceived acknowledgments" )] chain_id: ChainId, - #[clap(required = true, help = "port identifier")] + #[clap( + long = "port", + required = true, + value_name = "PORT_ID", + help = "Port identifier" + )] port_id: PortId, - #[clap(required = true, help = "channel identifier")] + #[clap( + long = "channel", + alias = "chan", + required = true, + value_name = "CHANNEL_ID", + help = "Channel identifier" + )] channel_id: ChannelId, } diff --git a/relayer-cli/src/commands/query/packet/unreceived_packets.rs b/relayer-cli/src/commands/query/packet/unreceived_packets.rs index fe027c50d7..2dd5025ee3 100644 --- a/relayer-cli/src/commands/query/packet/unreceived_packets.rs +++ b/relayer-cli/src/commands/query/packet/unreceived_packets.rs @@ -18,15 +18,28 @@ use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct QueryUnreceivedPacketsCmd { #[clap( + long = "chain", required = true, - help = "identifier of the chain for the unreceived sequences" + value_name = "CHAIN_ID", + help = "Identifier of the chain for the unreceived sequences" )] chain_id: ChainId, - #[clap(required = true, help = "port identifier")] + #[clap( + long = "port", + required = true, + value_name = "PORT_ID", + help = "Port identifier" + )] port_id: PortId, - #[clap(required = true, help = "channel identifier")] + #[clap( + long = "channel", + alias = "chan", + required = true, + value_name = "CHANNEL_ID", + help = "Channel identifier" + )] channel_id: ChannelId, } diff --git a/relayer-cli/src/commands/query/transfer/denom_trace.rs b/relayer-cli/src/commands/query/transfer/denom_trace.rs index f0c13a5c8b..310bd4525f 100644 --- a/relayer-cli/src/commands/query/transfer/denom_trace.rs +++ b/relayer-cli/src/commands/query/transfer/denom_trace.rs @@ -17,10 +17,10 @@ use crate::conclude::{exit_with_unrecoverable_error, json, Output}; /// If successful the the base denomination and the path will be displayed. #[derive(Clone, Command, Debug, Parser)] pub struct DenomTraceCmd { - #[clap(long = "chain", required = true, help = "identifier of the chain")] + #[clap(long = "chain", required = true, help = "Identifier of the chain")] chain_id: ChainId, - #[clap(long = "hash", required = true, help = "trace hash to query")] + #[clap(long = "hash", required = true, help = "Trace hash to query")] hash: String, } diff --git a/relayer-cli/src/commands/query/tx/events.rs b/relayer-cli/src/commands/query/tx/events.rs index f7a1023136..cd2d2cfbf7 100644 --- a/relayer-cli/src/commands/query/tx/events.rs +++ b/relayer-cli/src/commands/query/tx/events.rs @@ -19,14 +19,24 @@ use crate::prelude::app_config; /// Query the events emitted by transaction #[derive(Clone, Command, Debug, Parser)] pub struct QueryTxEventsCmd { - #[clap(required = true, help = "identifier of the chain to query")] + #[clap( + long = "chain", + required = true, + value_name = "CHAIN_ID", + help = "Identifier of the chain to query" + )] chain_id: ChainId, - #[clap(required = true, help = "transaction hash to query")] + #[clap( + long = "hash", + required = true, + value_name = "HASH", + help = "Transaction hash to query" + )] hash: String, } -// cargo run --bin hermes -- query tx events ibc-0 B8E78AD83810239E21863AC7B5FC4F99396ABB39EB534F721EEF43A4979C2821 +// cargo run --bin hermes -- query tx events --chain ibc-0 --hash B8E78AD83810239E21863AC7B5FC4F99396ABB39EB534F721EEF43A4979C2821 impl Runnable for QueryTxEventsCmd { fn run(&self) { let config = app_config(); diff --git a/relayer-cli/src/commands/start.rs b/relayer-cli/src/commands/start.rs index 2ff33a4945..a5f9c02ef9 100644 --- a/relayer-cli/src/commands/start.rs +++ b/relayer-cli/src/commands/start.rs @@ -19,7 +19,6 @@ use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct StartCmd { #[clap( - short = 'f', long = "full-scan", help = "Force a full scan of the chains for clients, connections and channels" )] diff --git a/relayer-cli/src/commands/tx/channel.rs b/relayer-cli/src/commands/tx/channel.rs index ae670e0d84..7472a6daea 100644 --- a/relayer-cli/src/commands/tx/channel.rs +++ b/relayer-cli/src/commands/tx/channel.rs @@ -51,26 +51,46 @@ macro_rules! tx_chan_cmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawChanOpenInitCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + long = "dst-chain", + required = true, + help = "Identifier of the destination chain" + )] dst_chain_id: ChainId, - #[clap(required = true, help = "identifier of the source chain")] + #[clap( + long = "src-chain", + required = true, + help = "Identifier of the source chain" + )] src_chain_id: ChainId, - #[clap(required = true, help = "identifier of the destination connection")] + #[clap( + long = "dst-connection", + alias = "dst-conn", + required = true, + help = "Identifier of the destination connection" + )] dst_conn_id: ConnectionId, - #[clap(required = true, help = "identifier of the destination port")] + #[clap( + long = "dst-port", + required = true, + help = "Identifier of the destination port" + )] dst_port_id: PortId, - #[clap(required = true, help = "identifier of the source port")] + #[clap( + long = "src-port", + required = true, + help = "Identifier of the source port" + )] src_port_id: PortId, #[clap( - short, - long, + long = "order", default_value_t, - help = "the channel ordering, valid options 'unordered' (default) and 'ordered'" + help = "The channel ordering, valid options 'unordered' (default) and 'ordered'" )] order: Order, } @@ -132,34 +152,55 @@ impl Runnable for TxRawChanOpenInitCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawChanOpenTryCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + long = "dst-chain", + required = true, + help = "Identifier of the destination chain" + )] dst_chain_id: ChainId, - #[clap(required = true, help = "identifier of the source chain")] + #[clap( + long = "src-chain", + required = true, + help = "Identifier of the source chain" + )] src_chain_id: ChainId, - #[clap(required = true, help = "identifier of the destination connection")] + #[clap( + long = "dst-connection", + alias = "dst-conn", + required = true, + help = "Identifier of the destination connection" + )] dst_conn_id: ConnectionId, - #[clap(required = true, help = "identifier of the destination port")] + #[clap( + long = "dst-port", + required = true, + help = "Identifier of the destination port" + )] dst_port_id: PortId, - #[clap(required = true, help = "identifier of the source port")] + #[clap( + long = "src-port", + required = true, + help = "Identifier of the source port" + )] src_port_id: PortId, #[clap( - short = 's', - long, + long = "src-channel", + alias = "src-chan", required = true, - help = "identifier of the source channel (required)", + help = "Identifier of the source channel (required)", value_name = "ID" )] src_chan_id: ChannelId, #[clap( - short = 'd', - long, - help = "identifier of the destination channel (optional)", + long = "dst-channel", + alias = "dst-chan", + help = "Identifier of the destination channel (optional)", value_name = "ID" )] dst_chan_id: Option, @@ -199,35 +240,56 @@ impl Runnable for TxRawChanOpenTryCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawChanOpenAckCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + long = "dst-chain", + required = true, + help = "Identifier of the destination chain" + )] dst_chain_id: ChainId, - #[clap(required = true, help = "identifier of the source chain")] + #[clap( + long = "src-chain", + required = true, + help = "Identifier of the source chain" + )] src_chain_id: ChainId, - #[clap(required = true, help = "identifier of the destination connection")] + #[clap( + long = "dst-connection", + alias = "dst-conn", + required = true, + help = "Identifier of the destination connection" + )] dst_conn_id: ConnectionId, - #[clap(required = true, help = "identifier of the destination port")] + #[clap( + long = "dst-port", + required = true, + help = "Identifier of the destination port" + )] dst_port_id: PortId, - #[clap(required = true, help = "identifier of the source port")] + #[clap( + long = "src-port", + required = true, + help = "Identifier of the source port" + )] src_port_id: PortId, #[clap( - short = 'd', - long, + long = "dst-channel", + alias = "dst-chan", required = true, - help = "identifier of the destination channel (required)", + help = "Identifier of the destination channel (required)", value_name = "ID" )] dst_chan_id: ChannelId, #[clap( - short = 's', - long, + long = "src-channel", + alias = "src-chan", required = true, - help = "identifier of the source channel (required)", + help = "Identifier of the source channel (required)", value_name = "ID" )] src_chan_id: ChannelId, @@ -267,35 +329,56 @@ impl Runnable for TxRawChanOpenAckCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawChanOpenConfirmCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + long = "dst-chain", + required = true, + help = "Identifier of the destination chain" + )] dst_chain_id: ChainId, - #[clap(required = true, help = "identifier of the source chain")] + #[clap( + long = "src-chain", + required = true, + help = "Identifier of the source chain" + )] src_chain_id: ChainId, - #[clap(required = true, help = "identifier of the destination connection")] + #[clap( + long = "dst-connection", + alias = "dst-conn", + required = true, + help = "Identifier of the destination connection" + )] dst_conn_id: ConnectionId, - #[clap(required = true, help = "identifier of the destination port")] + #[clap( + long = "dst-port", + required = true, + help = "Identifier of the destination port" + )] dst_port_id: PortId, - #[clap(required = true, help = "identifier of the source port")] + #[clap( + long = "src-port", + required = true, + help = "Identifier of the source port" + )] src_port_id: PortId, #[clap( - short = 'd', - long, + long = "dst-channel", + alias = "dst-chan", required = true, - help = "identifier of the destination channel (required)", + help = "Identifier of the destination channel (required)", value_name = "ID" )] dst_chan_id: ChannelId, #[clap( - short = 's', - long, + long = "src-channel", + alias = "src-chan", required = true, - help = "identifier of the source channel (required)", + help = "Identifier of the source channel (required)", value_name = "ID" )] src_chan_id: ChannelId, @@ -335,35 +418,56 @@ impl Runnable for TxRawChanOpenConfirmCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawChanCloseInitCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + long = "dst-chain", + required = true, + help = "Identifier of the destination chain" + )] dst_chain_id: ChainId, - #[clap(required = true, help = "identifier of the source chain")] + #[clap( + long = "src-chain", + required = true, + help = "Identifier of the source chain" + )] src_chain_id: ChainId, - #[clap(required = true, help = "identifier of the destination connection")] + #[clap( + long = "dst-connection", + alias = "dst-conn", + required = true, + help = "Identifier of the destination connection" + )] dst_conn_id: ConnectionId, - #[clap(required = true, help = "identifier of the destination port")] + #[clap( + long = "dst-port", + required = true, + help = "Identifier of the destination port" + )] dst_port_id: PortId, - #[clap(required = true, help = "identifier of the source port")] + #[clap( + long = "src-port", + required = true, + help = "Identifier of the source port" + )] src_port_id: PortId, #[clap( - short = 'd', - long, + long = "dst-channel", + alias = "dst-chan", required = true, - help = "identifier of the destination channel (required)", + help = "Identifier of the destination channel (required)", value_name = "ID" )] dst_chan_id: ChannelId, #[clap( - short = 's', - long, + long = "src-channel", + alias = "src-chan", required = true, - help = "identifier of the source channel (required)", + help = "Identifier of the source channel (required)", value_name = "ID" )] src_chan_id: ChannelId, @@ -403,35 +507,56 @@ impl Runnable for TxRawChanCloseInitCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawChanCloseConfirmCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + long = "dst-chain", + required = true, + help = "Identifier of the destination chain" + )] dst_chain_id: ChainId, - #[clap(required = true, help = "identifier of the source chain")] + #[clap( + long = "src-chain", + required = true, + help = "Identifier of the source chain" + )] src_chain_id: ChainId, - #[clap(required = true, help = "identifier of the destination connection")] + #[clap( + long = "dst-connection", + alias = "dst-conn", + required = true, + help = "Identifier of the destination connection" + )] dst_conn_id: ConnectionId, - #[clap(required = true, help = "identifier of the destination port")] + #[clap( + long = "dst-port", + required = true, + help = "Identifier of the destination port" + )] dst_port_id: PortId, - #[clap(required = true, help = "identifier of the source port")] + #[clap( + long = "src-port", + required = true, + help = "Identifier of the source port" + )] src_port_id: PortId, #[clap( - short = 'd', - long, + long = "dst-channel", + alias = "dst-chan", required = true, - help = "identifier of the destination channel (required)", + help = "Identifier of the destination channel (required)", value_name = "ID" )] dst_chan_id: ChannelId, #[clap( - short = 's', - long, + long = "src-channel", + alias = "src-chan", required = true, - help = "identifier of the source channel (required)", + help = "Identifier of the source channel (required)", value_name = "ID" )] src_chan_id: ChannelId, diff --git a/relayer-cli/src/commands/tx/client.rs b/relayer-cli/src/commands/tx/client.rs index 246e1e8e45..54745f1cf9 100644 --- a/relayer-cli/src/commands/tx/client.rs +++ b/relayer-cli/src/commands/tx/client.rs @@ -23,10 +23,20 @@ use crate::error::Error; #[derive(Clone, Command, Debug, Parser)] pub struct TxCreateClientCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + long = "host-chain", + required = true, + value_name = "HOST_CHAIN_ID", + help = "Identifier of the chain that hosts the client" + )] dst_chain_id: ChainId, - #[clap(required = true, help = "identifier of the source chain")] + #[clap( + long = "reference-chain", + required = true, + value_name = "REFERENCE_CHAIN_ID", + help = "Identifier of the chain targeted by the client" + )] src_chain_id: ChainId, /// The maximum allowed clock drift for this client. @@ -38,26 +48,26 @@ pub struct TxCreateClientCmd { /// to accept or reject a new header (originating from the source chain) for this client. /// If this option is not specified, a suitable clock drift value is derived from the chain /// configurations. - #[clap(short = 'd', long)] + #[clap(long = "clock-drift", value_name = "CLOCK_DRIFT")] clock_drift: Option, /// Override the trusting period specified in the config. /// /// The trusting period specifies how long a validator set is trusted for /// (must be shorter than the chain's unbonding period). - #[clap(short = 'p', long)] + #[clap(long = "trusting-period", value_name = "TRUSTING_PERIOD")] trusting_period: Option, /// Override the trust threshold specified in the configuration. /// /// The trust threshold defines what fraction of the total voting power of a known /// and trusted validator set is sufficient for a commit to be accepted going forward. - #[clap(short = 't', long, parse(try_from_str = parse_trust_threshold))] + #[clap(long = "trust-threshold", value_name = "TRUST_THRESHOLD", parse(try_from_str = parse_trust_threshold))] trust_threshold: Option, } /// Sample to run this tx: -/// `hermes tx raw create-client ibc-0 ibc-1` +/// `hermes tx raw create-client --dst-chain ibc-0 --src-chain ibc-1` impl Runnable for TxCreateClientCmd { fn run(&self) { let config = app_config(); @@ -93,19 +103,34 @@ impl Runnable for TxCreateClientCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxUpdateClientCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + long = "host-chain", + required = true, + value_name = "HOST_CHAIN_ID", + help = "Identifier of the chain that hosts the client" + )] dst_chain_id: ChainId, #[clap( + long = "client", required = true, - help = "identifier of the client to be updated on destination chain" + value_name = "CLIENT_ID", + help = "Identifier of the chain targeted by the client" )] dst_client_id: ClientId, - #[clap(short = 'H', long, help = "the target height of the client update")] + #[clap( + long = "height", + value_name = "REFERENCE_HEIGHT", + help = "The target height of the client update" + )] target_height: Option, - #[clap(short = 't', long, help = "the trusted height of the client update")] + #[clap( + long = "trusted-height", + value_name = "REFERENCE_TRUSTED_HEIGHT", + help = "The trusted height of the client update" + )] trusted_height: Option, } @@ -165,12 +190,19 @@ impl Runnable for TxUpdateClientCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxUpgradeClientCmd { #[clap( + long = "host-chain", required = true, - help = "identifier of the chain that hosts the client" + value_name = "HOST_CHAIN_ID", + help = "Identifier of the chain that hosts the client" )] chain_id: ChainId, - #[clap(required = true, help = "identifier of the client to be upgraded")] + #[clap( + long = "client", + required = true, + value_name = "CLIENT_ID", + help = "Identifier of the client to be upgraded" + )] client_id: ClientId, } @@ -237,8 +269,10 @@ impl Runnable for TxUpgradeClientCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxUpgradeClientsCmd { #[clap( + long = "reference-chain", required = true, - help = "identifier of the chain that underwent an upgrade; all clients targeting this chain will be upgraded" + value_name = "REFERENCE_CHAIN_ID", + help = "Identifier of the chain that underwent an upgrade; all clients targeting this chain will be upgraded" )] src_chain_id: ChainId, } diff --git a/relayer-cli/src/commands/tx/connection.rs b/relayer-cli/src/commands/tx/connection.rs index dc48202400..a483a67e7f 100644 --- a/relayer-cli/src/commands/tx/connection.rs +++ b/relayer-cli/src/commands/tx/connection.rs @@ -36,16 +36,32 @@ macro_rules! conn_open_cmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawConnInitCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + long = "dst-chain", + required = true, + help = "Identifier of the destination chain" + )] dst_chain_id: ChainId, - #[clap(required = true, help = "identifier of the source chain")] + #[clap( + long = "src-chain", + required = true, + help = "Identifier of the source chain" + )] src_chain_id: ChainId, - #[clap(required = true, help = "identifier of the destination client")] + #[clap( + long = "dst-client", + required = true, + help = "Identifier of the destination client" + )] dst_client_id: ClientId, - #[clap(required = true, help = "identifier of the source client")] + #[clap( + long = "src-client", + required = true, + help = "Identifier of the source client" + )] src_client_id: ClientId, } @@ -68,31 +84,47 @@ impl Runnable for TxRawConnInitCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawConnTryCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + long = "dst-chain", + required = true, + help = "Identifier of the destination chain" + )] dst_chain_id: ChainId, - #[clap(required = true, help = "identifier of the source chain")] + #[clap( + long = "src-chain", + required = true, + help = "Identifier of the source chain" + )] src_chain_id: ChainId, - #[clap(required = true, help = "identifier of the destination client")] + #[clap( + long = "dst-client", + required = true, + help = "Identifier of the destination client" + )] dst_client_id: ClientId, - #[clap(required = true, help = "identifier of the source client")] + #[clap( + long = "src-client", + required = true, + help = "Identifier of the source client" + )] src_client_id: ClientId, #[clap( - short = 's', - long, + long = "src-connection", + alias = "src-conn", required = true, - help = "identifier of the source connection (required)", + help = "Identifier of the source connection (required)", value_name = "ID" )] src_conn_id: ConnectionId, #[clap( - short = 'd', - long, - help = "identifier of the destination connection (optional)", + long = "dst-connection", + alias = "dst-conn", + help = "Identifier of the destination connection (optional)", value_name = "ID" )] dst_conn_id: Option, @@ -125,32 +157,48 @@ impl Runnable for TxRawConnTryCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawConnAckCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + long = "dst-chain", + required = true, + help = "Identifier of the destination chain" + )] dst_chain_id: ChainId, - #[clap(required = true, help = "identifier of the source chain")] + #[clap( + long = "src-chain", + required = true, + help = "Identifier of the source chain" + )] src_chain_id: ChainId, - #[clap(required = true, help = "identifier of the destination client")] + #[clap( + long = "dst-client", + required = true, + help = "Identifier of the destination client" + )] dst_client_id: ClientId, - #[clap(required = true, help = "identifier of the source client")] + #[clap( + long = "src-client", + required = true, + help = "Identifier of the source client" + )] src_client_id: ClientId, #[clap( - short = 'd', - long, + long = "dst-connection", + alias = "dst-conn", required = true, - help = "identifier of the destination connection (required)", + help = "Identifier of the destination connection (required)", value_name = "ID" )] dst_conn_id: ConnectionId, #[clap( - short = 's', - long, + long = "src-connection", + alias = "src-conn", required = true, - help = "identifier of the source connection (required)", + help = "Identifier of the source connection (required)", value_name = "ID" )] src_conn_id: ConnectionId, @@ -183,32 +231,48 @@ impl Runnable for TxRawConnAckCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawConnConfirmCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + long = "dst-chain", + required = true, + help = "Identifier of the destination chain" + )] dst_chain_id: ChainId, - #[clap(required = true, help = "identifier of the source chain")] + #[clap( + long = "src-chain", + required = true, + help = "Identifier of the source chain" + )] src_chain_id: ChainId, - #[clap(required = true, help = "identifier of the destination client")] + #[clap( + long = "dst-client", + required = true, + help = "Identifier of the destination client" + )] dst_client_id: ClientId, - #[clap(required = true, help = "identifier of the source client")] + #[clap( + long = "src-client", + required = true, + help = "Identifier of the source client" + )] src_client_id: ClientId, #[clap( - short = 'd', - long, + long = "dst-connection", + alias = "dst-conn", required = true, - help = "identifier of the destination connection (required)", + help = "Identifier of the destination connection (required)", value_name = "ID" )] dst_conn_id: ConnectionId, #[clap( - short = 's', - long, + long = "src-connection", + alias = "src-conn", required = true, - help = "identifier of the source connection (required)", + help = "Identifier of the source connection (required)", value_name = "ID" )] src_conn_id: ConnectionId, diff --git a/relayer-cli/src/commands/tx/packet.rs b/relayer-cli/src/commands/tx/packet.rs index 607703b4f6..a8e70bb1df 100644 --- a/relayer-cli/src/commands/tx/packet.rs +++ b/relayer-cli/src/commands/tx/packet.rs @@ -12,16 +12,33 @@ use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct TxRawPacketRecvCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + long = "dst-chain", + required = true, + help = "Identifier of the destination chain" + )] dst_chain_id: ChainId, - #[clap(required = true, help = "identifier of the source chain")] + #[clap( + long = "src-chain", + required = true, + help = "Identifier of the source chain" + )] src_chain_id: ChainId, - #[clap(required = true, help = "identifier of the source port")] + #[clap( + long = "src-port", + required = true, + help = "Identifier of the source port" + )] src_port_id: PortId, - #[clap(required = true, help = "identifier of the source channel")] + #[clap( + long = "src-channel", + alias = "src-chan", + required = true, + help = "Identifier of the source channel" + )] src_channel_id: ChannelId, } @@ -56,16 +73,33 @@ impl Runnable for TxRawPacketRecvCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawPacketAckCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + long = "dst-chain", + required = true, + help = "Identifier of the destination chain" + )] dst_chain_id: ChainId, - #[clap(required = true, help = "identifier of the source chain")] + #[clap( + long = "src-chain", + required = true, + help = "Identifier of the source chain" + )] src_chain_id: ChainId, - #[clap(required = true, help = "identifier of the source port")] + #[clap( + long = "src-port", + required = true, + help = "Identifier of the source port" + )] src_port_id: PortId, - #[clap(required = true, help = "identifier of the source channel")] + #[clap( + long = "src-channel", + alias = "src-chan", + required = true, + help = "Identifier of the source channel" + )] src_channel_id: ChannelId, } diff --git a/relayer-cli/src/commands/tx/transfer.rs b/relayer-cli/src/commands/tx/transfer.rs index ca85f60fc7..a8baa44ba4 100644 --- a/relayer-cli/src/commands/tx/transfer.rs +++ b/relayer-cli/src/commands/tx/transfer.rs @@ -26,64 +26,77 @@ use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct TxIcs20MsgTransferCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + long = "dst-chain", + required = true, + help = "Identifier of the destination chain" + )] dst_chain_id: ChainId, - #[clap(required = true, help = "identifier of the source chain")] + #[clap( + long = "src-chain", + required = true, + help = "Identifier of the source chain" + )] src_chain_id: ChainId, - #[clap(required = true, help = "identifier of the source port")] + #[clap( + long = "src-port", + required = true, + help = "Identifier of the source port" + )] src_port_id: PortId, - #[clap(required = true, help = "identifier of the source channel")] + #[clap( + long = "src-channel", + alias = "src-chan", + required = true, + help = "Identifier of the source channel" + )] src_channel_id: ChannelId, #[clap( + long = "amount", required = true, - help = "amount of coins (samoleans, by default) to send (e.g. `100000`)" + help = "Amount of coins (samoleans, by default) to send (e.g. `100000`)" )] amount: Amount, #[clap( - short = 'o', - long, + long = "timeout-height-offset", default_value = "0", - help = "timeout in number of blocks since current" + help = "Timeout in number of blocks since current" )] timeout_height_offset: u64, #[clap( - short = 't', - long, + long = "timeout-seconds", default_value = "0", - help = "timeout in seconds since current" + help = "Timeout in seconds since current" )] timeout_seconds: u64, #[clap( - short = 'r', - long, - help = "receiving account address on the destination chain" + long = "receiver", + help = "Receiving account address on the destination chain" )] receiver: Option, #[clap( - short = 'd', - long, - help = "denomination of the coins to send", + long = "denom", + help = "Denomination of the coins to send", default_value = "samoleans" )] denom: String, - #[clap(short = 'n', long, help = "number of messages to send")] + #[clap(long = "number-msgs", help = "Number of messages to send")] number_msgs: Option, #[clap( - short = 'k', - long, - help = "use the given signing key (default: `key_name` config)" + long = "key-name", + help = "Use the given signing key name (default: `key_name` config)" )] - key: Option, + key_name: Option, } impl Override for TxIcs20MsgTransferCmd { @@ -95,7 +108,7 @@ impl Override for TxIcs20MsgTransferCmd { )) })?; - if let Some(ref key_name) = self.key { + if let Some(ref key_name) = self.key_name { src_chain_config.key_name = key_name.to_string(); } diff --git a/relayer-cli/src/commands/tx/upgrade.rs b/relayer-cli/src/commands/tx/upgrade.rs index 1422a6c8ab..541af9ff2f 100644 --- a/relayer-cli/src/commands/tx/upgrade.rs +++ b/relayer-cli/src/commands/tx/upgrade.rs @@ -14,55 +14,61 @@ use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct TxIbcUpgradeChainCmd { - #[clap(required = true, help = "identifier of the chain to upgrade")] + #[clap( + long = "dst-chain", + required = true, + help = "Identifier of the chain to upgrade" + )] dst_chain_id: ChainId, - #[clap(required = true, help = "identifier of the source chain")] + #[clap( + long = "src-chain", + required = true, + help = "Identifier of the source chain" + )] src_chain_id: ChainId, #[clap( + long = "src-client", required = true, - help = "identifier of the client on source chain from which the plan is created" + help = "Identifier of the client on source chain from which the plan is created" )] src_client_id: ClientId, - #[clap(required = true, help = "amount of stake")] + #[clap(long = "amount", required = true, help = "Amount of stake")] amount: u64, #[clap( + long = "height-offset", required = true, - help = "upgrade height offset in number of blocks since current" + help = "Upgrade height offset in number of blocks since current" )] height_offset: u64, #[clap( - short = 'c', - long, + long = "new-chain", value_name = "CHAIN-ID", - help = "new chain identifier to assign to the upgrading chain (optional)" + help = "New chain identifier to assign to the upgrading chain (optional)" )] new_chain_id: Option, #[clap( - short = 'u', - long, + long = "new-unbonding", value_name = "PERIOD", - help = "new unbonding period to assign to the upgrading chain, in seconds (optional)" + help = "New unbonding period to assign to the upgrading chain, in seconds (optional)" )] new_unbonding: Option, #[clap( - short = 'n', - long, + long = "upgrade-name", value_name = "NAME", - help = "a string to name the upgrade proposal plan (default: 'plan')" + help = "A string to name the upgrade proposal plan (default: 'plan')" )] upgrade_name: Option, #[clap( - short = 'd', - long, - help = "denomination for the deposit (default: 'stake')" + long = "denom", + help = "Denomination for the deposit (default: 'stake')" )] denom: Option, } diff --git a/relayer-cli/src/conclude.rs b/relayer-cli/src/conclude.rs index 294c20e764..44f7683edb 100644 --- a/relayer-cli/src/conclude.rs +++ b/relayer-cli/src/conclude.rs @@ -83,7 +83,7 @@ pub fn exit_with(out: Output) -> ! { } } -/// Returns true if the application global json flag `-j` or `--json` is enabled. +/// Returns true if the application global json flag `--json` is enabled. /// Returns false otherwise. pub fn json() -> bool { let a = app_reader(); diff --git a/relayer-cli/src/entry.rs b/relayer-cli/src/entry.rs index 312d43dfe2..e27cba4cf9 100644 --- a/relayer-cli/src/entry.rs +++ b/relayer-cli/src/entry.rs @@ -13,11 +13,11 @@ use crate::commands::CliCmd; #[clap(author, about, version)] pub struct EntryPoint { /// Path to the configuration file - #[clap(short = 'c', long, help = "path to configuration file")] + #[clap(long = "config", help = "Path to configuration file")] pub config: Option, /// Toggle JSON output mode one verbosity setting - #[clap(short = 'j', long, help = "enable JSON output")] + #[clap(long = "json", help = "Enable JSON output")] pub json: bool, /// Subcommand to execute. @@ -53,7 +53,7 @@ impl Configurable for EntryPoint { } match &self.config { - // Use explicit `-c`/`--config` argument if passed + // Use explicit `--config` argument if passed Some(cfg) => Some(cfg.clone()), // Otherwise defer to the toplevel command's config path logic diff --git a/relayer/src/spawn.rs b/relayer/src/spawn.rs index 4e81bbee88..186eb39571 100644 --- a/relayer/src/spawn.rs +++ b/relayer/src/spawn.rs @@ -55,8 +55,6 @@ pub fn spawn_chain_runtime( .cloned() .ok_or_else(|| SpawnError::missing_chain_config(chain_id.clone()))?; - dbg!(chain_config.r#type); - let handle = match chain_config.r#type { ChainType::CosmosSdk => ChainRuntime::::spawn::(chain_config, rt), diff --git a/scripts/gm/bin/lib-gm b/scripts/gm/bin/lib-gm index cb4e8877d4..1074708f14 100644 --- a/scripts/gm/bin/lib-gm +++ b/scripts/gm/bin/lib-gm @@ -1011,25 +1011,25 @@ hermes_keys() { HERMES_BINARY="$(get_hermes_binary)" HDPATH="$(get_hdpath "$1")" if [ -z "$GLOBAL_HERMES_CONFIG" ] && [ -z "$HDPATH" ]; then - "$HERMES_BINARY" keys add "$ID" -f "${NETWORK_HOME_DIR}/wallet_seed.json" + "$HERMES_BINARY" keys add --chain "$ID" --key-file "${NETWORK_HOME_DIR}/wallet_seed.json" elif [ -n "$GLOBAL_HERMES_CONFIG" ] && [ -z "$HDPATH" ]; then - "$HERMES_BINARY" -c "$GLOBAL_HERMES_CONFIG" keys add "$ID" -f "${NETWORK_HOME_DIR}/wallet_seed.json" + "$HERMES_BINARY" --config "$GLOBAL_HERMES_CONFIG" keys add --chain "$ID" --key-file "${NETWORK_HOME_DIR}/wallet_seed.json" elif [ -z "$GLOBAL_HERMES_CONFIG" ] && [ -n "$HDPATH" ]; then - "$HERMES_BINARY" keys add "$ID" --hd-path "$HDPATH" -f "${NETWORK_HOME_DIR}/wallet_seed.json" + "$HERMES_BINARY" keys add --chain "$ID" --hd-path "$HDPATH" --key-file "${NETWORK_HOME_DIR}/wallet_seed.json" elif [ -n "$GLOBAL_HERMES_CONFIG" ] && [ -n "$HDPATH" ]; then - "$HERMES_BINARY" -c "$GLOBAL_HERMES_CONFIG" keys add "$ID" --hd-path "$HDPATH" -f "${NETWORK_HOME_DIR}/wallet_seed.json" + "$HERMES_BINARY" --config "$GLOBAL_HERMES_CONFIG" keys add --chain "$ID" --hd-path "$HDPATH" --key-file "${NETWORK_HOME_DIR}/wallet_seed.json" fi EXTRA_WALLETS_COUNTER="$(get_extra_wallets "$1")" while [ "$EXTRA_WALLETS_COUNTER" -gt 0 ]; do if [ -z "$GLOBAL_HERMES_CONFIG" ] && [ -z "$HDPATH" ]; then - "$HERMES_BINARY" keys add "$ID" --key-name "wallet${EXTRA_WALLETS_COUNTER}" -f "${NETWORK_HOME_DIR}/wallet${EXTRA_WALLETS_COUNTER}_seed.json" + "$HERMES_BINARY" keys add --chain "$ID" --key-name "wallet${EXTRA_WALLETS_COUNTER}" --key-file "${NETWORK_HOME_DIR}/wallet${EXTRA_WALLETS_COUNTER}_seed.json" elif [ -n "$GLOBAL_HERMES_CONFIG" ] && [ -z "$HDPATH" ]; then - "$HERMES_BINARY" -c "$GLOBAL_HERMES_CONFIG" keys add "$ID" --key-name "wallet${EXTRA_WALLETS_COUNTER}" -f "${NETWORK_HOME_DIR}/wallet${EXTRA_WALLETS_COUNTER}_seed.json" + "$HERMES_BINARY" --config "$GLOBAL_HERMES_CONFIG" keys add --chain "$ID" --key-name "wallet${EXTRA_WALLETS_COUNTER}" --key-file "${NETWORK_HOME_DIR}/wallet${EXTRA_WALLETS_COUNTER}_seed.json" elif [ -z "$GLOBAL_HERMES_CONFIG" ] && [ -n "$HDPATH" ]; then - "$HERMES_BINARY" keys add "$ID" --hd-path "$HDPATH" --key-name "wallet${EXTRA_WALLETS_COUNTER}" -f "${NETWORK_HOME_DIR}/wallet${EXTRA_WALLETS_COUNTER}_seed.json" + "$HERMES_BINARY" keys add --chain "$ID" --hd-path "$HDPATH" --key-name "wallet${EXTRA_WALLETS_COUNTER}" --key-file "${NETWORK_HOME_DIR}/wallet${EXTRA_WALLETS_COUNTER}_seed.json" elif [ -n "$GLOBAL_HERMES_CONFIG" ] && [ -n "$HDPATH" ]; then - "$HERMES_BINARY" -c "$GLOBAL_HERMES_CONFIG" keys add "$ID" --hd-path "$HDPATH" --key-name "wallet${EXTRA_WALLETS_COUNTER}" -f "${NETWORK_HOME_DIR}/wallet${EXTRA_WALLETS_COUNTER}_seed.json" + "$HERMES_BINARY" --config "$GLOBAL_HERMES_CONFIG" keys add --chain "$ID" --hd-path "$HDPATH" --key-name "wallet${EXTRA_WALLETS_COUNTER}" --key-file "${NETWORK_HOME_DIR}/wallet${EXTRA_WALLETS_COUNTER}_seed.json" fi EXTRA_WALLETS_COUNTER="$((EXTRA_WALLETS_COUNTER - 1))" done @@ -1051,7 +1051,7 @@ hermes_cc() { do for j in $(seq $((i+1)) $N) do - echo "\"${HERMES_BINARY}\" create channel $(n_from_a "$i" "$CHAINS") $(n_from_a "$j" "$CHAINS") --port-a transfer --port-b transfer" + echo "\"${HERMES_BINARY}\" create channel --a-chain $(n_from_a "$i" "$CHAINS") --b-chain $(n_from_a "$j" "$CHAINS") --a-port transfer --b-port transfer" done done } diff --git a/scripts/init-hermes b/scripts/init-hermes index ebf006e514..9f91ca009e 100755 --- a/scripts/init-hermes +++ b/scripts/init-hermes @@ -63,14 +63,14 @@ cargo build -q --locked # add the key seeds to the keyring of each chain echo "Importing keys..." -cargo run -q --bin hermes -- -c "$CONFIG_FILE" keys add "$CHAIN_0_ID" -f "$GAIA_DATA/$CHAIN_0_ID/user_seed.json" -cargo run -q --bin hermes -- -c "$CONFIG_FILE" keys add "$CHAIN_0_ID" -f "$GAIA_DATA/$CHAIN_0_ID/user2_seed.json" -k user2 -cargo run -q --bin hermes -- -c "$CONFIG_FILE" keys add "$CHAIN_1_ID" -f "$GAIA_DATA/$CHAIN_1_ID/user_seed.json" -cargo run -q --bin hermes -- -c "$CONFIG_FILE" keys add "$CHAIN_1_ID" -f "$GAIA_DATA/$CHAIN_1_ID/user2_seed.json" -k user2 +cargo run -q --bin hermes -- --config "$CONFIG_FILE" keys add --chain "$CHAIN_0_ID" --key-file "$GAIA_DATA/$CHAIN_0_ID/user_seed.json" +cargo run -q --bin hermes -- --config "$CONFIG_FILE" keys add --chain "$CHAIN_0_ID" --key-file "$GAIA_DATA/$CHAIN_0_ID/user2_seed.json" --key-name user2 +cargo run -q --bin hermes -- --config "$CONFIG_FILE" keys add --chain "$CHAIN_1_ID" --key-file "$GAIA_DATA/$CHAIN_1_ID/user2_seed.json" --key-name user2 +cargo run -q --bin hermes -- --config "$CONFIG_FILE" keys add --chain "$CHAIN_1_ID" --key-file "$GAIA_DATA/$CHAIN_1_ID/user_seed.json" if [ -n "$CHAIN_2_ID" ]; then - cargo run -q --bin hermes -- -c "$CONFIG_FILE" keys add "$CHAIN_2_ID" -f "$GAIA_DATA/$CHAIN_2_ID/user_seed.json" - cargo run -q --bin hermes -- -c "$CONFIG_FILE" keys add "$CHAIN_2_ID" -f "$GAIA_DATA/$CHAIN_2_ID/user2_seed.json" -k user2 + cargo run -q --bin hermes -- --config "$CONFIG_FILE" keys add --chain "$CHAIN_2_ID" --key-file "$GAIA_DATA/$CHAIN_2_ID/user_seed.json" + cargo run -q --bin hermes -- --config "$CONFIG_FILE" keys add --chain "$CHAIN_2_ID" --key-file "$GAIA_DATA/$CHAIN_2_ID/user2_seed.json" --key-name user2 fi echo "Done!"