mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-10 10:05:18 +00:00
update testnet deploy scripts
This commit is contained in:
parent
50c608c3af
commit
00b4923f94
@ -7,6 +7,7 @@ function help() {
|
|||||||
echo " -k Keyring password to create key (for Linux only)"
|
echo " -k Keyring password to create key (for Linux only)"
|
||||||
echo " -n Network (default: testnet)"
|
echo " -n Network (default: testnet)"
|
||||||
echo " -c Chain ID (default: \"zgtendermint_16600-1\")"
|
echo " -c Chain ID (default: \"zgtendermint_16600-1\")"
|
||||||
|
echo " -v schedule end time (unix epoch) for vesting accounts"
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,6 +24,7 @@ PEM_FLAG=""
|
|||||||
KEYRING_PASSWORD=""
|
KEYRING_PASSWORD=""
|
||||||
NETWORK="testnet"
|
NETWORK="testnet"
|
||||||
INIT_GENESIS_ENV=""
|
INIT_GENESIS_ENV=""
|
||||||
|
VESTING_ACCOUNT_END_TIME=0
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
@ -43,6 +45,10 @@ while [[ $# -gt 0 ]]; do
|
|||||||
INIT_GENESIS_ENV="$INIT_GENESIS_ENV export CHAIN_ID=$2;"
|
INIT_GENESIS_ENV="$INIT_GENESIS_ENV export CHAIN_ID=$2;"
|
||||||
shift; shift
|
shift; shift
|
||||||
;;
|
;;
|
||||||
|
-v)
|
||||||
|
INIT_GENESIS_ENV="$INIT_GENESIS_ENV export VESTING_ACCOUNT_END_TIME=$2;"
|
||||||
|
shift; shift
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
help
|
help
|
||||||
echo "Unknown flag passed: \"$1\""
|
echo "Unknown flag passed: \"$1\""
|
||||||
@ -56,7 +62,7 @@ NUM_NODES=${#IPS[@]}
|
|||||||
|
|
||||||
# Install dependent libraries and binary
|
# Install dependent libraries and binary
|
||||||
for ((i=0; i<$NUM_NODES; i++)) do
|
for ((i=0; i<$NUM_NODES; i++)) do
|
||||||
ssh $PEM_FLAG ubuntu@${IPS[$i]} "rm -rf 0g-chain; git clone https://github.com/0glabs/0g-chain.git; cd 0g-chain; git checkout v0.1.0; ./networks/testnet/install.sh"
|
ssh $PEM_FLAG ubuntu@${IPS[$i]} "rm -rf 0g-chain; git clone https://github.com/0glabs/0g-chain.git; cd 0g-chain; git checkout v0.2.2; ./networks/testnet/install.sh"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Create genesis config on node0
|
# Create genesis config on node0
|
||||||
|
@ -33,9 +33,12 @@ set -e
|
|||||||
IFS=","; declare -a IPS=($1); unset IFS
|
IFS=","; declare -a IPS=($1); unset IFS
|
||||||
|
|
||||||
NUM_NODES=${#IPS[@]}
|
NUM_NODES=${#IPS[@]}
|
||||||
VLIDATOR_BALANCE=15000000000000000000ua0gi
|
VALIDATOR_BALANCE=25000000000000ua0gi
|
||||||
FAUCET_BALANCE=40000000000000000000ua0gi
|
FAUCET_BALANCE=500000000000000ua0gi
|
||||||
STAKING=10000000000000000000ua0gi
|
STAKING=5000000000000ua0gi
|
||||||
|
VESTING_BALANCE=400000000000000ua0gi
|
||||||
|
|
||||||
|
VESTING_ACCOUNT_START_TIME=$(date -u +%s)
|
||||||
|
|
||||||
# Init configs
|
# Init configs
|
||||||
for ((i=0; i<$NUM_NODES; i++)) do
|
for ((i=0; i<$NUM_NODES; i++)) do
|
||||||
@ -146,12 +149,13 @@ fi
|
|||||||
for ((i=0; i<$NUM_NODES; i++)) do
|
for ((i=0; i<$NUM_NODES; i++)) do
|
||||||
for ((j=0; j<$NUM_NODES; j++)) do
|
for ((j=0; j<$NUM_NODES; j++)) do
|
||||||
if [[ "$OS_NAME" = "GNU/Linux" ]]; then
|
if [[ "$OS_NAME" = "GNU/Linux" ]]; then
|
||||||
yes $PASSWORD | 0gchaind add-genesis-account "0gchain_validator_$j" $VLIDATOR_BALANCE --home "$ROOT_DIR/node$i"
|
yes $PASSWORD | 0gchaind add-genesis-account "0gchain_validator_$j" $VALIDATOR_BALANCE --home "$ROOT_DIR/node$i"
|
||||||
else
|
else
|
||||||
0gchaind add-genesis-account "0gchain_validator_$j" $VLIDATOR_BALANCE --home "$ROOT_DIR/node$i"
|
0gchaind add-genesis-account "0gchain_validator_$j" $VALIDATOR_BALANCE --home "$ROOT_DIR/node$i"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
0gchaind add-genesis-account 0g17n8707c20e8gge2tk2gestetjcs4536p4fhqcs $FAUCET_BALANCE --home "$ROOT_DIR/node$i"
|
0gchaind add-genesis-account 0g1e4t48fq42tqxpapvpnuc9n9k998eex9rnyqzwm $FAUCET_BALANCE --home "$ROOT_DIR/node$i"
|
||||||
|
0gchaind add-genesis-account 0g16yvxafe63uzuxu6xpvpxdz9agdvnh0zn8vnuj6 $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
|
done
|
||||||
|
|
||||||
# Prepare genesis txs
|
# Prepare genesis txs
|
||||||
|
@ -13,6 +13,7 @@ if [[ $? -ne 0 ]]; then
|
|||||||
# Make under root dir
|
# Make under root dir
|
||||||
SCRIPT_DIR=`dirname "${BASH_SOURCE[0]}"`
|
SCRIPT_DIR=`dirname "${BASH_SOURCE[0]}"`
|
||||||
cd $SCRIPT_DIR/../..
|
cd $SCRIPT_DIR/../..
|
||||||
|
rm -rf $(go env GOPATH)/bin/0gchaind
|
||||||
make install
|
make install
|
||||||
|
|
||||||
# Add gopath to path
|
# Add gopath to path
|
||||||
|
Loading…
Reference in New Issue
Block a user