From 2c818476c267bfd6bc82649c5925fb020b815403 Mon Sep 17 00:00:00 2001 From: artemijspavlovs <19916123+artemijspavlovs@users.noreply.github.com> Date: Fri, 5 Apr 2024 11:25:28 +0300 Subject: [PATCH 1/2] chore: retrieve the bond amount from the sequencer params --- README.with-advanced-features.md | 13 +++++++++---- scripts/settlement/register_sequencer_to_hub.sh | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.with-advanced-features.md b/README.with-advanced-features.md index e0ae700..9b8488b 100644 --- a/README.with-advanced-features.md +++ b/README.with-advanced-features.md @@ -40,6 +40,9 @@ export KEY_NAME_ROLLAPP="rol-user" export BASE_DENOM="arax" export DENOM=$(echo "$BASE_DENOM" | sed 's/^.//') export MONIKER="$ROLLAPP_CHAIN_ID-sequencer" + +export ROLLAPP_HOME_DIR="$HOME/.rollapp_evm" +export ROLLAPP_SETTLEMENT_INIT_DIR_PATH="${ROLLAPP_HOME_DIR}/init" ``` And initialize the rollapp: @@ -85,15 +88,16 @@ SEQUENCER_ADDR=`dymd keys show sequencer --address --keyring-backend test --keyr fund the sequencer account (if you're using a remote hub node, you must fund the sequencer account or you must have an account with enough funds in your keyring) ```shell -BOND_AMOUNT="100000dym" +# retrieve the minimal bond amount from hub sequencer params +# you have to account for gas fees so it should the final value should be increased +BOND_AMOUNT="$(dymd q sequencer params -o json --node ${HUB_RPC_URL} | jq -r '.params.min_bond.amount')$(dymd q sequencer params -o json --node ${HUB_RPC_URL} | jq -r '.params.min_bond.denom')" + dymd tx bank send local-user $SEQUENCER_ADDR ${BOND_AMOUNT} --keyring-backend test --broadcast-mode block --fees 1dym -y --node ${HUB_RPC_URL} ``` ### Generate denommetadata ```shell -export ROLLAPP_SETTLEMENT_INIT_DIR_PATH="$HOME/.rollapp_evm/init" - sh scripts/settlement/generate_denom_metadata.sh ``` @@ -127,8 +131,9 @@ Modify `dymint.toml` in the chain directory (`~/.rollapp_evm/config`) set: ```shell -ROLLAPP_HOME_DIR="$HOME/.rollapp_evm" sed -i 's/settlement_layer.*/settlement_layer = "dymension"/' ${ROLLAPP_HOME_DIR}/config/dymint.toml +sed -i '/node_address =/c\node_address = '\"$HUB_RPC_URL\" "${ROLLAPP_HOME_DIR}/config/dymint.toml" +sed -i '/rollapp_id =/c\rollapp_id = '\"$ROLLAPP_CHAIN_ID\" "${ROLLAPP_HOME_DIR}/config/dymint.toml" ``` ### Update the Genesis file to include the denommetadata, genesis accounts, module account and elevated accounts diff --git a/scripts/settlement/register_sequencer_to_hub.sh b/scripts/settlement/register_sequencer_to_hub.sh index 4c4713b..1955547 100755 --- a/scripts/settlement/register_sequencer_to_hub.sh +++ b/scripts/settlement/register_sequencer_to_hub.sh @@ -7,7 +7,7 @@ KEY_NAME_SEQUENCER="sequencer" #Register Sequencer DESCRIPTION="{\"Moniker\":\"${ROLLAPP_CHAIN_ID}-sequencer\",\"Identity\":\"\",\"Website\":\"\",\"SecurityContact\":\"\",\"Details\":\"\"}" SEQ_PUB_KEY="$($EXECUTABLE dymint show-sequencer)" -BOND_AMOUNT="100000dym" +BOND_AMOUNT="$(dymd q sequencer params -o json --node ${HUB_RPC_URL} | jq -r '.params.min_bond.amount')$(dymd q sequencer params -o json --node ${HUB_RPC_URL} | jq -r '.params.min_bond.denom')" set -x dymd tx sequencer create-sequencer "$SEQ_PUB_KEY" "$ROLLAPP_CHAIN_ID" "$DESCRIPTION" "$BOND_AMOUNT" \ From bc5eed6d52a18cf956aa5742e77241cf397f6055 Mon Sep 17 00:00:00 2001 From: artemijspavlovs <19916123+artemijspavlovs@users.noreply.github.com> Date: Fri, 5 Apr 2024 11:38:19 +0300 Subject: [PATCH 2/2] chore: use BASE_DENOM in the init scripts --- scripts/settlement/add_genesis_accounts.sh | 4 ++-- scripts/settlement/generate_denom_metadata.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/settlement/add_genesis_accounts.sh b/scripts/settlement/add_genesis_accounts.sh index 7905a71..ffb9a72 100755 --- a/scripts/settlement/add_genesis_accounts.sh +++ b/scripts/settlement/add_genesis_accounts.sh @@ -13,11 +13,11 @@ dymd keys add bob-genesis --keyring-backend test tee "$ROLLAPP_SETTLEMENT_INIT_DIR_PATH/genesis_accounts.json" >/dev/null </dev/null </dev/null <