From f45f5d0bfa491ff256970fda92871759ae70bd37 Mon Sep 17 00:00:00 2001 From: hacheigriega Date: Tue, 27 Feb 2024 16:51:48 -0500 Subject: [PATCH] chore: update scripts --- scripts/testnet/build_genesis_state.sh | 10 +++++----- scripts/testnet/config_example.sh | 2 +- scripts/testnet/create_genesis.sh | 4 ++++ scripts/testnet/upload_and_start.sh | 12 ++++++------ 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/scripts/testnet/build_genesis_state.sh b/scripts/testnet/build_genesis_state.sh index 06b661f2..8b831cf0 100755 --- a/scripts/testnet/build_genesis_state.sh +++ b/scripts/testnet/build_genesis_state.sh @@ -195,11 +195,11 @@ if [ $ADD_GROUPS = true ]; then jq --slurpfile group $TMP_HOME/group.tmp '.app_state["group"] = $group[0]' $TMP_GENESIS > $TMP_TMP_GENESIS && mv $TMP_TMP_GENESIS $TMP_GENESIS - jq '.app_state["group"]["groups"][0]["admin"]="'$SECURITY_GROUP_POLICY_ADDR'"' $TMP_GENESIS > $TMP_TMP_GENESIS && mv $TMP_TMP_GENESIS $TMP_GENESIS - jq '.app_state["group"]["group_policies"][1]["admin"]="'$SECURITY_GROUP_POLICY_ADDR'"' $TMP_GENESIS > $TMP_TMP_GENESIS && mv $TMP_TMP_GENESIS $TMP_GENESIS - - jq '.app_state["group"]["groups"][0]["admin"]="'$TREASURY_GROUP_POLICY_ADDR'"' $TMP_GENESIS > $TMP_TMP_GENESIS && mv $TMP_TMP_GENESIS $TMP_GENESIS - jq '.app_state["group"]["group_policies"][1]["admin"]="'$TREASURY_GROUP_POLICY_ADDR'"' $TMP_GENESIS > $TMP_TMP_GENESIS && mv $TMP_TMP_GENESIS $TMP_GENESIS + # replace group policy address as group & group policy admin + jq '.app_state["group"]["groups"][0]["admin"]='$SECURITY_GROUP_POLICY_ADDR'' $TMP_GENESIS > $TMP_TMP_GENESIS && mv $TMP_TMP_GENESIS $TMP_GENESIS + jq '.app_state["group"]["group_policies"][1]["admin"]='$SECURITY_GROUP_POLICY_ADDR'' $TMP_GENESIS > $TMP_TMP_GENESIS && mv $TMP_TMP_GENESIS $TMP_GENESIS + jq '.app_state["group"]["groups"][1]["admin"]='$TREASURY_GROUP_POLICY_ADDR'' $TMP_GENESIS > $TMP_TMP_GENESIS && mv $TMP_TMP_GENESIS $TMP_GENESIS + jq '.app_state["group"]["group_policies"][0]["admin"]='$TREASURY_GROUP_POLICY_ADDR'' $TMP_GENESIS > $TMP_TMP_GENESIS && mv $TMP_TMP_GENESIS $TMP_GENESIS jq '.app_state["wasm"]["params"]["code_upload_access"]["permission"]="AnyOfAddresses"' $TMP_GENESIS > $TMP_TMP_GENESIS && mv $TMP_TMP_GENESIS $TMP_GENESIS jq '.app_state["wasm"]["params"]["instantiate_default_permission"]="AnyOfAddresses"' $TMP_GENESIS > $TMP_TMP_GENESIS && mv $TMP_TMP_GENESIS $TMP_GENESIS diff --git a/scripts/testnet/config_example.sh b/scripts/testnet/config_example.sh index f41aa5b0..d65ecaf5 100644 --- a/scripts/testnet/config_example.sh +++ b/scripts/testnet/config_example.sh @@ -82,7 +82,7 @@ CONTRACTS_VERSION=v0.0.1-rc # latest or seda-chain-contracts release version ####################################### MEMBERS_JSON_FILE=./members.json POLICY_JSON_FILE=./policy.json -ADMIN_SEED="mushroom energy ..." +ADMIN_SEED="mushroom energy ..." # used for creating groups - overwritten by group policy addresses anyways ####################################### ############### GITHUB ################ diff --git a/scripts/testnet/create_genesis.sh b/scripts/testnet/create_genesis.sh index 476f9e97..8019d198 100755 --- a/scripts/testnet/create_genesis.sh +++ b/scripts/testnet/create_genesis.sh @@ -48,6 +48,10 @@ cat $HOME/.sedad/config/genesis.json | jq '.app_state["gov"]["params"]["max_depo cat $HOME/.sedad/config/genesis.json | jq '.app_state["gov"]["params"]["min_initial_deposit_ratio"]="0.010000000000000000"' > $HOME/.sedad/config/tmp_genesis.json && mv $HOME/.sedad/config/tmp_genesis.json $HOME/.sedad/config/genesis.json # mint params +cat $HOME/.sedad/config/genesis.json | jq '.app_state["mint"]["minter"]["inflation"]="0.000000000000000000"' > $HOME/.sedad/config/tmp_genesis.json && mv $HOME/.sedad/config/tmp_genesis.json $HOME/.sedad/config/genesis.json +cat $HOME/.sedad/config/genesis.json | jq '.app_state["mint"]["params"]["inflation_rate_change"]="0.000000000000000000"' > $HOME/.sedad/config/tmp_genesis.json && mv $HOME/.sedad/config/tmp_genesis.json $HOME/.sedad/config/genesis.json +cat $HOME/.sedad/config/genesis.json | jq '.app_state["mint"]["params"]["inflation_max"]="0.000000000000000000"' > $HOME/.sedad/config/tmp_genesis.json && mv $HOME/.sedad/config/tmp_genesis.json $HOME/.sedad/config/genesis.json +cat $HOME/.sedad/config/genesis.json | jq '.app_state["mint"]["params"]["inflation_min"]="0.000000000000000000"' > $HOME/.sedad/config/tmp_genesis.json && mv $HOME/.sedad/config/tmp_genesis.json $HOME/.sedad/config/genesis.json cat $HOME/.sedad/config/genesis.json | jq '.app_state["mint"]["params"]["blocks_per_year"]="4204800"' > $HOME/.sedad/config/tmp_genesis.json && mv $HOME/.sedad/config/tmp_genesis.json $HOME/.sedad/config/genesis.json # slashing params diff --git a/scripts/testnet/upload_and_start.sh b/scripts/testnet/upload_and_start.sh index 32da0aa4..7d286453 100755 --- a/scripts/testnet/upload_and_start.sh +++ b/scripts/testnet/upload_and_start.sh @@ -56,7 +56,7 @@ done SEEDS=() for i in ${!IPS[@]}; do - SEED=$($LOCAL_BIN tendermint show-node-id --home $NODE_DIR/node$i) + SEED=$($LOCAL_BIN tendermint show-node-id --home $NODE_DIR/${MONIKERS[$i]}) SEEDS+=("$SEED@${IPS[$i]}:26656") done @@ -65,13 +65,13 @@ SEEDS_LIST="${list%,}" echo $SEEDS_LIST for i in ${!IPS[@]}; do - cp $NODE_DIR/genesis.json $NODE_DIR/node$i/config/genesis.json + cp $NODE_DIR/genesis.json $NODE_DIR/${MONIKERS[$i]}/config/genesis.json if [[ "$OSTYPE" == "darwin"* ]]; then - sed -i '' "s/seeds = \"\"/seeds = \"${SEEDS_LIST}\"/g" $NODE_DIR/node$i/config/config.toml + sed -i '' "s/seeds = \"\"/seeds = \"${SEEDS_LIST}\"/g" $NODE_DIR/${MONIKERS[$i]}/config/config.toml else - sed "s/seeds = \"\"/seeds = \"${SEEDS_LIST}\"/g" $NODE_DIR/node$i/config/config.toml > tmp - cat tmp > $NODE_DIR/node$i/config/config.toml + sed "s/seeds = \"\"/seeds = \"${SEEDS_LIST}\"/g" $NODE_DIR/${MONIKERS[$i]}/config/config.toml > tmp + cat tmp > $NODE_DIR/${MONIKERS[$i]}/config/config.toml rm tmp fi @@ -83,7 +83,7 @@ for i in ${!IPS[@]}; do ssh -i $SSH_KEY -t ec2-user@${IPS[$i]} 'sudo rm -rf /home/ec2-user/.sedad' # upload node files - scp -i $SSH_KEY -r $NODE_DIR/node$i ec2-user@${IPS[$i]}:/home/ec2-user/.sedad + scp -i $SSH_KEY -r $NODE_DIR/${MONIKERS[$i]} ec2-user@${IPS[$i]}:/home/ec2-user/.sedad # upload chain binary built for the corresponding architecture LINUX_BIN=$NODE_DIR/sedad-amd64