diff --git a/scripts/localnode.sh b/scripts/localnode.sh index b90d61c2..a6a0edeb 100755 --- a/scripts/localnode.sh +++ b/scripts/localnode.sh @@ -14,6 +14,7 @@ TRACE="" HOME_DIR=mytestnet DENOM=${2:-ppica} + if [ "$CONTINUE" == "true" ]; then echo "\n ->> continuing from previous state" $BINARY start --home $HOME_DIR --log_level debug @@ -44,7 +45,7 @@ $BINARY add-genesis-account $KEY 100000000000000000000000000$DENOM --keyring-bac # Sign genesis transaction $BINARY gentx $KEY 1000000000000000000000$DENOM --keyring-backend $KEYRING --chain-id $CHAINID --home $HOME_DIR -update_test_genesis '.app_state["gov"]["params"]["voting_period"]="50s"' +update_test_genesis '.app_state["gov"]["params"]["voting_period"]="5s"' update_test_genesis '.app_state["mint"]["params"]["mint_denom"]="'$DENOM'"' update_test_genesis '.app_state["gov"]["params"]["min_deposit"]=[{"denom":"'$DENOM'","amount": "1000000"}]' update_test_genesis '.app_state["crisis"]["constant_fee"]={"denom":"'$DENOM'","amount":"1000"}' diff --git a/scripts/tweak-test-upgrade.sh b/scripts/tweak-test-upgrade.sh index 68d2e677..e7f54b8c 100755 --- a/scripts/tweak-test-upgrade.sh +++ b/scripts/tweak-test-upgrade.sh @@ -15,6 +15,10 @@ ADDITIONAL_AFTER_SCRIPTS="./scripts/upgrade/v6_to_7/post_08_wasm.sh" SLEEP_TIME=1 +KEY="mykey" +KEY1="test1" +KEY2="test2" + if [[ "$FORK" == "true" ]]; then export PICA_HALT_HEIGHT=20 fi @@ -77,7 +81,6 @@ if [ ! -z "$ADDITIONAL_PRE_SCRIPTS" ]; then done fi -exit 0 run_fork () { echo "forking" @@ -100,7 +103,7 @@ run_upgrade () { # Get upgrade height, 12 block after (6s) STATUS_INFO=($(./_build/old/centaurid status --home $HOME | jq -r '.NodeInfo.network,.SyncInfo.latest_block_height')) - UPGRADE_HEIGHT=$((STATUS_INFO[1] + 50)) + UPGRADE_HEIGHT=$((STATUS_INFO[1] + 22)) echo "UPGRADE_HEIGHT = $UPGRADE_HEIGHT" tar -cf ./_build/new/centaurid.tar -C ./_build/new centaurid @@ -113,21 +116,21 @@ run_upgrade () { }') - ./_build/old/centaurid tx gov submit-legacy-proposal software-upgrade "$SOFTWARE_UPGRADE_NAME" --upgrade-height $UPGRADE_HEIGHT --upgrade-info "$UPGRADE_INFO" --title "upgrade" --description "upgrade" --from test1 --keyring-backend test --chain-id $CHAIN_ID --home $HOME -y > /dev/null + ./_build/old/centaurid tx gov submit-legacy-proposal software-upgrade "$SOFTWARE_UPGRADE_NAME" --upgrade-height $UPGRADE_HEIGHT --upgrade-info "$UPGRADE_INFO" --title "upgrade" --description "upgrade" --from $KEY --keyring-backend test --chain-id $CHAIN_ID --home $HOME -y > /dev/null sleep $SLEEP_TIME - ./_build/old/centaurid tx gov deposit 1 "20000000${DENOM}" --from test1 --keyring-backend test --chain-id $CHAIN_ID --home $HOME -y > /dev/null + ./_build/old/centaurid tx gov deposit 1 "20000000${DENOM}" --from $KEY --keyring-backend test --chain-id $CHAIN_ID --home $HOME -y > /dev/null sleep $SLEEP_TIME - ./_build/old/centaurid tx gov vote 1 yes --from test0 --keyring-backend test --chain-id $CHAIN_ID --home $HOME -y > /dev/null + ./_build/old/centaurid tx gov vote 1 yes --from $KEY --keyring-backend test --chain-id $CHAIN_ID --home $HOME -y > /dev/null sleep $SLEEP_TIME - ./_build/old/centaurid tx gov vote 1 yes --from test1 --keyring-backend test --chain-id $CHAIN_ID --home $HOME -y > /dev/null + # ./_build/old/centaurid tx gov vote 1 yes --from $KEY2 --keyring-backend test --chain-id $CHAIN_ID --home $HOME -y > /dev/null - sleep $SLEEP_TIME + # sleep $SLEEP_TIME # determine block_height to halt while true; do @@ -156,12 +159,8 @@ fi sleep 1 # run new node -echo -e "\n\n=> =>continue running nodes after upgrade" -if [[ "$OSTYPE" == "darwin"* ]]; then - screen -L -dmS new-node CONTINUE="true" bash scripts/localnode.sh _build/new/centaurid $DENOM -else - CONTINUE="true" bash scripts/localnode.sh _build/new/centaurid $DENOM -fi +echo -e "\n\n=> =>continue running nodes after upgrade" +CONTINUE="true" screen -dms new-node bash scripts/localnode.sh _build/new/centaurid $DENOM sleep 5