Resolve both ends of an IBC Classic channel

Channel identifiers are assigned locally. A relayer looking up channel-7 on both chains can inspect two unrelated paths.

Resolve the counterparty from the source chain

Set GRPC to a TLS gRPC endpoint with reflection on the sending chain. Replace the port and channel with the local pair. Read counterparty.portId and counterparty.channelId, plus state, ordering and connectionHops.

grpcurl -d '{"portId":"transfer","channelId":"channel-7"}' "$GRPC" ibc.core.channel.v1.Query/Channel

If the source returns transfer/channel-19 as the counterparty, query transfer/channel-19 on the destination. Check that its counterparty points back to transfer/channel-7 and examine both channel states.

Confirm chain identity and application version

The remote channel name alone does not identify a chain. Resolve the connection and its light client on the source to establish the tracked counterparty. Use the channel’s negotiated version and ordering when interpreting application packets. github.com ibc-go Query API