Skip to content

Commit

Permalink
chores(readme): update instruction and script for running rly v0.3.3-…
Browse files Browse the repository at this point in the history
…v2.5.2-relayer (#90)
  • Loading branch information
hoangdv2429 committed May 21, 2024
1 parent e883bef commit 6cf8b0d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
22 changes: 20 additions & 2 deletions scripts/ibc/setup_ibc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -105,15 +108,30 @@ 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.

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)
Expand Down

0 comments on commit 6cf8b0d

Please sign in to comment.