From 51852ae51b91471e24f7b4b57116749b2d24d39c Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Tue, 7 Jun 2022 11:31:37 +0200 Subject: [PATCH 01/37] Updated CLI commands to take flags everywhere and updated e2e tests accordingly --- ci/e2e.sh | 10 +- e2e/e2e/channel.py | 58 ++--- e2e/e2e/client.py | 4 +- e2e/e2e/cmd.py | 2 +- e2e/e2e/connection.py | 28 +-- e2e/e2e/packet.py | 26 +- e2e/e2e/relayer.py | 2 +- relayer-cli/src/commands/clear.rs | 11 +- relayer-cli/src/commands/create/channel.rs | 18 +- relayer-cli/src/commands/create/connection.rs | 12 +- relayer-cli/src/commands/keys/add.rs | 12 +- relayer-cli/src/commands/keys/balance.rs | 6 +- relayer-cli/src/commands/keys/delete.rs | 22 +- relayer-cli/src/commands/keys/list.rs | 2 +- relayer-cli/src/commands/misbehaviour.rs | 2 + relayer-cli/src/commands/query/channel.rs | 21 +- .../src/commands/query/channel_client.rs | 19 +- .../src/commands/query/channel_ends.rs | 22 +- relayer-cli/src/commands/query/channels.rs | 18 +- relayer-cli/src/commands/query/client.rs | 79 ++++-- relayer-cli/src/commands/query/clients.rs | 16 +- relayer-cli/src/commands/query/connection.rs | 26 +- relayer-cli/src/commands/query/connections.rs | 6 +- relayer-cli/src/commands/query/packet/ack.rs | 23 +- relayer-cli/src/commands/query/packet/acks.rs | 19 +- .../src/commands/query/packet/commitment.rs | 23 +- .../src/commands/query/packet/commitments.rs | 19 +- .../src/commands/query/packet/pending.rs | 4 + .../commands/query/packet/unreceived_acks.rs | 5 +- .../query/packet/unreceived_packets.rs | 5 +- relayer-cli/src/commands/query/tx/events.rs | 8 +- relayer-cli/src/commands/tx/channel.rs | 226 ++++++++++++++---- relayer-cli/src/commands/tx/client.rs | 49 +++- relayer-cli/src/commands/tx/connection.rs | 121 +++++++--- relayer-cli/src/commands/tx/packet.rs | 52 +++- relayer-cli/src/commands/tx/transfer.rs | 47 ++-- relayer-cli/src/commands/tx/upgrade.rs | 34 ++- relayer-cli/src/entry.rs | 4 +- 38 files changed, 772 insertions(+), 289 deletions(-) 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/e2e/e2e/channel.py b/e2e/e2e/channel.py index 90921aff7b..fba0eb16ec 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, + "--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, + "--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, + "--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, + "--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..5f6423dc11 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 ["--dst-chain", self.dst_chain_id, "--src-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 ["--dst-chain", self.dst_chain_id, "--dst-client", self.dst_client_id] def process(self, result: Any) -> ClientUpdated: return from_dict(ClientUpdated, result[-1]['UpdateClient']['common']) 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..9404fb81c9 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/relayer-cli/src/commands/clear.rs b/relayer-cli/src/commands/clear.rs index eff01641da..f7abd8f930 100644 --- a/relayer-cli/src/commands/clear.rs +++ b/relayer-cli/src/commands/clear.rs @@ -23,13 +23,18 @@ pub enum ClearCmds { #[derive(Debug, Parser)] pub struct ClearPacketsCmd { - #[clap(required = true, help = "identifier of the chain")] + #[clap(long = "chain", required = true, help = "identifier of the chain")] chain_id: ChainId, - #[clap(required = true, help = "identifier of the port")] + #[clap( + short = 'p', + long = "port", + required = true, + help = "identifier of the port" + )] port_id: PortId, - #[clap(required = true, help = "identifier of the channel")] + #[clap(long = "chan", required = true, help = "identifier of the channel")] channel_id: ChannelId, } diff --git a/relayer-cli/src/commands/create/channel.rs b/relayer-cli/src/commands/create/channel.rs index f26fa1fe2e..0288f61c04 100644 --- a/relayer-cli/src/commands/create/channel.rs +++ b/relayer-cli/src/commands/create/channel.rs @@ -45,14 +45,14 @@ static HINT: &str = "Consider using the default invocation\n\nhermes create chan #[clap(disable_version_flag = true)] pub struct CreateChannelCommand { #[clap( + long = "chain-a", required = true, help = "Identifier of the side `a` chain for the new channel" )] chain_a: ChainId, #[clap( - short, - long, + long = "chain-b", help = "Identifier of the side `b` chain for the new channel" )] chain_b: Option, @@ -61,37 +61,37 @@ pub struct CreateChannelCommand { connection_a: Option, #[clap( - long, + long = "port-a", required = true, help = "Identifier of the side `a` port for the new channel" )] port_a: PortId, #[clap( - long, + long = "port-b", required = true, help = "Identifier of the side `b` port for the new channel" )] port_b: PortId, #[clap( - short, - long, + short = 'o', + long = "order", help = "The channel ordering, valid options 'unordered' (default) and 'ordered'", default_value_t )] order: Order, #[clap( - short, - long = "channel-version", + short = 'v', + long = "chan-version", alias = "version", help = "The version for the new channel" )] version: Option, #[clap( - long, + long = "new-client-conn", help = "Indicates that a new client and connection will be created underlying the new channel" )] new_client_connection: bool, diff --git a/relayer-cli/src/commands/create/connection.rs b/relayer-cli/src/commands/create/connection.rs index d8377287ea..90c290373a 100644 --- a/relayer-cli/src/commands/create/connection.rs +++ b/relayer-cli/src/commands/create/connection.rs @@ -18,28 +18,32 @@ use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct CreateConnectionCommand { #[clap( + long = "chain-a", required = true, 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 = "chain-b", + help = "identifier of the side `b` chain for the new connection" + )] chain_b_id: Option, #[clap( - long, + long = "client-a", help = "identifier of client hosted on chain `a`; default: None (creates a new client)" )] client_a: Option, #[clap( - long, + long = "client-b", help = "identifier of client hosted on chain `b`; default: None (creates a new client)" )] client_b: Option, #[clap( - long, + long = "delay", help = "delay period parameter for the new connection (seconds)", default_value = "0" )] diff --git a/relayer-cli/src/commands/keys/add.rs b/relayer-cli/src/commands/keys/add.rs index 1e85269899..86e8293e02 100644 --- a/relayer-cli/src/commands/keys/add.rs +++ b/relayer-cli/src/commands/keys/add.rs @@ -37,7 +37,7 @@ pub struct KeysAddCmd { #[clap( short = 'f', - long, + long = "key-file", required = true, help = "path to the key file", group = "add-restore" @@ -45,8 +45,8 @@ pub struct KeysAddCmd { key_file: Option, #[clap( - short, - long, + short = 'm', + long = "mnemonic-file", required = true, help = "path to file containing mnemonic to restore the key from", group = "add-restore" @@ -54,15 +54,15 @@ pub struct KeysAddCmd { mnemonic_file: Option, #[clap( - short, - long, + short = 'k', + long = "key-name", help = "name of the key (defaults to the `key_name` defined in the config)" )] key_name: Option, #[clap( short = 'p', - long, + long = "hd-path", help = "derivation path for this key", default_value = "m/44'/118'/0'/0/0" )] diff --git a/relayer-cli/src/commands/keys/balance.rs b/relayer-cli/src/commands/keys/balance.rs index 2b0558f27e..137fa401c0 100644 --- a/relayer-cli/src/commands/keys/balance.rs +++ b/relayer-cli/src/commands/keys/balance.rs @@ -19,12 +19,12 @@ use crate::conclude::{exit_with_unrecoverable_error, json, Output}; /// 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, help = "identifier of the chain")] chain_id: ChainId, #[clap( - long, - short, + short = 'k', + long = "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..efb6756c0e 100644 --- a/relayer-cli/src/commands/keys/delete.rs +++ b/relayer-cli/src/commands/keys/delete.rs @@ -12,13 +12,13 @@ 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, help = "identifier of the chain")] chain_id: ChainId, - #[clap(short = 'n', long, help = "name of the key")] - name: Option, + #[clap(short = 'k', long = "key-name", help = "name of the key")] + key_name: Option, - #[clap(short = 'a', long, help = "delete all keys")] + #[clap(short = 'a', long = "all", help = "delete all keys")] all: bool, } @@ -31,17 +31,19 @@ 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 -k/--key-name and -a/--all" + .to_owned() + .into()); } (false, None) => { - return Err("must provide either -n/--name or -a/--all" + return Err("must provide either -k/--key-name or -a/--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 +82,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..bfc978206d 100644 --- a/relayer-cli/src/commands/keys/list.rs +++ b/relayer-cli/src/commands/keys/list.rs @@ -14,7 +14,7 @@ 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, help = "identifier of the chain")] chain_id: ChainId, } diff --git a/relayer-cli/src/commands/misbehaviour.rs b/relayer-cli/src/commands/misbehaviour.rs index 2b33c5171d..623f333552 100644 --- a/relayer-cli/src/commands/misbehaviour.rs +++ b/relayer-cli/src/commands/misbehaviour.rs @@ -18,12 +18,14 @@ 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" )] chain_id: ChainId, #[clap( + long = "client", required = true, help = "identifier of the client to be monitored for misbehaviour" )] diff --git a/relayer-cli/src/commands/query/channel.rs b/relayer-cli/src/commands/query/channel.rs index 24cef1d005..107af9ee51 100644 --- a/relayer-cli/src/commands/query/channel.rs +++ b/relayer-cli/src/commands/query/channel.rs @@ -15,16 +15,29 @@ 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, + help = "identifier of the chain to query" + )] chain_id: ChainId, - #[clap(required = true, help = "identifier of the port to query")] + #[clap( + short = 'p', + long = "port", + required = true, + help = "identifier of the port to query" + )] port_id: PortId, - #[clap(required = true, help = "identifier of the channel to query")] + #[clap( + long = "chan", + required = true, + help = "identifier of the channel to query" + )] channel_id: ChannelId, - #[clap(short = 'H', long, help = "height of the state to query")] + #[clap(short = 'H', long = "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..eafe56d825 100644 --- a/relayer-cli/src/commands/query/channel_client.rs +++ b/relayer-cli/src/commands/query/channel_client.rs @@ -16,13 +16,26 @@ use crate::conclude::{exit_with_unrecoverable_error, Output}; /// 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, + help = "identifier of the chain to query" + )] chain_id: ChainId, - #[clap(required = true, long, help = "identifier of the port to query")] + #[clap( + short = 'p', + long = "port", + required = true, + help = "identifier of the port to query" + )] port_id: PortId, - #[clap(required = true, long, help = "identifier of the channel to query")] + #[clap( + long = "chan", + required = true, + 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 774ae64f6c..7828948595 100644 --- a/relayer-cli/src/commands/query/channel_ends.rs +++ b/relayer-cli/src/commands/query/channel_ends.rs @@ -19,21 +19,33 @@ 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, + 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, + help = "identifier of the port to query" + )] port_id: PortId, - #[clap(required = true, help = "identifier of the channel to query")] + #[clap( + long = "chan", + required = true, + help = "identifier of the channel to query" + )] channel_id: ChannelId, - #[clap(short = 'H', long, help = "height of the state to query")] + #[clap(short = 'H', long = "height", help = "height of the state to query")] height: Option, #[clap( short = 'v', - long, + 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 7beb8fe618..80e50093d5 100644 --- a/relayer-cli/src/commands/query/channels.rs +++ b/relayer-cli/src/commands/query/channels.rs @@ -21,19 +21,23 @@ use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct QueryChannelsCmd { - #[clap(required = true, help = "identifier of the chain to query")] + #[clap( + long = "chain", + required = true, + help = "identifier of the chain to query" + )] chain_id: ChainId, #[clap( short = 'd', - long, + long = "dst-chain", help = "identifier of the channel's destination chain" )] - destination_chain: Option, + dst_chain_id: Option, #[clap( short = 'v', - long, + long = "verbose", help = "enable verbose output, displaying all client and connection ids" )] verbose: bool, @@ -90,7 +94,7 @@ fn run_query_channels( let channel_ends = query_channel_ends( &mut registry, &chain, - cmd.destination_chain.as_ref(), + cmd.dst_chain_id.as_ref(), channel_end, connection_id, chain_id, @@ -118,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, @@ -137,7 +141,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 f23c0fc40b..e3d5e4eaf9 100644 --- a/relayer-cli/src/commands/query/client.rs +++ b/relayer-cli/src/commands/query/client.rs @@ -25,13 +25,25 @@ 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, + 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, + help = "identifier of the client to query" + )] client_id: ClientId, - #[clap(short = 'H', long, help = "the chain height context for the query")] + #[clap( + short = 'H', + long = "height", + help = "the chain height context for the query" + )] height: Option, } @@ -68,25 +80,36 @@ 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, + 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, + help = "identifier of the client to query" + )] client_id: ClientId, #[clap( - short = 'c', - long, + long = "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( + short = 's', + long = "heights-only", + help = "show only consensus heights" + )] heights_only: bool, #[clap( short = 'H', - long, + long = "height", help = "the chain height context to be used, applicable only to a specific height" )] height: Option, @@ -165,16 +188,32 @@ 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, + 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, + 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, + help = "height of header to query" + )] consensus_height: u64, - #[clap(short = 'H', long, help = "the chain height context for the query")] + #[clap( + short = 'H', + long = "height", + help = "the chain height context for the query" + )] height: Option, } @@ -232,15 +271,23 @@ 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, + 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, + help = "identifier of the client to query" + )] client_id: ClientId, #[clap( short = 'H', - long, + long = "height", help = "the chain height which this query should reflect" )] height: Option, diff --git a/relayer-cli/src/commands/query/clients.rs b/relayer-cli/src/commands/query/clients.rs index e6ca161980..6bd2970d24 100644 --- a/relayer-cli/src/commands/query/clients.rs +++ b/relayer-cli/src/commands/query/clients.rs @@ -17,18 +17,26 @@ 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 = "chain", + required = true, + help = "identifier of the chain to query" + )] chain_id: ChainId, #[clap( - short, - long, + short = 's', + long = "src-chain", help = "filter for clients which target a specific chain id (implies '-o')", value_name = "ID" )] src_chain_id: Option, - #[clap(short, long, help = "omit printing the source chain for each client")] + #[clap( + short = 'o', + long = "omit-chain-ids", + help = "omit printing the source chain for each client" + )] omit_chain_ids: bool, } diff --git a/relayer-cli/src/commands/query/connection.rs b/relayer-cli/src/commands/query/connection.rs index ea1288dddb..8a2f0e3325 100644 --- a/relayer-cli/src/commands/query/connection.rs +++ b/relayer-cli/src/commands/query/connection.rs @@ -20,13 +20,21 @@ 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, + help = "identifier of the chain to query" + )] chain_id: ChainId, - #[clap(required = true, help = "identifier of the connection to query")] + #[clap( + long = "conn", + required = true, + help = "identifier of the connection to query" + )] connection_id: ConnectionId, - #[clap(short = 'H', long, help = "height of the state to query")] + #[clap(short = 'H', long = "height", help = "height of the state to query")] height: Option, } @@ -77,10 +85,18 @@ 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, + help = "identifier of the chain to query" + )] chain_id: ChainId, - #[clap(required = true, help = "identifier of the connection to query")] + #[clap( + long = "conn", + required = true, + 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 60aa94139e..f53d88a4ff 100644 --- a/relayer-cli/src/commands/query/connections.rs +++ b/relayer-cli/src/commands/query/connections.rs @@ -13,7 +13,11 @@ 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, + 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 afbbd07c99..432c8254f5 100644 --- a/relayer-cli/src/commands/query/packet/ack.rs +++ b/relayer-cli/src/commands/query/packet/ack.rs @@ -14,19 +14,32 @@ 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, + help = "identifier of the chain to query" + )] chain_id: ChainId, - #[clap(required = true, help = "identifier of the port to query")] + #[clap( + short = 'p', + long = "port", + required = true, + help = "identifier of the port to query" + )] port_id: PortId, - #[clap(required = true, help = "identifier of the channel to query")] + #[clap( + long = "chan", + required = true, + help = "identifier of the channel to query" + )] channel_id: ChannelId, - #[clap(required = true, help = "sequence of packet to query")] + #[clap(long = "seq", required = true, help = "sequence of packet to query")] sequence: Sequence, - #[clap(short = 'H', long, help = "height of the state to query")] + #[clap(short = 'H', long = "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..8f4142c310 100644 --- a/relayer-cli/src/commands/query/packet/acks.rs +++ b/relayer-cli/src/commands/query/packet/acks.rs @@ -21,13 +21,26 @@ 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, + help = "identifier of the chain to query" + )] chain_id: ChainId, - #[clap(required = true, help = "identifier of the port to query")] + #[clap( + short = 'p', + long = "port", + required = true, + help = "identifier of the port to query" + )] port_id: PortId, - #[clap(required = true, help = "identifier of the channel to query")] + #[clap( + long = "chan", + required = true, + help = "identifier of the channel to query" + )] channel_id: ChannelId, } diff --git a/relayer-cli/src/commands/query/packet/commitment.rs b/relayer-cli/src/commands/query/packet/commitment.rs index 7910c53030..5a4c9e5cc3 100644 --- a/relayer-cli/src/commands/query/packet/commitment.rs +++ b/relayer-cli/src/commands/query/packet/commitment.rs @@ -21,19 +21,32 @@ 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, + help = "identifier of the chain to query" + )] chain_id: ChainId, - #[clap(required = true, help = "identifier of the port to query")] + #[clap( + short = 'p', + long = "port", + required = true, + help = "identifier of the port to query" + )] port_id: PortId, - #[clap(required = true, help = "identifier of the channel to query")] + #[clap( + long = "chan", + required = true, + help = "identifier of the channel to query" + )] channel_id: ChannelId, - #[clap(required = true, help = "sequence of packet to query")] + #[clap(long = "seq", required = true, help = "sequence of packet to query")] sequence: Sequence, - #[clap(short = 'H', long, help = "height of the state to query")] + #[clap(short = 'H', long = "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..225b5fa245 100644 --- a/relayer-cli/src/commands/query/packet/commitments.rs +++ b/relayer-cli/src/commands/query/packet/commitments.rs @@ -20,13 +20,26 @@ 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, + help = "identifier of the chain to query" + )] chain_id: ChainId, - #[clap(required = true, help = "identifier of the port to query")] + #[clap( + short = 'p', + long = "port", + required = true, + help = "identifier of the port to query" + )] port_id: PortId, - #[clap(required = true, help = "identifier of the channel to query")] + #[clap( + long = "chan", + required = true, + help = "identifier of the channel to query" + )] channel_id: ChannelId, } diff --git a/relayer-cli/src/commands/query/packet/pending.rs b/relayer-cli/src/commands/query/packet/pending.rs index e59a7a1986..23d6e64a23 100644 --- a/relayer-cli/src/commands/query/packet/pending.rs +++ b/relayer-cli/src/commands/query/packet/pending.rs @@ -32,18 +32,22 @@ 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" )] chain_id: ChainId, #[clap( + short = 'p', + long = "port", required = true, help = "port identifier on the chain given by " )] port_id: PortId, #[clap( + long = "chan", required = true, help = "channel identifier on the chain given by " )] diff --git a/relayer-cli/src/commands/query/packet/unreceived_acks.rs b/relayer-cli/src/commands/query/packet/unreceived_acks.rs index a27ee607b3..0a88bc95b1 100644 --- a/relayer-cli/src/commands/query/packet/unreceived_acks.rs +++ b/relayer-cli/src/commands/query/packet/unreceived_acks.rs @@ -18,15 +18,16 @@ 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" )] chain_id: ChainId, - #[clap(required = true, help = "port identifier")] + #[clap(short = 'p', long = "port", required = true, help = "port identifier")] port_id: PortId, - #[clap(required = true, help = "channel identifier")] + #[clap(long = "chan", required = true, 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..e766e6ace6 100644 --- a/relayer-cli/src/commands/query/packet/unreceived_packets.rs +++ b/relayer-cli/src/commands/query/packet/unreceived_packets.rs @@ -18,15 +18,16 @@ 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" )] chain_id: ChainId, - #[clap(required = true, help = "port identifier")] + #[clap(short = 'p', long = "port", required = true, help = "port identifier")] port_id: PortId, - #[clap(required = true, help = "channel identifier")] + #[clap(long = "chan", required = true, help = "channel identifier")] channel_id: ChannelId, } diff --git a/relayer-cli/src/commands/query/tx/events.rs b/relayer-cli/src/commands/query/tx/events.rs index 2004a3cef1..28aaa07b65 100644 --- a/relayer-cli/src/commands/query/tx/events.rs +++ b/relayer-cli/src/commands/query/tx/events.rs @@ -22,10 +22,14 @@ 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, + help = "identifier of the chain to query" + )] chain_id: ChainId, - #[clap(required = true, help = "transaction hash to query")] + #[clap(long = "hash", required = true, help = "transaction hash to query")] hash: String, } diff --git a/relayer-cli/src/commands/tx/channel.rs b/relayer-cli/src/commands/tx/channel.rs index 3aa61c2fe7..5bce096f68 100644 --- a/relayer-cli/src/commands/tx/channel.rs +++ b/relayer-cli/src/commands/tx/channel.rs @@ -49,24 +49,46 @@ macro_rules! tx_chan_cmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawChanOpenInitCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + short = 'd', + 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( + short = 's', + 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-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, + short = 'o', + long = "order", default_value_t, help = "the channel ordering, valid options 'unordered' (default) and 'ordered'" )] @@ -127,24 +149,45 @@ impl Runnable for TxRawChanOpenInitCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawChanOpenTryCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + short = 'd', + 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( + short = 's', + 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-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-chan", required = true, help = "identifier of the source channel (required)", value_name = "ID" @@ -152,8 +195,7 @@ pub struct TxRawChanOpenTryCmd { src_chan_id: ChannelId, #[clap( - short = 'd', - long, + long = "dst-chan", help = "identifier of the destination channel (optional)", value_name = "ID" )] @@ -194,24 +236,45 @@ impl Runnable for TxRawChanOpenTryCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawChanOpenAckCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + short = 'd', + 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( + short = 's', + 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-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-chan", required = true, help = "identifier of the destination channel (required)", value_name = "ID" @@ -219,8 +282,7 @@ pub struct TxRawChanOpenAckCmd { dst_chan_id: ChannelId, #[clap( - short = 's', - long, + long = "src-chan", required = true, help = "identifier of the source channel (required)", value_name = "ID" @@ -262,24 +324,45 @@ impl Runnable for TxRawChanOpenAckCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawChanOpenConfirmCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + short = 'd', + 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( + short = 's', + 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-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-chan", required = true, help = "identifier of the destination channel (required)", value_name = "ID" @@ -287,8 +370,7 @@ pub struct TxRawChanOpenConfirmCmd { dst_chan_id: ChannelId, #[clap( - short = 's', - long, + long = "src-chan", required = true, help = "identifier of the source channel (required)", value_name = "ID" @@ -330,24 +412,45 @@ impl Runnable for TxRawChanOpenConfirmCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawChanCloseInitCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + short = 'd', + 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( + short = 's', + 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-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-chan", required = true, help = "identifier of the destination channel (required)", value_name = "ID" @@ -355,8 +458,7 @@ pub struct TxRawChanCloseInitCmd { dst_chan_id: ChannelId, #[clap( - short = 's', - long, + long = "src-chan", required = true, help = "identifier of the source channel (required)", value_name = "ID" @@ -398,24 +500,45 @@ impl Runnable for TxRawChanCloseInitCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawChanCloseConfirmCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + short = 'd', + 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( + short = 's', + 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-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-chan", required = true, help = "identifier of the destination channel (required)", value_name = "ID" @@ -423,8 +546,7 @@ pub struct TxRawChanCloseConfirmCmd { dst_chan_id: ChannelId, #[clap( - short = 's', - long, + long = "src-chan", required = true, help = "identifier of the source channel (required)", value_name = "ID" diff --git a/relayer-cli/src/commands/tx/client.rs b/relayer-cli/src/commands/tx/client.rs index 67b3030afe..6e1799efc2 100644 --- a/relayer-cli/src/commands/tx/client.rs +++ b/relayer-cli/src/commands/tx/client.rs @@ -21,10 +21,20 @@ use crate::error::Error; #[derive(Clone, Command, Debug, Parser)] pub struct TxCreateClientCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + short = 'd', + 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( + short = 's', + long = "src-chain", + required = true, + help = "identifier of the source chain" + )] src_chain_id: ChainId, /// The maximum allowed clock drift for this client. @@ -36,21 +46,21 @@ 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")] 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(short = 'p', long = "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(short = 't', long = "trust-threshold", parse(try_from_str = parse_trust_threshold))] trust_threshold: Option, } @@ -91,19 +101,33 @@ impl Runnable for TxCreateClientCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxUpdateClientCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + short = 'd', + long = "dst-chain", + required = true, + help = "identifier of the destination chain" + )] dst_chain_id: ChainId, #[clap( + long = "dst-client", required = true, help = "identifier of the client to be updated on destination chain" )] dst_client_id: ClientId, - #[clap(short = 'H', long, help = "the target height of the client update")] + #[clap( + short = 'H', + long = "target-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( + short = 't', + long = "trusted-height", + help = "the trusted height of the client update" + )] trusted_height: Option, } @@ -162,12 +186,17 @@ impl Runnable for TxUpdateClientCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxUpgradeClientCmd { #[clap( + long = "chain", required = true, 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, + help = "identifier of the client to be upgraded" + )] client_id: ClientId, } @@ -214,6 +243,8 @@ impl Runnable for TxUpgradeClientCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxUpgradeClientsCmd { #[clap( + short = 's', + long = "src-chain", required = true, help = "identifier of the chain that underwent an upgrade; all clients targeting this chain will be upgraded" )] diff --git a/relayer-cli/src/commands/tx/connection.rs b/relayer-cli/src/commands/tx/connection.rs index dc48202400..477ff1c3a0 100644 --- a/relayer-cli/src/commands/tx/connection.rs +++ b/relayer-cli/src/commands/tx/connection.rs @@ -36,16 +36,34 @@ macro_rules! conn_open_cmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawConnInitCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + short = 'd', + 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( + short = 's', + 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,21 +86,39 @@ impl Runnable for TxRawConnInitCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawConnTryCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + short = 'd', + 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( + short = 's', + 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-conn", required = true, help = "identifier of the source connection (required)", value_name = "ID" @@ -90,8 +126,7 @@ pub struct TxRawConnTryCmd { src_conn_id: ConnectionId, #[clap( - short = 'd', - long, + long = "dst-conn", help = "identifier of the destination connection (optional)", value_name = "ID" )] @@ -125,21 +160,38 @@ impl Runnable for TxRawConnTryCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawConnAckCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + short = 'd', + 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( + short = 's', + 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-conn", required = true, help = "identifier of the destination connection (required)", value_name = "ID" @@ -147,8 +199,7 @@ pub struct TxRawConnAckCmd { dst_conn_id: ConnectionId, #[clap( - short = 's', - long, + long = "src-conn", required = true, help = "identifier of the source connection (required)", value_name = "ID" @@ -183,21 +234,38 @@ impl Runnable for TxRawConnAckCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawConnConfirmCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + short = 'd', + 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( + short = 's', + 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-conn", required = true, help = "identifier of the destination connection (required)", value_name = "ID" @@ -205,8 +273,7 @@ pub struct TxRawConnConfirmCmd { dst_conn_id: ConnectionId, #[clap( - short = 's', - long, + long = "src-conn", required = true, help = "identifier of the source connection (required)", value_name = "ID" diff --git a/relayer-cli/src/commands/tx/packet.rs b/relayer-cli/src/commands/tx/packet.rs index 607703b4f6..674ca0d6ac 100644 --- a/relayer-cli/src/commands/tx/packet.rs +++ b/relayer-cli/src/commands/tx/packet.rs @@ -12,16 +12,34 @@ use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct TxRawPacketRecvCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + short = 'd', + 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( + short = 's', + 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-chan", + required = true, + help = "identifier of the source channel" + )] src_channel_id: ChannelId, } @@ -56,16 +74,34 @@ impl Runnable for TxRawPacketRecvCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawPacketAckCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + short = 'd', + 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( + short = 's', + 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-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 860a7c51e2..8452127403 100644 --- a/relayer-cli/src/commands/tx/transfer.rs +++ b/relayer-cli/src/commands/tx/transfer.rs @@ -27,19 +27,39 @@ use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct TxIcs20MsgTransferCmd { - #[clap(required = true, help = "identifier of the destination chain")] + #[clap( + short = 'd', + 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( + short = 's', + 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-chan", + required = true, + help = "identifier of the source channel" + )] src_channel_id: ChannelId, #[clap( + short = 'a', + long = "amount", required = true, help = "amount of coins (samoleans, by default) to send (e.g. `100000`)" )] @@ -47,7 +67,7 @@ pub struct TxIcs20MsgTransferCmd { #[clap( short = 'o', - long, + long = "timeout-height-offset", default_value = "0", help = "timeout in number of blocks since current" )] @@ -55,7 +75,7 @@ pub struct TxIcs20MsgTransferCmd { #[clap( short = 't', - long, + long = "timeout-seconds", default_value = "0", help = "timeout in seconds since current" )] @@ -63,28 +83,27 @@ pub struct TxIcs20MsgTransferCmd { #[clap( short = 'r', - long, + long = "receiver", help = "receiving account address on the destination chain" )] receiver: Option, #[clap( - short = 'd', - long, + 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(short = 'n', 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 { @@ -96,7 +115,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 da2fa15139..18c163e6fa 100644 --- a/relayer-cli/src/commands/tx/upgrade.rs +++ b/relayer-cli/src/commands/tx/upgrade.rs @@ -18,30 +18,47 @@ use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct TxIbcUpgradeChainCmd { - #[clap(required = true, help = "identifier of the chain to upgrade")] + #[clap( + short = 'd', + 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( + short = 's', + 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" )] src_client_id: ClientId, - #[clap(required = true, help = "amount of stake")] + #[clap( + short = 'a', + long = "amount", + required = true, + help = "amount of stake" + )] amount: u64, #[clap( + short = 'H', + long = "height-offset", required = true, 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)" )] @@ -49,7 +66,7 @@ pub struct TxIbcUpgradeChainCmd { #[clap( short = 'u', - long, + long = "new-unbonding", value_name = "PERIOD", help = "new unbonding period to assign to the upgrading chain, in seconds (optional)" )] @@ -57,15 +74,14 @@ pub struct TxIbcUpgradeChainCmd { #[clap( short = 'n', - long, + long = "upgrade-name", value_name = "NAME", help = "a string to name the upgrade proposal plan (default: 'plan')" )] upgrade_name: Option, #[clap( - short = 'd', - long, + long = "denom", help = "denomination for the deposit (default: 'stake')" )] denom: Option, diff --git a/relayer-cli/src/entry.rs b/relayer-cli/src/entry.rs index 312d43dfe2..c8198c9ed5 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(short = 'c', 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(short = 'j', long = "json", help = "enable JSON output")] pub json: bool, /// Subcommand to execute. From 21580d309f6627e9bfcd4da797d9ec539f74a810 Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Tue, 7 Jun 2022 11:55:45 +0200 Subject: [PATCH 02/37] Updated gm to use flags when calling Hermes --- relayer-cli/src/commands/keys/add.rs | 2 +- scripts/gm/bin/lib-gm | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/relayer-cli/src/commands/keys/add.rs b/relayer-cli/src/commands/keys/add.rs index 86e8293e02..279fd08edc 100644 --- a/relayer-cli/src/commands/keys/add.rs +++ b/relayer-cli/src/commands/keys/add.rs @@ -32,7 +32,7 @@ use crate::conclude::Output; /// If successful the key will be created or restored, depending on which flag was given. #[derive(Clone, Command, Debug, Parser)] 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( diff --git a/scripts/gm/bin/lib-gm b/scripts/gm/bin/lib-gm index d1d637b77c..a2a2266a2c 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 --chain-a $(n_from_a "$i" "$CHAINS") --chain-b $(n_from_a "$j" "$CHAINS") --port-a transfer --port-b transfer" done done } From 09c157f4c36bfa1a0a22f9fe3075a1bce08ba73b Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Tue, 7 Jun 2022 12:41:10 +0200 Subject: [PATCH 03/37] Added missing flags to e2e test for 'query client state' command --- e2e/e2e/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/e2e/client.py b/e2e/e2e/client.py index 5f6423dc11..7e958226e5 100644 --- a/e2e/e2e/client.py +++ b/e2e/e2e/client.py @@ -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 From 612a707c63909a19f92346726e680435452e2857 Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Tue, 7 Jun 2022 13:14:25 +0200 Subject: [PATCH 04/37] Fixed flag errors in e2e tests and removed conflicting short flag. --- e2e/e2e/channel.py | 8 ++++---- e2e/e2e/connection.py | 2 +- relayer-cli/src/commands/tx/connection.rs | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/e2e/e2e/channel.py b/e2e/e2e/channel.py index fba0eb16ec..5abd1df205 100644 --- a/e2e/e2e/channel.py +++ b/e2e/e2e/channel.py @@ -28,7 +28,7 @@ class TxChanOpenInit(Cmd[TxChanOpenInitRes]): def args(self) -> List[str]: args = ["--dst-chain", self.dst_chain_id, "--src-chain", self.src_chain_id, - "--conn", self.connection_id, + "--dst-conn", self.connection_id, "--dst-port", self.dst_port_id, "--src-port", self.src_port_id] if self.ordering is not None: @@ -66,7 +66,7 @@ class TxChanOpenTry(Cmd[TxChanOpenTryRes]): def args(self) -> List[str]: args = ["--dst-chain", self.dst_chain_id, "--src-chain", self.src_chain_id, - "--conn", self.connection_id, + "--dst-conn", self.connection_id, "--dst-port", self.dst_port_id, "--src-port", self.src_port_id, "--src-chan", self.src_channel_id] @@ -105,7 +105,7 @@ class TxChanOpenAck(Cmd[TxChanOpenAckRes]): def args(self) -> List[str]: args = ["--dst-chain", self.dst_chain_id, "--src-chain", self.src_chain_id, - "--conn", self.connection_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] @@ -142,7 +142,7 @@ class TxChanOpenConfirm(Cmd[TxChanOpenConfirmRes]): def args(self) -> List[str]: args = ["--dst-chain", self.dst_chain_id, "--src-chain", self.src_chain_id, - "--conn", self.connection_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] diff --git a/e2e/e2e/connection.py b/e2e/e2e/connection.py index 9404fb81c9..bfd15e1ef7 100644 --- a/e2e/e2e/connection.py +++ b/e2e/e2e/connection.py @@ -46,7 +46,7 @@ class TxConnTry(Cmd[TxConnTryRes]): src_conn_id: ConnectionId def args(self) -> List[str]: - return ["dst-chain", self.dst_chain_id, "--src-chain", self.src_chain_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] diff --git a/relayer-cli/src/commands/tx/connection.rs b/relayer-cli/src/commands/tx/connection.rs index 477ff1c3a0..983d94124d 100644 --- a/relayer-cli/src/commands/tx/connection.rs +++ b/relayer-cli/src/commands/tx/connection.rs @@ -117,7 +117,6 @@ pub struct TxRawConnTryCmd { src_client_id: ClientId, #[clap( - short = 's', long = "src-conn", required = true, help = "identifier of the source connection (required)", From 88474db7e7a2957f9ab0f3b5273f82ec3b2ee544 Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Wed, 8 Jun 2022 10:00:05 +0200 Subject: [PATCH 05/37] Removed all short flags and updated CLI commands comments --- relayer-cli/src/commands/clear.rs | 7 +---- relayer-cli/src/commands/create/channel.rs | 11 ++++---- relayer-cli/src/commands/create/connection.rs | 6 ++-- relayer-cli/src/commands/keys/add.rs | 10 ++----- relayer-cli/src/commands/keys/balance.rs | 3 +- relayer-cli/src/commands/keys/delete.rs | 4 +-- relayer-cli/src/commands/listen.rs | 3 +- relayer-cli/src/commands/query/channel.rs | 3 +- .../src/commands/query/channel_client.rs | 3 +- .../src/commands/query/channel_ends.rs | 3 +- relayer-cli/src/commands/query/channels.rs | 2 -- relayer-cli/src/commands/query/client.rs | 28 +++++-------------- relayer-cli/src/commands/query/clients.rs | 4 +-- relayer-cli/src/commands/query/connection.rs | 4 +-- relayer-cli/src/commands/query/packet/ack.rs | 3 +- relayer-cli/src/commands/query/packet/acks.rs | 3 +- .../src/commands/query/packet/commitment.rs | 3 +- .../src/commands/query/packet/commitments.rs | 3 +- .../src/commands/query/packet/pending.rs | 1 - .../commands/query/packet/unreceived_acks.rs | 2 +- .../query/packet/unreceived_packets.rs | 2 +- relayer-cli/src/commands/query/tx/events.rs | 2 +- relayer-cli/src/commands/start.rs | 1 - relayer-cli/src/commands/tx/channel.rs | 2 -- relayer-cli/src/commands/tx/client.rs | 4 +-- relayer-cli/src/commands/tx/transfer.rs | 9 +----- relayer-cli/src/commands/tx/upgrade.rs | 12 +------- relayer-cli/src/conclude.rs | 2 +- relayer-cli/src/entry.rs | 6 ++-- 29 files changed, 45 insertions(+), 101 deletions(-) diff --git a/relayer-cli/src/commands/clear.rs b/relayer-cli/src/commands/clear.rs index f7abd8f930..cbfd9fa805 100644 --- a/relayer-cli/src/commands/clear.rs +++ b/relayer-cli/src/commands/clear.rs @@ -26,12 +26,7 @@ pub struct ClearPacketsCmd { #[clap(long = "chain", required = true, help = "identifier of the chain")] chain_id: ChainId, - #[clap( - short = 'p', - long = "port", - required = true, - help = "identifier of the port" - )] + #[clap(long = "port", required = true, help = "identifier of the port")] port_id: PortId, #[clap(long = "chan", required = true, help = "identifier of the channel")] diff --git a/relayer-cli/src/commands/create/channel.rs b/relayer-cli/src/commands/create/channel.rs index 0288f61c04..8078acbf21 100644 --- a/relayer-cli/src/commands/create/channel.rs +++ b/relayer-cli/src/commands/create/channel.rs @@ -29,11 +29,11 @@ static HINT: &str = "Consider using the default invocation\n\nhermes create chan /// /// There are two possible ways to invoke this command: /// -/// `create channel --port-a --port-b ` is the default +/// `create channel --chain-a --conn-a --port-a --port-b ` is the default /// way in which this command should be used, specifying a `Connection-ID` for this new channel /// to re-use. The command expects that `Connection-ID` is associated with chain A. /// -/// `create channel --port-a --port-b --new-client-connection` +/// `create channel --chain-a --chain-b --port-a --port-b --new-client-conn` /// to indicate that a new connection/client pair is being created as part of this new channel. /// This brings up an interactive yes/no prompt to ensure that the operator at least /// considers the fact that they're initializing a new connection with the channel. @@ -57,7 +57,10 @@ pub struct CreateChannelCommand { )] chain_b: Option, - /// Identifier of the connection on chain `a` to use in creating the new channel. + #[clap( + long = "conn-a", + help = "Identifier of the connection on chain `a` to use in creating the new channel." + )] connection_a: Option, #[clap( @@ -75,7 +78,6 @@ pub struct CreateChannelCommand { port_b: PortId, #[clap( - short = 'o', long = "order", help = "The channel ordering, valid options 'unordered' (default) and 'ordered'", default_value_t @@ -83,7 +85,6 @@ pub struct CreateChannelCommand { order: Order, #[clap( - short = 'v', long = "chan-version", alias = "version", help = "The version for the new channel" diff --git a/relayer-cli/src/commands/create/connection.rs b/relayer-cli/src/commands/create/connection.rs index 90c290373a..5ae51fc90b 100644 --- a/relayer-cli/src/commands/create/connection.rs +++ b/relayer-cli/src/commands/create/connection.rs @@ -50,9 +50,9 @@ pub struct CreateConnectionCommand { 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 --chain-a ibc-0 --chain-b ibc-1 +// cargo run --bin hermes -- create connection --chain-a ibc-0 --chain-b ibc-1 --delay 100 +// cargo run --bin hermes -- create connection --chain-a ibc-0 --client-a 07-tendermint-0 --client-b 07-tendermint-0 impl Runnable for CreateConnectionCommand { fn run(&self) { match &self.chain_b_id { diff --git a/relayer-cli/src/commands/keys/add.rs b/relayer-cli/src/commands/keys/add.rs index 279fd08edc..f9139a618e 100644 --- a/relayer-cli/src/commands/keys/add.rs +++ b/relayer-cli/src/commands/keys/add.rs @@ -22,11 +22,11 @@ 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. @@ -36,7 +36,6 @@ pub struct KeysAddCmd { chain_id: ChainId, #[clap( - short = 'f', long = "key-file", required = true, help = "path to the key file", @@ -45,7 +44,6 @@ pub struct KeysAddCmd { key_file: Option, #[clap( - short = 'm', long = "mnemonic-file", required = true, help = "path to file containing mnemonic to restore the key from", @@ -54,14 +52,12 @@ pub struct KeysAddCmd { mnemonic_file: Option, #[clap( - short = 'k', long = "key-name", help = "name of the key (defaults to the `key_name` defined in the config)" )] key_name: Option, #[clap( - short = 'p', long = "hd-path", help = "derivation path for this key", default_value = "m/44'/118'/0'/0/0" @@ -107,7 +103,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 137fa401c0..9008536473 100644 --- a/relayer-cli/src/commands/keys/balance.rs +++ b/relayer-cli/src/commands/keys/balance.rs @@ -12,7 +12,7 @@ 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 @@ -23,7 +23,6 @@ pub struct KeyBalanceCmd { chain_id: ChainId, #[clap( - short = 'k', long = "key-name", help = "(optional) name of the key (defaults to the `key_name` defined in the config)" )] diff --git a/relayer-cli/src/commands/keys/delete.rs b/relayer-cli/src/commands/keys/delete.rs index efb6756c0e..3873f7c1e1 100644 --- a/relayer-cli/src/commands/keys/delete.rs +++ b/relayer-cli/src/commands/keys/delete.rs @@ -15,10 +15,10 @@ pub struct KeysDeleteCmd { #[clap(long = "chain", required = true, help = "identifier of the chain")] chain_id: ChainId, - #[clap(short = 'k', long = "key-name", help = "name of the key")] + #[clap(long = "key-name", help = "name of the key")] key_name: Option, - #[clap(short = 'a', long = "all", help = "delete all keys")] + #[clap(long = "all", help = "delete all keys")] all: bool, } diff --git a/relayer-cli/src/commands/listen.rs b/relayer-cli/src/commands/listen.rs index 9a5c448116..a646b28e5f 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)] 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 = "event", value_name = "EVENT")] events: Vec, } diff --git a/relayer-cli/src/commands/query/channel.rs b/relayer-cli/src/commands/query/channel.rs index 107af9ee51..1500b53746 100644 --- a/relayer-cli/src/commands/query/channel.rs +++ b/relayer-cli/src/commands/query/channel.rs @@ -23,7 +23,6 @@ pub struct QueryChannelEndCmd { chain_id: ChainId, #[clap( - short = 'p', long = "port", required = true, help = "identifier of the port to query" @@ -37,7 +36,7 @@ pub struct QueryChannelEndCmd { )] channel_id: ChannelId, - #[clap(short = 'H', long = "height", help = "height of the state to query")] + #[clap(long = "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 eafe56d825..88341cb383 100644 --- a/relayer-cli/src/commands/query/channel_client.rs +++ b/relayer-cli/src/commands/query/channel_client.rs @@ -11,7 +11,7 @@ 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 --chan ` /// /// If successful the channel's client state is displayed. #[derive(Clone, Command, Debug, Parser)] @@ -24,7 +24,6 @@ pub struct QueryChannelClientCmd { chain_id: ChainId, #[clap( - short = 'p', long = "port", required = true, help = "identifier of the port to query" diff --git a/relayer-cli/src/commands/query/channel_ends.rs b/relayer-cli/src/commands/query/channel_ends.rs index 7828948595..fa3f9c87d9 100644 --- a/relayer-cli/src/commands/query/channel_ends.rs +++ b/relayer-cli/src/commands/query/channel_ends.rs @@ -40,11 +40,10 @@ pub struct QueryChannelEndsCmd { )] channel_id: ChannelId, - #[clap(short = 'H', long = "height", help = "height of the state to query")] + #[clap(long = "height", help = "height of the state to query")] height: Option, #[clap( - short = 'v', long = "verbose", help = "enable verbose output, displaying all details of channels, connections & clients" )] diff --git a/relayer-cli/src/commands/query/channels.rs b/relayer-cli/src/commands/query/channels.rs index 80e50093d5..3603c490c6 100644 --- a/relayer-cli/src/commands/query/channels.rs +++ b/relayer-cli/src/commands/query/channels.rs @@ -29,14 +29,12 @@ pub struct QueryChannelsCmd { chain_id: ChainId, #[clap( - short = 'd', long = "dst-chain", help = "identifier of the channel's destination chain" )] dst_chain_id: Option, #[clap( - short = 'v', long = "verbose", help = "enable verbose output, displaying all client and connection ids" )] diff --git a/relayer-cli/src/commands/query/client.rs b/relayer-cli/src/commands/query/client.rs index e3d5e4eaf9..2f93ac0cd2 100644 --- a/relayer-cli/src/commands/query/client.rs +++ b/relayer-cli/src/commands/query/client.rs @@ -39,16 +39,12 @@ pub struct QueryClientStateCmd { )] client_id: ClientId, - #[clap( - short = 'H', - long = "height", - help = "the chain height context for the query" - )] + #[clap(long = "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(); @@ -100,15 +96,10 @@ pub struct QueryClientConsensusCmd { )] consensus_height: Option, - #[clap( - short = 's', - long = "heights-only", - help = "show only consensus heights" - )] + #[clap(long = "heights-only", help = "show only consensus heights")] heights_only: bool, #[clap( - short = 'H', long = "height", help = "the chain height context to be used, applicable only to a specific height" )] @@ -116,7 +107,7 @@ pub struct QueryClientConsensusCmd { } /// 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(); @@ -209,16 +200,12 @@ pub struct QueryClientHeaderCmd { )] consensus_height: u64, - #[clap( - short = 'H', - long = "height", - help = "the chain height context for the query" - )] + #[clap(long = "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(); @@ -286,14 +273,13 @@ pub struct QueryClientConnectionsCmd { client_id: ClientId, #[clap( - short = 'H', long = "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 6bd2970d24..67be80ccd2 100644 --- a/relayer-cli/src/commands/query/clients.rs +++ b/relayer-cli/src/commands/query/clients.rs @@ -25,7 +25,6 @@ pub struct QueryAllClientsCmd { chain_id: ChainId, #[clap( - short = 's', long = "src-chain", help = "filter for clients which target a specific chain id (implies '-o')", value_name = "ID" @@ -33,7 +32,6 @@ pub struct QueryAllClientsCmd { src_chain_id: Option, #[clap( - short = 'o', long = "omit-chain-ids", help = "omit printing the source chain for each client" )] @@ -47,7 +45,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 8a2f0e3325..cb583a39c5 100644 --- a/relayer-cli/src/commands/query/connection.rs +++ b/relayer-cli/src/commands/query/connection.rs @@ -34,11 +34,11 @@ pub struct QueryConnectionEndCmd { )] connection_id: ConnectionId, - #[clap(short = 'H', long = "height", help = "height of the state to query")] + #[clap(long = "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 --conn connectionidone --height 3 impl Runnable for QueryConnectionEndCmd { fn run(&self) { let config = app_config(); diff --git a/relayer-cli/src/commands/query/packet/ack.rs b/relayer-cli/src/commands/query/packet/ack.rs index 432c8254f5..4227815a67 100644 --- a/relayer-cli/src/commands/query/packet/ack.rs +++ b/relayer-cli/src/commands/query/packet/ack.rs @@ -22,7 +22,6 @@ pub struct QueryPacketAcknowledgmentCmd { chain_id: ChainId, #[clap( - short = 'p', long = "port", required = true, help = "identifier of the port to query" @@ -39,7 +38,7 @@ pub struct QueryPacketAcknowledgmentCmd { #[clap(long = "seq", required = true, help = "sequence of packet to query")] sequence: Sequence, - #[clap(short = 'H', long = "height", help = "height of the state to query")] + #[clap(long = "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 8f4142c310..c50d5f9670 100644 --- a/relayer-cli/src/commands/query/packet/acks.rs +++ b/relayer-cli/src/commands/query/packet/acks.rs @@ -29,7 +29,6 @@ pub struct QueryPacketAcknowledgementsCmd { chain_id: ChainId, #[clap( - short = 'p', long = "port", required = true, help = "identifier of the port to query" @@ -65,7 +64,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 --conn 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 5a4c9e5cc3..1de2dcb531 100644 --- a/relayer-cli/src/commands/query/packet/commitment.rs +++ b/relayer-cli/src/commands/query/packet/commitment.rs @@ -29,7 +29,6 @@ pub struct QueryPacketCommitmentCmd { chain_id: ChainId, #[clap( - short = 'p', long = "port", required = true, help = "identifier of the port to query" @@ -46,7 +45,7 @@ pub struct QueryPacketCommitmentCmd { #[clap(long = "seq", required = true, help = "sequence of packet to query")] sequence: Sequence, - #[clap(short = 'H', long = "height", help = "height of the state to query")] + #[clap(long = "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 225b5fa245..b4a156fa56 100644 --- a/relayer-cli/src/commands/query/packet/commitments.rs +++ b/relayer-cli/src/commands/query/packet/commitments.rs @@ -28,7 +28,6 @@ pub struct QueryPacketCommitmentsCmd { chain_id: ChainId, #[clap( - short = 'p', long = "port", required = true, help = "identifier of the port to query" @@ -60,7 +59,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 --chan 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 23d6e64a23..9d4c765439 100644 --- a/relayer-cli/src/commands/query/packet/pending.rs +++ b/relayer-cli/src/commands/query/packet/pending.rs @@ -39,7 +39,6 @@ pub struct QueryPendingPacketsCmd { chain_id: ChainId, #[clap( - short = 'p', long = "port", required = true, help = "port identifier on the chain given by " diff --git a/relayer-cli/src/commands/query/packet/unreceived_acks.rs b/relayer-cli/src/commands/query/packet/unreceived_acks.rs index 0a88bc95b1..afad48463f 100644 --- a/relayer-cli/src/commands/query/packet/unreceived_acks.rs +++ b/relayer-cli/src/commands/query/packet/unreceived_acks.rs @@ -24,7 +24,7 @@ pub struct QueryUnreceivedAcknowledgementCmd { )] chain_id: ChainId, - #[clap(short = 'p', long = "port", required = true, help = "port identifier")] + #[clap(long = "port", required = true, help = "port identifier")] port_id: PortId, #[clap(long = "chan", required = true, help = "channel identifier")] diff --git a/relayer-cli/src/commands/query/packet/unreceived_packets.rs b/relayer-cli/src/commands/query/packet/unreceived_packets.rs index e766e6ace6..34cec32185 100644 --- a/relayer-cli/src/commands/query/packet/unreceived_packets.rs +++ b/relayer-cli/src/commands/query/packet/unreceived_packets.rs @@ -24,7 +24,7 @@ pub struct QueryUnreceivedPacketsCmd { )] chain_id: ChainId, - #[clap(short = 'p', long = "port", required = true, help = "port identifier")] + #[clap(long = "port", required = true, help = "port identifier")] port_id: PortId, #[clap(long = "chan", required = true, help = "channel identifier")] diff --git a/relayer-cli/src/commands/query/tx/events.rs b/relayer-cli/src/commands/query/tx/events.rs index 28aaa07b65..a05106c288 100644 --- a/relayer-cli/src/commands/query/tx/events.rs +++ b/relayer-cli/src/commands/query/tx/events.rs @@ -33,7 +33,7 @@ pub struct QueryTxEventsCmd { 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 0fff79eeaa..e79e48605b 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 5bce096f68..5627400044 100644 --- a/relayer-cli/src/commands/tx/channel.rs +++ b/relayer-cli/src/commands/tx/channel.rs @@ -50,7 +50,6 @@ macro_rules! tx_chan_cmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawChanOpenInitCmd { #[clap( - short = 'd', long = "dst-chain", required = true, help = "identifier of the destination chain" @@ -58,7 +57,6 @@ pub struct TxRawChanOpenInitCmd { dst_chain_id: ChainId, #[clap( - short = 's', long = "src-chain", required = true, help = "identifier of the source chain" diff --git a/relayer-cli/src/commands/tx/client.rs b/relayer-cli/src/commands/tx/client.rs index 6e1799efc2..d76065552f 100644 --- a/relayer-cli/src/commands/tx/client.rs +++ b/relayer-cli/src/commands/tx/client.rs @@ -22,7 +22,6 @@ use crate::error::Error; #[derive(Clone, Command, Debug, Parser)] pub struct TxCreateClientCmd { #[clap( - short = 'd', long = "dst-chain", required = true, help = "identifier of the destination chain" @@ -30,7 +29,6 @@ pub struct TxCreateClientCmd { dst_chain_id: ChainId, #[clap( - short = 's', long = "src-chain", required = true, help = "identifier of the source chain" @@ -65,7 +63,7 @@ pub struct TxCreateClientCmd { } /// 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(); diff --git a/relayer-cli/src/commands/tx/transfer.rs b/relayer-cli/src/commands/tx/transfer.rs index 8452127403..c21f9b4f64 100644 --- a/relayer-cli/src/commands/tx/transfer.rs +++ b/relayer-cli/src/commands/tx/transfer.rs @@ -28,7 +28,6 @@ use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct TxIcs20MsgTransferCmd { #[clap( - short = 'd', long = "dst-chain", required = true, help = "identifier of the destination chain" @@ -36,7 +35,6 @@ pub struct TxIcs20MsgTransferCmd { dst_chain_id: ChainId, #[clap( - short = 's', long = "src-chain", required = true, help = "identifier of the source chain" @@ -58,7 +56,6 @@ pub struct TxIcs20MsgTransferCmd { src_channel_id: ChannelId, #[clap( - short = 'a', long = "amount", required = true, help = "amount of coins (samoleans, by default) to send (e.g. `100000`)" @@ -66,7 +63,6 @@ pub struct TxIcs20MsgTransferCmd { amount: Amount, #[clap( - short = 'o', long = "timeout-height-offset", default_value = "0", help = "timeout in number of blocks since current" @@ -74,7 +70,6 @@ pub struct TxIcs20MsgTransferCmd { timeout_height_offset: u64, #[clap( - short = 't', long = "timeout-seconds", default_value = "0", help = "timeout in seconds since current" @@ -82,7 +77,6 @@ pub struct TxIcs20MsgTransferCmd { timeout_seconds: u64, #[clap( - short = 'r', long = "receiver", help = "receiving account address on the destination chain" )] @@ -95,11 +89,10 @@ pub struct TxIcs20MsgTransferCmd { )] denom: String, - #[clap(short = 'n', long = "number-msgs", help = "number of messages to send")] + #[clap(long = "number-msgs", help = "number of messages to send")] number_msgs: Option, #[clap( - short = 'k', long = "key-name", help = "use the given signing key name (default: `key_name` config)" )] diff --git a/relayer-cli/src/commands/tx/upgrade.rs b/relayer-cli/src/commands/tx/upgrade.rs index 18c163e6fa..5fff3fab6a 100644 --- a/relayer-cli/src/commands/tx/upgrade.rs +++ b/relayer-cli/src/commands/tx/upgrade.rs @@ -19,7 +19,6 @@ use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct TxIbcUpgradeChainCmd { #[clap( - short = 'd', long = "dst-chain", required = true, help = "identifier of the chain to upgrade" @@ -27,7 +26,6 @@ pub struct TxIbcUpgradeChainCmd { dst_chain_id: ChainId, #[clap( - short = 's', long = "src-chain", required = true, help = "identifier of the source chain" @@ -41,16 +39,10 @@ pub struct TxIbcUpgradeChainCmd { )] src_client_id: ClientId, - #[clap( - short = 'a', - long = "amount", - required = true, - help = "amount of stake" - )] + #[clap(long = "amount", required = true, help = "amount of stake")] amount: u64, #[clap( - short = 'H', long = "height-offset", required = true, help = "upgrade height offset in number of blocks since current" @@ -65,7 +57,6 @@ pub struct TxIbcUpgradeChainCmd { new_chain_id: Option, #[clap( - short = 'u', long = "new-unbonding", value_name = "PERIOD", help = "new unbonding period to assign to the upgrading chain, in seconds (optional)" @@ -73,7 +64,6 @@ pub struct TxIbcUpgradeChainCmd { new_unbonding: Option, #[clap( - short = 'n', long = "upgrade-name", value_name = "NAME", help = "a string to name the upgrade proposal plan (default: 'plan')" 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 c8198c9ed5..eb55a7da14 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 = "config", 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 = "json", 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 From a76599fa918e7fc6f55235f1b70a782ebc274b8c Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Wed, 8 Jun 2022 10:03:10 +0200 Subject: [PATCH 06/37] Removed forgotten short flags. --- relayer-cli/src/commands/tx/channel.rs | 11 ----------- relayer-cli/src/commands/tx/client.rs | 8 ++------ relayer-cli/src/commands/tx/connection.rs | 8 -------- relayer-cli/src/commands/tx/packet.rs | 4 ---- 4 files changed, 2 insertions(+), 29 deletions(-) diff --git a/relayer-cli/src/commands/tx/channel.rs b/relayer-cli/src/commands/tx/channel.rs index 5627400044..9328a34af8 100644 --- a/relayer-cli/src/commands/tx/channel.rs +++ b/relayer-cli/src/commands/tx/channel.rs @@ -85,7 +85,6 @@ pub struct TxRawChanOpenInitCmd { src_port_id: PortId, #[clap( - short = 'o', long = "order", default_value_t, help = "the channel ordering, valid options 'unordered' (default) and 'ordered'" @@ -148,7 +147,6 @@ impl Runnable for TxRawChanOpenInitCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawChanOpenTryCmd { #[clap( - short = 'd', long = "dst-chain", required = true, help = "identifier of the destination chain" @@ -156,7 +154,6 @@ pub struct TxRawChanOpenTryCmd { dst_chain_id: ChainId, #[clap( - short = 's', long = "src-chain", required = true, help = "identifier of the source chain" @@ -235,7 +232,6 @@ impl Runnable for TxRawChanOpenTryCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawChanOpenAckCmd { #[clap( - short = 'd', long = "dst-chain", required = true, help = "identifier of the destination chain" @@ -243,7 +239,6 @@ pub struct TxRawChanOpenAckCmd { dst_chain_id: ChainId, #[clap( - short = 's', long = "src-chain", required = true, help = "identifier of the source chain" @@ -323,7 +318,6 @@ impl Runnable for TxRawChanOpenAckCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawChanOpenConfirmCmd { #[clap( - short = 'd', long = "dst-chain", required = true, help = "identifier of the destination chain" @@ -331,7 +325,6 @@ pub struct TxRawChanOpenConfirmCmd { dst_chain_id: ChainId, #[clap( - short = 's', long = "src-chain", required = true, help = "identifier of the source chain" @@ -411,7 +404,6 @@ impl Runnable for TxRawChanOpenConfirmCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawChanCloseInitCmd { #[clap( - short = 'd', long = "dst-chain", required = true, help = "identifier of the destination chain" @@ -419,7 +411,6 @@ pub struct TxRawChanCloseInitCmd { dst_chain_id: ChainId, #[clap( - short = 's', long = "src-chain", required = true, help = "identifier of the source chain" @@ -499,7 +490,6 @@ impl Runnable for TxRawChanCloseInitCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawChanCloseConfirmCmd { #[clap( - short = 'd', long = "dst-chain", required = true, help = "identifier of the destination chain" @@ -507,7 +497,6 @@ pub struct TxRawChanCloseConfirmCmd { dst_chain_id: ChainId, #[clap( - short = 's', long = "src-chain", required = true, help = "identifier of the source chain" diff --git a/relayer-cli/src/commands/tx/client.rs b/relayer-cli/src/commands/tx/client.rs index d76065552f..cfd59c2428 100644 --- a/relayer-cli/src/commands/tx/client.rs +++ b/relayer-cli/src/commands/tx/client.rs @@ -51,14 +51,14 @@ pub struct TxCreateClientCmd { /// /// 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 = "trusting-period")] + #[clap(long = "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 = "trust-threshold", parse(try_from_str = parse_trust_threshold))] + #[clap(long = "trust-threshold", parse(try_from_str = parse_trust_threshold))] trust_threshold: Option, } @@ -100,7 +100,6 @@ impl Runnable for TxCreateClientCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxUpdateClientCmd { #[clap( - short = 'd', long = "dst-chain", required = true, help = "identifier of the destination chain" @@ -115,14 +114,12 @@ pub struct TxUpdateClientCmd { dst_client_id: ClientId, #[clap( - short = 'H', long = "target-height", help = "the target height of the client update" )] target_height: Option, #[clap( - short = 't', long = "trusted-height", help = "the trusted height of the client update" )] @@ -241,7 +238,6 @@ impl Runnable for TxUpgradeClientCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxUpgradeClientsCmd { #[clap( - short = 's', long = "src-chain", required = true, help = "identifier of the chain that underwent an upgrade; all clients targeting this chain will be upgraded" diff --git a/relayer-cli/src/commands/tx/connection.rs b/relayer-cli/src/commands/tx/connection.rs index 983d94124d..775dd8fb55 100644 --- a/relayer-cli/src/commands/tx/connection.rs +++ b/relayer-cli/src/commands/tx/connection.rs @@ -37,7 +37,6 @@ macro_rules! conn_open_cmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawConnInitCmd { #[clap( - short = 'd', long = "dst-chain", required = true, help = "identifier of the destination chain" @@ -45,7 +44,6 @@ pub struct TxRawConnInitCmd { dst_chain_id: ChainId, #[clap( - short = 's', long = "src-chain", required = true, help = "identifier of the source chain" @@ -87,7 +85,6 @@ impl Runnable for TxRawConnInitCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawConnTryCmd { #[clap( - short = 'd', long = "dst-chain", required = true, help = "identifier of the destination chain" @@ -95,7 +92,6 @@ pub struct TxRawConnTryCmd { dst_chain_id: ChainId, #[clap( - short = 's', long = "src-chain", required = true, help = "identifier of the source chain" @@ -160,7 +156,6 @@ impl Runnable for TxRawConnTryCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawConnAckCmd { #[clap( - short = 'd', long = "dst-chain", required = true, help = "identifier of the destination chain" @@ -168,7 +163,6 @@ pub struct TxRawConnAckCmd { dst_chain_id: ChainId, #[clap( - short = 's', long = "src-chain", required = true, help = "identifier of the source chain" @@ -234,7 +228,6 @@ impl Runnable for TxRawConnAckCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawConnConfirmCmd { #[clap( - short = 'd', long = "dst-chain", required = true, help = "identifier of the destination chain" @@ -242,7 +235,6 @@ pub struct TxRawConnConfirmCmd { dst_chain_id: ChainId, #[clap( - short = 's', long = "src-chain", required = true, help = "identifier of the source chain" diff --git a/relayer-cli/src/commands/tx/packet.rs b/relayer-cli/src/commands/tx/packet.rs index 674ca0d6ac..b22f0b4ab3 100644 --- a/relayer-cli/src/commands/tx/packet.rs +++ b/relayer-cli/src/commands/tx/packet.rs @@ -13,7 +13,6 @@ use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct TxRawPacketRecvCmd { #[clap( - short = 'd', long = "dst-chain", required = true, help = "identifier of the destination chain" @@ -21,7 +20,6 @@ pub struct TxRawPacketRecvCmd { dst_chain_id: ChainId, #[clap( - short = 's', long = "src-chain", required = true, help = "identifier of the source chain" @@ -75,7 +73,6 @@ impl Runnable for TxRawPacketRecvCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxRawPacketAckCmd { #[clap( - short = 'd', long = "dst-chain", required = true, help = "identifier of the destination chain" @@ -83,7 +80,6 @@ pub struct TxRawPacketAckCmd { dst_chain_id: ChainId, #[clap( - short = 's', long = "src-chain", required = true, help = "identifier of the source chain" From bf60ca14f2f39689485dec6c52a28926d06d4579 Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Wed, 8 Jun 2022 17:20:48 +0200 Subject: [PATCH 07/37] Updated Hermes guide with flags instead of positional arguments --- guide/src/SUMMARY.md | 1 + guide/src/commands/config.md | 4 +- guide/src/commands/global.md | 12 +-- guide/src/commands/keys/index.md | 97 +++++++++---------- guide/src/commands/listen/index.md | 18 ++-- guide/src/commands/misbehaviour/index.md | 13 +-- guide/src/commands/path-setup/channels.md | 25 ++--- guide/src/commands/path-setup/clients.md | 35 ++++--- guide/src/commands/path-setup/connections.md | 21 ++-- guide/src/commands/queries/channel.md | 67 +++++++------ guide/src/commands/queries/client.md | 95 ++++++++++-------- guide/src/commands/queries/connection.md | 36 +++---- guide/src/commands/queries/index.md | 1 + guide/src/commands/queries/packet.md | 96 +++++++++--------- guide/src/commands/queries/tx.md | 10 +- guide/src/commands/raw/channel-close.md | 41 ++++---- guide/src/commands/raw/channel-open.md | 82 ++++++++-------- guide/src/commands/raw/client.md | 46 ++++++--- guide/src/commands/raw/connection.md | 69 +++++++------ guide/src/commands/raw/index.md | 11 ++- guide/src/commands/raw/packet.md | 82 ++++++++++------ guide/src/commands/raw/upgrade.md | 91 +++++++++++++++++ guide/src/commands/relaying/clear.md | 25 ++--- guide/src/commands/relaying/index.md | 5 +- guide/src/commands/upgrade/index.md | 8 +- guide/src/commands/upgrade/test.md | 6 +- guide/src/config.md | 6 +- guide/src/help.md | 27 +++--- .../src/tutorials/local-chains/identifiers.md | 6 +- .../src/tutorials/local-chains/raw/channel.md | 12 +-- .../src/tutorials/local-chains/raw/client.md | 10 +- .../tutorials/local-chains/raw/connection.md | 12 +-- .../src/tutorials/local-chains/raw/packet.md | 26 ++--- .../relay-paths/create-new-path.md | 2 +- .../relay-paths/multiple-paths.md | 16 +-- guide/src/tutorials/local-chains/start.md | 4 +- 36 files changed, 633 insertions(+), 485 deletions(-) create mode 100644 guide/src/commands/raw/upgrade.md diff --git a/guide/src/SUMMARY.md b/guide/src/SUMMARY.md index d6acbed04a..0e5345c191 100644 --- a/guide/src/SUMMARY.md +++ b/guide/src/SUMMARY.md @@ -55,6 +55,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..b80e8b6f42 100644 --- a/guide/src/commands/config.md +++ b/guide/src/commands/config.md @@ -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..927bf50ca7 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 --dst-chain ibc-0 --src-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 --dst-chain ibc-0 --src-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 --dst-chain ibc-0 --src-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..b6cbf970eb 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 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..89eb22f5b2 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: + --event 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 --event NewBlock` +- To listen for only `Tx` events on `ibc-0`, invoke `hermes listen --chain ibc-0 --event Tx` +- To listen for both `NewBlock` and `Tx` events on `ibc-0`, invoke `hermes listen --chain ibc-0 --event NewBlock --event 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..57432b0b7c 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..87544df7e2 100644 --- a/guide/src/commands/path-setup/channels.md +++ b/guide/src/commands/path-setup/channels.md @@ -10,24 +10,25 @@ 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] --chain-a --port-a --port-b 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 - 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] + --chain-a Identifier of the side `a` chain for the new channel --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 + +FLAGS: + --chain-b Identifier of the side `b` chain for the new channel + --conn-a Identifier of the connection on chain `a` to use in creating the + new channel. + -h, --help Print help information + --new-client-conn 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] + --chan-version The version for the new channel ``` ## Examples @@ -42,7 +43,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 --chain-a ibc-0 --conn-a connection-0 --port-a transfer --port-b transfer --order unordered ``` Notice that one can omit the destination chain parameter, as Hermes will automatically @@ -205,7 +206,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 --chain-a ibc-0 --chain-b ibc-1 --port-a transfer --port-b 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..44f2074d76 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] --dst-chain --src-chain -ARGS: - +FLAGS: + --dst-chain identifier of the destination chain - + --src-chain identifier of the source chain 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 --dst-chain ibc-0 --src-chain ibc-1 ``` ```json @@ -81,16 +81,19 @@ Specific update and trusted heights can be specified. ```shell USAGE: - hermes update client [OPTIONS] + hermes update client [OPTIONS] --dst-chain --dst-client -ARGS: - identifier of the destination chain - identifier of the client to be updated on destination chain +FLAGS: + --dst-chain + identifier of the destination chain + + --dst-client + identifier of the client to be updated on destination chain 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 + --target-height the target height of the client update + --trusted-height the trusted height of the client update ``` __Update client with latest header__ @@ -98,7 +101,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 --dst-chain ibc-0 --dst-client 07-tendermint-9 ``` ```json @@ -126,7 +129,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 --dst-chain ibc-0 --dst-client 07-tendermint-1 --target-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..ce2d6fda4e 100644 --- a/guide/src/commands/path-setup/connections.md +++ b/guide/src/commands/path-setup/connections.md @@ -9,19 +9,19 @@ Use the `create connection` command to create a new connection. ```shell USAGE: - hermes create connection + hermes create connection [OPTIONS] --chain-a 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) + --chain-a identifier of the side `a` chain for the new connection + +OPTIONS: + --chain-b identifier of the side `b` chain for the new connection + --client-a identifier of client hosted on chain `a`; default: None (creates a new client) + --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) ``` ## Examples @@ -31,7 +31,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 --chain-a ibc-0 --chain-b ibc-1 ``` ```json @@ -202,8 +202,7 @@ 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 --chain-a ibc-0 --client-a 07-tendermint-0 --client-b 07-tendermint-0 ``` diff --git a/guide/src/commands/queries/channel.md b/guide/src/commands/queries/channel.md index fed5deb4ea..8614260158 100644 --- a/guide/src/commands/queries/channel.md +++ b/guide/src/commands/queries/channel.md @@ -8,13 +8,18 @@ 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: + --dst-chain identifier of the channel's destination chain + --verbose enable verbose output, displaying all client and connection + ids ``` __Example__ @@ -22,7 +27,7 @@ __Example__ Query all channels on `ibc-1`: ```shell -hermes query channels ibc-1 +hermes query channels --chain ibc-1 ``` ```json @@ -69,18 +74,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 --chan 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 + --chan identifier of the channel to query + --port identifier of the port to query + +OPTIONS: + --height height of the state to query ``` __Example__ @@ -88,7 +93,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 --chan channel-1 ``` ```json @@ -121,19 +126,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 --chan 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 + --chan 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 +147,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 --chan channel-1 ``` ```json @@ -181,7 +187,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 +196,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 --chan 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 + --chan 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 +313,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 --chan ``` 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..0c5567ef37 100644 --- a/guide/src/commands/queries/client.md +++ b/guide/src/commands/queries/client.md @@ -9,17 +9,17 @@ Use the `query clients` command to query the identifiers of all clients on a giv ```shell USAGE: - hermes query clients + hermes query clients [OPTIONS] --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) + --chain identifier of the chain to query + +OPTIONS: + --src-chain filter for clients which target a specific chain id (implies '--omit-chain-ids') + --omit-chain-ids omit printing the source chain for each client (default: false) ``` __Example__ @@ -27,7 +27,7 @@ __Example__ Query all clients on `ibc-1`: ```shell -hermes query clients ibc-1 +hermes query clients --chain ibc-1 ``` ```json @@ -56,7 +56,7 @@ Success: [ Query all clients on `ibc-1` having `ibc-2` as their source chain: ```shell -hermes query clients ibc-1 -s ibc-2 +hermes query clients --chain ibc-1 --src-chain ibc-2 ``` ```json @@ -79,9 +79,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 +91,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 - 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 +109,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 +148,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 +176,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 +211,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 +234,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 +252,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 +266,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 +285,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..379d6d3dd3 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 --conn 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 + --conn 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 --conn 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 --conn 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 + --conn 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 --conn connection-1 ``` ```json diff --git a/guide/src/commands/queries/index.md b/guide/src/commands/queries/index.md index 67eeeba748..e40396b304 100644 --- a/guide/src/commands/queries/index.md +++ b/guide/src/commands/queries/index.md @@ -32,4 +32,5 @@ SUBCOMMANDS: channel Query information about channels channels Query the identifiers of all channels on a given chain packet Query information about packets + tx Query information about transactions ``` diff --git a/guide/src/commands/queries/packet.md b/guide/src/commands/queries/packet.md index fa7b8a9b5f..01f5e5278e 100644 --- a/guide/src/commands/queries/packet.md +++ b/guide/src/commands/queries/packet.md @@ -33,12 +33,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 --chan -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 + --chan channel identifier on the chain given by + --port port identifier on the chain given by ``` __Example__ @@ -46,7 +46,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 --chan channel-1 ``` ```json @@ -85,15 +85,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 --chan 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 + --chan identifier of the channel to query + --port identifier of the port to query ``` __Example__ @@ -101,7 +101,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 --chan channel-0 ``` ```json @@ -124,19 +124,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 --chan --seq 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 + --chan identifier of the channel to query + --port identifier of the port to query + --seq sequence of packet to query + +OPTIONS: + --height height of the state to query ``` __Example__ @@ -144,7 +144,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 --chan channel-0 --seq 3 ``` ```json @@ -157,15 +157,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 --chan 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 + --chan identifier of the channel to query + --port identifier of the port to query ``` __Example__ @@ -173,7 +173,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 --chan channel-1 ``` ```json @@ -196,19 +196,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 --chan --seq 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 + --chan identifier of the channel to query + --port identifier of the port to query + --seq sequence of packet to query + +OPTIONS: + --height height of the state to query ``` __Example__ @@ -216,7 +216,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 --chan channel-1 --seq 2 ``` ```json @@ -229,15 +229,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 --chan 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 + --chan channel identifier + --port port identifier ``` __Example__ @@ -245,7 +245,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 --chan channel-1 ``` ```json @@ -262,15 +262,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 --chan 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 + --chan channel identifier + --port port identifier ``` __Example__ @@ -278,7 +278,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 --chan channel-0 ``` ```json diff --git a/guide/src/commands/queries/tx.md b/guide/src/commands/queries/tx.md index 7af7c4c2a4..536b66ca0b 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..abe6c4e086 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..5dabafb714 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..39db753216 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] --dst-chain --src-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: + --dst-chain + identifier of the destination chain + + --src-chain + identifier of the source chain + +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 --dst-chain ibc-0 --src-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] --dst-chain --dst-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 + --dst-chain + identifier of the destination chain + + --dst-client + identifier of the client to be updated on destination chain + +OPTIONS: + + --target-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 --dst-chain ibc-0 --dst-client 07-tendermint-0 ``` ```json diff --git a/guide/src/commands/raw/connection.md b/guide/src/commands/raw/connection.md index ce20d223fd..b6e061c808 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..0bd37fd374 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..317ba51285 --- /dev/null +++ b/guide/src/commands/raw/upgrade.md @@ -0,0 +1,91 @@ +# 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 --chain --client + +DESCRIPTION: + Upgrade the specified client on destination chain + +FLAGS: + --chain identifier of the chain that hosts the client + --client identifier of the client to be upgraded +``` + +## Upgrade Clients + +Use this to perform the upgrade on all the clients. + +```shell +USAGE: + hermes tx raw upgrade-clients --src-chain + +DESCRIPTION: + Upgrade all IBC clients that target a specific chain + +FLAGS: + --src-chain identifier of the chain that underwent an upgrade; all clients + targeting this chain will be upgraded +``` + +## 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 +``` + +```json +Success: transaction::Hash(CE98D8D98091BA8016BD852D18056E54C4CB3C4525E7F40DD3C40B4FD0F2482B) +``` \ No newline at end of file diff --git a/guide/src/commands/relaying/clear.md b/guide/src/commands/relaying/clear.md index a9f2c581cf..e0d25a6631 100644 --- a/guide/src/commands/relaying/clear.md +++ b/guide/src/commands/relaying/clear.md @@ -9,17 +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. +USAGE: + hermes clear packets --chain --port --chan -The channel is identified by the chain, port, and channel IDs at one of its ends +DESCRIPTION: + Clear outstanding packets (i.e. packet-recv and packet-ack) on a given channel in both directions. -USAGE: - hermes clear packets + The channel is identified by the chain, port, and channel IDs at one of its ends -ARGS: - identifier of the chain - identifier of the port - identifier of the channel +FLAGS: + --chain identifier of the chain + --chan identifier of the channel + --port identifier of the port OPTIONS: -h, --help Print help information @@ -30,7 +31,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 +142,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 --chan channel-13 2022-02-24T14:21:28.874190Z INFO ThreadId(01) using default configuration from '/Users/coromac/.hermes/config.toml' Success: [ 14, @@ -153,7 +154,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 --chan 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 +436,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 --chan 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..d4d4538680 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 --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: + --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..b62aae96e1 100644 --- a/guide/src/commands/upgrade/test.md +++ b/guide/src/commands/upgrade/test.md @@ -27,7 +27,7 @@ commit: 535be14a8bdbfeb0d950914b5baa2dc72c6b081c 2. Create one client on `ibc-1` for `ibc-0`: ```shell - hermes create client ibc-1 ibc-0 + hermes create client --dst-chain ibc-1 --src-chain ibc-0 ``` ```json @@ -51,7 +51,7 @@ commit: 535be14a8bdbfeb0d950914b5baa2dc72c6b081c 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 @@ -197,7 +197,7 @@ commit: 535be14a8bdbfeb0d950914b5baa2dc72c6b081c and another for the upgraded state. ```shell - hermes upgrade client ibc-1 07-tendermint-0 + hermes upgrade client --chain ibc-1 --client 07-tendermint-0 ``` ```json Success: [ diff --git a/guide/src/config.md b/guide/src/config.md index cdde0904bd..31801b6431 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 --conn 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..aa61bbcea2 100644 --- a/guide/src/help.md +++ b/guide/src/help.md @@ -60,21 +60,26 @@ hermes help create channel ``` USAGE: - hermes create channel + hermes create channel [OPTIONS] --chain-a --port-a --port-b 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 + --chain-a Identifier of the side `a` chain for the new channel + --port-a Identifier of the side `a` port for the new channel + --port-b Identifier of the side `b` port for the new channel + +OPTIONS: + --chain-b Identifier of the side `b` chain for the new channel + --chan-version The version for the new channel + --conn-a Identifier of the connection on chain `a` to use in creating the + new channel. + --new-client-conn 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 diff --git a/guide/src/tutorials/local-chains/identifiers.md b/guide/src/tutorials/local-chains/identifiers.md index b72682d7b1..47d6913288 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 --dst-chain ibc-1 --src-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..35f600f833 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 --chan channel-0 ``` ```shell -hermes query channel end ibc-1 transfer channel-1 +hermes query channel end --chain ibc-1 --port transfer --chan 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..c84f389a65 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 --dst-chain ibc-0 --src-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 --dst-chain ibc-1 --src-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 --dst-chain ibc-0 --dst-client 07-tendermint-0 ``` ```shell -hermes tx raw update-client ibc-1 07-tendermint-1 +hermes tx raw update-client --dst-chain ibc-1 --dst-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..4985e364c5 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 --conn connection-0 ``` ```shell -hermes query connection end ibc-1 connection-1 +hermes query connection end --chain ibc-1 --conn connection-1 ``` diff --git a/guide/src/tutorials/local-chains/raw/packet.md b/guide/src/tutorials/local-chains/raw/packet.md index 426b374d50..aaae0ed89a 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 --chan 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 --chan 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 --chan 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..dc95686d2e 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 --chain-a ibc-0 --chain-b ibc-1 --port-a transfer --port-b 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..7f3cac5db4 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 --chain-a ibc-0 --chain-b ibc-1 --port-a transfer --port-b 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 --chain-a ibc-1 --chain-b ibc-2 --port-a transfer --port-b 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 --chan channel-0 + hermes query packet unreceived-acks --chain ibc-0 --port transfer --chan channel-0 + hermes query packet unreceived-packets --chain ibc-2 --port transfer --chan channel-0 + hermes query packet unreceived-acks --chain ibc-1 --port transfer --chan 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: From b9983eff6550f4c9b56a72b7d32bfe87e2a8f095 Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Wed, 8 Jun 2022 17:21:17 +0200 Subject: [PATCH 08/37] Updated script and comment with new long flags for Hermes --- relayer-cli/src/commands/query/clients.rs | 2 +- scripts/init-hermes | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/relayer-cli/src/commands/query/clients.rs b/relayer-cli/src/commands/query/clients.rs index 67be80ccd2..384eac5cd6 100644 --- a/relayer-cli/src/commands/query/clients.rs +++ b/relayer-cli/src/commands/query/clients.rs @@ -26,7 +26,7 @@ pub struct QueryAllClientsCmd { #[clap( long = "src-chain", - help = "filter for clients which target a specific chain id (implies '-o')", + help = "filter for clients which target a specific chain id (implies '--omit-chain-ids')", value_name = "ID" )] src_chain_id: Option, 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!" From eb13cd02cf05336d91ac67b1f5432f540cb61930 Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Fri, 10 Jun 2022 15:14:07 +0200 Subject: [PATCH 09/37] Completed 'tx raw upgrade-' commands guide page. Updated Testing client upgrade guide page --- guide/src/commands/raw/upgrade.md | 74 +++++++++++++++++++++++++++++- guide/src/commands/upgrade/test.md | 66 ++++++++++++++++++++++---- 2 files changed, 128 insertions(+), 12 deletions(-) diff --git a/guide/src/commands/raw/upgrade.md b/guide/src/commands/raw/upgrade.md index 317ba51285..4244e71ab3 100644 --- a/guide/src/commands/raw/upgrade.md +++ b/guide/src/commands/raw/upgrade.md @@ -20,6 +20,40 @@ FLAGS: --client identifier of the client to be upgraded ``` +__Example__ + +A given client is upgraded: + +```shell +hermes tx raw upgrade-client --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. @@ -36,6 +70,42 @@ FLAGS: targeting this chain will be upgraded ``` +__Example__ + +All the clients are upgraded: + +```shell +hermes tx raw upgrade-clients --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. @@ -86,6 +156,6 @@ An upgrade proposal is made for `ibc-0`, for height `300` blocks from latest hei hermes tx raw upgrade-chain --dst-chain ibc-0 --src-chain ibc-1 --src-client 07-tendermint-0 --amount 10000000 --height-offset 300 ``` -```json -Success: transaction::Hash(CE98D8D98091BA8016BD852D18056E54C4CB3C4525E7F40DD3C40B4FD0F2482B) +``` +Success: transaction::Hash(779713508B6103E37FADE60483BEE964A90BD67E5F20037B2CC4AE0E90B707C3) ``` \ No newline at end of file diff --git a/guide/src/commands/upgrade/test.md b/guide/src/commands/upgrade/test.md index b62aae96e1..803f323fcf 100644 --- a/guide/src/commands/upgrade/test.md +++ b/guide/src/commands/upgrade/test.md @@ -17,14 +17,24 @@ 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 --dst-chain ibc-1 --src-chain ibc-0 @@ -45,7 +55,7 @@ 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`) @@ -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: @@ -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 check 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 From 7a25573a3c199bf326fe7b8d0619a9a5d5e4cdec Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Fri, 10 Jun 2022 15:23:55 +0200 Subject: [PATCH 10/37] Added changelog entry --- .../ibc-relayer-cli/2239-changed-args-to-flags.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .changelog/unreleased/breaking-changes/ibc-relayer-cli/2239-changed-args-to-flags.md 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 From 2e3fff32c9651c72883cbce5d7c6d21ee937c822 Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Wed, 15 Jun 2022 16:58:27 +0200 Subject: [PATCH 11/37] Added example unit-tests to the 'keys add' command --- relayer-cli/src/commands/keys/add.rs | 38 +++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/relayer-cli/src/commands/keys/add.rs b/relayer-cli/src/commands/keys/add.rs index f9139a618e..67ffcdedd2 100644 --- a/relayer-cli/src/commands/keys/add.rs +++ b/relayer-cli/src/commands/keys/add.rs @@ -30,7 +30,7 @@ use crate::conclude::Output; /// /// 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(long = "chain", required = true, help = "identifier of the chain")] chain_id: ChainId, @@ -175,3 +175,39 @@ pub fn restore_key( keyring.add_key(key_name, key_entry.clone())?; Ok(key_entry) } + +#[cfg(test)] +mod tests { + + use super::KeysAddCmd; + use std::path::PathBuf; + + use abscissa_core::clap::Parser; + use ibc::core::ics24_host::identifier::ChainId; + + #[test] + fn test_keys_add_key_file() { + assert_eq!( + KeysAddCmd{ chain_id: ChainId::from_string("chain_id"), key_file: Some(PathBuf::from("key_file")), mnemonic_file: None, key_name: None, hd_path: "m/44'/118'/0'/0/0".to_string() }, + KeysAddCmd::try_parse_from(&["test", "--chain", "chain_id", "--key-file", "key_file"]).unwrap() + ) + } + + #[test] + fn test_keys_add_mnemonic_file() { + assert_eq!( + KeysAddCmd{ chain_id: ChainId::from_string("chain_id"), key_file: None, mnemonic_file: Some(PathBuf::from("mnemonic_file")), key_name: None, hd_path: "m/44'/118'/0'/0/0".to_string() }, + KeysAddCmd::try_parse_from(&["test", "--chain", "chain_id", "--mnemonic-file", "mnemonic_file"]).unwrap() + ) + } + + #[test] + fn test_keys_add_no_file() { + assert!(KeysAddCmd::try_parse_from(&["test", "--chain", "chain_id"]).is_err()); + } + + #[test] + fn test_keys_add_key_and_mnemonic() { + assert!(KeysAddCmd::try_parse_from(&["test", "--chain", "chain_id", "--key-file", "key_file", "--mnemonic-file", "mnemonic_file"]).is_err()); + } +} \ No newline at end of file From ff8411936208470c0daa4703156b79005218d172 Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Fri, 17 Jun 2022 09:48:03 +0200 Subject: [PATCH 12/37] Added value names to parameters and removed cli parsing unit-tests --- relayer-cli/src/commands/completions.rs | 2 +- relayer-cli/src/commands/create/channel.rs | 5 +++ relayer-cli/src/commands/create/connection.rs | 2 ++ relayer-cli/src/commands/keys/add.rs | 36 ------------------- relayer-cli/src/commands/query/channels.rs | 3 +- relayer-cli/src/commands/query/clients.rs | 7 ++-- relayer-cli/src/commands/tx/client.rs | 29 +++++++++------ 7 files changed, 32 insertions(+), 52 deletions(-) diff --git a/relayer-cli/src/commands/completions.rs b/relayer-cli/src/commands/completions.rs index 392cd9bb13..9bcb31becc 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", arg_enum)] shell: Shell, } diff --git a/relayer-cli/src/commands/create/channel.rs b/relayer-cli/src/commands/create/channel.rs index 8078acbf21..3f8999e43b 100644 --- a/relayer-cli/src/commands/create/channel.rs +++ b/relayer-cli/src/commands/create/channel.rs @@ -47,18 +47,21 @@ pub struct CreateChannelCommand { #[clap( long = "chain-a", required = true, + value_name = "CHAIN_A_ID", help = "Identifier of the side `a` chain for the new channel" )] chain_a: ChainId, #[clap( long = "chain-b", + value_name = "CHAIN_B_ID", help = "Identifier of the side `b` chain for the new channel" )] chain_b: Option, #[clap( long = "conn-a", + value_name = "CONNECTION_A_ID", help = "Identifier of the connection on chain `a` to use in creating the new channel." )] connection_a: Option, @@ -66,6 +69,7 @@ pub struct CreateChannelCommand { #[clap( long = "port-a", required = true, + value_name = "PORT_A_ID", help = "Identifier of the side `a` port for the new channel" )] port_a: PortId, @@ -73,6 +77,7 @@ pub struct CreateChannelCommand { #[clap( long = "port-b", required = true, + value_name = "PORT_B_ID", help = "Identifier of the side `b` port for the new channel" )] port_b: PortId, diff --git a/relayer-cli/src/commands/create/connection.rs b/relayer-cli/src/commands/create/connection.rs index 5ae51fc90b..2949364840 100644 --- a/relayer-cli/src/commands/create/connection.rs +++ b/relayer-cli/src/commands/create/connection.rs @@ -32,12 +32,14 @@ pub struct CreateConnectionCommand { #[clap( long = "client-a", + value_name = "CLIENT_A_ID", help = "identifier of client hosted on chain `a`; default: None (creates a new client)" )] client_a: Option, #[clap( long = "client-b", + value_name = "CLIENT_B_ID", help = "identifier of client hosted on chain `b`; default: None (creates a new client)" )] client_b: Option, diff --git a/relayer-cli/src/commands/keys/add.rs b/relayer-cli/src/commands/keys/add.rs index 67ffcdedd2..c923ad5bd5 100644 --- a/relayer-cli/src/commands/keys/add.rs +++ b/relayer-cli/src/commands/keys/add.rs @@ -174,40 +174,4 @@ pub fn restore_key( keyring.add_key(key_name, key_entry.clone())?; Ok(key_entry) -} - -#[cfg(test)] -mod tests { - - use super::KeysAddCmd; - use std::path::PathBuf; - - use abscissa_core::clap::Parser; - use ibc::core::ics24_host::identifier::ChainId; - - #[test] - fn test_keys_add_key_file() { - assert_eq!( - KeysAddCmd{ chain_id: ChainId::from_string("chain_id"), key_file: Some(PathBuf::from("key_file")), mnemonic_file: None, key_name: None, hd_path: "m/44'/118'/0'/0/0".to_string() }, - KeysAddCmd::try_parse_from(&["test", "--chain", "chain_id", "--key-file", "key_file"]).unwrap() - ) - } - - #[test] - fn test_keys_add_mnemonic_file() { - assert_eq!( - KeysAddCmd{ chain_id: ChainId::from_string("chain_id"), key_file: None, mnemonic_file: Some(PathBuf::from("mnemonic_file")), key_name: None, hd_path: "m/44'/118'/0'/0/0".to_string() }, - KeysAddCmd::try_parse_from(&["test", "--chain", "chain_id", "--mnemonic-file", "mnemonic_file"]).unwrap() - ) - } - - #[test] - fn test_keys_add_no_file() { - assert!(KeysAddCmd::try_parse_from(&["test", "--chain", "chain_id"]).is_err()); - } - - #[test] - fn test_keys_add_key_and_mnemonic() { - assert!(KeysAddCmd::try_parse_from(&["test", "--chain", "chain_id", "--key-file", "key_file", "--mnemonic-file", "mnemonic_file"]).is_err()); - } } \ No newline at end of file diff --git a/relayer-cli/src/commands/query/channels.rs b/relayer-cli/src/commands/query/channels.rs index 3603c490c6..c3c8014847 100644 --- a/relayer-cli/src/commands/query/channels.rs +++ b/relayer-cli/src/commands/query/channels.rs @@ -29,7 +29,8 @@ pub struct QueryChannelsCmd { chain_id: ChainId, #[clap( - long = "dst-chain", + long = "chain-counterparty", + value_name = "CHAIN_COUNTERPARTY_ID", help = "identifier of the channel's destination chain" )] dst_chain_id: Option, diff --git a/relayer-cli/src/commands/query/clients.rs b/relayer-cli/src/commands/query/clients.rs index 384eac5cd6..eb82806a22 100644 --- a/relayer-cli/src/commands/query/clients.rs +++ b/relayer-cli/src/commands/query/clients.rs @@ -18,16 +18,17 @@ use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct QueryAllClientsCmd { #[clap( - long = "chain", + long = "chain-host", required = true, + value_name = "CHAIN_HOST_ID", help = "identifier of the chain to query" )] chain_id: ChainId, #[clap( - long = "src-chain", + long = "chain-reference", help = "filter for clients which target a specific chain id (implies '--omit-chain-ids')", - value_name = "ID" + value_name = "CHAIN_REFERENCE_ID" )] src_chain_id: Option, diff --git a/relayer-cli/src/commands/tx/client.rs b/relayer-cli/src/commands/tx/client.rs index cfd59c2428..c2ff6de1c5 100644 --- a/relayer-cli/src/commands/tx/client.rs +++ b/relayer-cli/src/commands/tx/client.rs @@ -22,16 +22,18 @@ use crate::error::Error; #[derive(Clone, Command, Debug, Parser)] pub struct TxCreateClientCmd { #[clap( - long = "dst-chain", + long = "chain-host", required = true, - help = "identifier of the destination chain" + value_name = "CHAIN_HOST_ID", + help = "identifier of the chain that hosts the client" )] dst_chain_id: ChainId, #[clap( - long = "src-chain", + long = "chain-reference", required = true, - help = "identifier of the source chain" + value_name = "CHAIN_REFERENCE_ID", + help = "identifier of the chain targeted by the client" )] src_chain_id: ChainId, @@ -100,27 +102,31 @@ impl Runnable for TxCreateClientCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxUpdateClientCmd { #[clap( - long = "dst-chain", + long = "chain-host", required = true, - help = "identifier of the destination chain" + value_name = "CHAIN_HOST_ID", + help = "identifier of the chain that hosts the client" )] dst_chain_id: ChainId, #[clap( - long = "dst-client", + long = "client-reference", required = true, - help = "identifier of the client to be updated on destination chain" + value_name = "CHAIN_REFERENCE_ID", + help = "identifier of the chain targeted by the client" )] dst_client_id: ClientId, #[clap( - long = "target-height", + long = "height", + value_name = "REFERENCE_HEIGHT", help = "the target height of the client update" )] target_height: Option, #[clap( long = "trusted-height", + value_name = "REFERENCE_TRUSTED_HEIGHT", help = "the trusted height of the client update" )] trusted_height: Option, @@ -181,7 +187,7 @@ impl Runnable for TxUpdateClientCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxUpgradeClientCmd { #[clap( - long = "chain", + long = "chain-host", required = true, help = "identifier of the chain that hosts the client" )] @@ -238,8 +244,9 @@ impl Runnable for TxUpgradeClientCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxUpgradeClientsCmd { #[clap( - long = "src-chain", + long = "chain-reference", required = true, + value_name = "CHAIN_REFERENCE_ID", help = "identifier of the chain that underwent an upgrade; all clients targeting this chain will be upgraded" )] src_chain_id: ChainId, From 4d3580070c2bfd1168ae9bd4d97ac37032919e18 Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Fri, 17 Jun 2022 09:49:43 +0200 Subject: [PATCH 13/37] Cargo fmt changes --- relayer-cli/src/commands/keys/add.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/relayer-cli/src/commands/keys/add.rs b/relayer-cli/src/commands/keys/add.rs index c923ad5bd5..1847ac67ea 100644 --- a/relayer-cli/src/commands/keys/add.rs +++ b/relayer-cli/src/commands/keys/add.rs @@ -174,4 +174,4 @@ pub fn restore_key( keyring.add_key(key_name, key_entry.clone())?; Ok(key_entry) -} \ No newline at end of file +} From c7e1b9a7cd2de05e62e5f6b62d4d751eb7f8e21f Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Fri, 17 Jun 2022 16:09:38 +0200 Subject: [PATCH 14/37] Updated flags in order to reflect ADR 010 --- relayer-cli/src/commands/clear.rs | 21 +++++++++++-- relayer-cli/src/commands/completions.rs | 2 +- relayer-cli/src/commands/create/channel.rs | 22 +++++++------- relayer-cli/src/commands/create/connection.rs | 15 ++++++---- relayer-cli/src/commands/keys/add.rs | 4 +++ relayer-cli/src/commands/keys/balance.rs | 8 ++++- relayer-cli/src/commands/keys/delete.rs | 9 ++++-- relayer-cli/src/commands/keys/list.rs | 7 ++++- relayer-cli/src/commands/listen.rs | 2 +- relayer-cli/src/commands/misbehaviour.rs | 2 ++ relayer-cli/src/commands/query/channel.rs | 9 +++++- .../src/commands/query/channel_client.rs | 3 ++ .../src/commands/query/channel_ends.rs | 9 +++++- relayer-cli/src/commands/query/channels.rs | 5 ++-- relayer-cli/src/commands/query/client.rs | 24 +++++++++++++-- relayer-cli/src/commands/query/clients.rs | 8 ++--- relayer-cli/src/commands/query/connection.rs | 10 ++++++- relayer-cli/src/commands/query/connections.rs | 1 + relayer-cli/src/commands/query/packet/ack.rs | 16 ++++++++-- relayer-cli/src/commands/query/packet/acks.rs | 3 ++ .../src/commands/query/packet/commitment.rs | 16 ++++++++-- .../src/commands/query/packet/commitments.rs | 3 ++ .../src/commands/query/packet/pending.rs | 3 ++ .../commands/query/packet/unreceived_acks.rs | 15 ++++++++-- .../query/packet/unreceived_packets.rs | 15 ++++++++-- relayer-cli/src/commands/query/tx/events.rs | 8 ++++- relayer-cli/src/commands/tx/client.rs | 30 ++++++++++--------- 27 files changed, 211 insertions(+), 59 deletions(-) diff --git a/relayer-cli/src/commands/clear.rs b/relayer-cli/src/commands/clear.rs index cbfd9fa805..054ac05374 100644 --- a/relayer-cli/src/commands/clear.rs +++ b/relayer-cli/src/commands/clear.rs @@ -23,13 +23,28 @@ pub enum ClearCmds { #[derive(Debug, Parser)] pub struct ClearPacketsCmd { - #[clap(long = "chain", 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 = "port", 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(long = "chan", required = true, help = "identifier of the channel")] + #[clap( + long = "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 9bcb31becc..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(long = "shell", arg_enum)] + #[clap(long = "shell", value_name = "SHELL", arg_enum)] shell: Shell, } diff --git a/relayer-cli/src/commands/create/channel.rs b/relayer-cli/src/commands/create/channel.rs index 3f8999e43b..b4ae11d76a 100644 --- a/relayer-cli/src/commands/create/channel.rs +++ b/relayer-cli/src/commands/create/channel.rs @@ -45,45 +45,46 @@ static HINT: &str = "Consider using the default invocation\n\nhermes create chan #[clap(disable_version_flag = true)] pub struct CreateChannelCommand { #[clap( - long = "chain-a", + long = "a-chain", required = true, - value_name = "CHAIN_A_ID", + value_name = "A_CHAIN_ID", help = "Identifier of the side `a` chain for the new channel" )] chain_a: ChainId, #[clap( - long = "chain-b", - value_name = "CHAIN_B_ID", + long = "b-chain", + value_name = "B_CHAIN_ID", help = "Identifier of the side `b` chain for the new channel" )] chain_b: Option, #[clap( - long = "conn-a", - value_name = "CONNECTION_A_ID", + long = "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 = "port-a", + long = "a-port", required = true, - value_name = "PORT_A_ID", + value_name = "A_PORT_ID", help = "Identifier of the side `a` port for the new channel" )] port_a: PortId, #[clap( - long = "port-b", + long = "b-port", required = true, - value_name = "PORT_B_ID", + value_name = "B_PORT_ID", help = "Identifier of the side `b` port for the new channel" )] port_b: PortId, #[clap( long = "order", + value_name = "ORDER", help = "The channel ordering, valid options 'unordered' (default) and 'ordered'", default_value_t )] @@ -92,6 +93,7 @@ pub struct CreateChannelCommand { #[clap( long = "chan-version", alias = "version", + value_name = "VERSION", help = "The version for the new channel" )] version: Option, diff --git a/relayer-cli/src/commands/create/connection.rs b/relayer-cli/src/commands/create/connection.rs index 2949364840..b4d862a917 100644 --- a/relayer-cli/src/commands/create/connection.rs +++ b/relayer-cli/src/commands/create/connection.rs @@ -18,34 +18,37 @@ use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct CreateConnectionCommand { #[clap( - long = "chain-a", + long = "a-chain", required = true, + value_name = "A_CHAIN_ID", help = "identifier of the side `a` chain for the new connection" )] chain_a_id: ChainId, #[clap( - long = "chain-b", + 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 = "client-a", - value_name = "CLIENT_A_ID", + 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 = "client-b", - value_name = "CLIENT_B_ID", + 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 = "delay", + value_name = "DELAY", help = "delay period parameter for the new connection (seconds)", default_value = "0" )] diff --git a/relayer-cli/src/commands/keys/add.rs b/relayer-cli/src/commands/keys/add.rs index 1847ac67ea..41a594a05b 100644 --- a/relayer-cli/src/commands/keys/add.rs +++ b/relayer-cli/src/commands/keys/add.rs @@ -38,6 +38,7 @@ pub struct KeysAddCmd { #[clap( long = "key-file", required = true, + value_name = "KEY_FILE", help = "path to the key file", group = "add-restore" )] @@ -46,6 +47,7 @@ pub struct KeysAddCmd { #[clap( long = "mnemonic-file", required = true, + value_name = "MNEMONIC_FILE", help = "path to file containing mnemonic to restore the key from", group = "add-restore" )] @@ -53,12 +55,14 @@ pub struct KeysAddCmd { #[clap( 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( long = "hd-path", + value_name = "HD_PATH", help = "derivation path for this key", default_value = "m/44'/118'/0'/0/0" )] diff --git a/relayer-cli/src/commands/keys/balance.rs b/relayer-cli/src/commands/keys/balance.rs index 9008536473..6d911469d5 100644 --- a/relayer-cli/src/commands/keys/balance.rs +++ b/relayer-cli/src/commands/keys/balance.rs @@ -19,11 +19,17 @@ use crate::conclude::{exit_with_unrecoverable_error, json, Output}; /// on the given chain, will be displayed. #[derive(Clone, Command, Debug, Parser)] pub struct KeyBalanceCmd { - #[clap(long = "chain", 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 = "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 3873f7c1e1..f5af54c604 100644 --- a/relayer-cli/src/commands/keys/delete.rs +++ b/relayer-cli/src/commands/keys/delete.rs @@ -12,10 +12,15 @@ use crate::conclude::Output; #[derive(Clone, Command, Debug, Parser)] pub struct KeysDeleteCmd { - #[clap(long = "chain", 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 = "key-name", help = "name of the key")] + #[clap(long = "key-name", value_name = "KEY_NAME", help = "name of the key")] key_name: Option, #[clap(long = "all", help = "delete all keys")] diff --git a/relayer-cli/src/commands/keys/list.rs b/relayer-cli/src/commands/keys/list.rs index bfc978206d..428b1c3c42 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(long = "chain", 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 a646b28e5f..83775f9059 100644 --- a/relayer-cli/src/commands/listen.rs +++ b/relayer-cli/src/commands/listen.rs @@ -61,7 +61,7 @@ impl FromStr for EventFilter { #[derive(Debug, Parser)] pub struct ListenCmd { /// Identifier of the chain to listen for events from - #[clap(long = "chain", required = true)] + #[clap(long = "chain", required = true, value_name = "CHAIN_ID")] chain_id: ChainId, /// Add an event type to listen for, can be repeated. diff --git a/relayer-cli/src/commands/misbehaviour.rs b/relayer-cli/src/commands/misbehaviour.rs index 623f333552..36fb4e3f15 100644 --- a/relayer-cli/src/commands/misbehaviour.rs +++ b/relayer-cli/src/commands/misbehaviour.rs @@ -20,6 +20,7 @@ pub struct MisbehaviourCmd { #[clap( long = "chain", required = true, + value_name = "CHAIN_ID", help = "identifier of the chain where client updates are monitored for misbehaviour" )] chain_id: ChainId, @@ -27,6 +28,7 @@ pub struct MisbehaviourCmd { #[clap( long = "client", required = true, + 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/channel.rs b/relayer-cli/src/commands/query/channel.rs index 1500b53746..af4b52f1b1 100644 --- a/relayer-cli/src/commands/query/channel.rs +++ b/relayer-cli/src/commands/query/channel.rs @@ -18,6 +18,7 @@ pub struct QueryChannelEndCmd { #[clap( long = "chain", required = true, + value_name = "CHAIN_ID", help = "identifier of the chain to query" )] chain_id: ChainId, @@ -25,6 +26,7 @@ pub struct QueryChannelEndCmd { #[clap( long = "port", required = true, + value_name = "PORT_ID", help = "identifier of the port to query" )] port_id: PortId, @@ -32,11 +34,16 @@ pub struct QueryChannelEndCmd { #[clap( long = "chan", required = true, + value_name = "CHANNEL_ID", help = "identifier of the channel to query" )] channel_id: ChannelId, - #[clap(long = "height", 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 88341cb383..1d84fbd6c5 100644 --- a/relayer-cli/src/commands/query/channel_client.rs +++ b/relayer-cli/src/commands/query/channel_client.rs @@ -19,6 +19,7 @@ pub struct QueryChannelClientCmd { #[clap( long = "chain", required = true, + value_name = "CHAIN_ID", help = "identifier of the chain to query" )] chain_id: ChainId, @@ -26,6 +27,7 @@ pub struct QueryChannelClientCmd { #[clap( long = "port", required = true, + value_name = "PORT_ID", help = "identifier of the port to query" )] port_id: PortId, @@ -33,6 +35,7 @@ pub struct QueryChannelClientCmd { #[clap( long = "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 fa3f9c87d9..f731ec40d6 100644 --- a/relayer-cli/src/commands/query/channel_ends.rs +++ b/relayer-cli/src/commands/query/channel_ends.rs @@ -22,6 +22,7 @@ pub struct QueryChannelEndsCmd { #[clap( long = "chain", required = true, + value_name = "CHAIN_ID", help = "identifier of the chain to query" )] chain_id: ChainId, @@ -29,6 +30,7 @@ pub struct QueryChannelEndsCmd { #[clap( long = "port", required = true, + value_name = "PORT_ID", help = "identifier of the port to query" )] port_id: PortId, @@ -36,11 +38,16 @@ pub struct QueryChannelEndsCmd { #[clap( long = "chan", required = true, + value_name = "CHANNEL_ID", help = "identifier of the channel to query" )] channel_id: ChannelId, - #[clap(long = "height", help = "height of the state to query")] + #[clap( + long = "height", + value_name = "HEIGHT", + help = "height of the state to query" + )] height: Option, #[clap( diff --git a/relayer-cli/src/commands/query/channels.rs b/relayer-cli/src/commands/query/channels.rs index c3c8014847..39761f0e70 100644 --- a/relayer-cli/src/commands/query/channels.rs +++ b/relayer-cli/src/commands/query/channels.rs @@ -24,13 +24,14 @@ pub struct QueryChannelsCmd { #[clap( long = "chain", required = true, + value_name = "CHAIN_ID", help = "identifier of the chain to query" )] chain_id: ChainId, #[clap( - long = "chain-counterparty", - value_name = "CHAIN_COUNTERPARTY_ID", + long = "counterparty-chain", + value_name = "COUNTERPARTY_CHAIN_ID", help = "identifier of the channel's destination chain" )] dst_chain_id: Option, diff --git a/relayer-cli/src/commands/query/client.rs b/relayer-cli/src/commands/query/client.rs index 2f93ac0cd2..8d4695ed65 100644 --- a/relayer-cli/src/commands/query/client.rs +++ b/relayer-cli/src/commands/query/client.rs @@ -28,6 +28,7 @@ pub struct QueryClientStateCmd { #[clap( long = "chain", required = true, + value_name = "CHAIN_ID", help = "identifier of the chain to query" )] chain_id: ChainId, @@ -35,11 +36,16 @@ pub struct QueryClientStateCmd { #[clap( long = "client", required = true, + value_name = "CLIENT_ID", help = "identifier of the client to query" )] client_id: ClientId, - #[clap(long = "height", help = "the chain height context for the query")] + #[clap( + long = "height", + value_name = "HEIGHT", + help = "the chain height context for the query" + )] height: Option, } @@ -79,6 +85,7 @@ pub struct QueryClientConsensusCmd { #[clap( long = "chain", required = true, + value_name = "CHAIN_ID", help = "identifier of the chain to query" )] chain_id: ChainId, @@ -86,12 +93,14 @@ pub struct QueryClientConsensusCmd { #[clap( long = "client", required = true, + value_name = "CLIENT_ID", help = "identifier of the client to query" )] client_id: ClientId, #[clap( long = "consensus-height", + value_name = "CONSENSUS_HEIGHT", help = "height of the client's consensus state to query" )] consensus_height: Option, @@ -101,6 +110,7 @@ pub struct QueryClientConsensusCmd { #[clap( long = "height", + value_name = "HEIGHT", help = "the chain height context to be used, applicable only to a specific height" )] height: Option, @@ -182,6 +192,7 @@ pub struct QueryClientHeaderCmd { #[clap( long = "chain", required = true, + value_name = "CHAIN_ID", help = "identifier of the chain to query" )] chain_id: ChainId, @@ -189,6 +200,7 @@ pub struct QueryClientHeaderCmd { #[clap( long = "client", required = true, + value_name = "CLIENT_ID", help = "identifier of the client to query" )] client_id: ClientId, @@ -196,11 +208,16 @@ pub struct QueryClientHeaderCmd { #[clap( long = "consensus-height", required = true, + value_name = "CONSENSUS_HEIGHT", help = "height of header to query" )] consensus_height: u64, - #[clap(long = "height", help = "the chain height context for the query")] + #[clap( + long = "height", + value_name = "HEIGHT", + help = "the chain height context for the query" + )] height: Option, } @@ -261,6 +278,7 @@ pub struct QueryClientConnectionsCmd { #[clap( long = "chain", required = true, + value_name = "CHAIN_ID", help = "identifier of the chain to query" )] chain_id: ChainId, @@ -268,12 +286,14 @@ pub struct QueryClientConnectionsCmd { #[clap( long = "client", required = true, + value_name = "CLIENT_ID", help = "identifier of the client to query" )] client_id: ClientId, #[clap( long = "height", + value_name = "HEIGHT", help = "the chain height which this query should reflect" )] height: Option, diff --git a/relayer-cli/src/commands/query/clients.rs b/relayer-cli/src/commands/query/clients.rs index eb82806a22..7acf2fc8d7 100644 --- a/relayer-cli/src/commands/query/clients.rs +++ b/relayer-cli/src/commands/query/clients.rs @@ -18,17 +18,17 @@ use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct QueryAllClientsCmd { #[clap( - long = "chain-host", + long = "host-chain", required = true, - value_name = "CHAIN_HOST_ID", + value_name = "HOST_CHAIN_ID", help = "identifier of the chain to query" )] chain_id: ChainId, #[clap( - long = "chain-reference", + long = "reference-chain", help = "filter for clients which target a specific chain id (implies '--omit-chain-ids')", - value_name = "CHAIN_REFERENCE_ID" + value_name = "REFERENCE_CHAIN_ID" )] src_chain_id: Option, diff --git a/relayer-cli/src/commands/query/connection.rs b/relayer-cli/src/commands/query/connection.rs index cb583a39c5..0eb4805605 100644 --- a/relayer-cli/src/commands/query/connection.rs +++ b/relayer-cli/src/commands/query/connection.rs @@ -23,6 +23,7 @@ pub struct QueryConnectionEndCmd { #[clap( long = "chain", required = true, + value_name = "CHAIN_ID", help = "identifier of the chain to query" )] chain_id: ChainId, @@ -30,11 +31,16 @@ pub struct QueryConnectionEndCmd { #[clap( long = "conn", required = true, + value_name = "CONNECTION_ID", help = "identifier of the connection to query" )] connection_id: ConnectionId, - #[clap(long = "height", help = "height of the state to query")] + #[clap( + long = "height", + value_name = "HEIGHT", + help = "height of the state to query" + )] height: Option, } @@ -88,6 +94,7 @@ pub struct QueryConnectionChannelsCmd { #[clap( long = "chain", required = true, + value_name = "CHAIN_ID", help = "identifier of the chain to query" )] chain_id: ChainId, @@ -95,6 +102,7 @@ pub struct QueryConnectionChannelsCmd { #[clap( long = "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 f53d88a4ff..51f9964598 100644 --- a/relayer-cli/src/commands/query/connections.rs +++ b/relayer-cli/src/commands/query/connections.rs @@ -16,6 +16,7 @@ pub struct QueryConnectionsCmd { #[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 4227815a67..70ef2dfd2c 100644 --- a/relayer-cli/src/commands/query/packet/ack.rs +++ b/relayer-cli/src/commands/query/packet/ack.rs @@ -17,6 +17,7 @@ pub struct QueryPacketAcknowledgmentCmd { #[clap( long = "chain", required = true, + value_name = "CHAIN_ID", help = "identifier of the chain to query" )] chain_id: ChainId, @@ -24,6 +25,7 @@ pub struct QueryPacketAcknowledgmentCmd { #[clap( long = "port", required = true, + value_name = "PORT_ID", help = "identifier of the port to query" )] port_id: PortId, @@ -31,14 +33,24 @@ pub struct QueryPacketAcknowledgmentCmd { #[clap( long = "chan", required = true, + value_name = "CHANNEL_ID", help = "identifier of the channel to query" )] channel_id: ChannelId, - #[clap(long = "seq", required = true, help = "sequence of packet to query")] + #[clap( + long = "seq", + required = true, + value_name = "SEQUENCE", + help = "sequence of packet to query" + )] sequence: Sequence, - #[clap(long = "height", 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 c50d5f9670..1ba0df863b 100644 --- a/relayer-cli/src/commands/query/packet/acks.rs +++ b/relayer-cli/src/commands/query/packet/acks.rs @@ -24,6 +24,7 @@ pub struct QueryPacketAcknowledgementsCmd { #[clap( long = "chain", required = true, + value_name = "CHAIN_ID", help = "identifier of the chain to query" )] chain_id: ChainId, @@ -31,6 +32,7 @@ pub struct QueryPacketAcknowledgementsCmd { #[clap( long = "port", required = true, + value_name = "PORT_ID", help = "identifier of the port to query" )] port_id: PortId, @@ -38,6 +40,7 @@ pub struct QueryPacketAcknowledgementsCmd { #[clap( long = "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/packet/commitment.rs b/relayer-cli/src/commands/query/packet/commitment.rs index 1de2dcb531..e272f5001f 100644 --- a/relayer-cli/src/commands/query/packet/commitment.rs +++ b/relayer-cli/src/commands/query/packet/commitment.rs @@ -24,6 +24,7 @@ pub struct QueryPacketCommitmentCmd { #[clap( long = "chain", required = true, + value_name = "CHAIN_ID", help = "identifier of the chain to query" )] chain_id: ChainId, @@ -31,6 +32,7 @@ pub struct QueryPacketCommitmentCmd { #[clap( long = "port", required = true, + value_name = "PORT_ID", help = "identifier of the port to query" )] port_id: PortId, @@ -38,14 +40,24 @@ pub struct QueryPacketCommitmentCmd { #[clap( long = "chan", required = true, + value_name = "CHANNEL_ID", help = "identifier of the channel to query" )] channel_id: ChannelId, - #[clap(long = "seq", required = true, help = "sequence of packet to query")] + #[clap( + long = "seq", + required = true, + value_name = "SEQUENCE", + help = "sequence of packet to query" + )] sequence: Sequence, - #[clap(long = "height", 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 b4a156fa56..9e06b7c10b 100644 --- a/relayer-cli/src/commands/query/packet/commitments.rs +++ b/relayer-cli/src/commands/query/packet/commitments.rs @@ -23,6 +23,7 @@ pub struct QueryPacketCommitmentsCmd { #[clap( long = "chain", required = true, + value_name = "CHAIN_ID", help = "identifier of the chain to query" )] chain_id: ChainId, @@ -30,6 +31,7 @@ pub struct QueryPacketCommitmentsCmd { #[clap( long = "port", required = true, + value_name = "PORT_ID", help = "identifier of the port to query" )] port_id: PortId, @@ -37,6 +39,7 @@ pub struct QueryPacketCommitmentsCmd { #[clap( long = "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/packet/pending.rs b/relayer-cli/src/commands/query/packet/pending.rs index 9d4c765439..b4834358ef 100644 --- a/relayer-cli/src/commands/query/packet/pending.rs +++ b/relayer-cli/src/commands/query/packet/pending.rs @@ -34,6 +34,7 @@ pub struct QueryPendingPacketsCmd { #[clap( long = "chain", required = true, + value_name = "CHAIN_ID", help = "identifier of the chain at one end of the channel" )] chain_id: ChainId, @@ -41,6 +42,7 @@ pub struct QueryPendingPacketsCmd { #[clap( long = "port", required = true, + value_name = "PORT_ID", help = "port identifier on the chain given by " )] port_id: PortId, @@ -48,6 +50,7 @@ pub struct QueryPendingPacketsCmd { #[clap( long = "chan", required = true, + 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 afad48463f..831712e7df 100644 --- a/relayer-cli/src/commands/query/packet/unreceived_acks.rs +++ b/relayer-cli/src/commands/query/packet/unreceived_acks.rs @@ -20,14 +20,25 @@ pub struct QueryUnreceivedAcknowledgementCmd { #[clap( long = "chain", required = true, + value_name = "CHAIN_ID", help = "identifier of the chain to query the unreceived acknowledgments" )] chain_id: ChainId, - #[clap(long = "port", required = true, help = "port identifier")] + #[clap( + long = "port", + required = true, + value_name = "PORT_ID", + help = "port identifier" + )] port_id: PortId, - #[clap(long = "chan", required = true, help = "channel identifier")] + #[clap( + long = "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 34cec32185..485c185316 100644 --- a/relayer-cli/src/commands/query/packet/unreceived_packets.rs +++ b/relayer-cli/src/commands/query/packet/unreceived_packets.rs @@ -20,14 +20,25 @@ pub struct QueryUnreceivedPacketsCmd { #[clap( long = "chain", required = true, + value_name = "CHAIN_ID", help = "identifier of the chain for the unreceived sequences" )] chain_id: ChainId, - #[clap(long = "port", required = true, help = "port identifier")] + #[clap( + long = "port", + required = true, + value_name = "PORT_ID", + help = "port identifier" + )] port_id: PortId, - #[clap(long = "chan", required = true, help = "channel identifier")] + #[clap( + long = "chan", + required = true, + value_name = "CHANNEL_ID", + help = "channel identifier" + )] channel_id: ChannelId, } diff --git a/relayer-cli/src/commands/query/tx/events.rs b/relayer-cli/src/commands/query/tx/events.rs index a05106c288..2279ae3d93 100644 --- a/relayer-cli/src/commands/query/tx/events.rs +++ b/relayer-cli/src/commands/query/tx/events.rs @@ -25,11 +25,17 @@ pub struct QueryTxEventsCmd { #[clap( long = "chain", required = true, + value_name = "CHAIN_ID", help = "identifier of the chain to query" )] chain_id: ChainId, - #[clap(long = "hash", required = true, help = "transaction hash to query")] + #[clap( + long = "hash", + required = true, + value_name = "HASH", + help = "transaction hash to query" + )] hash: String, } diff --git a/relayer-cli/src/commands/tx/client.rs b/relayer-cli/src/commands/tx/client.rs index c2ff6de1c5..a0d9cb8bd9 100644 --- a/relayer-cli/src/commands/tx/client.rs +++ b/relayer-cli/src/commands/tx/client.rs @@ -22,17 +22,17 @@ use crate::error::Error; #[derive(Clone, Command, Debug, Parser)] pub struct TxCreateClientCmd { #[clap( - long = "chain-host", + long = "host-chain", required = true, - value_name = "CHAIN_HOST_ID", + value_name = "HOST_CHAIN_ID", help = "identifier of the chain that hosts the client" )] dst_chain_id: ChainId, #[clap( - long = "chain-reference", + long = "reference-chain", required = true, - value_name = "CHAIN_REFERENCE_ID", + value_name = "REFERENCE_CHAIN_ID", help = "identifier of the chain targeted by the client" )] src_chain_id: ChainId, @@ -46,21 +46,21 @@ 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(long = "clock-drift")] + #[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(long = "trusting-period")] + #[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(long = "trust-threshold", 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, } @@ -102,17 +102,17 @@ impl Runnable for TxCreateClientCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxUpdateClientCmd { #[clap( - long = "chain-host", + long = "host-chain", required = true, - value_name = "CHAIN_HOST_ID", + value_name = "HOST_CHAIN_ID", help = "identifier of the chain that hosts the client" )] dst_chain_id: ChainId, #[clap( - long = "client-reference", + long = "client", required = true, - value_name = "CHAIN_REFERENCE_ID", + value_name = "CLIENT_ID", help = "identifier of the chain targeted by the client" )] dst_client_id: ClientId, @@ -187,8 +187,9 @@ impl Runnable for TxUpdateClientCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxUpgradeClientCmd { #[clap( - long = "chain-host", + long = "host-chain", required = true, + value_name = "HOST_CHAIN_ID", help = "identifier of the chain that hosts the client" )] chain_id: ChainId, @@ -196,6 +197,7 @@ pub struct TxUpgradeClientCmd { #[clap( long = "client", required = true, + value_name = "CLIENT_ID", help = "identifier of the client to be upgraded" )] client_id: ClientId, @@ -244,9 +246,9 @@ impl Runnable for TxUpgradeClientCmd { #[derive(Clone, Command, Debug, Parser)] pub struct TxUpgradeClientsCmd { #[clap( - long = "chain-reference", + long = "reference-chain", required = true, - value_name = "CHAIN_REFERENCE_ID", + 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, From c363e047323208afcdd8962a9246ff6b5d82a7a2 Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Fri, 17 Jun 2022 17:13:32 +0200 Subject: [PATCH 15/37] Updated guide to reflect flag changes from ADR 010 --- guide/src/commands/config.md | 2 +- guide/src/commands/global.md | 6 +-- guide/src/commands/keys/index.md | 4 +- guide/src/commands/path-setup/channels.md | 30 ++++++------ guide/src/commands/path-setup/clients.md | 34 ++++++------- guide/src/commands/path-setup/connections.md | 20 ++++---- guide/src/commands/path-setup/index.md | 10 ++-- guide/src/commands/queries/channel.md | 10 ++-- guide/src/commands/queries/client.md | 16 ++++--- guide/src/commands/queries/packet.md | 1 - guide/src/commands/raw/client.md | 28 +++++------ guide/src/commands/raw/upgrade.md | 17 +++---- guide/src/commands/relaying/clear.md | 3 -- guide/src/commands/upgrade/index.md | 6 +-- guide/src/commands/upgrade/test.md | 4 +- guide/src/help.md | 48 ++++++++++--------- guide/src/installation.md | 34 ++++++++----- .../src/tutorials/local-chains/identifiers.md | 2 +- .../src/tutorials/local-chains/raw/client.md | 8 ++-- .../relay-paths/create-new-path.md | 2 +- .../relay-paths/multiple-paths.md | 4 +- 21 files changed, 155 insertions(+), 134 deletions(-) diff --git a/guide/src/commands/config.md b/guide/src/commands/config.md index b80e8b6f42..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 diff --git a/guide/src/commands/global.md b/guide/src/commands/global.md index 927bf50ca7..ef9c9596cd 100644 --- a/guide/src/commands/global.md +++ b/guide/src/commands/global.md @@ -34,7 +34,7 @@ To process all the output using `jq`, one can redirect `stderr` to `stdout` with __Example__ ```shell -hermes --config /home/my_chain.toml --json create client --dst-chain ibc-0 --src-chain 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 --config /home/my_chain.toml --json create client --dst-chain ibc-0 --src-chain 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 --config /home/my_chain.toml --json create client --dst-chain ibc-0 --src-chain 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 b6cbf970eb..08539a220e 100644 --- a/guide/src/commands/keys/index.md +++ b/guide/src/commands/keys/index.md @@ -218,8 +218,8 @@ FLAGS: --chain identifier of the chain OPTIONS: - --key-name NAME name of the key - --all delete all keys + --key-name name of the key + --all delete all keys ``` #### Delete private keys that was previously added to a chain diff --git a/guide/src/commands/path-setup/channels.md b/guide/src/commands/path-setup/channels.md index 87544df7e2..a6fbbe5d9e 100644 --- a/guide/src/commands/path-setup/channels.md +++ b/guide/src/commands/path-setup/channels.md @@ -10,25 +10,27 @@ Use the `create channel` command to establish a new channel. ```shell USAGE: - hermes create channel [OPTIONS] --chain-a --port-a --port-b + 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. FLAGS: - --chain-a Identifier of the side `a` chain for the new channel - --port-a Identifier of the side `a` port for the new channel - --port-b Identifier of the side `b` port 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 -FLAGS: - --chain-b Identifier of the side `b` chain for the new channel - --conn-a Identifier of the connection on chain `a` to use in creating the - new channel. - -h, --help Print help information - --new-client-conn 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] - --chan-version The version for the new channel +OPTIONS: + + --a-conn 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-conn 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 @@ -43,7 +45,7 @@ specifically the one we just created in the example above, with port name `transfer` on both sides: ```shell -hermes create channel --chain-a ibc-0 --conn-a connection-0 --port-a transfer --port-b transfer --order unordered +hermes create channel --a-chain ibc-0 --a-conn connection-0 --a-port transfer --b-port transfer --order unordered ``` Notice that one can omit the destination chain parameter, as Hermes will automatically @@ -206,7 +208,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 --chain-a ibc-0 --chain-b ibc-1 --port-a transfer --port-b transfer --order unordered --new-client-conn +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 44f2074d76..025ae08d80 100644 --- a/guide/src/commands/path-setup/clients.md +++ b/guide/src/commands/path-setup/clients.md @@ -11,14 +11,14 @@ tracking the state of the source chain. ```shell USAGE: - hermes create client [OPTIONS] --dst-chain --src-chain + hermes create client [OPTIONS] --host-chain --reference-chain FLAGS: - --dst-chain - identifier of the destination chain + --host-chain + identifier of the chain that hosts the client - --src-chain - identifier of the source chain + --reference-chain + identifier of the chain targeted by the client OPTIONS: --clock-drift @@ -49,7 +49,7 @@ __Example__ Create a new client on `ibc-0` which tracks `ibc-1`: ```shell -hermes create client --dst-chain ibc-0 --src-chain ibc-1 +hermes create client --host-chain ibc-0 --reference-chain ibc-1 ``` ```json @@ -81,19 +81,21 @@ Specific update and trusted heights can be specified. ```shell USAGE: - hermes update client [OPTIONS] --dst-chain --dst-client + hermes update client [OPTIONS] --host-chain --client FLAGS: - --dst-chain - identifier of the destination chain + --host-chain + identifier of the chain that hosts the client - --dst-client - identifier of the client to be updated on destination chain + --client + identifier of the chain targeted by the client OPTIONS: - -h, --help Print help information - --target-height the target height of the client update - --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__ @@ -101,7 +103,7 @@ __Update client with latest header__ the client on `ibc-0` with latest header of `ibc-1`: ```shell -hermes update client --dst-chain ibc-0 --dst-client 07-tendermint-9 +hermes update client --host-chain ibc-0 --client 07-tendermint-9 ``` ```json @@ -129,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 --dst-chain ibc-0 --dst-client 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 ce2d6fda4e..5bea038052 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 [OPTIONS] --chain-a + hermes create connection [OPTIONS] --a-chain DESCRIPTION: Create a new connection between two chains FLAGS: - --chain-a identifier of the side `a` chain for the new connection + --a-chain identifier of the side `a` chain for the new connection OPTIONS: - --chain-b identifier of the side `b` chain for the new connection - --client-a identifier of client hosted on chain `a`; default: None (creates a new client) - --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-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 @@ OPTIONS: Create a new connection between `ibc-0` and `ibc-1` over new clients: ```shell -hermes create connection --chain-a ibc-0 --chain-b ibc-1 +hermes create connection --a-chain ibc-0 --b-chain ibc-1 ``` ```json @@ -202,10 +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 --chain-a 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..f632ad8907 100644 --- a/guide/src/commands/path-setup/index.md +++ b/guide/src/commands/path-setup/index.md @@ -21,10 +21,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) ``` ## Update diff --git a/guide/src/commands/queries/channel.md b/guide/src/commands/queries/channel.md index 8614260158..033b64f938 100644 --- a/guide/src/commands/queries/channel.md +++ b/guide/src/commands/queries/channel.md @@ -14,12 +14,14 @@ DESCRIPTION: Query the identifiers of all channels on a given chain FLAGS: - --chain identifier of the chain to query + --chain + identifier of the chain to query OPTIONS: - --dst-chain identifier of the channel's destination chain - --verbose enable verbose output, displaying all client and connection - ids + --counterparty-chain + identifier of the channel's destination chain + --verbose + enable verbose output, displaying all client and connection ids ``` __Example__ diff --git a/guide/src/commands/queries/client.md b/guide/src/commands/queries/client.md index 0c5567ef37..37cbf1435e 100644 --- a/guide/src/commands/queries/client.md +++ b/guide/src/commands/queries/client.md @@ -9,17 +9,21 @@ Use the `query clients` command to query the identifiers of all clients on a giv ```shell USAGE: - hermes query clients [OPTIONS] --chain + hermes query clients [OPTIONS] --host-chain DESCRIPTION: Query the identifiers of all clients on a chain FLAGS: - --chain identifier of the chain to query + --host-chain + identifier of the chain to query OPTIONS: - --src-chain filter for clients which target a specific chain id (implies '--omit-chain-ids') - --omit-chain-ids omit printing the source chain for each client (default: false) + --omit-chain-ids + omit printing the source chain for each client + + --reference-chain + filter for clients which target a specific chain id (implies '--omit-chain-ids') ``` __Example__ @@ -27,7 +31,7 @@ __Example__ Query all clients on `ibc-1`: ```shell -hermes query clients --chain ibc-1 +hermes query clients --host-chain ibc-1 ``` ```json @@ -56,7 +60,7 @@ Success: [ Query all clients on `ibc-1` having `ibc-2` as their source chain: ```shell -hermes query clients --chain ibc-1 --src-chain ibc-2 +hermes query clients --host-chain ibc-1 --reference-chain ibc-2 ``` ```json diff --git a/guide/src/commands/queries/packet.md b/guide/src/commands/queries/packet.md index 01f5e5278e..647a280df6 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 diff --git a/guide/src/commands/raw/client.md b/guide/src/commands/raw/client.md index 39db753216..6d35f638ef 100644 --- a/guide/src/commands/raw/client.md +++ b/guide/src/commands/raw/client.md @@ -9,17 +9,17 @@ Use the `create-client` command to create a new client. ```shell USAGE: - hermes tx raw create-client [OPTIONS] --dst-chain --src-chain + hermes tx raw create-client [OPTIONS] --host-chain --reference-chain DESCRIPTION: Create a client for source chain on destination chain FLAGS: - --dst-chain - identifier of the destination chain + --host-chain + identifier of the chain that hosts the client - --src-chain - identifier of the source chain + --reference-chain + identifier of the chain targeted by the client OPTIONS: --clock-drift @@ -38,7 +38,7 @@ __Example__ Create a new client of `ibc-1` on `ibc-0`: ```shell -hermes tx raw create-client --dst-chain ibc-0 --src-chain ibc-1 +hermes tx raw create-client --host-chain ibc-0 --reference-chain ibc-1 ``` ```json @@ -66,24 +66,24 @@ Specific update and trusted heights can be specified. ```shell USAGE: - hermes tx raw update-client [OPTIONS] --dst-chain --dst-client + hermes tx raw update-client [OPTIONS] --host-chain --client DESCRIPTION: Update the specified client on destination chain FLAGS: - --dst-chain - identifier of the destination chain + --host-chain + identifier of the chain that hosts the client - --dst-client - identifier of the client to be updated on destination chain + --client + identifier of the chain targeted by the client OPTIONS: - --target-height + --height the target height of the client update - --trusted-height + --trusted-height the trusted height of the client update ``` @@ -92,7 +92,7 @@ __Example__ Update the client on `ibc-0` with latest header of `ibc-1` ```shell -hermes tx raw update-client --dst-chain ibc-0 --dst-client 07-tendermint-0 +hermes tx raw update-client --host-chain ibc-0 --client 07-tendermint-0 ``` ```json diff --git a/guide/src/commands/raw/upgrade.md b/guide/src/commands/raw/upgrade.md index 4244e71ab3..b04268ba5f 100644 --- a/guide/src/commands/raw/upgrade.md +++ b/guide/src/commands/raw/upgrade.md @@ -10,14 +10,14 @@ Use this to perform the upgrade for the given client. ```shell USAGE: - hermes tx raw upgrade-client --chain --client + hermes tx raw upgrade-client --host-chain --client DESCRIPTION: Upgrade the specified client on destination chain FLAGS: - --chain identifier of the chain that hosts the client - --client identifier of the client to be upgraded + --client identifier of the client to be upgraded + --host-chain identifier of the chain that hosts the client ``` __Example__ @@ -25,7 +25,7 @@ __Example__ A given client is upgraded: ```shell -hermes tx raw upgrade-client --chain ibc-1 --client 07-tendermint-0 +hermes tx raw upgrade-client --host-chain ibc-1 --client 07-tendermint-0 ```` ``` @@ -60,14 +60,15 @@ Use this to perform the upgrade on all the clients. ```shell USAGE: - hermes tx raw upgrade-clients --src-chain + hermes tx raw upgrade-clients --reference-chain DESCRIPTION: Upgrade all IBC clients that target a specific chain FLAGS: - --src-chain identifier of the chain that underwent an upgrade; all clients - targeting this chain will be upgraded + --reference-chain + identifier of the chain that underwent an upgrade; all clients targeting this chain will + be upgraded ``` __Example__ @@ -75,7 +76,7 @@ __Example__ All the clients are upgraded: ```shell -hermes tx raw upgrade-clients --chain ibc-1 +hermes tx raw upgrade-clients --reference-chain ibc-1 ```` ``` diff --git a/guide/src/commands/relaying/clear.md b/guide/src/commands/relaying/clear.md index e0d25a6631..46588aefd3 100644 --- a/guide/src/commands/relaying/clear.md +++ b/guide/src/commands/relaying/clear.md @@ -21,9 +21,6 @@ FLAGS: --chain identifier of the chain --chan identifier of the channel --port identifier of the port - -OPTIONS: - -h, --help Print help information ``` ### Example diff --git a/guide/src/commands/upgrade/index.md b/guide/src/commands/upgrade/index.md index d4d4538680..2251baa45f 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 --chain --client + hermes upgrade client --host-chain --client DESCRIPTION: Upgrade an IBC client FLAGS: - --chain identifier of the chain that hosts the client - --client identifier of the client to be upgraded + --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 803f323fcf..5e4f330bbe 100644 --- a/guide/src/commands/upgrade/test.md +++ b/guide/src/commands/upgrade/test.md @@ -37,7 +37,7 @@ __With gm__ 1. Create one client on `ibc-1` for `ibc-0`: ```shell - hermes create client --dst-chain ibc-1 --src-chain ibc-0 + hermes create client --host-chain ibc-1 --reference-chain ibc-0 ``` ```json @@ -229,7 +229,7 @@ __With gm__ and another for the upgraded state. ```shell - hermes upgrade client --chain ibc-1 --client 07-tendermint-0 + hermes upgrade client --host-chain ibc-1 --client 07-tendermint-0 ``` ```json Success: [ diff --git a/guide/src/help.md b/guide/src/help.md index aa61bbcea2..055324fea6 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,26 +62,26 @@ hermes help create channel ``` USAGE: - hermes create channel [OPTIONS] --chain-a --port-a --port-b + 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 FLAGS: - --chain-a Identifier of the side `a` chain for the new channel - --port-a Identifier of the side `a` port for the new channel - --port-b Identifier of the side `b` port 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: - --chain-b Identifier of the side `b` chain for the new channel - --chan-version The version for the new channel - --conn-a Identifier of the connection on chain `a` to use in creating the - new channel. - --new-client-conn 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] + --a-conn 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-conn 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 @@ -410,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 -c 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 -c 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 -c 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 -c config.toml query channel end --chain ibc-0 --port transfer --chan channel-0 + hermes -c config.toml query channel end --chain ibc-1 --port transfer --chan channel-1 ``` @@ -517,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..fbd3f69150 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 47d6913288..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 --dst-chain ibc-1 --src-chain ibc-0 +hermes tx raw create-client --host-chain ibc-1 --reference-chain ibc-0 ``` ```json diff --git a/guide/src/tutorials/local-chains/raw/client.md b/guide/src/tutorials/local-chains/raw/client.md index c84f389a65..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 --dst-chain ibc-0 --src-chain 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`: @@ -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 --dst-chain ibc-1 --src-chain 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 --dst-chain ibc-0 --dst-client 07-tendermint-0 +hermes tx raw update-client --host-chain ibc-0 --client 07-tendermint-0 ``` ```shell -hermes tx raw update-client --dst-chain ibc-1 --dst-client 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/relay-paths/create-new-path.md b/guide/src/tutorials/local-chains/relay-paths/create-new-path.md index dc95686d2e..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 --chain-a ibc-0 --chain-b ibc-1 --port-a transfer --port-b transfer --new-client-conn +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 7f3cac5db4..1161aa12f2 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 --chain-a ibc-0 --chain-b ibc-1 --port-a transfer --port-b transfer --new-client-conn + 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 --chain-a ibc-1 --chain-b ibc-2 --port-a transfer --port-b transfer --new-client-conn + hermes create channel --a-chain ibc-1 --b-chain ibc-2 --a-port transfer --b-port transfer --new-client-conn ``` ```json From 9e6d309eb4dca44ef5d35bd31f85194ff3690e5a Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Fri, 17 Jun 2022 17:28:52 +0200 Subject: [PATCH 16/37] Updated gm script and e2e tests to match flag changes from ADR 010 --- e2e/e2e/client.py | 4 ++-- scripts/gm/bin/lib-gm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/e2e/e2e/client.py b/e2e/e2e/client.py index 7e958226e5..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 ["--dst-chain", self.dst_chain_id, "--src-chain", 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 ["--dst-chain", self.dst_chain_id, "--dst-client", 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']) diff --git a/scripts/gm/bin/lib-gm b/scripts/gm/bin/lib-gm index a2a2266a2c..4176894b4f 100644 --- a/scripts/gm/bin/lib-gm +++ b/scripts/gm/bin/lib-gm @@ -1051,7 +1051,7 @@ hermes_cc() { do for j in $(seq $((i+1)) $N) do - echo "\"${HERMES_BINARY}\" create channel --chain-a $(n_from_a "$i" "$CHAINS") --chain-b $(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 } From 89bfbf6961fc54ae899ff58514d65d612628ae3d Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Mon, 20 Jun 2022 10:26:54 +0200 Subject: [PATCH 17/37] Fixed ADR 010 typo --- docs/architecture/adr-010-unified-cli-arguments-hermes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/architecture/adr-010-unified-cli-arguments-hermes.md b/docs/architecture/adr-010-unified-cli-arguments-hermes.md index f39aea60b5..b392287021 100644 --- a/docs/architecture/adr-010-unified-cli-arguments-hermes.md +++ b/docs/architecture/adr-010-unified-cli-arguments-hermes.md @@ -115,7 +115,7 @@ __Connection__ * Optional: `[--height ]` * `query connections --chain ` - * Optional: `[--chain-counterparty ] [--verbose]` + * Optional: `[--counterparty-chain ] [--verbose]` __Channel__ From 01aeaac0bcdb077b0db816b2305f360e8a459868 Mon Sep 17 00:00:00 2001 From: Sean Chen Date: Tue, 21 Jun 2022 13:37:56 -0500 Subject: [PATCH 18/37] Remove short flags from `key` error messages --- relayer-cli/src/commands/keys/delete.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/relayer-cli/src/commands/keys/delete.rs b/relayer-cli/src/commands/keys/delete.rs index f5af54c604..09dd10bb8a 100644 --- a/relayer-cli/src/commands/keys/delete.rs +++ b/relayer-cli/src/commands/keys/delete.rs @@ -38,12 +38,12 @@ impl KeysDeleteCmd { let id = match (self.all, &self.key_name) { (true, Some(_)) => { - return Err("cannot set both -k/--key-name and -a/--all" + return Err("cannot set both --key-name and --all" .to_owned() .into()); } (false, None) => { - return Err("must provide either -k/--key-name or -a/--all" + return Err("must provide either --key-name or --all" .to_owned() .into()); } From f5ee6dd01259e50fd1af5115dc16db75b8be574d Mon Sep 17 00:00:00 2001 From: Sean Chen Date: Tue, 21 Jun 2022 13:58:14 -0500 Subject: [PATCH 19/37] Fix inconsistent error messaging in channel.rs --- relayer-cli/src/commands/create/channel.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/relayer-cli/src/commands/create/channel.rs b/relayer-cli/src/commands/create/channel.rs index 90c376bb31..b4d83f07c1 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-conn \n\nto re-use a pre-existing connection."; /// The data structure that represents all the possible options when invoking /// the `create channel` CLI command. @@ -139,7 +139,7 @@ impl Runnable for CreateChannelCommand { } } else { Output::error( - "The `--new-client-connection` flag is required if invoking with `--chain-b`".to_string() + "The `--new-client-conn` flag is required if invoking with `--chain-b`".to_string() ) .exit(); } From 3f923de40a90742938b5b720566844ca6e00c467 Mon Sep 17 00:00:00 2001 From: Sean Chen Date: Tue, 21 Jun 2022 16:01:49 -0500 Subject: [PATCH 20/37] Fix more inconsistent error messaging --- relayer-cli/src/commands/create/channel.rs | 4 ++-- relayer-cli/src/commands/create/connection.rs | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/relayer-cli/src/commands/create/channel.rs b/relayer-cli/src/commands/create/channel.rs index b4d83f07c1..e9f3d7dc80 100644 --- a/relayer-cli/src/commands/create/channel.rs +++ b/relayer-cli/src/commands/create/channel.rs @@ -30,11 +30,11 @@ static HINT: &str = "Consider using the default invocation\n\nhermes create chan /// /// There are two possible ways to invoke this command: /// -/// `create channel --chain-a --conn-a --port-a --port-b ` is the default +/// `create channel --a-chain --a-conn --a-port --b-port ` is the default /// way in which this command should be used, specifying a `Connection-ID` for this new channel /// to re-use. The command expects that `Connection-ID` is associated with chain A. /// -/// `create channel --chain-a --chain-b --port-a --port-b --new-client-conn` +/// `create channel --a-chain --b-chain --a-port --b-port --new-client-conn` /// to indicate that a new connection/client pair is being created as part of this new channel. /// This brings up an interactive yes/no prompt to ensure that the operator at least /// considers the fact that they're initializing a new connection with the channel. diff --git a/relayer-cli/src/commands/create/connection.rs b/relayer-cli/src/commands/create/connection.rs index c346bfa0fc..3ec5d4be64 100644 --- a/relayer-cli/src/commands/create/connection.rs +++ b/relayer-cli/src/commands/create/connection.rs @@ -54,9 +54,9 @@ pub struct CreateConnectionCommand { delay: u64, } -// cargo run --bin hermes -- create connection --chain-a ibc-0 --chain-b ibc-1 -// cargo run --bin hermes -- create connection --chain-a ibc-0 --chain-b ibc-1 --delay 100 -// cargo run --bin hermes -- create connection --chain-a ibc-0 --client-a 07-tendermint-0 --client-b 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 { @@ -76,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(); } @@ -116,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(), }; @@ -147,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(), }; From 7b28a0350f29f15b8c7a10258bc175ce20243019 Mon Sep 17 00:00:00 2001 From: Sean Chen Date: Tue, 21 Jun 2022 16:30:34 -0500 Subject: [PATCH 21/37] Run cargo fmt --- relayer-cli/src/commands/create/channel.rs | 7 ++++--- relayer-cli/src/commands/keys/delete.rs | 8 ++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/relayer-cli/src/commands/create/channel.rs b/relayer-cli/src/commands/create/channel.rs index e9f3d7dc80..33a1a51c7b 100644 --- a/relayer-cli/src/commands/create/channel.rs +++ b/relayer-cli/src/commands/create/channel.rs @@ -139,9 +139,10 @@ impl Runnable for CreateChannelCommand { } } else { Output::error( - "The `--new-client-conn` flag is required if invoking with `--chain-b`".to_string() - ) - .exit(); + "The `--new-client-conn` flag is required if invoking with `--chain-b`" + .to_string(), + ) + .exit(); } } None => Output::error("Missing one of `` or ``".to_string()) diff --git a/relayer-cli/src/commands/keys/delete.rs b/relayer-cli/src/commands/keys/delete.rs index 09dd10bb8a..65d69b9e97 100644 --- a/relayer-cli/src/commands/keys/delete.rs +++ b/relayer-cli/src/commands/keys/delete.rs @@ -38,14 +38,10 @@ impl KeysDeleteCmd { let id = match (self.all, &self.key_name) { (true, Some(_)) => { - return Err("cannot set both --key-name and --all" - .to_owned() - .into()); + return Err("cannot set both --key-name and --all".to_owned().into()); } (false, None) => { - return Err("must provide either --key-name or --all" - .to_owned() - .into()); + return Err("must provide either --key-name or --all".to_owned().into()); } (true, None) => KeysDeleteId::All, (false, Some(ref key_name)) => KeysDeleteId::Named(key_name), From ca4a26dda678f5de77ad20b9b51a6bb21a57f84d Mon Sep 17 00:00:00 2001 From: Sean Chen Date: Wed, 22 Jun 2022 16:06:33 -0500 Subject: [PATCH 22/37] Fix commands that use deprecated `-c` flag --- guide/src/commands/upgrade/test.md | 2 +- guide/src/help.md | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/guide/src/commands/upgrade/test.md b/guide/src/commands/upgrade/test.md index 5e4f330bbe..5f38ece8e0 100644 --- a/guide/src/commands/upgrade/test.md +++ b/guide/src/commands/upgrade/test.md @@ -269,7 +269,7 @@ If the command fails with the error: 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 check with the INFO output of the command: +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 diff --git a/guide/src/help.md b/guide/src/help.md index 055324fea6..87d3909515 100644 --- a/guide/src/help.md +++ b/guide/src/help.md @@ -91,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: @@ -419,26 +419,26 @@ In order to test the correct operation during the channel close, perform the ste to close-open: ```shell - hermes -c 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 + 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 --dst-chain ibc-0 --src-chain ibc-1 --src-port transfer --src-chan 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 --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 + 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 --chain ibc-0 --port transfer --chan channel-0 - hermes -c config.toml query channel end --chain ibc-1 --port transfer --chan channel-1 + hermes --config config.toml query channel end --chain ibc-0 --port transfer --chan channel-0 + hermes --config config.toml query channel end --chain ibc-1 --port transfer --chan channel-1 ``` From d4218da5c2373c4543b92f1bb5e1c879001b90ac Mon Sep 17 00:00:00 2001 From: Adi Seredinschi Date: Fri, 24 Jun 2022 10:23:30 +0300 Subject: [PATCH 23/37] Added the query transfer subcommand in docs. --- docs/architecture/adr-010-unified-cli-arguments-hermes.md | 4 ++++ guide/src/commands/queries/index.md | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/architecture/adr-010-unified-cli-arguments-hermes.md b/docs/architecture/adr-010-unified-cli-arguments-hermes.md index b392287021..5b15b22bf6 100644 --- a/docs/architecture/adr-010-unified-cli-arguments-hermes.md +++ b/docs/architecture/adr-010-unified-cli-arguments-hermes.md @@ -148,6 +148,10 @@ __Packet__ * `query packet unreceived-packets --chain --port --chan ` +__Transfer__ + +* `query transfer denom-trace --chain --hash ` + __Tx__ * `query tx events --chain --hash ` diff --git a/guide/src/commands/queries/index.md b/guide/src/commands/queries/index.md index e40396b304..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,5 +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 ``` From a28dc78875ef8023fd1098e998d1b367960a0fe0 Mon Sep 17 00:00:00 2001 From: Adi Seredinschi Date: Fri, 24 Jun 2022 10:30:38 +0300 Subject: [PATCH 24/37] Scrub query clients --- guide/src/commands/queries/client.md | 7 ++++--- relayer-cli/src/commands/query/clients.rs | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/guide/src/commands/queries/client.md b/guide/src/commands/queries/client.md index 37cbf1435e..4b6f64f948 100644 --- a/guide/src/commands/queries/client.md +++ b/guide/src/commands/queries/client.md @@ -5,7 +5,8 @@ # 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: @@ -20,7 +21,7 @@ FLAGS: OPTIONS: --omit-chain-ids - omit printing the source chain for each client + 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') @@ -57,7 +58,7 @@ 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 --host-chain ibc-1 --reference-chain ibc-2 diff --git a/relayer-cli/src/commands/query/clients.rs b/relayer-cli/src/commands/query/clients.rs index 61d30520cd..df3ada5dc5 100644 --- a/relayer-cli/src/commands/query/clients.rs +++ b/relayer-cli/src/commands/query/clients.rs @@ -32,7 +32,7 @@ pub struct QueryAllClientsCmd { #[clap( long = "omit-chain-ids", - help = "omit printing the source chain for each client" + help = "omit printing the reference (or target) chain for each client" )] omit_chain_ids: bool, } From 52a83c9abcb536a168cfd5316a79befca91314c0 Mon Sep 17 00:00:00 2001 From: Adi Seredinschi Date: Fri, 24 Jun 2022 10:42:31 +0300 Subject: [PATCH 25/37] Scrub query client state --- guide/src/commands/queries/client.md | 2 +- relayer-cli/src/commands/query.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/guide/src/commands/queries/client.md b/guide/src/commands/queries/client.md index 4b6f64f948..a7daede06c 100644 --- a/guide/src/commands/queries/client.md +++ b/guide/src/commands/queries/client.md @@ -99,7 +99,7 @@ USAGE: hermes query client state [OPTIONS] --chain --client DESCRIPTION: - Query client full state + Query the client state FLAGS: --chain identifier of the chain to query 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 From 2624c7aef480836865ce5d03eb077af02dd1aa01 Mon Sep 17 00:00:00 2001 From: Adi Seredinschi Date: Fri, 24 Jun 2022 10:44:07 +0300 Subject: [PATCH 26/37] Removed excessive debug line --- relayer/src/spawn.rs | 2 -- 1 file changed, 2 deletions(-) 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), From 7612d8b1e890a7c148d90f7a6698b32e56024ba5 Mon Sep 17 00:00:00 2001 From: Adi Seredinschi Date: Fri, 24 Jun 2022 11:19:48 +0300 Subject: [PATCH 27/37] Disabled filtering for query channels CLI --- guide/src/commands/queries/channel.md | 5 ++--- relayer-cli/src/commands/query/channels.rs | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/guide/src/commands/queries/channel.md b/guide/src/commands/queries/channel.md index 033b64f938..dcdf6fb27d 100644 --- a/guide/src/commands/queries/channel.md +++ b/guide/src/commands/queries/channel.md @@ -18,10 +18,9 @@ FLAGS: identifier of the chain to query OPTIONS: - --counterparty-chain - identifier of the channel's destination chain --verbose - enable verbose output, displaying all client and connection ids + enable verbose output, displaying the client and connection ids for each channel in the + response ``` __Example__ diff --git a/relayer-cli/src/commands/query/channels.rs b/relayer-cli/src/commands/query/channels.rs index 1b6b9fb9bc..461e6d6177 100644 --- a/relayer-cli/src/commands/query/channels.rs +++ b/relayer-cli/src/commands/query/channels.rs @@ -28,16 +28,17 @@ pub struct QueryChannelsCmd { )] chain_id: ChainId, - #[clap( - long = "counterparty-chain", - value_name = "COUNTERPARTY_CHAIN_ID", - help = "identifier of the channel's destination chain" - )] - dst_chain_id: Option, - + // 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( long = "verbose", - help = "enable verbose output, displaying all client and connection ids" + help = "enable verbose output, displaying the client and connection ids for each channel in the response" )] verbose: bool, } @@ -93,7 +94,7 @@ fn run_query_channels( let channel_ends = query_channel_ends( &mut registry, &chain, - cmd.dst_chain_id.as_ref(), + None, channel_end, connection_id, chain_id, From 840a51c48fccaf53b1d3291265be5d3bfa317998 Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Tue, 28 Jun 2022 12:00:28 +0200 Subject: [PATCH 28/37] Added aliases for 'connection', 'channel' and 'sequence' flags --- .../adr-010-unified-cli-arguments-hermes.md | 30 +- guide/src/commands/path-setup/channels.md | 24 +- guide/src/commands/queries/channel.md | 38 +-- guide/src/commands/queries/connection.md | 18 +- guide/src/commands/queries/packet.md | 78 ++--- guide/src/commands/relaying/clear.md | 14 +- guide/src/config.md | 2 +- guide/src/help.md | 26 +- .../src/tutorials/local-chains/raw/channel.md | 4 +- .../tutorials/local-chains/raw/connection.md | 4 +- .../src/tutorials/local-chains/raw/packet.md | 6 +- .../relay-paths/multiple-paths.md | 8 +- relayer-cli/src/commands/clear.rs | 3 +- relayer-cli/src/commands/create/channel.rs | 8 +- .../src/commands/create/channel.rs.orig | 272 ------------------ relayer-cli/src/commands/query/channel.rs | 3 +- .../src/commands/query/channel_client.rs | 5 +- .../src/commands/query/channel_ends.rs | 3 +- relayer-cli/src/commands/query/connection.rs | 8 +- relayer-cli/src/commands/query/packet/ack.rs | 6 +- relayer-cli/src/commands/query/packet/acks.rs | 5 +- .../src/commands/query/packet/commitment.rs | 6 +- .../src/commands/query/packet/commitments.rs | 5 +- .../src/commands/query/packet/pending.rs | 3 +- .../commands/query/packet/unreceived_acks.rs | 3 +- .../query/packet/unreceived_packets.rs | 3 +- 26 files changed, 165 insertions(+), 420 deletions(-) delete mode 100644 relayer-cli/src/commands/create/channel.rs.orig diff --git a/docs/architecture/adr-010-unified-cli-arguments-hermes.md b/docs/architecture/adr-010-unified-cli-arguments-hermes.md index 5b15b22bf6..520935707b 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` @@ -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,9 +109,9 @@ __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 ` @@ -119,12 +119,12 @@ __Connection__ __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,21 @@ __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 --chan ` +* `query packet pending --chain --port --channel ` -* `query packet unreceived-acks --chain --port --chan ` +* `query packet unreceived-acks --chain --port --channel ` -* `query packet unreceived-packets --chain --port --chan ` +* `query packet unreceived-packets --chain --port --channel ` __Transfer__ diff --git a/guide/src/commands/path-setup/channels.md b/guide/src/commands/path-setup/channels.md index a6fbbe5d9e..9921445c71 100644 --- a/guide/src/commands/path-setup/channels.md +++ b/guide/src/commands/path-setup/channels.md @@ -17,20 +17,20 @@ DESCRIPTION: Alternatively, create a new client and a new connection underlying the new channel if a pre-existing connection is not provided. FLAGS: - --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 + --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-conn 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-conn 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] + --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 @@ -45,7 +45,7 @@ specifically the one we just created in the example above, with port name `transfer` on both sides: ```shell -hermes create channel --a-chain ibc-0 --a-conn connection-0 --a-port transfer --b-port transfer --order 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 diff --git a/guide/src/commands/queries/channel.md b/guide/src/commands/queries/channel.md index dcdf6fb27d..8ea8b3468c 100644 --- a/guide/src/commands/queries/channel.md +++ b/guide/src/commands/queries/channel.md @@ -75,18 +75,18 @@ Use the `query channel end` command to query the channel end: ```shell USAGE: - hermes query channel end [OPTIONS] --chain --port --chan + hermes query channel end [OPTIONS] --chain --port --channel DESCRIPTION: Query channel end FLAGS: - --chain identifier of the chain to query - --chan identifier of the channel to query - --port 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 OPTIONS: - --height height of the state to query + --height height of the state to query ``` __Example__ @@ -94,7 +94,7 @@ __Example__ Query the channel end of channel `channel-1` on port `transfer` on `ibc-1`: ```shell -hermes query channel end --chain ibc-1 --port transfer --chan channel-1 +hermes query channel end --chain ibc-1 --port transfer --channel channel-1 ``` ```json @@ -127,20 +127,20 @@ Use the `query channel ends` command to obtain both ends of a channel: ```shell USAGE: - hermes query channel ends [OPTIONS] --chain --port --chan + hermes query channel ends [OPTIONS] --chain --port --channel DESCRIPTION: Query channel ends and underlying connection and client objects FLAGS: - --chain identifier of the chain to query - --chan identifier of the channel to query - --port 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 OPTIONS: - --height height of the state to query - --verbose enable verbose output, displaying all details of channels, - connections & clients + --height height of the state to query + --verbose enable verbose output, displaying all details of channels, + connections & clients ``` __Example__ @@ -148,7 +148,7 @@ __Example__ Query the channel end of channel `channel-1` on port `transfer` on `ibc-0`: ```shell -hermes query channel ends --chain ibc-0 --port transfer --chan channel-1 +hermes query channel ends --chain ibc-0 --port transfer --channel channel-1 ``` ```json @@ -197,15 +197,15 @@ Use the `query channel client` command to obtain the channel's client state: ```shell USAGE: - hermes query channel client --chain --port --chan + hermes query channel client --chain --port --channel DESCRIPTION: Query channel's client state FLAGS: - --chain identifier of the chain to query - --chan identifier of the channel to query - --port 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: @@ -314,7 +314,7 @@ Success: Some( **JSON:** ```shell - hermes --json query channel client --chain --port --chan + 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/connection.md b/guide/src/commands/queries/connection.md index 379d6d3dd3..3028728e37 100644 --- a/guide/src/commands/queries/connection.md +++ b/guide/src/commands/queries/connection.md @@ -58,17 +58,17 @@ Use the `query connection end` command to query the connection end: ```shell USAGE: - hermes query connection end [OPTIONS] --chain --conn + hermes query connection end [OPTIONS] --chain --connection DESCRIPTION: Query connection end FLAGS: - --chain identifier of the chain to query - --conn identifier of the connection to query + --chain identifier of the chain to query + --connection identifier of the connection to query OPTIONS: - --height height of the state to query + --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 --chain ibc-1 --conn 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 --chain --conn + hermes query connection channels --chain --connection DESCRIPTION: Query connection channels FLAGS: - --chain identifier of the chain to query - --conn identifier of the connection to query + --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 --chain ibc-1 --conn connection-1 +hermes query connection channels --chain ibc-1 --connection connection-1 ``` ```json diff --git a/guide/src/commands/queries/packet.md b/guide/src/commands/queries/packet.md index 647a280df6..6aff501792 100644 --- a/guide/src/commands/queries/packet.md +++ b/guide/src/commands/queries/packet.md @@ -32,12 +32,12 @@ Use the `query packet pending` command to query the sequence numbers of all pack ```shell USAGE: - hermes query packet pending --chain --port --chan + hermes query packet pending --chain --port --channel FLAGS: - --chain identifier of the chain at one end of the channel - --chan channel identifier on the chain given by - --port port identifier on the chain given by + --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__ @@ -45,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 --chain ibc-0 --port transfer --chan channel-1 +$ hermes query packet pending --chain ibc-0 --port transfer --channel channel-1 ``` ```json @@ -84,15 +84,15 @@ Use the `query packet commitments` command to query the sequence numbers of all ```shell USAGE: - hermes query packet commitments --chain --port --chan + hermes query packet commitments --chain --port --channel DESCRIPTION: Query packet commitments FLAGS: - --chain identifier of the chain to query - --chan identifier of the channel to query - --port 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 ``` __Example__ @@ -100,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 --chain ibc-0 --port transfer --chan channel-0 +hermes query packet commitments --chain ibc-0 --port transfer --channel channel-0 ``` ```json @@ -123,19 +123,19 @@ Use the `query packet commitment` command to query the commitment value of a pac ```shell USAGE: - hermes query packet commitment [OPTIONS] --chain --port --chan --seq + hermes query packet commitment [OPTIONS] --chain --port --channel --sequence DESCRIPTION: Query packet commitment FLAGS: - --chain identifier of the chain to query - --chan identifier of the channel to query - --port identifier of the port to query - --seq sequence of packet 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 + --height height of the state to query ``` __Example__ @@ -143,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 --chain ibc-0 --port transfer --chan channel-0 --seq 3 +hermes query packet commitment --chain ibc-0 --port transfer --channel channel-0 --sequence 3 ``` ```json @@ -156,15 +156,15 @@ Use the `query packet acknowledgments` command to query the sequence numbers of ```shell USAGE: - hermes query packet acks --chain --port --chan + hermes query packet acks --chain --port --channel DESCRIPTION: Query packet acknowledgments FLAGS: - --chain identifier of the chain to query - --chan identifier of the channel to query - --port 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 ``` __Example__ @@ -172,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 --chain ibc-1 --port transfer --chan channel-1 +hermes query packet acks --chain ibc-1 --port transfer --channel channel-1 ``` ```json @@ -195,19 +195,19 @@ Use the `query packet acknowledgment` command to query the acknowledgment value ```shell USAGE: - hermes query packet ack [OPTIONS] --chain --port --chan --seq + hermes query packet ack [OPTIONS] --chain --port --channel --sequence DESCRIPTION: Query packet acknowledgment FLAGS: - --chain identifier of the chain to query - --chan identifier of the channel to query - --port identifier of the port to query - --seq sequence of packet 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 + --height height of the state to query ``` __Example__ @@ -215,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 --chain ibc-1 --port transfer --chan channel-1 --seq 2 +hermes query packet ack --chain ibc-1 --port transfer --channel channel-1 --sequence 2 ``` ```json @@ -228,15 +228,15 @@ Use the `query packet unreceived-packets` command to query the sequence numbers ```shell USAGE: - hermes query packet unreceived-packets --chain --port --chan + hermes query packet unreceived-packets --chain --port --channel DESCRIPTION: Query unreceived packets FLAGS: - --chain identifier of the chain for the unreceived sequences - --chan channel identifier - --port port identifier + --chain identifier of the chain for the unreceived sequences + --channel channel identifier + --port port identifier ``` __Example__ @@ -244,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 --chain ibc-1 --port transfer --chan channel-1 +hermes query packet unreceived-packets --chain ibc-1 --port transfer --channel channel-1 ``` ```json @@ -261,15 +261,15 @@ Use the `query packet unreceived-acks` command to query the sequence numbers of ```shell USAGE: - hermes query packet unreceived-acks --chain --port --chan + hermes query packet unreceived-acks --chain --port --channel DESCRIPTION: Query unreceived acknowledgments FLAGS: - --chain identifier of the chain to query the unreceived acknowledgments - --chan channel identifier - --port port identifier + --chain identifier of the chain to query the unreceived acknowledgments + --channel channel identifier + --port port identifier ``` __Example__ @@ -277,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 --chain ibc-0 --port transfer --chan channel-0 +hermes query packet unreceived-acks --chain ibc-0 --port transfer --channel channel-0 ``` ```json diff --git a/guide/src/commands/relaying/clear.md b/guide/src/commands/relaying/clear.md index 46588aefd3..c7a7907ddf 100644 --- a/guide/src/commands/relaying/clear.md +++ b/guide/src/commands/relaying/clear.md @@ -10,7 +10,7 @@ and [packet-acks](../raw/packet.md#relay-acknowledgment-packets). ``` USAGE: - hermes clear packets --chain --port --chan + hermes clear packets --chain --port --channel DESCRIPTION: Clear outstanding packets (i.e. packet-recv and packet-ack) on a given channel in both directions. @@ -18,9 +18,9 @@ DESCRIPTION: The channel is identified by the chain, port, and channel IDs at one of its ends FLAGS: - --chain identifier of the chain - --chan identifier of the channel - --port identifier of the port + --chain identifier of the chain + --channel identifier of the channel + --port identifier of the port ``` ### Example @@ -139,7 +139,7 @@ Success: [ as can be seen with the `query packet unreceived-packets` command: ``` -❯ hermes query packet unreceived-packets --chain ibc1 --port transfer --chan 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, @@ -151,7 +151,7 @@ Success: [ 3. We can clear them manually using the `clear packets` command: ``` -❯ hermes clear packets --chain ibc0 --port transfer --chan 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 @@ -433,7 +433,7 @@ Success: [ 4. The packets have now been successfully relayed: ``` -❯ hermes query packet unreceived-packets --chain ibc1 --port transfer --chan 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/config.md b/guide/src/config.md index 31801b6431..756e39defb 100644 --- a/guide/src/config.md +++ b/guide/src/config.md @@ -7,7 +7,7 @@ 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 `--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 --conn connection-1`. +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. diff --git a/guide/src/help.md b/guide/src/help.md index 87d3909515..a076612b70 100644 --- a/guide/src/help.md +++ b/guide/src/help.md @@ -69,19 +69,19 @@ DESCRIPTION: client and a new connection underlying the new channel if a pre-existing connection is not provided FLAGS: - --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 + --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-conn 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-conn 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] + --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 @@ -437,8 +437,8 @@ to close-open: - verify that the two ends are in Close state: ```shell - hermes --config config.toml query channel end --chain ibc-0 --port transfer --chan channel-0 - hermes --config config.toml query channel end --chain ibc-1 --port transfer --chan 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 ``` diff --git a/guide/src/tutorials/local-chains/raw/channel.md b/guide/src/tutorials/local-chains/raw/channel.md index 35f600f833..38b4c9263d 100644 --- a/guide/src/tutorials/local-chains/raw/channel.md +++ b/guide/src/tutorials/local-chains/raw/channel.md @@ -34,11 +34,11 @@ hermes tx raw chan-open-confirm --dst-chain ibc-1 --src-chain ibc-0 --dst-conn c To verify that the two ends are in `Open` state: ```shell -hermes query channel end --chain ibc-0 --port transfer --chan channel-0 +hermes query channel end --chain ibc-0 --port transfer --channel channel-0 ``` ```shell -hermes query channel end --chain ibc-1 --port transfer --chan 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/connection.md b/guide/src/tutorials/local-chains/raw/connection.md index 4985e364c5..04224b2d6e 100644 --- a/guide/src/tutorials/local-chains/raw/connection.md +++ b/guide/src/tutorials/local-chains/raw/connection.md @@ -37,11 +37,11 @@ hermes tx raw conn-confirm --dst-chain ibc-1 --src-chain ibc-0 --dst-client 07-t To verify that the two ends are in `Open` state: ```shell -hermes query connection end --chain ibc-0 --conn connection-0 +hermes query connection end --chain ibc-0 --connection connection-0 ``` ```shell -hermes query connection end --chain ibc-1 --conn 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 aaae0ed89a..d3030ef81b 100644 --- a/guide/src/tutorials/local-chains/raw/packet.md +++ b/guide/src/tutorials/local-chains/raw/packet.md @@ -29,13 +29,13 @@ First, we'll send `9999` `samoleans` from `ibc-0` to `ibc-1`. - query packet commitments on `ibc-0` ```shell - hermes query packet commitments --chain ibc-0 --port transfer --chan 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 --chain ibc-1 --port transfer --chan channel-1 + hermes query packet unreceived-packets --chain ibc-1 --port transfer --channel channel-1 ``` - send `recv_packet` to `ibc-1` @@ -47,7 +47,7 @@ First, we'll send `9999` `samoleans` from `ibc-0` to `ibc-1`. - query unreceived acks on `ibc-0` ```shell - hermes query packet unreceived-acks --chain ibc-0 --port transfer --chan channel-0 + hermes query packet unreceived-acks --chain ibc-0 --port transfer --channel channel-0 ``` - send acknowledgement to `ibc-0` 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 1161aa12f2..69d8aa2c9b 100644 --- a/guide/src/tutorials/local-chains/relay-paths/multiple-paths.md +++ b/guide/src/tutorials/local-chains/relay-paths/multiple-paths.md @@ -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 --chain ibc-1 --port transfer --chan channel-0 - hermes query packet unreceived-acks --chain ibc-0 --port transfer --chan channel-0 - hermes query packet unreceived-packets --chain ibc-2 --port transfer --chan channel-0 - hermes query packet unreceived-acks --chain ibc-1 --port transfer --chan 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/relayer-cli/src/commands/clear.rs b/relayer-cli/src/commands/clear.rs index 054ac05374..4721ed8b28 100644 --- a/relayer-cli/src/commands/clear.rs +++ b/relayer-cli/src/commands/clear.rs @@ -40,7 +40,8 @@ pub struct ClearPacketsCmd { port_id: PortId, #[clap( - long = "chan", + long = "channel", + alias = "chan", required = true, value_name = "CHANNEL_ID", help = "identifier of the channel" diff --git a/relayer-cli/src/commands/create/channel.rs b/relayer-cli/src/commands/create/channel.rs index d66e02a48e..66edefe0b5 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. @@ -63,7 +63,8 @@ pub struct CreateChannelCommand { chain_b: Option, #[clap( - long = "a-conn", + 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." )] @@ -102,7 +103,8 @@ pub struct CreateChannelCommand { version: Option, #[clap( - long = "new-client-conn", + 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/channel.rs.orig b/relayer-cli/src/commands/create/channel.rs.orig deleted file mode 100644 index e1d73bc9bd..0000000000 --- a/relayer-cli/src/commands/create/channel.rs.orig +++ /dev/null @@ -1,272 +0,0 @@ -use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; - -use console::style; -use dialoguer::Confirm; - -use ibc::core::ics02_client::client_state::ClientState; -use ibc::core::ics03_connection::connection::IdentifiedConnectionEnd; -use ibc::core::ics04_channel::channel::Order; -use ibc::core::ics04_channel::Version; -use ibc::core::ics24_host::identifier::{ChainId, ConnectionId, PortId}; -use ibc_relayer::chain::handle::ChainHandle; -use ibc_relayer::chain::requests::{ - IncludeProof, QueryClientStateRequest, QueryConnectionRequest, QueryHeight, -}; -use ibc_relayer::channel::Channel; -use ibc_relayer::connection::Connection; -use ibc_relayer::foreign_client::ForeignClient; - -use crate::cli_utils::{spawn_chain_runtime, ChainHandlePair}; -use crate::conclude::{exit_with_unrecoverable_error, Output}; -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 --a-port --b-port --a-chain --a-conn \n\nto re-use a pre-existing connection."; - -/// The data structure that represents all the possible options when invoking -/// the `create channel` CLI command. -/// -/// There are two possible ways to invoke this command: -/// -<<<<<<< HEAD -/// `create channel --a-chain --a-conn --a-port --b-port ` is the default -/// way in which this command should be used, specifying a `Connection-ID` for this new channel -/// to re-use. The command expects that `Connection-ID` is associated with chain A. -/// -/// `create channel --a-chain --b-chain --a-port --b-port --new-client-conn` -/// to indicate that a new connection/client pair is being created as part of this new channel. -/// This brings up an interactive yes/no prompt to ensure that the operator at least -/// considers the fact that they're initializing a new connection with the channel. -======= -/// `create channel --a-port --b-port --a-chain --a-conn ` -/// is the default way in which this command should be used, specifying a `Connection-ID` -/// associated with chain A for this new channel to re-use. -/// -/// `create channel --a-port --b-port --a-chain --b-chain --new-client-conn` -/// can alternatively be used to indicate that a new connection/client pair is being -/// created as part of this new channel. This brings up an interactive yes/no prompt -/// to ensure that the operator at least considers the fact that they're initializing a -/// new connection with the channel. This prompt can be skipped by appending the `--yes` -/// flag to the command. ->>>>>>> master -/// -/// Note that `Connection-ID`s have to be considered based off of the chain's perspective. Although -/// 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( - long = "b-chain", - value_name = "B_CHAIN_ID", - help = "Identifier of the side `b` chain for the new channel" - )] - chain_b: Option, - - #[clap( - long = "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 = "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 = "b-port", - required = true, - value_name = "B_PORT_ID", - help = "Identifier of the side `b` port for the new channel" - )] - port_b: PortId, - - #[clap( - long = "order", - value_name = "ORDER", - help = "The channel ordering, valid options 'unordered' (default) and 'ordered'", - default_value_t - )] - order: Order, - - #[clap( - long = "chan-version", - alias = "version", - value_name = "VERSION", - help = "The version for the new channel" - )] - version: Option, - - #[clap( - long = "new-client-conn", - help = "Indicates that a new client and connection will be created underlying the new channel" - )] - new_client_conn: bool, - - #[clap(long, help = "Skip new_client_conn confirmation")] - yes: bool, -} - -impl Runnable for CreateChannelCommand { - fn run(&self) { - match &self.connection_a { - Some(conn) => self.run_reusing_connection(conn), - None => match &self.chain_b { - Some(chain_b) => { - if self.new_client_conn { - if self.yes { - self.run_using_new_connection(chain_b); - } else { - match Confirm::new() - .with_prompt(format!( - "{}: {}\n{}: {}", - style("WARN").yellow(), - PROMPT, - style("Hint").cyan(), - HINT - )) - .interact() - { - Ok(confirm) => { - if confirm { - self.run_using_new_connection(chain_b); - } else { - Output::error("You elected not to create new clients and connections. Please re-invoke `create channel` with a pre-existing connection ID".to_string()).exit(); - } - } - Err(e) => { - Output::error(format!( - "An error occurred while waiting for user input: {}", - e - )); - } - } - } - } else { - Output::error( -<<<<<<< HEAD - "The `--new-client-conn` flag is required if invoking with `--chain-b`" -======= - "The `--new-client-conn` flag is required if invoking with `--b-chain`" ->>>>>>> master - .to_string(), - ) - .exit(); - } - } - None => { - Output::error("Missing one of `--b-chain` or `--a-conn`".to_string()).exit() - } - }, - } - } -} - -impl CreateChannelCommand { - /// Creates a new channel, as well as a new underlying connection and clients. - fn run_using_new_connection(&self, chain_b: &ChainId) { - let config = app_config(); - - let chains = ChainHandlePair::spawn(&config, &self.chain_a, chain_b) - .unwrap_or_else(exit_with_unrecoverable_error); - - info!( - "Creating new clients, new connection, and a new channel with order {}", - self.order - ); - - let client_a = ForeignClient::new(chains.src.clone(), chains.dst.clone()) - .unwrap_or_else(exit_with_unrecoverable_error); - let client_b = ForeignClient::new(chains.dst.clone(), chains.src) - .unwrap_or_else(exit_with_unrecoverable_error); - - // Create the connection. - let con = Connection::new(client_a, client_b, connection_delay()) - .unwrap_or_else(exit_with_unrecoverable_error); - - // Finally create the channel. - let channel = Channel::new( - con, - self.order, - self.port_a.clone(), - self.port_b.clone(), - self.version.clone(), - ) - .unwrap_or_else(exit_with_unrecoverable_error); - - Output::success(channel).exit(); - } - - /// Creates a new channel, reusing an already existing connection and its clients. - fn run_reusing_connection(&self, connection_a: &ConnectionId) { - let config = app_config(); - - // Validate & spawn runtime for side a. - let chain_a = spawn_chain_runtime(&config, &self.chain_a) - .unwrap_or_else(exit_with_unrecoverable_error); - - // Query the connection end. - let (conn_end, _) = chain_a - .query_connection( - QueryConnectionRequest { - connection_id: connection_a.clone(), - height: QueryHeight::Latest, - }, - IncludeProof::No, - ) - .unwrap_or_else(exit_with_unrecoverable_error); - - // Query the client state, obtain the identifier of chain b. - let chain_b = chain_a - .query_client_state( - QueryClientStateRequest { - client_id: conn_end.client_id().clone(), - height: QueryHeight::Latest, - }, - IncludeProof::No, - ) - .map(|(cs, _)| cs.chain_id()) - .unwrap_or_else(exit_with_unrecoverable_error); - - // Spawn the runtime for side b. - let chain_b = - spawn_chain_runtime(&config, &chain_b).unwrap_or_else(exit_with_unrecoverable_error); - - // Create the foreign client handles. - let client_a = ForeignClient::find(chain_b.clone(), chain_a.clone(), conn_end.client_id()) - .unwrap_or_else(exit_with_unrecoverable_error); - let client_b = ForeignClient::find(chain_a, chain_b, conn_end.counterparty().client_id()) - .unwrap_or_else(exit_with_unrecoverable_error); - - let identified_end = IdentifiedConnectionEnd::new(connection_a.clone(), conn_end); - - let connection = Connection::find(client_a, client_b, &identified_end) - .unwrap_or_else(exit_with_unrecoverable_error); - - let channel = Channel::new( - connection, - self.order, - self.port_a.clone(), - self.port_b.clone(), - self.version.clone(), - ) - .unwrap_or_else(exit_with_unrecoverable_error); - - Output::success(channel).exit(); - } -} diff --git a/relayer-cli/src/commands/query/channel.rs b/relayer-cli/src/commands/query/channel.rs index 7990fea378..2482352457 100644 --- a/relayer-cli/src/commands/query/channel.rs +++ b/relayer-cli/src/commands/query/channel.rs @@ -30,7 +30,8 @@ pub struct QueryChannelEndCmd { port_id: PortId, #[clap( - long = "chan", + long = "channel", + alias = "chan", required = true, value_name = "CHANNEL_ID", help = "identifier of the channel to query" diff --git a/relayer-cli/src/commands/query/channel_client.rs b/relayer-cli/src/commands/query/channel_client.rs index 1d84fbd6c5..8a60c86087 100644 --- a/relayer-cli/src/commands/query/channel_client.rs +++ b/relayer-cli/src/commands/query/channel_client.rs @@ -11,7 +11,7 @@ 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 --chain --port --chan ` +/// `query channel client --chain --port --channel ` /// /// If successful the channel's client state is displayed. #[derive(Clone, Command, Debug, Parser)] @@ -33,7 +33,8 @@ pub struct QueryChannelClientCmd { port_id: PortId, #[clap( - long = "chan", + long = "channel", + alias = "chan", required = true, value_name = "CHANNEL_ID", help = "identifier of the channel to query" diff --git a/relayer-cli/src/commands/query/channel_ends.rs b/relayer-cli/src/commands/query/channel_ends.rs index a1526dba4c..10a7876f8d 100644 --- a/relayer-cli/src/commands/query/channel_ends.rs +++ b/relayer-cli/src/commands/query/channel_ends.rs @@ -36,7 +36,8 @@ pub struct QueryChannelEndsCmd { port_id: PortId, #[clap( - long = "chan", + long = "channel", + alias = "chan", required = true, value_name = "CHANNEL_ID", help = "identifier of the channel to query" diff --git a/relayer-cli/src/commands/query/connection.rs b/relayer-cli/src/commands/query/connection.rs index 7e4586f01e..451048d424 100644 --- a/relayer-cli/src/commands/query/connection.rs +++ b/relayer-cli/src/commands/query/connection.rs @@ -27,7 +27,8 @@ pub struct QueryConnectionEndCmd { chain_id: ChainId, #[clap( - long = "conn", + long = "connection", + alias = "conn", required = true, value_name = "CONNECTION_ID", help = "identifier of the connection to query" @@ -42,7 +43,7 @@ pub struct QueryConnectionEndCmd { height: Option, } -// cargo run --bin hermes -- query connection end --chain ibc-test --conn 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(); @@ -92,7 +93,8 @@ pub struct QueryConnectionChannelsCmd { chain_id: ChainId, #[clap( - long = "conn", + long = "connection", + alias = "conn", required = true, value_name = "CONNECTION_ID", help = "identifier of the connection to query" diff --git a/relayer-cli/src/commands/query/packet/ack.rs b/relayer-cli/src/commands/query/packet/ack.rs index 430f62dc05..cee95b3313 100644 --- a/relayer-cli/src/commands/query/packet/ack.rs +++ b/relayer-cli/src/commands/query/packet/ack.rs @@ -31,7 +31,8 @@ pub struct QueryPacketAcknowledgmentCmd { port_id: PortId, #[clap( - long = "chan", + long = "channel", + alias = "chan", required = true, value_name = "CHANNEL_ID", help = "identifier of the channel to query" @@ -39,7 +40,8 @@ pub struct QueryPacketAcknowledgmentCmd { channel_id: ChannelId, #[clap( - long = "seq", + long = "sequence", + alias = "seq", required = true, value_name = "SEQUENCE", help = "sequence of packet to query" diff --git a/relayer-cli/src/commands/query/packet/acks.rs b/relayer-cli/src/commands/query/packet/acks.rs index 1ba0df863b..23bf553a8a 100644 --- a/relayer-cli/src/commands/query/packet/acks.rs +++ b/relayer-cli/src/commands/query/packet/acks.rs @@ -38,7 +38,8 @@ pub struct QueryPacketAcknowledgementsCmd { port_id: PortId, #[clap( - long = "chan", + long = "channel", + alias = "chan", required = true, value_name = "CHANNEL_ID", help = "identifier of the channel to query" @@ -67,7 +68,7 @@ impl QueryPacketAcknowledgementsCmd { } } -// cargo run --bin hermes -- query packet acknowledgements --chain ibc-0 --port transfer --conn 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 d03a1032e0..ceeff93721 100644 --- a/relayer-cli/src/commands/query/packet/commitment.rs +++ b/relayer-cli/src/commands/query/packet/commitment.rs @@ -39,7 +39,8 @@ pub struct QueryPacketCommitmentCmd { port_id: PortId, #[clap( - long = "chan", + long = "channel", + alias = "chan", required = true, value_name = "CHANNEL_ID", help = "identifier of the channel to query" @@ -47,7 +48,8 @@ pub struct QueryPacketCommitmentCmd { channel_id: ChannelId, #[clap( - long = "seq", + long = "sequence", + alias = "seq", required = true, value_name = "SEQUENCE", help = "sequence of packet to query" diff --git a/relayer-cli/src/commands/query/packet/commitments.rs b/relayer-cli/src/commands/query/packet/commitments.rs index 9e06b7c10b..eaa19539c9 100644 --- a/relayer-cli/src/commands/query/packet/commitments.rs +++ b/relayer-cli/src/commands/query/packet/commitments.rs @@ -37,7 +37,8 @@ pub struct QueryPacketCommitmentsCmd { port_id: PortId, #[clap( - long = "chan", + long = "channel", + alias = "chan", required = true, value_name = "CHANNEL_ID", help = "identifier of the channel to query" @@ -62,7 +63,7 @@ impl QueryPacketCommitmentsCmd { } } -// cargo run --bin hermes -- query packet commitments --chain ibc-0 --port transfer --chan 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 b4834358ef..c954a7dae2 100644 --- a/relayer-cli/src/commands/query/packet/pending.rs +++ b/relayer-cli/src/commands/query/packet/pending.rs @@ -48,7 +48,8 @@ pub struct QueryPendingPacketsCmd { port_id: PortId, #[clap( - long = "chan", + long = "channel", + alias = "chan", required = true, value_name = "CHANNEL_ID", help = "channel identifier on the chain given by " diff --git a/relayer-cli/src/commands/query/packet/unreceived_acks.rs b/relayer-cli/src/commands/query/packet/unreceived_acks.rs index 831712e7df..b1eb902186 100644 --- a/relayer-cli/src/commands/query/packet/unreceived_acks.rs +++ b/relayer-cli/src/commands/query/packet/unreceived_acks.rs @@ -34,7 +34,8 @@ pub struct QueryUnreceivedAcknowledgementCmd { port_id: PortId, #[clap( - long = "chan", + long = "channel", + alias = "chan", required = true, value_name = "CHANNEL_ID", help = "channel identifier" diff --git a/relayer-cli/src/commands/query/packet/unreceived_packets.rs b/relayer-cli/src/commands/query/packet/unreceived_packets.rs index 485c185316..03e0ab8722 100644 --- a/relayer-cli/src/commands/query/packet/unreceived_packets.rs +++ b/relayer-cli/src/commands/query/packet/unreceived_packets.rs @@ -34,7 +34,8 @@ pub struct QueryUnreceivedPacketsCmd { port_id: PortId, #[clap( - long = "chan", + long = "channel", + alias = "chan", required = true, value_name = "CHANNEL_ID", help = "channel identifier" From d389f3d1e509b0d62368b436e106d68ff365c35a Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Tue, 28 Jun 2022 12:05:32 +0200 Subject: [PATCH 29/37] Fixed error in CLI replacing HeightQuery with QueryHeight --- relayer-cli/src/commands/create/channel.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/relayer-cli/src/commands/create/channel.rs b/relayer-cli/src/commands/create/channel.rs index 66edefe0b5..ceffc1aa35 100644 --- a/relayer-cli/src/commands/create/channel.rs +++ b/relayer-cli/src/commands/create/channel.rs @@ -11,7 +11,7 @@ use ibc::core::ics04_channel::Version; use ibc::core::ics24_host::identifier::{ChainId, ConnectionId, PortId}; use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer::chain::requests::{ - HeightQuery, IncludeProof, QueryClientStateRequest, QueryConnectionRequest, + IncludeProof, QueryClientStateRequest, QueryConnectionRequest, QueryHeight }; use ibc_relayer::channel::Channel; use ibc_relayer::connection::Connection; From e06b55ac481c54925cd134361579eca88c79e093 Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Tue, 28 Jun 2022 12:08:21 +0200 Subject: [PATCH 30/37] Fix cargo fmt --- relayer-cli/src/commands/create/channel.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/relayer-cli/src/commands/create/channel.rs b/relayer-cli/src/commands/create/channel.rs index ceffc1aa35..0d8b827cf2 100644 --- a/relayer-cli/src/commands/create/channel.rs +++ b/relayer-cli/src/commands/create/channel.rs @@ -11,7 +11,7 @@ use ibc::core::ics04_channel::Version; use ibc::core::ics24_host::identifier::{ChainId, ConnectionId, PortId}; use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer::chain::requests::{ - IncludeProof, QueryClientStateRequest, QueryConnectionRequest, QueryHeight + IncludeProof, QueryClientStateRequest, QueryConnectionRequest, QueryHeight, }; use ibc_relayer::channel::Channel; use ibc_relayer::connection::Connection; From fd711316ee70d24843d7c23cb827510333470872 Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Tue, 28 Jun 2022 12:46:02 +0200 Subject: [PATCH 31/37] Changed 'version' to 'channel-version' for 'hermes create channel' command --- relayer-cli/src/commands/create/channel.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/relayer-cli/src/commands/create/channel.rs b/relayer-cli/src/commands/create/channel.rs index 0d8b827cf2..0181586d9f 100644 --- a/relayer-cli/src/commands/create/channel.rs +++ b/relayer-cli/src/commands/create/channel.rs @@ -45,7 +45,6 @@ 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", @@ -95,8 +94,8 @@ pub struct CreateChannelCommand { order: Order, #[clap( - long = "chan-version", - alias = "version", + long = "channel-version", + alias = "chan-version", value_name = "VERSION", help = "The version for the new channel" )] From 64e54e297180b60f4b631f581c3703f3e604c821 Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Tue, 28 Jun 2022 12:54:27 +0200 Subject: [PATCH 32/37] Separated 'hermes create channel' help into short and long message --- guide/src/commands/path-setup/channels.md | 4 +++- guide/src/commands/path-setup/index.md | 4 +--- relayer-cli/src/commands/create.rs | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/guide/src/commands/path-setup/channels.md b/guide/src/commands/path-setup/channels.md index 9921445c71..975f5107fc 100644 --- a/guide/src/commands/path-setup/channels.md +++ b/guide/src/commands/path-setup/channels.md @@ -14,7 +14,9 @@ USAGE: 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. + + Alternatively, create a new client and a new connection underlying the new channel if a pre-existing + connection is not provided. FLAGS: --a-chain Identifier of the side `a` chain for the new channel diff --git a/guide/src/commands/path-setup/index.md b/guide/src/commands/path-setup/index.md index f632ad8907..84a8408425 100644 --- a/guide/src/commands/path-setup/index.md +++ b/guide/src/commands/path-setup/index.md @@ -21,9 +21,7 @@ DESCRIPTION: Create objects (client, connection, or channel) on chains SUBCOMMANDS: - 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 + 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) 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), From d2ef49c85fc58feb401000b9ac05bc1476fd1686 Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Tue, 28 Jun 2022 13:04:41 +0200 Subject: [PATCH 33/37] Updated 'hermes listen' so that '--events' flag can take multiple values --- docs/architecture/adr-010-unified-cli-arguments-hermes.md | 2 +- relayer-cli/src/commands/listen.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/architecture/adr-010-unified-cli-arguments-hermes.md b/docs/architecture/adr-010-unified-cli-arguments-hermes.md index 520935707b..8d98fe2053 100644 --- a/docs/architecture/adr-010-unified-cli-arguments-hermes.md +++ b/docs/architecture/adr-010-unified-cli-arguments-hermes.md @@ -73,7 +73,7 @@ The following commands are implemented, with the binary name `hermes` often omit ### Listen * `listen --chain ` - * Optional: `[--event ]` + * Optional: `[--events ...]` ### Misbehaviour diff --git a/relayer-cli/src/commands/listen.rs b/relayer-cli/src/commands/listen.rs index 83775f9059..b183ca53c8 100644 --- a/relayer-cli/src/commands/listen.rs +++ b/relayer-cli/src/commands/listen.rs @@ -66,7 +66,7 @@ pub struct ListenCmd { /// Add an event type to listen for, can be repeated. /// Listen for all events by default (available: Tx, NewBlock). - #[clap(long = "event", value_name = "EVENT")] + #[clap(long = "events", value_name = "EVENT", multiple_values = true)] events: Vec, } From 7d8a58e52ea86dec7171f46df1b6fcf8851691e5 Mon Sep 17 00:00:00 2001 From: Luca Joss Date: Tue, 28 Jun 2022 13:08:49 +0200 Subject: [PATCH 34/37] Updated guide with new '--events' flag for 'hermes listen' --- guide/src/commands/listen/index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/guide/src/commands/listen/index.md b/guide/src/commands/listen/index.md index 89eb22f5b2..fc1bf0d8a1 100644 --- a/guide/src/commands/listen/index.md +++ b/guide/src/commands/listen/index.md @@ -13,7 +13,7 @@ FLAGS: --chain Identifier of the chain to listen for events from OPTIONS: - --event Add an event type to listen for, can be repeated. Listen for all events by default (available: Tx, NewBlock) + --events ... Add an event type to listen for, can be repeated. Listen for all events by default (available: Tx, NewBlock) ``` __Example__ @@ -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 --chain ibc-0 --event NewBlock` -- To listen for only `Tx` events on `ibc-0`, invoke `hermes listen --chain ibc-0 --event Tx` -- To listen for both `NewBlock` and `Tx` events on `ibc-0`, invoke `hermes listen --chain ibc-0 --event 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. From 92cd4635d921a64a6fc5da747fae8ad376bae966 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Tue, 28 Jun 2022 13:56:10 +0200 Subject: [PATCH 35/37] Start all arguments help text with an uppercase letter, to match Clap's help for autogenerated arguments (eg. --help) --- relayer-cli/src/commands/clear.rs | 6 +- relayer-cli/src/commands/create/connection.rs | 10 +-- relayer-cli/src/commands/keys/add.rs | 10 +-- relayer-cli/src/commands/keys/balance.rs | 2 +- relayer-cli/src/commands/keys/delete.rs | 6 +- relayer-cli/src/commands/keys/list.rs | 2 +- relayer-cli/src/commands/misbehaviour.rs | 4 +- relayer-cli/src/commands/query/channel.rs | 8 +- .../src/commands/query/channel_client.rs | 6 +- .../src/commands/query/channel_ends.rs | 10 +-- relayer-cli/src/commands/query/channels.rs | 6 +- relayer-cli/src/commands/query/client.rs | 30 +++---- relayer-cli/src/commands/query/clients.rs | 6 +- relayer-cli/src/commands/query/connection.rs | 10 +-- relayer-cli/src/commands/query/connections.rs | 2 +- relayer-cli/src/commands/query/packet/ack.rs | 10 +-- relayer-cli/src/commands/query/packet/acks.rs | 6 +- .../src/commands/query/packet/commitment.rs | 10 +-- .../src/commands/query/packet/commitments.rs | 6 +- .../src/commands/query/packet/pending.rs | 6 +- .../commands/query/packet/unreceived_acks.rs | 6 +- .../query/packet/unreceived_packets.rs | 6 +- .../commands/query/transfer/denom_trace.rs | 4 +- relayer-cli/src/commands/query/tx/events.rs | 4 +- relayer-cli/src/commands/tx/channel.rs | 82 +++++++++---------- relayer-cli/src/commands/tx/client.rs | 18 ++-- relayer-cli/src/commands/tx/connection.rs | 44 +++++----- relayer-cli/src/commands/tx/packet.rs | 16 ++-- relayer-cli/src/commands/tx/transfer.rs | 22 ++--- relayer-cli/src/commands/tx/upgrade.rs | 18 ++-- relayer-cli/src/entry.rs | 4 +- 31 files changed, 190 insertions(+), 190 deletions(-) diff --git a/relayer-cli/src/commands/clear.rs b/relayer-cli/src/commands/clear.rs index 4721ed8b28..df7d009b41 100644 --- a/relayer-cli/src/commands/clear.rs +++ b/relayer-cli/src/commands/clear.rs @@ -27,7 +27,7 @@ pub struct ClearPacketsCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain" + help = "Identifier of the chain" )] chain_id: ChainId, @@ -35,7 +35,7 @@ pub struct ClearPacketsCmd { long = "port", required = true, value_name = "PORT_ID", - help = "identifier of the port" + help = "Identifier of the port" )] port_id: PortId, @@ -44,7 +44,7 @@ pub struct ClearPacketsCmd { alias = "chan", required = true, value_name = "CHANNEL_ID", - help = "identifier of the channel" + help = "Identifier of the channel" )] channel_id: ChannelId, } diff --git a/relayer-cli/src/commands/create/connection.rs b/relayer-cli/src/commands/create/connection.rs index a775d18ea4..83f48bc8a1 100644 --- a/relayer-cli/src/commands/create/connection.rs +++ b/relayer-cli/src/commands/create/connection.rs @@ -20,35 +20,35 @@ pub struct CreateConnectionCommand { long = "a-chain", required = true, value_name = "A_CHAIN_ID", - help = "identifier of the side `a` chain for the new connection" + help = "Identifier of the side `a` chain for the new connection" )] chain_a_id: ChainId, #[clap( long = "b-chain", value_name = "B_CHAIN_ID", - help = "identifier of the side `b` chain for the new connection" + help = "Identifier of the side `b` chain for the new connection" )] chain_b_id: Option, #[clap( long = "a-client", value_name = "A_CLIENT_ID", - help = "identifier of client hosted on chain `a`; default: None (creates a new client)" + help = "Identifier of client hosted on chain `a`; default: None (creates a new client)" )] client_a: Option, #[clap( long = "b-client", value_name = "B_CLIENT_ID", - help = "identifier of client hosted on chain `b`; default: None (creates a new client)" + help = "Identifier of client hosted on chain `b`; default: None (creates a new client)" )] client_b: Option, #[clap( long = "delay", value_name = "DELAY", - help = "delay period parameter for the new connection (seconds)", + help = "Delay period parameter for the new connection (seconds)", default_value = "0" )] delay: u64, diff --git a/relayer-cli/src/commands/keys/add.rs b/relayer-cli/src/commands/keys/add.rs index 41a594a05b..d49a2b9d67 100644 --- a/relayer-cli/src/commands/keys/add.rs +++ b/relayer-cli/src/commands/keys/add.rs @@ -32,14 +32,14 @@ use crate::conclude::Output; /// If successful the key will be created or restored, depending on which flag was given. #[derive(Clone, Command, Debug, Parser, PartialEq)] pub struct KeysAddCmd { - #[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 = "key-file", required = true, value_name = "KEY_FILE", - help = "path to the key file", + help = "Path to the key file", group = "add-restore" )] key_file: Option, @@ -48,7 +48,7 @@ pub struct KeysAddCmd { long = "mnemonic-file", required = true, value_name = "MNEMONIC_FILE", - help = "path to file containing mnemonic to restore the key from", + help = "Path to file containing mnemonic to restore the key from", group = "add-restore" )] mnemonic_file: Option, @@ -56,14 +56,14 @@ pub struct KeysAddCmd { #[clap( long = "key-name", value_name = "KEY_NAME", - help = "name of the key (defaults to the `key_name` defined in the config)" + help = "Name of the key (defaults to the `key_name` defined in the config)" )] key_name: Option, #[clap( long = "hd-path", value_name = "HD_PATH", - help = "derivation path for this key", + help = "Derivation path for this key", default_value = "m/44'/118'/0'/0/0" )] hd_path: String, diff --git a/relayer-cli/src/commands/keys/balance.rs b/relayer-cli/src/commands/keys/balance.rs index 6d911469d5..7473e22ea0 100644 --- a/relayer-cli/src/commands/keys/balance.rs +++ b/relayer-cli/src/commands/keys/balance.rs @@ -23,7 +23,7 @@ pub struct KeyBalanceCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain" + help = "Identifier of the chain" )] chain_id: ChainId, diff --git a/relayer-cli/src/commands/keys/delete.rs b/relayer-cli/src/commands/keys/delete.rs index 65d69b9e97..9d6430bbc8 100644 --- a/relayer-cli/src/commands/keys/delete.rs +++ b/relayer-cli/src/commands/keys/delete.rs @@ -16,14 +16,14 @@ pub struct KeysDeleteCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain" + help = "Identifier of the chain" )] chain_id: ChainId, - #[clap(long = "key-name", value_name = "KEY_NAME", help = "name of the key")] + #[clap(long = "key-name", value_name = "KEY_NAME", help = "Name of the key")] key_name: Option, - #[clap(long = "all", help = "delete all keys")] + #[clap(long = "all", help = "Delete all keys")] all: bool, } diff --git a/relayer-cli/src/commands/keys/list.rs b/relayer-cli/src/commands/keys/list.rs index 428b1c3c42..7bd09db4eb 100644 --- a/relayer-cli/src/commands/keys/list.rs +++ b/relayer-cli/src/commands/keys/list.rs @@ -18,7 +18,7 @@ pub struct KeysListCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain" + help = "Identifier of the chain" )] chain_id: ChainId, } diff --git a/relayer-cli/src/commands/misbehaviour.rs b/relayer-cli/src/commands/misbehaviour.rs index e583796b1d..d93f305789 100644 --- a/relayer-cli/src/commands/misbehaviour.rs +++ b/relayer-cli/src/commands/misbehaviour.rs @@ -20,7 +20,7 @@ pub struct MisbehaviourCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain where client updates are monitored for misbehaviour" + help = "Identifier of the chain where client updates are monitored for misbehaviour" )] chain_id: ChainId, @@ -28,7 +28,7 @@ pub struct MisbehaviourCmd { long = "client", required = true, value_name = "CLIENT_ID", - help = "identifier of the client to be monitored for misbehaviour" + help = "Identifier of the client to be monitored for misbehaviour" )] client_id: ClientId, } diff --git a/relayer-cli/src/commands/query/channel.rs b/relayer-cli/src/commands/query/channel.rs index 2482352457..a30c29ef69 100644 --- a/relayer-cli/src/commands/query/channel.rs +++ b/relayer-cli/src/commands/query/channel.rs @@ -17,7 +17,7 @@ pub struct QueryChannelEndCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain to query" + help = "Identifier of the chain to query" )] chain_id: ChainId, @@ -25,7 +25,7 @@ pub struct QueryChannelEndCmd { long = "port", required = true, value_name = "PORT_ID", - help = "identifier of the port to query" + help = "Identifier of the port to query" )] port_id: PortId, @@ -34,14 +34,14 @@ pub struct QueryChannelEndCmd { alias = "chan", required = true, value_name = "CHANNEL_ID", - help = "identifier of the channel to query" + help = "Identifier of the channel to query" )] channel_id: ChannelId, #[clap( long = "height", value_name = "HEIGHT", - help = "height of the state to query" + 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 8a60c86087..9df2ff2c3a 100644 --- a/relayer-cli/src/commands/query/channel_client.rs +++ b/relayer-cli/src/commands/query/channel_client.rs @@ -20,7 +20,7 @@ pub struct QueryChannelClientCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain to query" + help = "Identifier of the chain to query" )] chain_id: ChainId, @@ -28,7 +28,7 @@ pub struct QueryChannelClientCmd { long = "port", required = true, value_name = "PORT_ID", - help = "identifier of the port to query" + help = "Identifier of the port to query" )] port_id: PortId, @@ -37,7 +37,7 @@ pub struct QueryChannelClientCmd { alias = "chan", required = true, value_name = "CHANNEL_ID", - help = "identifier of the channel to query" + 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 10a7876f8d..c667dcf6c4 100644 --- a/relayer-cli/src/commands/query/channel_ends.rs +++ b/relayer-cli/src/commands/query/channel_ends.rs @@ -23,7 +23,7 @@ pub struct QueryChannelEndsCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain to query" + help = "Identifier of the chain to query" )] chain_id: ChainId, @@ -31,7 +31,7 @@ pub struct QueryChannelEndsCmd { long = "port", required = true, value_name = "PORT_ID", - help = "identifier of the port to query" + help = "Identifier of the port to query" )] port_id: PortId, @@ -40,20 +40,20 @@ pub struct QueryChannelEndsCmd { alias = "chan", required = true, value_name = "CHANNEL_ID", - help = "identifier of the channel to query" + help = "Identifier of the channel to query" )] channel_id: ChannelId, #[clap( long = "height", value_name = "HEIGHT", - help = "height of the state to query" + help = "Height of the state to query" )] height: Option, #[clap( long = "verbose", - help = "enable verbose output, displaying all details of channels, connections & clients" + 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 3e5e648b6c..d68d0ff940 100644 --- a/relayer-cli/src/commands/query/channels.rs +++ b/relayer-cli/src/commands/query/channels.rs @@ -24,7 +24,7 @@ pub struct QueryChannelsCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain to query" + help = "Identifier of the chain to query" )] chain_id: ChainId, @@ -33,12 +33,12 @@ pub struct QueryChannelsCmd { // #[clap( // long = "counterparty-chain", // value_name = "COUNTERPARTY_CHAIN_ID", - // help = "filter the query response by the this counterparty chain" + // help = "Filter the query response by the this counterparty chain" // )] // dst_chain_id: Option, #[clap( long = "verbose", - help = "enable verbose output, displaying the client and connection ids for each channel in the response" + help = "Enable verbose output, displaying the client and connection ids for each channel in the response" )] verbose: bool, } diff --git a/relayer-cli/src/commands/query/client.rs b/relayer-cli/src/commands/query/client.rs index 433d9c3a18..9614085ea8 100644 --- a/relayer-cli/src/commands/query/client.rs +++ b/relayer-cli/src/commands/query/client.rs @@ -26,7 +26,7 @@ pub struct QueryClientStateCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain to query" + help = "Identifier of the chain to query" )] chain_id: ChainId, @@ -34,14 +34,14 @@ pub struct QueryClientStateCmd { long = "client", required = true, value_name = "CLIENT_ID", - help = "identifier of the client to query" + help = "Identifier of the client to query" )] client_id: ClientId, #[clap( long = "height", value_name = "HEIGHT", - help = "the chain height context for the query" + help = "The chain height context for the query" )] height: Option, } @@ -77,7 +77,7 @@ pub struct QueryClientConsensusCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain to query" + help = "Identifier of the chain to query" )] chain_id: ChainId, @@ -85,24 +85,24 @@ pub struct QueryClientConsensusCmd { long = "client", required = true, value_name = "CLIENT_ID", - help = "identifier of the client to query" + help = "Identifier of the client to query" )] client_id: ClientId, #[clap( long = "consensus-height", value_name = "CONSENSUS_HEIGHT", - help = "height of the client's consensus state to query" + help = "Height of the client's consensus state to query" )] consensus_height: Option, - #[clap(long = "heights-only", help = "show only consensus heights")] + #[clap(long = "heights-only", help = "Show only consensus heights")] heights_only: bool, #[clap( long = "height", value_name = "HEIGHT", - help = "the chain height context to be used, applicable only to a specific height" + help = "The chain height context to be used, applicable only to a specific height" )] height: Option, } @@ -189,7 +189,7 @@ pub struct QueryClientHeaderCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain to query" + help = "Identifier of the chain to query" )] chain_id: ChainId, @@ -197,7 +197,7 @@ pub struct QueryClientHeaderCmd { long = "client", required = true, value_name = "CLIENT_ID", - help = "identifier of the client to query" + help = "Identifier of the client to query" )] client_id: ClientId, @@ -205,14 +205,14 @@ pub struct QueryClientHeaderCmd { long = "consensus-height", required = true, value_name = "CONSENSUS_HEIGHT", - help = "height of header to query" + help = "Height of header to query" )] consensus_height: u64, #[clap( long = "height", value_name = "HEIGHT", - help = "the chain height context for the query" + help = "The chain height context for the query" )] height: Option, } @@ -274,7 +274,7 @@ pub struct QueryClientConnectionsCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain to query" + help = "Identifier of the chain to query" )] chain_id: ChainId, @@ -282,14 +282,14 @@ pub struct QueryClientConnectionsCmd { long = "client", required = true, value_name = "CLIENT_ID", - help = "identifier of the client to query" + help = "Identifier of the client to query" )] client_id: ClientId, #[clap( long = "height", value_name = "HEIGHT", - help = "the chain height which this query should reflect" + help = "The chain height which this query should reflect" )] height: Option, } diff --git a/relayer-cli/src/commands/query/clients.rs b/relayer-cli/src/commands/query/clients.rs index df3ada5dc5..5e5d310d67 100644 --- a/relayer-cli/src/commands/query/clients.rs +++ b/relayer-cli/src/commands/query/clients.rs @@ -19,20 +19,20 @@ pub struct QueryAllClientsCmd { long = "host-chain", required = true, value_name = "HOST_CHAIN_ID", - help = "identifier of the chain to query" + help = "Identifier of the chain to query" )] chain_id: ChainId, #[clap( long = "reference-chain", - help = "filter for clients which target a specific chain id (implies '--omit-chain-ids')", + help = "Filter for clients which target a specific chain id (implies '--omit-chain-ids')", value_name = "REFERENCE_CHAIN_ID" )] src_chain_id: Option, #[clap( long = "omit-chain-ids", - help = "omit printing the reference (or target) chain for each client" + help = "Omit printing the reference (or target) chain for each client" )] omit_chain_ids: bool, } diff --git a/relayer-cli/src/commands/query/connection.rs b/relayer-cli/src/commands/query/connection.rs index 451048d424..bce0250934 100644 --- a/relayer-cli/src/commands/query/connection.rs +++ b/relayer-cli/src/commands/query/connection.rs @@ -22,7 +22,7 @@ pub struct QueryConnectionEndCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain to query" + help = "Identifier of the chain to query" )] chain_id: ChainId, @@ -31,14 +31,14 @@ pub struct QueryConnectionEndCmd { alias = "conn", required = true, value_name = "CONNECTION_ID", - help = "identifier of the connection to query" + help = "Identifier of the connection to query" )] connection_id: ConnectionId, #[clap( long = "height", value_name = "HEIGHT", - help = "height of the state to query" + help = "Height of the state to query" )] height: Option, } @@ -88,7 +88,7 @@ pub struct QueryConnectionChannelsCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain to query" + help = "Identifier of the chain to query" )] chain_id: ChainId, @@ -97,7 +97,7 @@ pub struct QueryConnectionChannelsCmd { alias = "conn", required = true, value_name = "CONNECTION_ID", - help = "identifier of the connection to query" + 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 e5e88ddd9a..6b789ecf29 100644 --- a/relayer-cli/src/commands/query/connections.rs +++ b/relayer-cli/src/commands/query/connections.rs @@ -15,7 +15,7 @@ pub struct QueryConnectionsCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain to query" + 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 cee95b3313..a7acd62e39 100644 --- a/relayer-cli/src/commands/query/packet/ack.rs +++ b/relayer-cli/src/commands/query/packet/ack.rs @@ -18,7 +18,7 @@ pub struct QueryPacketAcknowledgmentCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain to query" + help = "Identifier of the chain to query" )] chain_id: ChainId, @@ -26,7 +26,7 @@ pub struct QueryPacketAcknowledgmentCmd { long = "port", required = true, value_name = "PORT_ID", - help = "identifier of the port to query" + help = "Identifier of the port to query" )] port_id: PortId, @@ -35,7 +35,7 @@ pub struct QueryPacketAcknowledgmentCmd { alias = "chan", required = true, value_name = "CHANNEL_ID", - help = "identifier of the channel to query" + help = "Identifier of the channel to query" )] channel_id: ChannelId, @@ -44,14 +44,14 @@ pub struct QueryPacketAcknowledgmentCmd { alias = "seq", required = true, value_name = "SEQUENCE", - help = "sequence of packet to query" + help = "Sequence of packet to query" )] sequence: Sequence, #[clap( long = "height", value_name = "HEIGHT", - help = "height of the state to query" + 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 23bf553a8a..0209faccf3 100644 --- a/relayer-cli/src/commands/query/packet/acks.rs +++ b/relayer-cli/src/commands/query/packet/acks.rs @@ -25,7 +25,7 @@ pub struct QueryPacketAcknowledgementsCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain to query" + help = "Identifier of the chain to query" )] chain_id: ChainId, @@ -33,7 +33,7 @@ pub struct QueryPacketAcknowledgementsCmd { long = "port", required = true, value_name = "PORT_ID", - help = "identifier of the port to query" + help = "Identifier of the port to query" )] port_id: PortId, @@ -42,7 +42,7 @@ pub struct QueryPacketAcknowledgementsCmd { alias = "chan", required = true, value_name = "CHANNEL_ID", - help = "identifier of the channel to query" + help = "Identifier of the channel to query" )] channel_id: ChannelId, } diff --git a/relayer-cli/src/commands/query/packet/commitment.rs b/relayer-cli/src/commands/query/packet/commitment.rs index ceeff93721..3df8986f3c 100644 --- a/relayer-cli/src/commands/query/packet/commitment.rs +++ b/relayer-cli/src/commands/query/packet/commitment.rs @@ -26,7 +26,7 @@ pub struct QueryPacketCommitmentCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain to query" + help = "Identifier of the chain to query" )] chain_id: ChainId, @@ -34,7 +34,7 @@ pub struct QueryPacketCommitmentCmd { long = "port", required = true, value_name = "PORT_ID", - help = "identifier of the port to query" + help = "Identifier of the port to query" )] port_id: PortId, @@ -43,7 +43,7 @@ pub struct QueryPacketCommitmentCmd { alias = "chan", required = true, value_name = "CHANNEL_ID", - help = "identifier of the channel to query" + help = "Identifier of the channel to query" )] channel_id: ChannelId, @@ -52,14 +52,14 @@ pub struct QueryPacketCommitmentCmd { alias = "seq", required = true, value_name = "SEQUENCE", - help = "sequence of packet to query" + help = "Sequence of packet to query" )] sequence: Sequence, #[clap( long = "height", value_name = "HEIGHT", - help = "height of the state to query" + 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 eaa19539c9..c5258ebdc1 100644 --- a/relayer-cli/src/commands/query/packet/commitments.rs +++ b/relayer-cli/src/commands/query/packet/commitments.rs @@ -24,7 +24,7 @@ pub struct QueryPacketCommitmentsCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain to query" + help = "Identifier of the chain to query" )] chain_id: ChainId, @@ -32,7 +32,7 @@ pub struct QueryPacketCommitmentsCmd { long = "port", required = true, value_name = "PORT_ID", - help = "identifier of the port to query" + help = "Identifier of the port to query" )] port_id: PortId, @@ -41,7 +41,7 @@ pub struct QueryPacketCommitmentsCmd { alias = "chan", required = true, value_name = "CHANNEL_ID", - help = "identifier of the channel to query" + help = "Identifier of the channel to query" )] channel_id: ChannelId, } diff --git a/relayer-cli/src/commands/query/packet/pending.rs b/relayer-cli/src/commands/query/packet/pending.rs index c954a7dae2..12e1115a4e 100644 --- a/relayer-cli/src/commands/query/packet/pending.rs +++ b/relayer-cli/src/commands/query/packet/pending.rs @@ -35,7 +35,7 @@ pub struct QueryPendingPacketsCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain at one end of the channel" + help = "Identifier of the chain at one end of the channel" )] chain_id: ChainId, @@ -43,7 +43,7 @@ pub struct QueryPendingPacketsCmd { long = "port", required = true, value_name = "PORT_ID", - help = "port identifier on the chain given by " + help = "Port identifier on the chain given by " )] port_id: PortId, @@ -52,7 +52,7 @@ pub struct QueryPendingPacketsCmd { alias = "chan", required = true, value_name = "CHANNEL_ID", - help = "channel identifier on the chain given by " + 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 b1eb902186..c1a627d05f 100644 --- a/relayer-cli/src/commands/query/packet/unreceived_acks.rs +++ b/relayer-cli/src/commands/query/packet/unreceived_acks.rs @@ -21,7 +21,7 @@ pub struct QueryUnreceivedAcknowledgementCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain to query the unreceived acknowledgments" + help = "Identifier of the chain to query the unreceived acknowledgments" )] chain_id: ChainId, @@ -29,7 +29,7 @@ pub struct QueryUnreceivedAcknowledgementCmd { long = "port", required = true, value_name = "PORT_ID", - help = "port identifier" + help = "Port identifier" )] port_id: PortId, @@ -38,7 +38,7 @@ pub struct QueryUnreceivedAcknowledgementCmd { alias = "chan", required = true, value_name = "CHANNEL_ID", - help = "channel identifier" + 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 03e0ab8722..2dd5025ee3 100644 --- a/relayer-cli/src/commands/query/packet/unreceived_packets.rs +++ b/relayer-cli/src/commands/query/packet/unreceived_packets.rs @@ -21,7 +21,7 @@ pub struct QueryUnreceivedPacketsCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain for the unreceived sequences" + help = "Identifier of the chain for the unreceived sequences" )] chain_id: ChainId, @@ -29,7 +29,7 @@ pub struct QueryUnreceivedPacketsCmd { long = "port", required = true, value_name = "PORT_ID", - help = "port identifier" + help = "Port identifier" )] port_id: PortId, @@ -38,7 +38,7 @@ pub struct QueryUnreceivedPacketsCmd { alias = "chan", required = true, value_name = "CHANNEL_ID", - help = "channel identifier" + 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 6471a85178..cd2d2cfbf7 100644 --- a/relayer-cli/src/commands/query/tx/events.rs +++ b/relayer-cli/src/commands/query/tx/events.rs @@ -23,7 +23,7 @@ pub struct QueryTxEventsCmd { long = "chain", required = true, value_name = "CHAIN_ID", - help = "identifier of the chain to query" + help = "Identifier of the chain to query" )] chain_id: ChainId, @@ -31,7 +31,7 @@ pub struct QueryTxEventsCmd { long = "hash", required = true, value_name = "HASH", - help = "transaction hash to query" + help = "Transaction hash to query" )] hash: String, } diff --git a/relayer-cli/src/commands/tx/channel.rs b/relayer-cli/src/commands/tx/channel.rs index 6b57d36546..b4eeabbb83 100644 --- a/relayer-cli/src/commands/tx/channel.rs +++ b/relayer-cli/src/commands/tx/channel.rs @@ -54,42 +54,42 @@ pub struct TxRawChanOpenInitCmd { #[clap( long = "dst-chain", required = true, - help = "identifier of the destination chain" + help = "Identifier of the destination chain" )] dst_chain_id: ChainId, #[clap( long = "src-chain", required = true, - help = "identifier of the source chain" + help = "Identifier of the source chain" )] src_chain_id: ChainId, #[clap( long = "dst-conn", required = true, - help = "identifier of the destination connection" + help = "Identifier of the destination connection" )] dst_conn_id: ConnectionId, #[clap( long = "dst-port", required = true, - help = "identifier of the destination port" + help = "Identifier of the destination port" )] dst_port_id: PortId, #[clap( long = "src-port", required = true, - help = "identifier of the source port" + help = "Identifier of the source port" )] src_port_id: PortId, #[clap( 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, } @@ -154,49 +154,49 @@ pub struct TxRawChanOpenTryCmd { #[clap( long = "dst-chain", required = true, - help = "identifier of the destination chain" + help = "Identifier of the destination chain" )] dst_chain_id: ChainId, #[clap( long = "src-chain", required = true, - help = "identifier of the source chain" + help = "Identifier of the source chain" )] src_chain_id: ChainId, #[clap( long = "dst-conn", required = true, - help = "identifier of the destination connection" + help = "Identifier of the destination connection" )] dst_conn_id: ConnectionId, #[clap( long = "dst-port", required = true, - help = "identifier of the destination port" + help = "Identifier of the destination port" )] dst_port_id: PortId, #[clap( long = "src-port", required = true, - help = "identifier of the source port" + help = "Identifier of the source port" )] src_port_id: PortId, #[clap( long = "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( long = "dst-chan", - help = "identifier of the destination channel (optional)", + help = "Identifier of the destination channel (optional)", value_name = "ID" )] dst_chan_id: Option, @@ -239,42 +239,42 @@ pub struct TxRawChanOpenAckCmd { #[clap( long = "dst-chain", required = true, - help = "identifier of the destination chain" + help = "Identifier of the destination chain" )] dst_chain_id: ChainId, #[clap( long = "src-chain", required = true, - help = "identifier of the source chain" + help = "Identifier of the source chain" )] src_chain_id: ChainId, #[clap( long = "dst-conn", required = true, - help = "identifier of the destination connection" + help = "Identifier of the destination connection" )] dst_conn_id: ConnectionId, #[clap( long = "dst-port", required = true, - help = "identifier of the destination port" + help = "Identifier of the destination port" )] dst_port_id: PortId, #[clap( long = "src-port", required = true, - help = "identifier of the source port" + help = "Identifier of the source port" )] src_port_id: PortId, #[clap( long = "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, @@ -282,7 +282,7 @@ pub struct TxRawChanOpenAckCmd { #[clap( long = "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, @@ -325,42 +325,42 @@ pub struct TxRawChanOpenConfirmCmd { #[clap( long = "dst-chain", required = true, - help = "identifier of the destination chain" + help = "Identifier of the destination chain" )] dst_chain_id: ChainId, #[clap( long = "src-chain", required = true, - help = "identifier of the source chain" + help = "Identifier of the source chain" )] src_chain_id: ChainId, #[clap( long = "dst-conn", required = true, - help = "identifier of the destination connection" + help = "Identifier of the destination connection" )] dst_conn_id: ConnectionId, #[clap( long = "dst-port", required = true, - help = "identifier of the destination port" + help = "Identifier of the destination port" )] dst_port_id: PortId, #[clap( long = "src-port", required = true, - help = "identifier of the source port" + help = "Identifier of the source port" )] src_port_id: PortId, #[clap( long = "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, @@ -368,7 +368,7 @@ pub struct TxRawChanOpenConfirmCmd { #[clap( long = "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, @@ -411,42 +411,42 @@ pub struct TxRawChanCloseInitCmd { #[clap( long = "dst-chain", required = true, - help = "identifier of the destination chain" + help = "Identifier of the destination chain" )] dst_chain_id: ChainId, #[clap( long = "src-chain", required = true, - help = "identifier of the source chain" + help = "Identifier of the source chain" )] src_chain_id: ChainId, #[clap( long = "dst-conn", required = true, - help = "identifier of the destination connection" + help = "Identifier of the destination connection" )] dst_conn_id: ConnectionId, #[clap( long = "dst-port", required = true, - help = "identifier of the destination port" + help = "Identifier of the destination port" )] dst_port_id: PortId, #[clap( long = "src-port", required = true, - help = "identifier of the source port" + help = "Identifier of the source port" )] src_port_id: PortId, #[clap( long = "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, @@ -454,7 +454,7 @@ pub struct TxRawChanCloseInitCmd { #[clap( long = "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, @@ -497,42 +497,42 @@ pub struct TxRawChanCloseConfirmCmd { #[clap( long = "dst-chain", required = true, - help = "identifier of the destination chain" + help = "Identifier of the destination chain" )] dst_chain_id: ChainId, #[clap( long = "src-chain", required = true, - help = "identifier of the source chain" + help = "Identifier of the source chain" )] src_chain_id: ChainId, #[clap( long = "dst-conn", required = true, - help = "identifier of the destination connection" + help = "Identifier of the destination connection" )] dst_conn_id: ConnectionId, #[clap( long = "dst-port", required = true, - help = "identifier of the destination port" + help = "Identifier of the destination port" )] dst_port_id: PortId, #[clap( long = "src-port", required = true, - help = "identifier of the source port" + help = "Identifier of the source port" )] src_port_id: PortId, #[clap( long = "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, @@ -540,7 +540,7 @@ pub struct TxRawChanCloseConfirmCmd { #[clap( long = "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 fec2d8e00c..54745f1cf9 100644 --- a/relayer-cli/src/commands/tx/client.rs +++ b/relayer-cli/src/commands/tx/client.rs @@ -27,7 +27,7 @@ pub struct TxCreateClientCmd { long = "host-chain", required = true, value_name = "HOST_CHAIN_ID", - help = "identifier of the chain that hosts the client" + help = "Identifier of the chain that hosts the client" )] dst_chain_id: ChainId, @@ -35,7 +35,7 @@ pub struct TxCreateClientCmd { long = "reference-chain", required = true, value_name = "REFERENCE_CHAIN_ID", - help = "identifier of the chain targeted by the client" + help = "Identifier of the chain targeted by the client" )] src_chain_id: ChainId, @@ -107,7 +107,7 @@ pub struct TxUpdateClientCmd { long = "host-chain", required = true, value_name = "HOST_CHAIN_ID", - help = "identifier of the chain that hosts the client" + help = "Identifier of the chain that hosts the client" )] dst_chain_id: ChainId, @@ -115,21 +115,21 @@ pub struct TxUpdateClientCmd { long = "client", required = true, value_name = "CLIENT_ID", - help = "identifier of the chain targeted by the client" + help = "Identifier of the chain targeted by the client" )] dst_client_id: ClientId, #[clap( long = "height", value_name = "REFERENCE_HEIGHT", - help = "the target height of the client update" + help = "The target height of the client update" )] target_height: Option, #[clap( long = "trusted-height", value_name = "REFERENCE_TRUSTED_HEIGHT", - help = "the trusted height of the client update" + help = "The trusted height of the client update" )] trusted_height: Option, } @@ -193,7 +193,7 @@ pub struct TxUpgradeClientCmd { long = "host-chain", required = true, value_name = "HOST_CHAIN_ID", - help = "identifier of the chain that hosts the client" + help = "Identifier of the chain that hosts the client" )] chain_id: ChainId, @@ -201,7 +201,7 @@ pub struct TxUpgradeClientCmd { long = "client", required = true, value_name = "CLIENT_ID", - help = "identifier of the client to be upgraded" + help = "Identifier of the client to be upgraded" )] client_id: ClientId, } @@ -272,7 +272,7 @@ pub struct TxUpgradeClientsCmd { long = "reference-chain", required = true, value_name = "REFERENCE_CHAIN_ID", - help = "identifier of the chain that underwent an upgrade; all clients targeting this chain will be upgraded" + 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 775dd8fb55..69f772d16a 100644 --- a/relayer-cli/src/commands/tx/connection.rs +++ b/relayer-cli/src/commands/tx/connection.rs @@ -39,28 +39,28 @@ pub struct TxRawConnInitCmd { #[clap( long = "dst-chain", required = true, - help = "identifier of the destination chain" + help = "Identifier of the destination chain" )] dst_chain_id: ChainId, #[clap( long = "src-chain", required = true, - help = "identifier of the source chain" + help = "Identifier of the source chain" )] src_chain_id: ChainId, #[clap( long = "dst-client", required = true, - help = "identifier of the destination client" + help = "Identifier of the destination client" )] dst_client_id: ClientId, #[clap( long = "src-client", required = true, - help = "identifier of the source client" + help = "Identifier of the source client" )] src_client_id: ClientId, } @@ -87,42 +87,42 @@ pub struct TxRawConnTryCmd { #[clap( long = "dst-chain", required = true, - help = "identifier of the destination chain" + help = "Identifier of the destination chain" )] dst_chain_id: ChainId, #[clap( long = "src-chain", required = true, - help = "identifier of the source chain" + help = "Identifier of the source chain" )] src_chain_id: ChainId, #[clap( long = "dst-client", required = true, - help = "identifier of the destination client" + help = "Identifier of the destination client" )] dst_client_id: ClientId, #[clap( long = "src-client", required = true, - help = "identifier of the source client" + help = "Identifier of the source client" )] src_client_id: ClientId, #[clap( long = "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( long = "dst-conn", - help = "identifier of the destination connection (optional)", + help = "Identifier of the destination connection (optional)", value_name = "ID" )] dst_conn_id: Option, @@ -158,35 +158,35 @@ pub struct TxRawConnAckCmd { #[clap( long = "dst-chain", required = true, - help = "identifier of the destination chain" + help = "Identifier of the destination chain" )] dst_chain_id: ChainId, #[clap( long = "src-chain", required = true, - help = "identifier of the source chain" + help = "Identifier of the source chain" )] src_chain_id: ChainId, #[clap( long = "dst-client", required = true, - help = "identifier of the destination client" + help = "Identifier of the destination client" )] dst_client_id: ClientId, #[clap( long = "src-client", required = true, - help = "identifier of the source client" + help = "Identifier of the source client" )] src_client_id: ClientId, #[clap( long = "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, @@ -194,7 +194,7 @@ pub struct TxRawConnAckCmd { #[clap( long = "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, @@ -230,35 +230,35 @@ pub struct TxRawConnConfirmCmd { #[clap( long = "dst-chain", required = true, - help = "identifier of the destination chain" + help = "Identifier of the destination chain" )] dst_chain_id: ChainId, #[clap( long = "src-chain", required = true, - help = "identifier of the source chain" + help = "Identifier of the source chain" )] src_chain_id: ChainId, #[clap( long = "dst-client", required = true, - help = "identifier of the destination client" + help = "Identifier of the destination client" )] dst_client_id: ClientId, #[clap( long = "src-client", required = true, - help = "identifier of the source client" + help = "Identifier of the source client" )] src_client_id: ClientId, #[clap( long = "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, @@ -266,7 +266,7 @@ pub struct TxRawConnConfirmCmd { #[clap( long = "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 b22f0b4ab3..59a258d472 100644 --- a/relayer-cli/src/commands/tx/packet.rs +++ b/relayer-cli/src/commands/tx/packet.rs @@ -15,28 +15,28 @@ pub struct TxRawPacketRecvCmd { #[clap( long = "dst-chain", required = true, - help = "identifier of the destination chain" + help = "Identifier of the destination chain" )] dst_chain_id: ChainId, #[clap( long = "src-chain", required = true, - help = "identifier of the source chain" + help = "Identifier of the source chain" )] src_chain_id: ChainId, #[clap( long = "src-port", required = true, - help = "identifier of the source port" + help = "Identifier of the source port" )] src_port_id: PortId, #[clap( long = "src-chan", required = true, - help = "identifier of the source channel" + help = "Identifier of the source channel" )] src_channel_id: ChannelId, } @@ -75,28 +75,28 @@ pub struct TxRawPacketAckCmd { #[clap( long = "dst-chain", required = true, - help = "identifier of the destination chain" + help = "Identifier of the destination chain" )] dst_chain_id: ChainId, #[clap( long = "src-chain", required = true, - help = "identifier of the source chain" + help = "Identifier of the source chain" )] src_chain_id: ChainId, #[clap( long = "src-port", required = true, - help = "identifier of the source port" + help = "Identifier of the source port" )] src_port_id: PortId, #[clap( long = "src-chan", required = true, - help = "identifier of the source channel" + 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 27b17ff9c7..72991d0fd0 100644 --- a/relayer-cli/src/commands/tx/transfer.rs +++ b/relayer-cli/src/commands/tx/transfer.rs @@ -29,71 +29,71 @@ pub struct TxIcs20MsgTransferCmd { #[clap( long = "dst-chain", required = true, - help = "identifier of the destination chain" + help = "Identifier of the destination chain" )] dst_chain_id: ChainId, #[clap( long = "src-chain", required = true, - help = "identifier of the source chain" + help = "Identifier of the source chain" )] src_chain_id: ChainId, #[clap( long = "src-port", required = true, - help = "identifier of the source port" + help = "Identifier of the source port" )] src_port_id: PortId, #[clap( long = "src-chan", required = true, - help = "identifier of the source channel" + 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( 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( long = "timeout-seconds", default_value = "0", - help = "timeout in seconds since current" + help = "Timeout in seconds since current" )] timeout_seconds: u64, #[clap( long = "receiver", - help = "receiving account address on the destination chain" + help = "Receiving account address on the destination chain" )] receiver: Option, #[clap( long = "denom", - help = "denomination of the coins to send", + help = "Denomination of the coins to send", default_value = "samoleans" )] denom: String, - #[clap(long = "number-msgs", help = "number of messages to send")] + #[clap(long = "number-msgs", help = "Number of messages to send")] number_msgs: Option, #[clap( long = "key-name", - help = "use the given signing key name (default: `key_name` config)" + help = "Use the given signing key name (default: `key_name` config)" )] key_name: Option, } diff --git a/relayer-cli/src/commands/tx/upgrade.rs b/relayer-cli/src/commands/tx/upgrade.rs index 6a4cdac8d3..541af9ff2f 100644 --- a/relayer-cli/src/commands/tx/upgrade.rs +++ b/relayer-cli/src/commands/tx/upgrade.rs @@ -17,58 +17,58 @@ pub struct TxIbcUpgradeChainCmd { #[clap( long = "dst-chain", required = true, - help = "identifier of the chain to upgrade" + help = "Identifier of the chain to upgrade" )] dst_chain_id: ChainId, #[clap( long = "src-chain", required = true, - help = "identifier of the source chain" + 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(long = "amount", 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( 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( 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( 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( long = "denom", - help = "denomination for the deposit (default: 'stake')" + help = "Denomination for the deposit (default: 'stake')" )] denom: Option, } diff --git a/relayer-cli/src/entry.rs b/relayer-cli/src/entry.rs index eb55a7da14..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(long = "config", help = "path to configuration file")] + #[clap(long = "config", help = "Path to configuration file")] pub config: Option, /// Toggle JSON output mode one verbosity setting - #[clap(long = "json", help = "enable JSON output")] + #[clap(long = "json", help = "Enable JSON output")] pub json: bool, /// Subcommand to execute. From eff375cbbcce9c5c8516452fff156fef23416338 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Tue, 28 Jun 2022 14:01:08 +0200 Subject: [PATCH 36/37] Update guide to account for argument help text starting with an uppercase letter --- guide/src/commands/global.md | 4 +- guide/src/commands/keys/index.md | 10 ++-- guide/src/commands/misbehaviour/index.md | 4 +- guide/src/commands/path-setup/connections.md | 10 ++-- guide/src/commands/queries/channel.md | 22 ++++---- guide/src/commands/queries/client.md | 20 ++++---- guide/src/commands/queries/connection.md | 12 ++--- guide/src/commands/queries/packet.md | 50 +++++++++--------- guide/src/commands/queries/transfer.md | 4 +- guide/src/commands/queries/tx.md | 4 +- guide/src/commands/raw/channel-close.md | 28 +++++----- guide/src/commands/raw/channel-open.md | 54 ++++++++++---------- guide/src/commands/raw/connection.md | 44 ++++++++-------- guide/src/commands/raw/packet.md | 16 +++--- guide/src/commands/raw/upgrade.md | 4 +- guide/src/commands/relaying/clear.md | 6 +-- guide/src/commands/upgrade/index.md | 4 +- guide/src/installation.md | 4 +- 18 files changed, 150 insertions(+), 150 deletions(-) diff --git a/guide/src/commands/global.md b/guide/src/commands/global.md index ef9c9596cd..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: - --config path to configuration file - --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. diff --git a/guide/src/commands/keys/index.md b/guide/src/commands/keys/index.md index 08539a220e..f91153961c 100644 --- a/guide/src/commands/keys/index.md +++ b/guide/src/commands/keys/index.md @@ -215,11 +215,11 @@ DESCRIPTION: Delete key(s) from a configured chain FLAGS: - --chain identifier of the chain + --chain Identifier of the chain OPTIONS: - --key-name name of the key - --all delete all keys + --key-name Name of the key + --all Delete all keys ``` #### Delete private keys that was previously added to a chain @@ -248,7 +248,7 @@ DESCRIPTION: List keys configured on a chain FLAGS: - --chain identifier of the chain + --chain Identifier of the chain ``` #### Listing the private key that was added to a chain @@ -308,7 +308,7 @@ DESCRIPTION: Query balance for a key from a configured chain. If no key is given, the key is retrieved from the configuration file FLAGS: - --chain identifier of the chain + --chain Identifier of the chain OPTIONS: --key-name (optional) name of the key (defaults to the `key_name` defined in the config) diff --git a/guide/src/commands/misbehaviour/index.md b/guide/src/commands/misbehaviour/index.md index 57432b0b7c..18ef25ffa2 100644 --- a/guide/src/commands/misbehaviour/index.md +++ b/guide/src/commands/misbehaviour/index.md @@ -16,9 +16,9 @@ DESCRIPTION: Listen to client update IBC events and handles misbehaviour FLAGS: - --chain identifier of the chain where client updates are monitored for + --chain Identifier of the chain where client updates are monitored for misbehaviour - --client identifier of the client to be 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. diff --git a/guide/src/commands/path-setup/connections.md b/guide/src/commands/path-setup/connections.md index 5bea038052..0918a6b10e 100644 --- a/guide/src/commands/path-setup/connections.md +++ b/guide/src/commands/path-setup/connections.md @@ -15,15 +15,15 @@ DESCRIPTION: Create a new connection between two chains FLAGS: - --a-chain identifier of the side `a` chain for the new connection + --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-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 + --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) + --delay Delay period parameter for the new connection (seconds) [default: 0] ``` diff --git a/guide/src/commands/queries/channel.md b/guide/src/commands/queries/channel.md index 8ea8b3468c..a0a397c24f 100644 --- a/guide/src/commands/queries/channel.md +++ b/guide/src/commands/queries/channel.md @@ -81,12 +81,12 @@ DESCRIPTION: Query channel end FLAGS: - --chain identifier of the chain to query - --channel identifier of the channel to query - --port 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 OPTIONS: - --height height of the state to query + --height Height of the state to query ``` __Example__ @@ -133,12 +133,12 @@ DESCRIPTION: Query channel ends and underlying connection and client objects FLAGS: - --chain identifier of the chain to query - --channel identifier of the channel to query - --port 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 OPTIONS: - --height height of the state to query + --height Height of the state to query --verbose enable verbose output, displaying all details of channels, connections & clients ``` @@ -203,9 +203,9 @@ DESCRIPTION: Query channel's client state FLAGS: - --chain identifier of the chain to query - --channel identifier of the channel to query - --port 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: diff --git a/guide/src/commands/queries/client.md b/guide/src/commands/queries/client.md index a7daede06c..ff09bd3f08 100644 --- a/guide/src/commands/queries/client.md +++ b/guide/src/commands/queries/client.md @@ -102,11 +102,11 @@ DESCRIPTION: Query the client state FLAGS: - --chain identifier of the chain to query - --client identifier of the client to query + --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 + --height HEIGHT The chain height which this query should reflect ``` __Example__ @@ -245,11 +245,11 @@ DESCRIPTION: Query client connections FLAGS: - --chain identifier of the chain to query - --client identifier of the client to query + --chain Identifier of the chain to query + --client Identifier of the client to query OPTIONS: - --height the chain height which this query should reflect + --height The chain height which this query should reflect ``` __Example__ @@ -277,12 +277,12 @@ DESCRIPTION: Query for the header used in a client update at a certain height FLAGS: - --chain identifier of the chain to query - --client identifier of the client to query - --consensus-height height of header to 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 + --height The chain height context for the query ``` __Example__ diff --git a/guide/src/commands/queries/connection.md b/guide/src/commands/queries/connection.md index 3028728e37..2d8b505fca 100644 --- a/guide/src/commands/queries/connection.md +++ b/guide/src/commands/queries/connection.md @@ -14,7 +14,7 @@ DESCRIPTION: Query the identifiers of all connections on a chain FLAGS: - --chain identifier of the chain to query + --chain Identifier of the chain to query ``` __Example__ @@ -64,11 +64,11 @@ DESCRIPTION: Query connection end FLAGS: - --chain identifier of the chain to query - --connection identifier of the connection to query + --chain Identifier of the chain to query + --connection Identifier of the connection to query OPTIONS: - --height height of the state to query + --height Height of the state to query ``` __Example__ @@ -121,8 +121,8 @@ DESCRIPTION: Query connection channels FLAGS: - --chain identifier of the chain to query - --connection identifier of the connection to query + --chain Identifier of the chain to query + --connection Identifier of the connection to query ``` __Example__ diff --git a/guide/src/commands/queries/packet.md b/guide/src/commands/queries/packet.md index 6aff501792..357a360c8b 100644 --- a/guide/src/commands/queries/packet.md +++ b/guide/src/commands/queries/packet.md @@ -35,9 +35,9 @@ USAGE: hermes query packet pending --chain --port --channel 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 + --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__ @@ -90,9 +90,9 @@ DESCRIPTION: Query packet commitments FLAGS: - --chain identifier of the chain to query - --channel identifier of the channel to query - --port 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 ``` __Example__ @@ -129,13 +129,13 @@ DESCRIPTION: Query packet commitment FLAGS: - --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 + --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 + --height Height of the state to query ``` __Example__ @@ -162,9 +162,9 @@ DESCRIPTION: Query packet acknowledgments FLAGS: - --chain identifier of the chain to query - --channel identifier of the channel to query - --port 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 ``` __Example__ @@ -201,13 +201,13 @@ DESCRIPTION: Query packet acknowledgment FLAGS: - --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 + --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 + --height Height of the state to query ``` __Example__ @@ -234,9 +234,9 @@ DESCRIPTION: Query unreceived packets FLAGS: - --chain identifier of the chain for the unreceived sequences - --channel channel identifier - --port port identifier + --chain Identifier of the chain for the unreceived sequences + --channel Channel identifier + --port Port identifier ``` __Example__ @@ -267,9 +267,9 @@ DESCRIPTION: Query unreceived acknowledgments FLAGS: - --chain identifier of the chain to query the unreceived acknowledgments - --channel channel identifier - --port port identifier + --chain Identifier of the chain to query the unreceived acknowledgments + --channel Channel identifier + --port Port identifier ``` __Example__ 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 536b66ca0b..c0fb5917b3 100644 --- a/guide/src/commands/queries/tx.md +++ b/guide/src/commands/queries/tx.md @@ -32,8 +32,8 @@ DESCRIPTION: Query the events emitted by transaction FLAGS: - --chain identifier of the chain to query - --hash transaction hash to query + --chain Identifier of the chain to query + --hash Transaction hash to query ``` __Example__ diff --git a/guide/src/commands/raw/channel-close.md b/guide/src/commands/raw/channel-close.md index abe6c4e086..16bddfbf38 100644 --- a/guide/src/commands/raw/channel-close.md +++ b/guide/src/commands/raw/channel-close.md @@ -18,13 +18,13 @@ DESCRIPTION: Initiate the closing of a channel (ChannelCloseInit) FLAGS: - --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 + --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__ @@ -77,13 +77,13 @@ DESCRIPTION: Confirm the closing of a channel (ChannelCloseConfirm) FLAGS: - --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 + --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 ``` diff --git a/guide/src/commands/raw/channel-open.md b/guide/src/commands/raw/channel-open.md index 5dabafb714..6dc106cfe1 100644 --- a/guide/src/commands/raw/channel-open.md +++ b/guide/src/commands/raw/channel-open.md @@ -41,14 +41,14 @@ DESCRIPTION: Initialize a channel (ChannelOpenInit) FLAGS: - --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 + --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 + --order The channel ordering, valid options 'unordered' (default) and 'ordered' [default: ORDER_UNORDERED] ``` @@ -105,15 +105,15 @@ DESCRIPTION: Relay the channel attempt (ChannelOpenTry) FLAGS: - --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 + --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) + --dst-chan Identifier of the destination channel (optional) ``` __Example__ @@ -173,13 +173,13 @@ DESCRIPTION: Relay acknowledgment of a channel attempt (ChannelOpenAck) FLAGS: - --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 + --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__ @@ -238,13 +238,13 @@ DESCRIPTION: Confirm opening of a channel (ChannelOpenConfirm) FLAGS: - --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 + --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__ diff --git a/guide/src/commands/raw/connection.md b/guide/src/commands/raw/connection.md index b6e061c808..276fcc0cea 100644 --- a/guide/src/commands/raw/connection.md +++ b/guide/src/commands/raw/connection.md @@ -41,10 +41,10 @@ DESCRIPTION: Initialize a connection (ConnectionOpenInit) 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 + --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__ @@ -100,14 +100,14 @@ DESCRIPTION: Relay the connection attempt (ConnectionOpenTry) 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 - --src-conn 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) + --dst-conn Identifier of the destination connection (optional) ``` __Example__ @@ -164,12 +164,12 @@ DESCRIPTION: Relay acknowledgment of a connection attempt (ConnectionOpenAck) FLAGS: - --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) + --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__ @@ -225,12 +225,12 @@ DESCRIPTION: Confirm opening of a connection (ConnectionOpenConfirm) FLAGS: - --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) + --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__ diff --git a/guide/src/commands/raw/packet.md b/guide/src/commands/raw/packet.md index 0bd37fd374..5522eac79a 100644 --- a/guide/src/commands/raw/packet.md +++ b/guide/src/commands/raw/packet.md @@ -117,10 +117,10 @@ DESCRIPTION: Relay receive or timeout packets 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 + --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__ @@ -229,10 +229,10 @@ DESCRIPTION: Relay acknowledgment packets 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 + --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__ diff --git a/guide/src/commands/raw/upgrade.md b/guide/src/commands/raw/upgrade.md index b04268ba5f..c5b11b3290 100644 --- a/guide/src/commands/raw/upgrade.md +++ b/guide/src/commands/raw/upgrade.md @@ -16,8 +16,8 @@ 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 + --client Identifier of the client to be upgraded + --host-chain Identifier of the chain that hosts the client ``` __Example__ diff --git a/guide/src/commands/relaying/clear.md b/guide/src/commands/relaying/clear.md index c7a7907ddf..1211137f53 100644 --- a/guide/src/commands/relaying/clear.md +++ b/guide/src/commands/relaying/clear.md @@ -18,9 +18,9 @@ DESCRIPTION: The channel is identified by the chain, port, and channel IDs at one of its ends FLAGS: - --chain identifier of the chain - --channel identifier of the channel - --port identifier of the port + --chain Identifier of the chain + --channel Identifier of the channel + --port Identifier of the port ``` ### Example diff --git a/guide/src/commands/upgrade/index.md b/guide/src/commands/upgrade/index.md index 2251baa45f..0d974602c1 100644 --- a/guide/src/commands/upgrade/index.md +++ b/guide/src/commands/upgrade/index.md @@ -12,8 +12,8 @@ DESCRIPTION: Upgrade an IBC client FLAGS: - --host-chain identifier of the chain that hosts the client - --client identifier of the client to be upgraded + --host-chain Identifier of the chain that hosts the client + --client Identifier of the client to be upgraded ``` __Example__ diff --git a/guide/src/installation.md b/guide/src/installation.md index fbd3f69150..75f1fcac24 100644 --- a/guide/src/installation.md +++ b/guide/src/installation.md @@ -158,9 +158,9 @@ USAGE: hermes [OPTIONS] OPTIONS: - --config path to configuration file + --config Path to configuration file -h, --help Print help information - --json enable JSON output + --json Enable JSON output -V, --version Print version information SUBCOMMANDS: From 6b2947e01c19aff147dc3f0d7889930fc78a97fa Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Tue, 28 Jun 2022 14:18:51 +0200 Subject: [PATCH 37/37] Add shortened aliases for `tx raw` commands --- relayer-cli/src/commands/tx/channel.rs | 48 +++++++++++++++-------- relayer-cli/src/commands/tx/connection.rs | 18 ++++++--- relayer-cli/src/commands/tx/packet.rs | 6 ++- relayer-cli/src/commands/tx/transfer.rs | 3 +- 4 files changed, 50 insertions(+), 25 deletions(-) diff --git a/relayer-cli/src/commands/tx/channel.rs b/relayer-cli/src/commands/tx/channel.rs index b4eeabbb83..7472a6daea 100644 --- a/relayer-cli/src/commands/tx/channel.rs +++ b/relayer-cli/src/commands/tx/channel.rs @@ -66,7 +66,8 @@ pub struct TxRawChanOpenInitCmd { src_chain_id: ChainId, #[clap( - long = "dst-conn", + long = "dst-connection", + alias = "dst-conn", required = true, help = "Identifier of the destination connection" )] @@ -166,7 +167,8 @@ pub struct TxRawChanOpenTryCmd { src_chain_id: ChainId, #[clap( - long = "dst-conn", + long = "dst-connection", + alias = "dst-conn", required = true, help = "Identifier of the destination connection" )] @@ -187,7 +189,8 @@ pub struct TxRawChanOpenTryCmd { src_port_id: PortId, #[clap( - long = "src-chan", + long = "src-channel", + alias = "src-chan", required = true, help = "Identifier of the source channel (required)", value_name = "ID" @@ -195,7 +198,8 @@ pub struct TxRawChanOpenTryCmd { src_chan_id: ChannelId, #[clap( - long = "dst-chan", + long = "dst-channel", + alias = "dst-chan", help = "Identifier of the destination channel (optional)", value_name = "ID" )] @@ -251,7 +255,8 @@ pub struct TxRawChanOpenAckCmd { src_chain_id: ChainId, #[clap( - long = "dst-conn", + long = "dst-connection", + alias = "dst-conn", required = true, help = "Identifier of the destination connection" )] @@ -272,7 +277,8 @@ pub struct TxRawChanOpenAckCmd { src_port_id: PortId, #[clap( - long = "dst-chan", + long = "dst-channel", + alias = "dst-chan", required = true, help = "Identifier of the destination channel (required)", value_name = "ID" @@ -280,7 +286,8 @@ pub struct TxRawChanOpenAckCmd { dst_chan_id: ChannelId, #[clap( - long = "src-chan", + long = "src-channel", + alias = "src-chan", required = true, help = "Identifier of the source channel (required)", value_name = "ID" @@ -337,7 +344,8 @@ pub struct TxRawChanOpenConfirmCmd { src_chain_id: ChainId, #[clap( - long = "dst-conn", + long = "dst-connection", + alias = "dst-conn", required = true, help = "Identifier of the destination connection" )] @@ -358,7 +366,8 @@ pub struct TxRawChanOpenConfirmCmd { src_port_id: PortId, #[clap( - long = "dst-chan", + long = "dst-channel", + alias = "dst-chan", required = true, help = "Identifier of the destination channel (required)", value_name = "ID" @@ -366,7 +375,8 @@ pub struct TxRawChanOpenConfirmCmd { dst_chan_id: ChannelId, #[clap( - long = "src-chan", + long = "src-channel", + alias = "src-chan", required = true, help = "Identifier of the source channel (required)", value_name = "ID" @@ -423,7 +433,8 @@ pub struct TxRawChanCloseInitCmd { src_chain_id: ChainId, #[clap( - long = "dst-conn", + long = "dst-connection", + alias = "dst-conn", required = true, help = "Identifier of the destination connection" )] @@ -444,7 +455,8 @@ pub struct TxRawChanCloseInitCmd { src_port_id: PortId, #[clap( - long = "dst-chan", + long = "dst-channel", + alias = "dst-chan", required = true, help = "Identifier of the destination channel (required)", value_name = "ID" @@ -452,7 +464,8 @@ pub struct TxRawChanCloseInitCmd { dst_chan_id: ChannelId, #[clap( - long = "src-chan", + long = "src-channel", + alias = "src-chan", required = true, help = "Identifier of the source channel (required)", value_name = "ID" @@ -509,7 +522,8 @@ pub struct TxRawChanCloseConfirmCmd { src_chain_id: ChainId, #[clap( - long = "dst-conn", + long = "dst-connection", + alias = "dst-conn", required = true, help = "Identifier of the destination connection" )] @@ -530,7 +544,8 @@ pub struct TxRawChanCloseConfirmCmd { src_port_id: PortId, #[clap( - long = "dst-chan", + long = "dst-channel", + alias = "dst-chan", required = true, help = "Identifier of the destination channel (required)", value_name = "ID" @@ -538,7 +553,8 @@ pub struct TxRawChanCloseConfirmCmd { dst_chan_id: ChannelId, #[clap( - long = "src-chan", + long = "src-channel", + alias = "src-chan", required = true, help = "Identifier of the source channel (required)", value_name = "ID" diff --git a/relayer-cli/src/commands/tx/connection.rs b/relayer-cli/src/commands/tx/connection.rs index 69f772d16a..a483a67e7f 100644 --- a/relayer-cli/src/commands/tx/connection.rs +++ b/relayer-cli/src/commands/tx/connection.rs @@ -113,7 +113,8 @@ pub struct TxRawConnTryCmd { src_client_id: ClientId, #[clap( - long = "src-conn", + long = "src-connection", + alias = "src-conn", required = true, help = "Identifier of the source connection (required)", value_name = "ID" @@ -121,7 +122,8 @@ pub struct TxRawConnTryCmd { src_conn_id: ConnectionId, #[clap( - long = "dst-conn", + long = "dst-connection", + alias = "dst-conn", help = "Identifier of the destination connection (optional)", value_name = "ID" )] @@ -184,7 +186,8 @@ pub struct TxRawConnAckCmd { src_client_id: ClientId, #[clap( - long = "dst-conn", + long = "dst-connection", + alias = "dst-conn", required = true, help = "Identifier of the destination connection (required)", value_name = "ID" @@ -192,7 +195,8 @@ pub struct TxRawConnAckCmd { dst_conn_id: ConnectionId, #[clap( - long = "src-conn", + long = "src-connection", + alias = "src-conn", required = true, help = "Identifier of the source connection (required)", value_name = "ID" @@ -256,7 +260,8 @@ pub struct TxRawConnConfirmCmd { src_client_id: ClientId, #[clap( - long = "dst-conn", + long = "dst-connection", + alias = "dst-conn", required = true, help = "Identifier of the destination connection (required)", value_name = "ID" @@ -264,7 +269,8 @@ pub struct TxRawConnConfirmCmd { dst_conn_id: ConnectionId, #[clap( - long = "src-conn", + long = "src-connection", + alias = "src-conn", required = true, help = "Identifier of the source connection (required)", value_name = "ID" diff --git a/relayer-cli/src/commands/tx/packet.rs b/relayer-cli/src/commands/tx/packet.rs index 59a258d472..a8e70bb1df 100644 --- a/relayer-cli/src/commands/tx/packet.rs +++ b/relayer-cli/src/commands/tx/packet.rs @@ -34,7 +34,8 @@ pub struct TxRawPacketRecvCmd { src_port_id: PortId, #[clap( - long = "src-chan", + long = "src-channel", + alias = "src-chan", required = true, help = "Identifier of the source channel" )] @@ -94,7 +95,8 @@ pub struct TxRawPacketAckCmd { src_port_id: PortId, #[clap( - long = "src-chan", + long = "src-channel", + alias = "src-chan", required = true, help = "Identifier of the source channel" )] diff --git a/relayer-cli/src/commands/tx/transfer.rs b/relayer-cli/src/commands/tx/transfer.rs index 72991d0fd0..a8baa44ba4 100644 --- a/relayer-cli/src/commands/tx/transfer.rs +++ b/relayer-cli/src/commands/tx/transfer.rs @@ -48,7 +48,8 @@ pub struct TxIcs20MsgTransferCmd { src_port_id: PortId, #[clap( - long = "src-chan", + long = "src-channel", + alias = "src-chan", required = true, help = "Identifier of the source channel" )]