From 16e9706bfb12c8cf4615c57300ec610232886122 Mon Sep 17 00:00:00 2001 From: artpav <19916123+artemijspavlovs@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:43:39 +0300 Subject: [PATCH] chore: add minimal updating stript for genesis (#133) --- scripts/minimal_update_genesis_params.sh | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 scripts/minimal_update_genesis_params.sh diff --git a/scripts/minimal_update_genesis_params.sh b/scripts/minimal_update_genesis_params.sh new file mode 100644 index 0000000..b823b2a --- /dev/null +++ b/scripts/minimal_update_genesis_params.sh @@ -0,0 +1,31 @@ +#!/bin/bash + set -x +if [ "$GENESIS_FILE" = "" ]; then + DEFAULT_GENESIS_FILE_PATH="${HOME}/.rollapp_evm/config/genesis.json" + echo "GENESIS_FILE is not set, using default: ${DEFAULT_GENESIS_FILE_PATH}" + export GENESIS_FILE=$DEFAULT_GENESIS_FILE_PATH +fi + +update_params() { + local success=true + + BLOCK_SIZE="500000" + + 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.distribution.params.base_proposer_reward' -v '0.8' || success=false + dasel put -f "$GENESIS_FILE" 'app_state.distribution.params.community_tax' -v "0.00002" || success=false + # these vary depending on environment + dasel put -f "$GENESIS_FILE" 'app_state.gov.voting_params.voting_period' -v "300s" || success=false + dasel put -f "$GENESIS_FILE" '.app_state.sequencers.params.unbonding_time' -v "1209600s" || success=false # 2 weeks + dasel put -f "$GENESIS_FILE" '.app_state.staking.params.unbonding_time' -v "1209600s" || success=false # 2 weeks + + if [ "$success" = false ]; then + echo "An error occurred." + return 1 + fi + set +x +} + +update_params