update deploy script for set vesting account end time

This commit is contained in:
Solovyov1796 2024-06-19 12:36:57 +08:00
parent 30e8370024
commit 1fa36696bc
2 changed files with 15 additions and 1 deletions

View File

@ -7,6 +7,7 @@ function help() {
echo " -k Keyring password to create key (for Linux only)"
echo " -n Network (default: devnet)"
echo " -c Chain ID (default: \"zgtendermint_16600-1\")"
echo " -v schedule end time (unix epoch) for vesting accounts"
echo ""
}
@ -24,6 +25,7 @@ KEYRING_PASSWORD=""
NETWORK="devnet"
TAG_OR_BRANCH="testnet/v0.2.x"
INIT_GENESIS_ENV=""
VESTING_ACCOUNT_END_TIME=0
while [[ $# -gt 0 ]]; do
case $1 in
@ -44,6 +46,10 @@ while [[ $# -gt 0 ]]; do
INIT_GENESIS_ENV="$INIT_GENESIS_ENV export CHAIN_ID=$2;"
shift; shift
;;
-v)
export VESTING_ACCOUNT_END_TIME=$2
shift; shift
;;
*)
help
echo "Unknown flag passed: \"$1\""
@ -52,6 +58,12 @@ while [[ $# -gt 0 ]]; do
esac
done
if [[ $VESTING_ACCOUNT_END_TIME -eq 0 ]]; then
help
echo "schedule end time (unix epoch) for vesting accounts should be set!"
exit 1
fi
IFS=","; declare -a IPS=($IP_LIST); unset IFS
NUM_NODES=${#IPS[@]}

View File

@ -38,6 +38,8 @@ FAUCET_BALANCE=500000000000000ua0gi
STAKING=5000000000000ua0gi
VESTING_BALANCE=400000000000000ua0gi
VESTING_ACCOUNT_START_TIME=$(date -u +%s)
# Init configs
for ((i=0; i<$NUM_NODES; i++)) do
HOMEDIR="$ROOT_DIR"/node$i
@ -153,7 +155,7 @@ for ((i=0; i<$NUM_NODES; i++)) do
fi
done
0gchaind add-genesis-account 0g1zyvrkyr8pmczkguxztxpp3qcd0uhkt0tfxjupt $FAUCET_BALANCE --home "$ROOT_DIR/node$i"
0gchaind add-genesis-account 0g1jwuhghh6qrln4tthhqrdt3qrmjn9zm05xns46u $VESTING_BALANCE --home "$ROOT_DIR/node$i"
0gchaind add-genesis-account 0g1jwuhghh6qrln4tthhqrdt3qrmjn9zm05xns46u $VESTING_BALANCE --vesting-amount $VESTING_BALANCE --vesting-start-time $VESTING_ACCOUNT_START_TIME --vesting-end-time $VESTING_ACCOUNT_END_TIME --home "$ROOT_DIR/node$i"
done
# Prepare genesis txs