In this article I will tell you how to set up a repeater for cross translation between two networks using the example of Rizon and Kichain For this we need a repeater and two working nodes. Or a relay and one working node and a global rpc from the second network. Or a repeater and a global rpc from two networks. But everything is in order. I will install a repeater for the Rizon node, but you can choose any other method that suits you. The main criterion is that the selected network must have IBC-transfer enabled. This parameter can be checked by entering in the terminal where the node is installed. the following command:
rizond q ibc-transfer params # (replace rizond with your node's command)
receive_enabled: true send_enabled: true
So we found out that the Rizon Network is great for cross transactions. Let's start installing and adjusting the Repeater. Download and install the repeater from the official source Relayer v.1.0.0
git clone https://github.com/cosmos/relayer.git
cd relayer
make install
cd
rly version
output:
version: 1.0.0-rc1–152-g112205b
rly config init
create a folder with network configuration and go to it:
mkdir rly_config
cd rly_config
nano kichain-t-4.json
#we use the global rpc as we put it on vps where the node is not installed locally kichain.
{ "chain-id": "kichain-t-4", "rpc-addr": "https://rpc-challenge.blockchain.ki:443", "account-prefix": "tki", "gas-adjustment": 1.5, "gas-prices": "0.025utki", "trusting-period": "48h" }
similarly, we create a file for the second network, instead of the global rpc, we enter the local one, since the rizon node is located on one server. In theory, you can establish relaying without having a single node, but having a global rpc node of both networks.
nano groot-011.json
{ "chain-id": "groot-011", "rpc-addr": "http://localhost:26657", "account-prefix": "rizon", "gas-adjustment": 1.5, "gas-prices": "0.025uatolo", "trusting-period": "48h" }
rly chains add -f groot-011.json
rly chains add -f kichain-t-4.json
cd
rly keys add groot-011 name of your wallet
rly keys add kichain-t-4 name of your wallet
rly keys restore groot-011 name of your wallet "mnemonic farce from wallet"
rly keys restore kichain-t-4 name of your wallet "mnemonic farce from wallet"
#You can use the same mnemonic for both wallets, which is very convenient for me :-) the relay will create different wallets based on network settings with different rizon and tki prefixes:
rly chains edit groot-011 key name of your wallet
rly chains edit kichain-t-4 key name of your wallet
nano ~/.relayer/config/config.yaml
timeout: 30s
rly q balance groot-011
rly q balance kichain-t-4
If there are coins on the balance and the relay shows them, then we continue, We initialize the light client in both networks with the command:
rly light init groot-011 -f
rly light init kichain-t-4 -f
rly paths generate groot-011 kichain-t-4 transfer -- port=transfer
#If the command does not work, try several times or add the - debug parameter to see the step-by-step actions of the system the output should be as follows:
Generated path(transfer), run 'rly paths show transfer -- yaml' to see details
rly tx link transfer --debug
nano /root/.relayer/config/config.yaml
client-id: 07-tendermint-16 connection-id: connection-14 channel-id: channel-11
rly light init groot-011 -f
rly light init kichain-t-4 -f
rly tx link transfer -- debug
I[2021–09–06|09:22:54.913] ★ Channel created: [groot-011]chan{channel-11}port{transfer} -> [kichain-t-4]chan{channel-41}port{transfer}
rly paths list -d
0: transfer -> chns(✔) clnts(✔) conn(✔) chan(✔) (groot-011:transfer<>kichain-t-3:transfer)
rly transact transfer [src-chain-id] [dst-chain-id] [amount] [dst-addr] [flags]
rly tx transfer groot-011 kichain-t-4 1000000uatolo tki1eakzw0qhxcclerm0uwxae88ugcmet2radufqqf -- path transfer
and the answer will be a conclusion about a successful hash transaction, which can be checked in both rizon and kichain networks in explorer
I[2021–09–06|09:35:00.471] ✔ [groot-011]@{412926} - msg(0:transfer) hash(D4E8A8C5CA7E6ED0B3FD247C456938E1A160B3E850FB10E27440D25A08C69DAE)
https://ki.thecodes.dev/tx/92E0FBD56828840DFC638650910A7A41684CDEA678BC5FA43A6C0C063DF4F443
https://ki.thecodes.dev/tx/02D5881818D5A27CE0120ECC63B8FD23091391AE0037B0E2D8BAE3146E9E5990
rly tx transfer kichain-t-4 groot-011 1000000utki rizon1eakzw0qhxcclerm0uwxae88ugcmet2raquwh9n -- path transfer
rly keys list groot-011
rly keys list kichaint-t-4
first we need to start Relayer permanent we can use tmux or screen but more sensce use service file. let make one
sudo tee /etc/systemd/system/rlyd.service > /dev/null <<EOF [Unit] Description=relayer client After=network-online.target, rizond.service [Service] User=$USER ExecStart=$(which rly) start transfer Restart=always RestartSec=3 LimitNOFILE=65535 [Install] WantedBy=multi-user.target EOF
now make start our service and lets use Relayer remote
sudo systemctl daemon-reload
sudo systemctl enable rlyd
sudo systemctl start rlyd
kid tx ibc-transfer transfer transfer channel-N rizon_WALLET_address 1000utki --from name_OF_wallet --fees=5000utki --gas=auto --chain-id kichain-t-4 --home $HOME/kichain/kid
#number of chanel you can see in config.yaml on relayer or use command
rly paths show transfer -- yaml
Send back to kichain from rizon same comand
rizond tx ibc-transfer transfer transfer channel-N tki_wallet_adress 1000uatolo --from your_wallet_name --fees=5000uatolo --gas=auto --chain-id groot-011