-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrelay v2 guide and steps
217 lines (165 loc) · 12.1 KB
/
relay v2 guide and steps
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
++++++++++++++++++++ Install Relay V2
------ Guide:
https://github.com/cosmos/relayer?fbclid=IwAR3fBu3kTtqDCBxxbR3W4SwSjckoIDBUuQ2J-Z-nsmTA0cGV6-8tC70_t_U
------ Command:
git clone https://github.com/cosmos/relayer.git
cd relayer/
git checkout v2.0.0-rc4
make install
------ Check version
root@vmi844997:~/relayer# rly version
version: 2.0.0-rc4
commit: unknown
cosmos-sdk: v0.45.6
go: go1.18.3 linux/amd64
++++++++++++ Configure for Relay
rly config init --memo "Discord ID"
cd $HOME/.relayer/config
check config.yaml:
global:
api-listen-addr: :5183
timeout: 100s
memo: "phuongwoo#7399"
light-cache-size: 20
chains:
{}
paths:
+++++++++++++++ Add chain by json file
nano stride_testnet_4.json
{
"type": "cosmos",
"value": {
"key": "w1_pw",
"chain-id": "STRIDE-TESTNET-4",
"rpc-addr": "http://localhost:16657",
"account-prefix": "stride",
"keyring-backend": "test",
"gas-adjustment": 1.2,
"gas-prices": "0.0025ustrd",
"debug": true,
"timeout": "20s",
"output-format": "json",
"sign-mode": "direct"
}
}
nano gaia.json
{
"type": "cosmos",
"value": {
"key": "w1_Gaia",
"chain-id": "GAIA",
"rpc-addr": "http://localhost:23657",
"account-prefix": "cosmos",
"keyring-backend": "test",
"gas-adjustment": 1.2,
"gas-prices": "0.0025uatom",
"debug": true,
"timeout": "20s",
"output-format": "json",
"sign-mode": "direct"
}
}
rly chains add --file stride_testnet_4.json STRIDE-TESTNET-4
rly chains add --file gaia.json GAIA
++++++++++++= Add key
rly keys restore STRIDE-TESTNET-4 w1_pw "24 mnemomic phrase"
rly keys restore GAIA w1_Gaia "24 mnemomic phrase"
root@vmi844997:~/.relayer/config# rly chains add --file stride_testnet_2.json STRIDE-TESTNET-4
root@vmi844997:~/.relayer/config# rly chains add --file gaia.json GAIA
root@vmi844997:~/.relayer/config# rly keys restore STRIDE-TESTNET-2 w1_pw "24 mnemomic phrase"
<stride wallet>
root@vmi844997:~/.relayer/config#
root@vmi844997:~/.relayer/config#
root@vmi844997:~/.relayer/config# rly keys restore GAIA w1_Gaia "24 mnemomic phrase"
<gaia wallet>
root@vmi844997:~/.relayer/config#
+++++++++++ List key
root@vmi844997:~/.relayer# rly keys list STRIDE-TESTNET-4
key(w1_pw) -> <stride wallet>
root@vmi844997:~/.relayer# rly keys list GAIA
key(w1_Gaia) -> <gaia wallet>
root@vmi844997:~/.relayer#
+++++++++= Query balance
rly q balance GAIA
rly q balance STRIDE-TESTNET-4
root@vmi844997:~/.relayer/config# rly q balance GAIA
address {<gaia wallet>} balance {10000000uatom}
root@vmi844997:~/.relayer/config# rly q balance STRIDE-TESTNET-4
address {<stride wallet>} balance {4984345ustrd}
root@vmi844997:~/.relayer/config#
root@vmi844997:~/.relayer/config# rly chains list
1: STRIDE-TESTNET-4 -> type(cosmos) key(✔) bal(✔) path(✘)
2: GAIA -> type(cosmos) key(✔) bal(✔) path(✘)
++++++++++++= Make system service
sudo tee /etc/systemd/system/rlyd.service > /dev/null <<EOF
[Unit]
Description=V2 Go relayer
After=network-online.target
[Service]
User=$USER
ExecStart=$(which rly) start P_Stride_Gaia --memo "phuongwoo#7399"
Restart=on-failure
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
++++++= Command to manage service
sudo systemctl daemon-reload
sudo systemctl enable rlyd
sudo systemctl restart rlyd
sudo journalctl -fu rlyd -o cat
sudo systemctl stop rlyd
sudo systemctl disable rlyd
+++++++++++++++ Path
rly paths new STRIDE-TESTNET-4 GAIA P_Stride_Gaia
++++++== Create by link command
rly transact link P_Stride_Gaia
rly transact link stride_gaia.json
++++++== Create manual
rly transact clients P_Stride_Gaia
rly transact connection P_Stride_Gaia
rly transact channel P_Stride_Gaia
+++++++++++++ Example log of command
root@vmi844997:~/.relayer# rly transact link P_Stride_Gaia
2022-08-19T14:41:19.316124Z info Successful transaction {"provider_type": "cosmos", "chain_id": "GAIA", "gas_used": 96948, "fees": "259uatom", "fee_payer": "<gaia wallet>", "height": 9469, "msg_types": ["/ibc.core.client.v1.MsgCreateClient"], "tx_hash": " "}
2022-08-19T14:41:19.316255Z info Client Created {"src_chain_id": "GAIA", "src_client_id": "07-tendermint-1", "dst_chain_id": "STRIDE-TESTNET-4"}
2022-08-19T14:41:19.316280Z info Clients created {"src_client_id": "07-tendermint-4", "src_chain_id": "STRIDE-TESTNET-4", "dst_client_id": "07-tendermint-1", "dst_chain_id": "GAIA"}
2022-08-19T14:41:19.317814Z info Starting event processor for connection handshake {"src_chain_id": "STRIDE-TESTNET-4", "src_client_id": "07-tendermint-4", "dst_chain_id": "GAIA", "dst_client_id": "07-tendermint-1"}
2022-08-19T14:41:19.363477Z info Chain is not yet in sync {"chain_name": "STRIDE-TESTNET-4", "chain_id": "STRIDE-TESTNET-4", "latest_queried_block": 8459, "latest_height": 8479}
2022-08-19T14:41:19.421062Z info Chain is not yet in sync {"chain_name": "GAIA", "chain_id": "GAIA", "latest_queried_block": 9449, "latest_height": 9469}
2022-08-19T14:41:21.025060Z info Chain is in sync {"chain_name": "GAIA", "chain_id": "GAIA"}
2022-08-19T14:41:22.433451Z info Chain is in sync {"chain_name": "STRIDE-TESTNET-4", "chain_id": "STRIDE-TESTNET-4"}
2022-08-19T14:41:22.447078Z warn Error querying block data {"chain_name": "STRIDE-TESTNET-4", "chain_id": "STRIDE-TESTNET-4", "error": "RPC error -32603 - Internal error: could not find results for height #8480"}
2022-08-19T14:41:24.044168Z warn Error querying block data {"chain_name": "GAIA", "chain_id": "GAIA", "error": "RPC error -32603 - Internal error: could not find results for height #9470"}
2022-08-19T14:41:28.369144Z info Successful transaction {"provider_type": "cosmos", "chain_id": "STRIDE-TESTNET-4", "gas_used": 156635, "fees": "439ustrd", "fee_payer": "<stride wallet>", "height": 8481, "msg_types": ["/ibc.core.client.v1.MsgUpdateClient", "/ibc.core.connection.v1.MsgConnectionOpenInit"], "tx_hash": " "}
2022-08-19T14:41:29.036812Z warn Error querying block data {"chain_name": "GAIA", "chain_id": "GAIA", "error": "RPC error -32603 - Internal error: could not find results for height #9471"}
2022-08-19T14:41:39.311922Z info Successful transaction {"provider_type": "cosmos", "chain_id": "GAIA", "gas_used": 358219, "fees": "1043uatom", "fee_payer": "<gaia wallet>", "height": 9473, "msg_types": ["/ibc.core.client.v1.MsgUpdateClient", "/ibc.core.connection.v1.MsgConnectionOpenTry"], "tx_hash": " "}
2022-08-19T14:41:50.661436Z warn Error querying block data {"chain_name": "STRIDE-TESTNET-4", "chain_id": "STRIDE-TESTNET-4", "error": "RPC error -32603 - Internal error: could not find results for height #8485"}
2022-08-19T14:41:50.978873Z info Successful transaction {"provider_type": "cosmos", "chain_id": "STRIDE-TESTNET-4", "gas_used": 280664, "fees": "811ustrd", "fee_payer": "<stride wallet>", "height": 8485, "msg_types": ["/ibc.core.client.v1.MsgUpdateClient", "/ibc.core.connection.v1.MsgConnectionOpenAck"], "tx_hash": " "}
2022-08-19T14:41:54.148855Z warn Error querying block data {"chain_name": "GAIA", "chain_id": "GAIA", "error": "RPC error -32603 - Internal error: could not find results for height #9476"}
2022-08-19T14:42:05.217091Z info Successful transaction {"provider_type": "cosmos", "chain_id": "GAIA", "gas_used": 286820, "fees": "828uatom", "fee_payer": "<gaia wallet>", "height": 9478, "msg_types": ["/ibc.core.client.v1.MsgUpdateClient", "/ibc.core.connection.v1.MsgConnectionOpenConfirm"], "tx_hash": " "}
2022-08-19T14:42:12.449149Z info Skipping retry due to invalid connection state {"provider_type": "cosmos", "error": "rpc error: code = InvalidArgument desc = failed to execute message; message index: 1: connection handshake open ack failed: connection state is not INIT or TRYOPEN (got STATE_OPEN): invalid connection state: invalid request"}
2022-08-19T14:42:12.449256Z error Error sending messages {"src_chain_id": "GAIA", "dst_chain_id": "STRIDE-TESTNET-4", "src_client_id": "07-tendermint-1", "dst_client_id": "07-tendermint-4", "error": "error sending messages: rpc error: code = InvalidArgument desc = failed to execute message; message index: 1: connection handshake open ack failed: connection state is not INIT or TRYOPEN (got STATE_OPEN): invalid connection state: invalid request"}
2022-08-19T14:42:12.449294Z info Connection handshake termination candidate {"chain_id": "GAIA", "client_id": "07-tendermint-1", "termination_client_id": "07-tendermint-1", "observed_client_id": "07-tendermint-1", "termination_counterparty_client_id": "07-tendermint-4", "observed_counterparty_client_id": "07-tendermint-4"}
2022-08-19T14:42:12.449317Z info Found termination condition for connection handshake {"chain_id": "GAIA", "client_id": "07-tendermint-1"}
2022-08-19T14:42:12.506931Z info Starting event processor for channel handshake {"src_chain_id": "STRIDE-TESTNET-4", "src_port_id": "transfer", "dst_chain_id": "GAIA", "dst_port_id": "transfer"}
2022-08-19T14:42:12.534125Z info Chain is in sync {"chain_name": "STRIDE-TESTNET-4", "chain_id": "STRIDE-TESTNET-4"}
2022-08-19T14:42:12.543070Z info Chain is in sync {"chain_name": "GAIA", "chain_id": "GAIA"}
2022-08-19T14:42:18.822421Z warn Error querying block data {"chain_name": "STRIDE-TESTNET-4", "chain_id": "STRIDE-TESTNET-4", "error": "RPC error -32603 - Internal error: could not find results for height #8490"}
2022-08-19T14:42:19.068852Z info Successful transaction {"provider_type": "cosmos", "chain_id": "STRIDE-TESTNET-4", "gas_used": 199321, "fees": "567ustrd", "fee_payer": "<stride wallet>", "height": 8490, "msg_types": ["/ibc.core.client.v1.MsgUpdateClient", "/ibc.core.channel.v1.MsgChannelOpenInit"], "tx_hash": " "}
2022-08-19T14:42:24.740277Z warn Error querying block data {"chain_name": "STRIDE-TESTNET-4", "chain_id": "STRIDE-TESTNET-4", "error": "RPC error -32603 - Internal error: could not find results for height #8491"}
2022-08-19T14:42:29.382631Z info Successful transaction {"provider_type": "cosmos", "chain_id": "GAIA", "gas_used": 349225, "fees": "1016uatom", "fee_payer": "<gaia wallet>", "height": 9483, "msg_types": ["/ibc.core.client.v1.MsgUpdateClient", "/ibc.core.channel.v1.MsgChannelOpenTry"], "tx_hash": " "}
2022-08-19T14:42:40.747688Z warn Error querying block data {"chain_name": "STRIDE-TESTNET-4", "chain_id": "STRIDE-TESTNET-4", "error": "RPC error -32603 - Internal error: could not find results for height #8494"}
2022-08-19T14:42:40.871151Z info Successful transaction {"provider_type": "cosmos", "chain_id": "STRIDE-TESTNET-4", "gas_used": 165461, "fees": "465ustrd", "fee_payer": "<stride wallet>", "height": 8494, "msg_types": ["/ibc.core.client.v1.MsgUpdateClient", "/ibc.core.channel.v1.MsgChannelOpenAck"], "tx_hash": " "}
================ Transfer
----------- Transfer from Stride to Gaia
rly transact transfer STRIDE-TESTNET-4 GAIA 4455ustrd $(rly chains address GAIA) channel-10 --path P_Stride_Gaia
root@vmi844997:~/.relayer# rly transact transfer STRIDE-TESTNET-4 GAIA 5555ustrd $(rly chains address GAIA) channel-10 --path P_Stride_Gaia
2022-08-19T15:08:24.051073Z info Successful transaction {"provider_type": "cosmos", "chain_id": "STRIDE-TESTNET-4", "packet_src_channel": "channel-10", "packet_dst_channel": "channel-5", "gas_used": 97029, "fees": "260ustrd", "fee_payer": "<stride wallet>", "height": 8768, "msg_types": ["/ibc.applications.transfer.v1.MsgTransfer"], "tx_hash": " "}
root@vmi844997:~/.relayer#
------------ Transfer from Gaia to Stride
rly transact transfer GAIA STRIDE-TESTNET-4 666uatom $(rly chains address STRIDE-TESTNET-4) channel-5 --path P_Stride_Gaia
root@vmi844997:~/.relayer# rly transact transfer GAIA STRIDE-TESTNET-4 666uatom $(rly chains address STRIDE-TESTNET-4) channel-5 --path P_Stride_Gaia
2022-08-19T15:10:14.125239Z info Successful transaction {"provider_type": "cosmos", "chain_id": "GAIA", "packet_src_channel": "channel-5", "packet_dst_channel": "channel-10", "gas_used": 97203, "fees": "260uatom", "fee_payer": "<gaia wallet>", "height": 9814, "msg_types": ["/ibc.applications.transfer.v1.MsgTransfer"], "tx_hash": " "}
root@vmi844997:~/.relayer#