2020-08-11 02:16:33 +00:00
|
|
|
#!/usr/bin/env bash
|
2020-05-17 11:16:48 +00:00
|
|
|
|
|
|
|
#
|
2021-03-30 05:17:58 +00:00
|
|
|
# Deploys the deposit contract and makes deposits for $VALIDATOR_COUNT insecure deterministic validators.
|
2020-05-17 11:16:48 +00:00
|
|
|
# Produces a testnet specification and a genesis state where the genesis time
|
2021-03-30 05:17:58 +00:00
|
|
|
# is now + $GENESIS_DELAY.
|
|
|
|
#
|
2021-07-09 06:15:32 +00:00
|
|
|
# Generates datadirs for multiple validator keys according to the
|
2021-03-30 05:17:58 +00:00
|
|
|
# $VALIDATOR_COUNT and $NODE_COUNT variables.
|
2020-05-17 11:16:48 +00:00
|
|
|
#
|
|
|
|
|
2021-08-06 00:47:31 +00:00
|
|
|
set -o nounset -o errexit -o pipefail
|
|
|
|
|
2020-05-26 08:30:44 +00:00
|
|
|
source ./vars.env
|
2020-05-17 11:16:48 +00:00
|
|
|
|
2021-03-30 05:17:58 +00:00
|
|
|
lcli \
|
|
|
|
deploy-deposit-contract \
|
|
|
|
--eth1-http http://localhost:8545 \
|
|
|
|
--confirmations 1 \
|
|
|
|
--validator-count $VALIDATOR_COUNT
|
|
|
|
|
|
|
|
NOW=`date +%s`
|
|
|
|
GENESIS_TIME=`expr $NOW + $GENESIS_DELAY`
|
|
|
|
|
2020-05-17 11:16:48 +00:00
|
|
|
lcli \
|
|
|
|
new-testnet \
|
2021-08-06 00:47:31 +00:00
|
|
|
--spec $SPEC_PRESET \
|
2021-03-30 05:17:58 +00:00
|
|
|
--deposit-contract-address $DEPOSIT_CONTRACT_ADDRESS \
|
2020-05-17 11:16:48 +00:00
|
|
|
--testnet-dir $TESTNET_DIR \
|
2021-03-30 05:17:58 +00:00
|
|
|
--min-genesis-active-validator-count $GENESIS_VALIDATOR_COUNT \
|
|
|
|
--min-genesis-time $GENESIS_TIME \
|
|
|
|
--genesis-delay $GENESIS_DELAY \
|
|
|
|
--genesis-fork-version $GENESIS_FORK_VERSION \
|
2021-07-09 06:15:32 +00:00
|
|
|
--altair-fork-epoch $ALTAIR_FORK_EPOCH \
|
2021-05-12 00:51:20 +00:00
|
|
|
--eth1-id $NETWORK_ID \
|
2021-03-30 05:17:58 +00:00
|
|
|
--eth1-follow-distance 1 \
|
2021-07-31 03:50:52 +00:00
|
|
|
--seconds-per-slot $SECONDS_PER_SLOT \
|
|
|
|
--seconds-per-eth1-block $SECONDS_PER_ETH1_BLOCK \
|
2020-05-17 11:16:48 +00:00
|
|
|
--force
|
|
|
|
|
2020-05-26 08:30:44 +00:00
|
|
|
echo Specification generated at $TESTNET_DIR.
|
|
|
|
echo "Generating $VALIDATOR_COUNT validators concurrently... (this may take a while)"
|
|
|
|
|
|
|
|
lcli \
|
|
|
|
insecure-validators \
|
|
|
|
--count $VALIDATOR_COUNT \
|
2021-03-30 05:17:58 +00:00
|
|
|
--base-dir $DATADIR \
|
|
|
|
--node-count $NODE_COUNT
|
2020-05-26 08:30:44 +00:00
|
|
|
|
2021-03-30 05:17:58 +00:00
|
|
|
echo Validators generated with keystore passwords at $DATADIR.
|
2020-05-17 11:16:48 +00:00
|
|
|
echo "Building genesis state... (this might take a while)"
|
|
|
|
|
|
|
|
lcli \
|
|
|
|
interop-genesis \
|
2021-08-06 00:47:31 +00:00
|
|
|
--spec $SPEC_PRESET \
|
2021-03-30 05:17:58 +00:00
|
|
|
--genesis-time $GENESIS_TIME \
|
2020-05-17 11:16:48 +00:00
|
|
|
--testnet-dir $TESTNET_DIR \
|
2021-03-30 05:17:58 +00:00
|
|
|
$GENESIS_VALIDATOR_COUNT
|
2020-05-17 11:16:48 +00:00
|
|
|
|
2021-05-12 00:51:20 +00:00
|
|
|
echo Created genesis state in $TESTNET_DIR
|