From 7c8024ee090c5d7509d2dabe7e15262d48a8565a Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 8 Aug 2024 09:29:00 +0530 Subject: [PATCH 1/2] Add env variables to configure authority auctions in initialization script --- scripts/init.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/scripts/init.sh b/scripts/init.sh index 1697ef7c..e13ae74c 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -6,7 +6,7 @@ MONIKER=${MONIKER:-"localtestnet"} KEYRING=${KEYRING:-"test"} DENOM=${DENOM:-"alnt"} STAKING_AMOUNT=${STAKING_AMOUNT:-"1000000000000000"} -LOGLEVEL="${LOGLEVEL:-"info"}" +LOGLEVEL=${LOGLEVEL:-"info"} input_genesis_file=${GENESIS_FILE} @@ -33,7 +33,7 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then # Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer) laconicd init $MONIKER --chain-id $CHAINID --default-denom $DENOM - if [ -f ${input_genesis_file} ]; then + if [[ -f ${input_genesis_file} ]]; then # Use provided genesis config cp $input_genesis_file $HOME/.laconicd/config/genesis.json fi @@ -67,6 +67,21 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then update_genesis '.app_state["onboarding"]["params"]["onboarding_enabled"]=true' fi + if [[ "$AUTHORITY_AUCTION_ENABLED" == "true" ]]; then + echo "Enabling authority auctions." + update_genesis '.app_state["registry"]["params"]["authority_auction_enabled"]=true' + fi + + if [[ -n $AUTHORITY_AUCTION_COMMITS_DURATION ]]; then + echo "Setting authority_auction_commits_duration to $AUTHORITY_AUCTION_COMMITS_DURATION seconds." + update_genesis ".app_state[\"registry\"][\"params\"][\"authority_auction_commits_duration\"]=\"${AUTHORITY_AUCTION_COMMITS_DURATION}s\"" + fi + + if [[ -n $AUTHORITY_AUCTION_REVEALS_DURATION ]]; then + echo "Setting authority_auction_reveals_duration to $AUTHORITY_AUCTION_REVEALS_DURATION seconds." + update_genesis ".app_state[\"registry\"][\"params\"][\"authority_auction_reveals_duration\"]=\"${AUTHORITY_AUCTION_REVEALS_DURATION}s\"" + fi + # increase block time (?) update_genesis '.consensus["params"]["block"]["time_iota_ms"]="1000"' -- 2.45.2 From d738b22ef236ce794432bf715334d388d98dabcb Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 8 Aug 2024 11:50:09 +0530 Subject: [PATCH 2/2] Add variable to configure authority grace period --- scripts/init.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/init.sh b/scripts/init.sh index e13ae74c..d612eb4f 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -82,6 +82,11 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then update_genesis ".app_state[\"registry\"][\"params\"][\"authority_auction_reveals_duration\"]=\"${AUTHORITY_AUCTION_REVEALS_DURATION}s\"" fi + if [[ -n $AUTHORITY_GRACE_PERIOD ]]; then + echo "Setting authority_grace_period to $AUTHORITY_GRACE_PERIOD seconds." + update_genesis ".app_state[\"registry\"][\"params\"][\"authority_grace_period\"]=\"${AUTHORITY_GRACE_PERIOD}s\"" + fi + # increase block time (?) update_genesis '.consensus["params"]["block"]["time_iota_ms"]="1000"' -- 2.45.2