2020-08-11 02:16:33 +00:00
|
|
|
#!/usr/bin/env bash
|
2020-05-17 21:16:48 +10: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 21:16:48 +10: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-10-01 06:32:37 +00:00
|
|
|
# $VALIDATOR_COUNT and $BN_COUNT variables.
|
2020-05-17 21:16:48 +10:00
|
|
|
#
|
|
|
|
|
2021-08-06 00:47:31 +00:00
|
|
|
set -o nounset -o errexit -o pipefail
|
|
|
|
|
2020-05-26 18:30:44 +10:00
|
|
|
source ./vars.env
|
2020-05-17 21:16:48 +10:00
|
|
|
|
2022-11-30 22:45:06 +05:30
|
|
|
# lcli \
|
|
|
|
# deploy-deposit-contract \
|
|
|
|
# --eth1-http http://localhost:8545 \
|
|
|
|
# --confirmations 1 \
|
|
|
|
# --validator-count $VALIDATOR_COUNT
|
2021-03-30 05:17:58 +00:00
|
|
|
|
|
|
|
NOW=`date +%s`
|
|
|
|
GENESIS_TIME=`expr $NOW + $GENESIS_DELAY`
|
|
|
|
|
2020-05-17 21:16:48 +10: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 21:16:48 +10: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 \
|
2022-11-30 22:45:06 +05:30
|
|
|
--bellatrix-fork-epoch $ALTAIR_FORK_EPOCH \
|
|
|
|
--capella-fork-epoch $ALTAIR_FORK_EPOCH \
|
|
|
|
--eip4844-fork-epoch $ALTAIR_FORK_EPOCH \
|
|
|
|
--eth1-block-hash 0000000000000000000000000000000000000000000000000000000000000000 \
|
2022-06-29 09:07:09 +00:00
|
|
|
--eth1-id $CHAIN_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 \
|
2022-11-30 22:45:06 +05:30
|
|
|
--validator-count $GENESIS_VALIDATOR_COUNT \
|
|
|
|
--interop-genesis-state \
|
2020-05-17 21:16:48 +10:00
|
|
|
--force
|
|
|
|
|
2020-05-26 18:30:44 +10: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 \
|
2021-10-01 06:32:37 +00:00
|
|
|
--node-count $BN_COUNT
|
2020-05-26 18:30:44 +10:00
|
|
|
|
2021-03-30 05:17:58 +00:00
|
|
|
echo Validators generated with keystore passwords at $DATADIR.
|
2020-05-17 21:16:48 +10: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 21:16:48 +10:00
|
|
|
--testnet-dir $TESTNET_DIR \
|
2021-03-30 05:17:58 +00:00
|
|
|
$GENESIS_VALIDATOR_COUNT
|
2020-05-17 21:16:48 +10:00
|
|
|
|
2021-05-12 00:51:20 +00:00
|
|
|
echo Created genesis state in $TESTNET_DIR
|