Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filtering to query channels to show channels between a pairs of chains #1132

Closed
5 tasks
ancazamfir opened this issue Jun 28, 2021 · 1 comment · Fixed by #1243 or #2377
Closed
5 tasks

Add filtering to query channels to show channels between a pairs of chains #1132

ancazamfir opened this issue Jun 28, 2021 · 1 comment · Fixed by #1243 or #2377
Labels
I: CLI Internal: related to the relayer's CLI O: new-feature Objective: cause to add a new feature or support O: usability Objective: cause to improve the user experience (UX) and ease using the product
Milestone

Comments

@ancazamfir
Copy link
Collaborator

Crate

relayer-cli

Summary

Current hermes query channels <chain-id> shows all channels on the specified chains.
It would be very useful to show all channels between two chains.

Problem Definition

Needed for operations (Dex, osmosis, etc).

Proposal

Extend query channels to take an optional destination chain. In addition add the --verbose option to show client and connection ids on the counterparty chain. In this case the output should use, for each channel, the same format as in #1062

query channels <chain-id> [--destination-chain <chain-id>] [--verbose]
e.g.:

$ query channels ibc-0 -d ibc-1

Success: [
    PortChannelId {
        channel_id: ChannelId(
            "channel-0",
        ),
        port_id: PortId(
            "transfer",
        ),
    },
    PortChannelId {
        channel_id: ChannelId(
            "channel-1",
        ),
        port_id: PortId(
            "transfer",
        ),
    },
]
$ query channels ibc-0 -d ibc-1 --verbose
...

Acceptance Criteria


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@adizere adizere modified the milestones: 06.2021, 07.2021 Jun 29, 2021
@adizere adizere added I: CLI Internal: related to the relayer's CLI O: new-feature Objective: cause to add a new feature or support O: usability Objective: cause to improve the user experience (UX) and ease using the product labels Jul 2, 2021
@hu55a1n1 hu55a1n1 self-assigned this Jul 28, 2021
@adizere adizere modified the milestones: 07.2021, 08.2021 Aug 3, 2021
@adizere
Copy link
Member

adizere commented Jun 24, 2022

Found out that the filtering implemented in #1243 does not work.

Note: The option --destination-chain was renamed into --counterparty-chain as part of ADR 010 and its implementation.

Examples:

  • we have a single channel opened between ibc-0 and ibc-1 in these examples;
  • filtering by the same chain as the chain we're querying
$ hermes query channels --chain ibc-0 --counterparty-chain ibc-0
    Finished dev [unoptimized + debuginfo] target(s) in 0.25s
     Running `target/debug/hermes query channels --chain ibc-0 --counterparty-chain ibc-0`
2022-06-24T08:03:53.395055Z  INFO ThreadId(01) using default configuration from '/Users/adi/.hermes/config.toml'
2022-06-24T08:03:53.396324Z DEBUG ThreadId(01) Options: QueryChannelsCmd { chain_id: ChainId { id: "ibc-0", version: 0 }, dst_chain_id: Some(ChainId { id: "ibc-0", version: 0 }), verbose: false }
2022-06-24T08:03:53.404463Z TRACE ThreadId(01) spawned chain runtime chain=ibc-0
Success: [
    PortChannelId {
        channel_id: ChannelId(
            "channel-0",
        ),
        port_id: PortId(
            "transfer",
        ),
    },
]
  • filtering by a non-existing chain ibc-10
$ hermes query channels --chain ibc-0 --counterparty-chain ibc-10
    Finished dev [unoptimized + debuginfo] target(s) in 0.29s
     Running `target/debug/hermes query channels --chain ibc-0 --counterparty-chain ibc-10`
2022-06-24T08:11:37.139260Z  INFO ThreadId(01) using default configuration from '/Users/adi/.hermes/config.toml'
2022-06-24T08:11:37.140570Z DEBUG ThreadId(01) Options: QueryChannelsCmd { chain_id: ChainId { id: "ibc-0", version: 0 }, dst_chain_id: Some(ChainId { id: "ibc-10", version: 10 }), verbose: false }
2022-06-24T08:11:37.149776Z TRACE ThreadId(01) spawned chain runtime chain=ibc-0
Success: [
    PortChannelId {
        channel_id: ChannelId(
            "channel-0",
        ),
        port_id: PortId(
            "transfer",
        ),
    },
]

Tested w/ versions:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: CLI Internal: related to the relayer's CLI O: new-feature Objective: cause to add a new feature or support O: usability Objective: cause to improve the user experience (UX) and ease using the product
Projects
No open projects
Status: Backlog
4 participants