Channel Close Handshake
The channel close handshake involves two steps: init and confirm.
Table of Contents
Channel Close Init
Use the chan-close-init
command to initialize the closure of a channel.
USAGE:
hermes tx raw chan-close-init <OPTIONS>
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)
Example
hermes tx raw chan-close-init ibc-0 ibc-1 connection-0 transfer transfer -d channel-0 -s channel-1
Success: CloseInitChannel(
CloseInit(
Attributes {
height: Height {
revision: 0,
height: 77,
},
port_id: PortId(
"transfer",
),
channel_id: Some(
ChannelId(
"channel-0",
),
),
connection_id: ConnectionId(
"connection-0",
),
counterparty_port_id: PortId(
"transfer",
),
counterparty_channel_id: Some(
ChannelId(
"channel-1",
),
),
},
),
)
Channel Close Confirm
Use the chan-close-confirm
command to confirm the closure of a channel.
USAGE:
hermes tx raw chan-close-confirm <OPTIONS>
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)
Example
hermes tx raw chan-close-confirm ibc-1 ibc-0 connection-1 transfer transfer -d channel-1 -s channel-0
Success: CloseConfirmChannel(
CloseConfirm(
Attributes {
height: Height {
revision: 1,
height: 551,
},
port_id: PortId(
"transfer",
),
channel_id: Some(
ChannelId(
"channel-1",
),
),
connection_id: ConnectionId(
"connection-1",
),
counterparty_port_id: PortId(
"transfer",
),
counterparty_channel_id: Some(
ChannelId(
"channel-0",
),
),
},
),
)
NOTE: The cosmos-sdk
transfer module implementation does not allow the user (hermes
in this case) to initiate the closing of channels.
Therefore, when using the Gaia release image, the chan-close-init
command
fails as the MsgChannelCloseInit
message included in the transaction is rejected.
To be able to test channel closure, you need to patch your gaia deployments.