- Special thanks to Northa and goooodnes from Let's encrypt community
Requirements:
4cpu, 4gb ram, ssd > 80Gb
ubuntu 20.04 lts
In this guide, we will examine how to setup ibc relayer between kichain-t-4 and testnet-croeseid-4
1. Install ibc relayer from the official repo
Check the relayer version. In my case it was 0.9.3 version
$ rly version
version: v0.9.3
commit: 4b81fa59055e3e94520bdfae1debe2fe0b747dc1
cosmos-sdk: v0.42.4
go: go1.15.11 linux/amd64$ rly config init
$ cd && mkdir -p ./relayer/kichain && cd ./relayer/kichain
Create config for the kichain-t-4 network
$ tee ki_config.json > /dev/null <<EOF
{
"chain-id": "kichain-t-4",
"rpc-addr": "http://127.0.0.1:26657",
"account-prefix": "tki",
"gas-adjustment": 1.5,
"gas-prices": "0.025utki",
"trusting-period": "48h"
}
EOF
Create config for the croeseid testnet network
- note in my case i configured my croeseid testnet to operate with port 26552. Your port might be different!
$ tee cro_config.json > /dev/null <<EOF
{
"chain-id": "testnet-croeseid-4",
"rpc-addr": "http://127.0.0.1:26652",
"account-prefix": "tcro",
"gas-adjustment": 1.5,
"gas-prices": "0.025basetcro",
"trusting-period": "48h"
}
EOF
$ rly chains add -f ki_config.json
$ rly chains add -f cro_config.
- Notice in my case im using key name ki_test and cro_test. You can specify watever you want name.
$ rly keys add kichain-t-4 ki_test
$ rly keys add testnet-croeseid-4 --coin-type 1 cro_test
- We using
--coin-type 1when generating croeseid wallet because croesseid using DIFFERENT derivation path!
$ rly keys restore kichain-t-4 ki_test "YOUR MNEMONIC"
$ rly keys restore "testnet-croeseid-4" cro_test --coin-type 1 "YOUR MNEMONIC"
$ rly keys list kichain-t-4
key(0): ki_test -> tki1__YOUR_WALLET$ rly keys list testnet-croeseid-4
key(0): cro_test -> tcro__YOUR_WALLET$ rly chains edit kichain-t-4 key ki_test
$ rly chains edit testnet-croeseid-4 key cro_test
$ nano ~/.relayer/config/config.yaml
Find the line timeout: 10s and replace to timeout: 10m
- If you dont have funds. Request some via faucet.
KI foundation under testnet-challenge thread
$ rly q balance kichain-t-4
100000000utki$ rly q balance testnet-croeseid-4
100000000basetcro$ rly light init kichain-t-4 -f
$ rly light init testnet-croeseid-4 -f
$ rly paths generate kichain-t-4 testnet-croeseid-4 transfer --port=transfer
If you have some issues try Troubleshooting guide
$ rly chains list -d
0: kichain-t-4 -> key(✔) bal(✔) light(✔) path(✔)
1: testnet-croeseid-4 -> key(✔) bal(✔) light(✔) path(✔)
Note this command might take some time. If you have some errors try to repeat several times.
$ rly tx link transfer
If operation completes successfull the output of the last line should be like:
★ Channel created: [kichain-t-4]chan{channel-45}port{transfer} -> [testnet-croeseid-4]chan{channel-18}port{transfer}
$ rly paths list -d
0: transfer -> chns(✔) clnts(✔) conn(✔) chan(✔) (kichain-t-4:transfer<>testnet-croeseid-4:transfer)
We are using rly tx link-then-start transfer --timeout 60s command.
It will link our channel as we made it above in chappter 14 and then relayer will run with timeout 60 seconds.
sudo tee /etc/systemd/system/rlyd.service > /dev/null <<EOF
[Unit]
Description=relayer client
After=network-online.target
[Service]
User=$USER
ExecStart=$(which rly) tx link-then-start transfer --timeout 60s
Restart=always
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
Start rlyd daemon
$ sudo systemctl daemon-reload
$ sudo systemctl enable rlyd
$ sudo systemctl start rlyd
Logs can be checked: journalctl -f -u rlyd
From croeseid to kichain
$ rly tx transfer testnet-croeseid-4 kichain-t-4 1000000basetcro $(rly chains address kichain-t-4) --path transfer
The output should be:
From kichain to croeseid
$ rly tx transfer kichain-t-4 testnet-croeseid-4 666000utki $(rly chains address testnet-croeseid-4) --path transfer
The output should be:
$ rly q bal kichain-t-4 --ibc-denoms
100000000ibc/EFD45E62E0368A6D1DAEC5D7C2352282EADF89236465D9DB8779687BAC0F690A,10000000utki
$ rly q bal testnet-croeseid-4 --ibc-denoms
1000000ibc/9F40556CD453E6FAEAAA13E0069C395685F62BFBF4204E2B076A6409371FE555,1000000000basetcro
$ rly tx transfer kichain-t-4 testnet-croeseid-4 10000ibc/EFD45E62E0368A6D1DAEC5D7C2352282EADF89236465D9DB8779687BAC0F690A $(rly chains address testnet-croeseid-4) --path transfer -d
$ rly tx transfer testnet-croeseid-4 kichain-t-4 20000ibc/9F40556CD453E6FAEAAA13E0069C395685F62BFBF4204E2B076A6409371FE555 $(rly chains address kichain-t-4) --path transfer -d
Example of txs from kichain to croeseid:
B5120764919AC7C5F7B4FC03DE0F82C4A33D647402D60A5BD672B092A9110572 E388D4F4D47707D24947B9275178A850A7CFF068FF05D95205626E84A2418CBF CC909D79A86119D689C894AC41DEA28E2FFEB2AE2C6FF7D32F81FA7262C96889
Example of txs from croeseid to kichain:
280F26EB11925961944ABCDEC14DEBFA87CD7502B915E67AF7B94C1CC496E4F2 280F26EB11925961944ABCDEC14DEBFA87CD7502B915E67AF7B94C1CC496E4F2 707286841BA7330A4AF0EDC550C8F225268DD6EB91E393F12CCDD85C6607A34E
Troubleshooting guide
Error: no concrete type registered for type URL
in this case we have to create paths manually. Open relayer config.yaml$ nano ~/.relayer/config/config.yaml
navigate to paths line. delete "paths{}" and paste the folowing code instead
paths:
transfer:
src:
chain-id: kichain-t-4
port-id: transfer
order: UNORDERED
version: ics20-1
dst:
chain-id: testnet-croeseid-4
port-id: transfer
order: UNORDERED
version: ics20-1
strategy:
type: naive
Error: failed to get trusted header
Try to update client manually$ rly tx update-clients transfer
If this doesn't help you have to re-generate a new path
Error: more than one transaction returned with query
Check if you have unrelayed packets$ rly q unrelayed transfer
If you have some try
$ rly tx rly transfer
If that doesn't work, then create a new path
Error: no transactions returned with query
Check if you have unrelayed packets$ rly q unrelayed transfer
If you have some try
$ rly tx rly transfer
If that doesn't work, then create a new path