Skip to content

Commit

Permalink
fix(scripts): adjusted IBC script to work with whitelisted relayers (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
keruch authored Nov 21, 2024
1 parent 4bedb8d commit 8df5b11
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/ibc/setup_ibc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ rly keys add "$ROLLAPP_CHAIN_ID" "$RELAYER_KEY_FOR_ROLLAPP"
rly keys add "$SETTLEMENT_CHAIN_ID" "$RELAYER_KEY_FOR_HUB"

RLY_HUB_ADDR=$(rly keys show "$SETTLEMENT_CHAIN_ID")
RLY_ROLLAPP_ADDR=$(rly keys show "$ROLLAPP_CHAIN_ID")

echo '--------------------------------- Funding rly account on hub ['"$RLY_HUB_ADDR"']... --------------------------------'
DYM_BALANCE=$("$SETTLEMENT_EXECUTABLE" q bank balances "$RLY_HUB_ADDR" -o json | jq -r '.balances[0].amount')
Expand All @@ -113,6 +114,16 @@ else
"$SETTLEMENT_EXECUTABLE" tx bank send "$SETTLEMENT_KEY_NAME_GENESIS" "$RLY_HUB_ADDR" 100dym --keyring-backend test --fees 1dym --node "$SETTLEMENT_RPC_FOR_RELAYER" -y || exit 1
fi

echo '--------------------------------- Funding rly account on rollapp ['"$RLY_ROLLAPP_ADDR"']... --------------------------------'
ROLLAPP_BALANCE=$("$EXECUTABLE" q bank balances "$RLY_ROLLAPP_ADDR" -o json | jq -r '.balances[0].amount')

if [ "$(echo "$ROLLAPP_BALANCE >= 100000000000000000000" | bc)" -eq 1 ]; then
echo "${RLY_ROLLAPP_ADDR} already funded"
else
"$EXECUTABLE" tx bank send "$KEY_NAME_ROLLAPP" "$RLY_ROLLAPP_ADDR" "100000000000000000000$BASE_DENOM" --keyring-backend test --fees "10000000000000000$BASE_DENOM" --node "$ROLLAPP_RPC_FOR_RELAYER" -y || exit 1
fi


echo '--------------------------------- Creating IBC path... --------------------------------'

rly paths new "$SETTLEMENT_CHAIN_ID" "$ROLLAPP_CHAIN_ID" "$RELAYER_PATH" --src-port "$IBC_PORT" --dst-port "$IBC_PORT" --version "$IBC_VERSION"
Expand Down

0 comments on commit 8df5b11

Please sign in to comment.