From 8ca1a19af0cf4d581895884d80b70f566054be40 Mon Sep 17 00:00:00 2001 From: Sergi Rene Date: Tue, 26 Nov 2024 17:36:27 +0100 Subject: [PATCH] chore: fix init script (#159) --- README.md | 2 +- go.mod | 4 ++-- go.sum | 8 ++++---- scripts/init.sh | 11 ++++------- scripts/settlement/register_rollapp_to_hub.sh | 6 +++--- 5 files changed, 14 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 771fbca..6b5fc68 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ You can find out in There are a few variables was allow blockchains to customize at compile time. If you build your own chain and import x/wasm, you can adjust a few items via module parameters, but a few others did not fit in that, as they need to be used by stateless ValidateBasic(). Thus, we made them as flags and set them in start.go so that they can be overridden on your custom chain. ```shell -rollapp-wasm start --max-label-size 64 --max-wasm-size 2048000 --max-wasm-proposal-size 2048000 +rollapp-wasm start --max-label-size 64 --max-wasm-size 2048000 --max-proposal-wasm-size 2048000 ``` Those flags are optional, the default value was set as: diff --git a/go.mod b/go.mod index bd68202..fb073bc 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/cosmos/ibc-go/v6 v6.3.0 github.com/dvsekhvalnov/jose2go v1.5.0 github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241119103059-def6322e4345 - github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241119130703-a5453ad86b4c + github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241126070643-7ef37e51de91 github.com/ethereum/go-ethereum v1.12.0 github.com/evmos/evmos/v12 v12.1.6 github.com/gogo/protobuf v1.3.3 @@ -121,7 +121,7 @@ require ( github.com/docker/go-units v0.5.0 // indirect github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf // indirect github.com/dustin/go-humanize v1.0.1 // indirect - github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20240821081230-b4018b2bac13 // indirect + github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd // indirect github.com/dymensionxyz/gerr-cosmos v1.0.0 // indirect github.com/dymensionxyz/sdk-utils v0.1.2-0.20240909101947-e1b483ada9c8 // indirect github.com/edsrzf/mmap-go v1.0.0 // indirect diff --git a/go.sum b/go.sum index fe4b38d..d108728 100644 --- a/go.sum +++ b/go.sum @@ -571,12 +571,12 @@ github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQx github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/dymensionxyz/cometbft v0.34.29-0.20241104165035-feade34f8f89 h1:rGkCcx4dWX9mxAUrq7zrdOc44XddMY/nM6kqYTWjerY= github.com/dymensionxyz/cometbft v0.34.29-0.20241104165035-feade34f8f89/go.mod h1:L9shMfbkZ8B+7JlwANEr+NZbBcn+hBpwdbeYvA5rLCw= -github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20240821081230-b4018b2bac13 h1:u5yeve5jZR6TdRjjR+vYT/8PWKbhwCZxUmAu+/Tnxyg= -github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20240821081230-b4018b2bac13/go.mod h1:jabDQYXrccscSE0fXkh7eQFYPWJCRiuWKonFGObVq6s= +github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd h1:V89QyOFM84o9w0iFdctMU6So8SS/Xt32JWAXGqJduT0= +github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd/go.mod h1:3weqpVj/TqTFpC0LjEB3H+HZSpm7BrQ1QkEg1Ahy6KY= github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241119103059-def6322e4345 h1:FcHidPgGEHh9ELwodNJkGcHqsG+mdPiGdughzG4W+X8= github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241119103059-def6322e4345/go.mod h1:y89w1OG4C4aF7yyW8bv9PwV3o1KkCx1hyt34ap04Rnk= -github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241119130703-a5453ad86b4c h1:dZpHHZMssXklHO18XhzD/fj1QZjSnw1Wo3DOo24/dwE= -github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241119130703-a5453ad86b4c/go.mod h1:ui7okdD4GRAySphS7XNOlbJKXIA2TAH/Wu6S8KV3o0M= +github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241126070643-7ef37e51de91 h1:w1aFCVNQm8EUGxJy7bztCI0wTNZ6FphRCLmjtXgodLc= +github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241126070643-7ef37e51de91/go.mod h1:wqEC/5bf0bZwW/1+A+YGGLirDL0r8uj46U0999lPO8Q= github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.4.2 h1:aVP3off7u2vsvRH7lHAUPTLdf9/AfnzC/rvvi0wC/co= github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.4.2/go.mod h1:CI6D89pkoiIm4BjoMFNnEaCLdKBEobLuwvhS0c1zh7Y= github.com/dymensionxyz/gerr-cosmos v1.0.0 h1:oi91rgOkpJWr41oX9JOyjvvBnhGY54tj513x8VlDAEc= diff --git a/scripts/init.sh b/scripts/init.sh index 3b5c061..c09cf41 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -152,15 +152,12 @@ EOF EOF } + add_denom_metadata() { local success=true - denom_metadata=$(cat "$ROLLAPP_SETTLEMENT_INIT_DIR_PATH"/denommetadata.json) - elevated_address=$("$EXECUTABLE" keys show "$KEY_NAME_ROLLAPP" --keyring-backend test -a) - - dasel put -f "$GENESIS_FILE" '.app_state.bank.denom_metadata' -v "$denom_metadata" || success=false - dasel put -t json -f "$GENESIS_FILE" '.app_state.denommetadata.params.allowed_addresses.' -v "$elevated_address" || success=false - + jq --argjson metadata "$(cat "$ROLLAPP_SETTLEMENT_INIT_DIR_PATH"/denommetadata.json)" '.app_state.bank.denom_metadata = $metadata' "$GENESIS_FILE" > temp.json && mv temp.json "$GENESIS_FILE" + if [ "$success" = false ]; then echo "An error occurred. Please refer to README.md" return 1 @@ -194,7 +191,6 @@ set_consensus_params() { dasel put -f "$GENESIS_FILE" '.consensus_params.block.max_gas' -v "400000000" || success=false dasel put -f "$GENESIS_FILE" '.consensus_params.block.max_bytes' -v "$BLOCK_SIZE" || success=false dasel put -f "$GENESIS_FILE" '.consensus_params.evidence.max_bytes' -v "$BLOCK_SIZE" || success=false - dasel put -f "$GENESIS_FILE" '.app_state.rollappparams.params.version' -v "$COMMIT" || success=false dasel put -f "$GENESIS_FILE" '.app_state.rollappparams.params.da' -v "$DA" || success=false dasel put -f "$GENESIS_FILE" '.app_state.rollappparams.params.drs_version' -v $DRS_VERSION -t int || success=false @@ -272,6 +268,7 @@ set_denom "$BASE_DENOM" update_configuration add_genesis_accounts generate_denom_metadata +add_denom_metadata update_configuration set_consensus_params diff --git a/scripts/settlement/register_rollapp_to_hub.sh b/scripts/settlement/register_rollapp_to_hub.sh index f5466d4..411a607 100644 --- a/scripts/settlement/register_rollapp_to_hub.sh +++ b/scripts/settlement/register_rollapp_to_hub.sh @@ -3,15 +3,15 @@ # this account must be whitelisted on the hub for permissioned deployment setup DEPLOYER=${HUB_PERMISSIONED_KEY-"$HUB_KEY_WITH_FUNDS"} -if [ "$EXECUTABLE" = "" ]; then +if [ "$SETTLEMENT_EXECUTABLE" = "" ]; then DEFAULT_EXECUTABLE=$(which dymd) if [ "$DEFAULT_EXECUTABLE" = "" ]; then echo "dymd not found in PATH. Exiting." exit 1 fi - echo "EXECUTABLE is not set, using '${DEFAULT_EXECUTABLE}'" - EXECUTABLE=$DEFAULT_SEQUENCER_KEY_PATH + echo "SETTLEMENT_EXECUTABLE is not set, using '${DEFAULT_EXECUTABLE}'" + SETTLEMENT_EXECUTABLE=$DEFAULT_EXECUTABLE fi if [ "$SEQUENCER_KEY_PATH" = "" ]; then