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

channels query extended info #1106

Merged
merged 7 commits into from
Feb 22, 2023
Merged

Conversation

agouin
Copy link
Member

@agouin agouin commented Feb 21, 2023

When querying channels, the information is limited. Additional useful information:

  • Client ID
  • Counterparty Chain ID (to which chain does this channel lead?)
  • Counterparty Connection ID
  • Counterparty Client ID

This information is now printed out, and pagination is added due to extremely long query times on chains like the hub.

Example output:

$ rly q channels cosmoshub
...
{"chain_id":"cosmoshub-4","channel_id":"channel-12","client_id":"07-tendermint-18","connection_hops":["connection-36"],"counterparty":{"chain_id":"mars","channel_id":"channel-1","client_id":"07-tendermint-1","connection_id":"connection-1","port_id":"transfer"},"ordering":"ORDER_UNORDERED","port_id":"transfer","state":"STATE_TRYOPEN","version":"ics20-1"}
{"chain_id":"cosmoshub-4","channel_id":"channel-120","client_id":"07-tendermint-185","connection_hops":["connection-224"],"counterparty":{"chain_id":"coindesk-testnet-1","channel_id":"channel-1","client_id":"07-tendermint-0","connection_id":"connection-1","port_id":"transfer"},"ordering":"ORDER_UNORDERED","port_id":"transfer","state":"STATE_OPEN","version":"ics20-1"}
{"chain_id":"cosmoshub-4","channel_id":"channel-121","client_id":"07-tendermint-194","connection_hops":["connection-232"],"counterparty":{"chain_id":"akashnet-2","channel_id":"channel-7","client_id":"07-tendermint-16","connection_id":"connection-9","port_id":"transfer"},"ordering":"ORDER_UNORDERED","port_id":"transfer","state":"STATE_OPEN","version":"ics20-1"}

Pagination next key: /ports/transfer/channels/channel-122
$ rly q channels cosmoshub --page-key /ports/transfer/channels/channel-122
...
{"chain_id":"cosmoshub-4","channel_id":"channel-209","client_id":"07-tendermint-444","connection_hops":["connection-376"],"counterparty":{"chain_id":"injective-1","channel_id":"channel-0","client_id":"07-tendermint-3","connection_id":"connection-1","port_id":"transfer"},"ordering":"ORDER_UNORDERED","port_id":"transfer","state":"STATE_TRYOPEN","version":"ics20-1"}
{"chain_id":"cosmoshub-4","channel_id":"channel-21","client_id":"07-tendermint-24","connection_hops":["connection-84"],"counterparty":{"chain_id":"world","channel_id":"channel-0","client_id":"07-tendermint-0","connection_id":"connection-0","port_id":"transfer"},"ordering":"ORDER_UNORDERED","port_id":"transfer","state":"STATE_OPEN","version":"ics20-1"}
{"chain_id":"cosmoshub-4","channel_id":"channel-210","client_id":"07-tendermint-444","connection_hops":["connection-376"],"counterparty":{"chain_id":"injective-1","channel_id":"channel-0","client_id":"07-tendermint-3","connection_id":"connection-1","port_id":"transfer"},"ordering":"ORDER_UNORDERED","port_id":"transfer","state":"STATE_TRYOPEN","version":"ics20-1"}
{"chain_id":"cosmoshub-4","channel_id":"channel-211","client_id":"07-tendermint-444","connection_hops":["connection-376"],"counterparty":{"chain_id":"injective-1","channel_id":"channel-0","client_id":"07-tendermint-3","connection_id":"connection-1","port_id":"transfer"},"ordering":"ORDER_UNORDERED","port_id":"transfer","state":"STATE_OPEN","version":"ics20-1"}

Pagination next key: /ports/transfer/channels/channel-212

Additionally, adds ability to query channels specifically between two chains:

$ rly q channels stargaze osmosis
...
{"chain_id":"stargaze-1","channel_id":"channel-11","client_id":"07-tendermint-91","connection_hops":["connection-17"],"counterparty":{"chain_id":"osmosis-1","channel_id":"channel-11","client_id":"07-tendermint-14","connection_id":"connection-14","port_id":"transfer"},"ordering":"ORDER_UNORDERED","port_id":"transfer","state":"STATE_OPEN","version":"ics20-1"}
...

Copy link
Member

@jtieri jtieri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really nice overall enhancement! 🎉

cmd/query.go Outdated Show resolved Hide resolved
@agouin agouin merged commit ab349dd into main Feb 22, 2023
@agouin agouin deleted the andrew/channels_query_show_chain_id branch February 22, 2023 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants