Skip to content

Commit

Permalink
chore: update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
hacheigriega committed Mar 1, 2024
1 parent cc50618 commit f45f5d0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
10 changes: 5 additions & 5 deletions scripts/testnet/build_genesis_state.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/testnet/config_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ################
Expand Down
4 changes: 4 additions & 0 deletions scripts/testnet/create_genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions scripts/testnet/upload_and_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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
Expand Down

0 comments on commit f45f5d0

Please sign in to comment.