Skip to content

Commit

Permalink
chore: add minimal updating stript for genesis (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
artemijspavlovs authored Sep 20, 2024
1 parent 794042b commit 16e9706
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions scripts/minimal_update_genesis_params.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 16e9706

Please sign in to comment.