Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: retrieve the bond amount from the sequencer params #139

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions README.with-advanced-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
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:
Expand Down Expand Up @@ -85,21 +88,22 @@
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
```

### Add genesis accounts


Check failure on line 106 in README.with-advanced-features.md

View workflow job for this annotation

GitHub Actions / markdownlint

Multiple consecutive blank lines [Expected: 1; Actual: 2]
```shell
sh scripts/settlement/add_genesis_accounts.sh
```
Expand Down Expand Up @@ -127,8 +131,9 @@
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
Expand All @@ -137,7 +142,7 @@
sh scripts/update_genesis_file.sh
```

### Update the Genesis file to include the denommetadata, genesis accounts, module account and elevated accounts

Check failure on line 145 in README.with-advanced-features.md

View workflow job for this annotation

GitHub Actions / markdownlint

Multiple headings with the same content [Context: "### Update the Genesis file to..."]

```shell
# this script automatically adds 2 vesting accounts, adjust the timestampts to your liking or skip this step
Expand Down
4 changes: 2 additions & 2 deletions scripts/settlement/add_genesis_accounts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ dymd keys add bob-genesis --keyring-backend test
tee "$ROLLAPP_SETTLEMENT_INIT_DIR_PATH/genesis_accounts.json" >/dev/null <<EOF
[
{"amount":
{"amount":"10000000000000000000000","denom":"a${DENOM}"},
{"amount":"10000000000000000000000","denom":"${BASE_DENOM}"},
"address": "$(dymd keys show -a bob-genesis --keyring-backend test)"
},
{"amount":
{"amount":"50000000000000000000000","denom":"a${DENOM}"},
{"amount":"50000000000000000000000","denom":"${BASE_DENOM}"},
"address":"$(dymd keys show -a alice-genesis --keyring-backend test)"
}
]
Expand Down
4 changes: 2 additions & 2 deletions scripts/settlement/generate_denom_metadata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ tee "$ROLLAPP_SETTLEMENT_INIT_DIR_PATH/denommetadata.json" >/dev/null <<EOF
"description": "The native staking and governance token of the ${ROLLAPP_CHAIN_ID}",
"denom_units": [
{
"denom": "a${DENOM}",
"denom": "${BASE_DENOM}",
"exponent": 0
},
{
"denom": "${DENOM}",
"exponent": 18
}
],
"base": "a${DENOM}",
"base": "${BASE_DENOM}",
"display": "${DENOM}",
"name": "${DENOM}",
"symbol": "${DENOM}"
Expand Down
2 changes: 1 addition & 1 deletion scripts/settlement/register_sequencer_to_hub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
Loading