Description
Crate
relayer, relayer-cli
Summary
Proposal for the relayer CLIs (tx raw
excluded)
The proposal is summarized in ADR 006.
Problem Definition
Currently the relayer CLIs do not cover user needs and offer a poor UX. See for example #628.
Proposal
I propose the following new/ changed CLIs:
-
Follow the Go relayer commands for channel and connection handshakes (?):
hermes channel handshake..
should be renamed tohermes tx channel ..
- add new
hermes tx connection...
-
Add options to commands so they can establish new connections and channels, finalize any unfinished handshakes, reuse clients, connection, etc:
-
hermes tx connection <src-chain> [<dst-chain>] [--src-client <client-id>] [--dst-client <client-id>] [--src-connection <connection-id>]
-
Examples:
hermex tx connection ibc-0 ibc-1
- creates new clients and establishes a new connection between the two chains- Should it look for already created clients, check if the trust model is the same as in the
config.toml
and reuse those clients? And create new clients only if some to use are not found. I believe the Go relayer does this.
- Should it look for already created clients, check if the trust model is the same as in the
hermex tx connection ibc-0 ibc-1 --src-client client-0 --dst-client client-1
- establishes a new connection using the specified clients. Note that only one client may be specified, the other is created (with the same question as above)hermex tx connection ibc-0 --src-connection connection-0
- finalizes the handshake forconnection-0
-
hermes tx channel <src-chain> [<dst-chain>] [--src-connection <connection-id>] [--src-port <port-id>] [--dst-port <port-id>] [--src-channel <channel-id>]
-
Examples:
hermex tx channel ibc-0 ibc-1 --src-port transfer --dst-port transfer
- establishes a new connection (with new clients) and a new channel between the two ports (we have this today)- Similar question as for connections: should this look for any connection between the two chains and reuse it?
hermex tx channel ibc-0 --src-connection connection-0 --src-port transfer --dst-port transfer
- establishes a new channel usingconnection-1
, between the two ports.connection-0
must exist, if not in open state it will finalize the connection handshake before establishing the new channelhermex tx channel ibc-0 --src-port transfer--src-channel channel-0
- finalizes the handshake forchannel-0
-
-
I propose we change
hermes start ...
command:hermes start <src-chain> [<dst-chain>] [--src-port <port-id>] [--dst-port <port-id>] [--src-channel <channel-id>]
hermes start ibc-0 ibc-1
- don't allow this anymore, the equivalent would be the one below- this is currently looking in config for the
connection.paths
sections and uses the ports specified in the first one - I believe is the only command that uses that portion of the config so we could remove it
- this is currently looking in config for the
hermes start ibc-0 ibc-1 --src-port transfer --dst-port transfer
- creates new clients, connection, channel between the two chains and ports- same question as before: should it reuse existing connection if one exists?
hermes start ibc-0 --src-port transfer --src-channel channel-0
- finalizes any pending handshakes (forchannel-0
and maybe the connection that the channel uses) and starts the event listening loop
-
There is a recurrent question above: when an identifier for a required client or connection is not specified should a command look for an existing client or connection or create new ones? Should we add a
--reuse-if-exist
type flag to allow both behaviors?
For Admin Use
- Not duplicate issue
- Appropriate labels applied
- Appropriate milestone (priority) applied
- Appropriate contributors tagged
- Contributor assigned/self-assigned