Helpful script for populating a node dataDir with a large number of validator keys
This commit is contained in:
parent
42ca6afae2
commit
23b7cbfc9c
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -eu
|
||||
|
||||
NETWORK_NAME=$1
|
||||
NODE_ID=$2
|
||||
FIRST_VALIDATOR=$3
|
||||
LAST_VALIDATOR=$4
|
||||
|
||||
cd $(dirname "$0")
|
||||
cd ..
|
||||
|
||||
if [ -f .env ]; then
|
||||
source .env
|
||||
fi
|
||||
|
||||
NETWORK_DIR=$WWW_DIR/$NETWORK_NAME
|
||||
|
||||
for i in $(seq $FIRST_VALIDATOR $LAST_VALIDATOR); do
|
||||
VALIDATOR=v$(printf '%07d' $i)
|
||||
beacon_chain/beacon_node --dataDir="$DATA_DIR/node-$NODE_ID" importValidators \
|
||||
--keyfile="$NETWORK_DIR/$VALIDATOR.privkey"
|
||||
done
|
||||
|
|
@ -22,8 +22,9 @@ regenTestnetFiles() {
|
|||
NETWORK_FLAVOUR=$1
|
||||
|
||||
if [ ! -f $NETWORK_DIR/genesis.json ]; then
|
||||
rm $NETWORK_DIR/*
|
||||
rm -f $NETWORK_DIR/*
|
||||
nim c -r $NIM_FLAGS beacon_chain/validator_keygen \
|
||||
--generateFakeKeys=no \
|
||||
--validators=$VALIDATOR_COUNT \
|
||||
--outputDir="$NETWORK_DIR"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue