#!/bin/bash set -eu VALIDATORS_START=${1:-20} VALIDATORS_NUM=${2:-5} VALIDATORS_TOTAL=${3:-30} source "$(dirname "$0")/vars.sh" cd "$GIT_ROOT" DATA_DIR="${SIMULATION_DIR}/node-0" V_PREFIX="${VALIDATORS_DIR}/v$(printf '%06d' 0)" PORT=$(printf '5%04d' 0) NAT_FLAG="--nat:none" if [ "${NAT:-}" == "1" ]; then NAT_FLAG="--nat:any" fi mkdir -p $DATA_DIR/validators rm -f $DATA_DIR/validators/* pushd $VALIDATORS_DIR >/dev/null cp $(seq -s " " -f v%07g.privkey $VALIDATORS_START $(($VALIDATORS_START+$VALIDATORS_NUM-1))) $DATA_DIR/validators popd >/dev/null rm -rf "$DATA_DIR/dump" mkdir -p "$DATA_DIR/dump" set -x trap 'kill -9 -- -$$' SIGINT EXIT SIGTERM ./env.sh $BEACON_NODE_BIN \ --statusbar:off \ --network:$NETWORK_METADATA_FILE \ --dataDir:$DATA_DIR \ --nodename:0 \ --tcpPort:$PORT \ --udpPort:$PORT \ $NAT_FLAG \ --stateSnapshot:$SNAPSHOT_FILE