From 6cf8b0dd051e0bd16b4ced114ed2679edc12c92d Mon Sep 17 00:00:00 2001 From: Hoang Do Date: Tue, 21 May 2024 16:51:11 +0700 Subject: [PATCH] chores(readme): update instruction and script for running rly v0.3.3-v2.5.2-relayer (#90) --- README.md | 2 +- scripts/ibc/setup_ibc.sh | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 61b8daf..84d9f05 100644 --- a/README.md +++ b/README.md @@ -211,7 +211,7 @@ sudo systemctl daemon-reload ### Install dymension relayer ```shell -git clone https://github.com/dymensionxyz/go-relayer.git --branch v0.3.2-v2.5.2-relayer +git clone https://github.com/dymensionxyz/go-relayer.git --branch v0.3.3-v2.5.2-relayer cd go-relayer && make install ``` diff --git a/scripts/ibc/setup_ibc.sh b/scripts/ibc/setup_ibc.sh index 08868e2..668a991 100644 --- a/scripts/ibc/setup_ibc.sh +++ b/scripts/ibc/setup_ibc.sh @@ -69,6 +69,9 @@ jq --arg rpc "$SETTLEMENT_RPC_FOR_RELAYER" '.value."rpc-addr" = $rpc' $HUB_IBC_C rly chains add --file "$ROLLAPP_IBC_CONF_FILE" "$ROLLAPP_CHAIN_ID" rly chains add --file "$HUB_IBC_CONF_FILE" "$SETTLEMENT_CHAIN_ID" +echo -e '--------------------------------- Setting min-loop-duration to 100ms in rly config... --------------------------------' +sed -i.bak '/min-loop-duration:/s/.*/ min-loop-duration: 100ms/' "$RLY_CONFIG_FILE" + echo '# -------------------------------- creating keys ------------------------------- #' rly keys add "$ROLLAPP_CHAIN_ID" "$RELAYER_KEY_FOR_ROLLAPP" rly keys add "$SETTLEMENT_CHAIN_ID" "$RELAYER_KEY_FOR_HUB" @@ -105,7 +108,7 @@ echo '# -------------------------------- creating IBC link --------------------- rly paths new "$ROLLAPP_CHAIN_ID" "$SETTLEMENT_CHAIN_ID" "$RELAYER_PATH" --src-port "$IBC_PORT" --dst-port "$IBC_PORT" --version "$IBC_VERSION" -rly tx link "$RELAYER_PATH" --src-port "$IBC_PORT" --dst-port "$IBC_PORT" --version "$IBC_VERSION" +rly tx link "$RELAYER_PATH" --src-port "$IBC_PORT" --dst-port "$IBC_PORT" --version "$IBC_VERSION" --max-clock-drift 70m # Channel is currently not created in the tx link since we changed the relayer to support on demand blocks # Which messed up with channel creation as part of tx link. @@ -113,7 +116,22 @@ sleep 5 echo '# -------------------------------- IBC channel established ------------------------------- #' echo "Channel Information:" -echo $(rly q channels "$ROLLAPP_CHAIN_ID" | jq '{ "rollapp-channel": .channel_id, "hub-channel": .counterparty.channel_id }') +channel_info=$(rly q channels "$ROLLAPP_CHAIN_ID" | jq '{ "rollapp-channel": .channel_id, "hub-channel": .counterparty.channel_id }') +rollapp_channel=$(echo "$channel_info" | jq -r '.["rollapp-channel"]') +hub_channel=$(echo "$channel_info" | jq -r '.["hub-channel"]') + +echo "$channel_info" + +echo -e '--------------------------------- Set channel-filter --------------------------------' + +if [ -z "$rollapp_channel" ] || [ -z "$hub_channel" ]; then + echo "Both channels must be provided. Something is wrong. Exiting." + exit 1 +fi + +sed -i.bak '/rule:/s/.*/ rule: "allowlist"/' "$RLY_CONFIG_FILE" +sed -i.bak '/channel-list:/s/.*/ channel-list: ["'"$rollapp_channel"'","'"$hub_channel"'"]/' "$RLY_CONFIG_FILE" +echo "Config file updated successfully." # --------------------------------- revert empty block time to 1h --------------------------------- # kill $(pgrep rollapp-wasm)