diff --git a/tests/simulation/run_node.sh b/tests/simulation/run_node.sh index f2bf1f10c..8de368289 100755 --- a/tests/simulation/run_node.sh +++ b/tests/simulation/run_node.sh @@ -15,20 +15,17 @@ if [ "${NAT:-}" == "1" ]; then NAT_FLAG="--nat:extip:$(curl -s ifconfig.me)" fi +FIRST_VALIDATOR_IDX=$(printf '%07d' $(( (NUM_VALIDATORS / ($NUM_NODES + 1)) * $1 ))) +LAST_VALIDATOR_IDX=$(printf '%07d' $(( (NUM_VALIDATORS / ($NUM_NODES + 1)) * ($1 + 1) - 1 ))) + +mkdir -p $DATA_DIR/validators +rm -f $DATA_DIR/validators/* +eval cp ${VALIDATORS_DIR}/v{$FIRST_VALIDATOR_IDX..$LAST_VALIDATOR_IDX}.privkey $DATA_DIR/validators + $BEACON_NODE_BIN \ --network:$NETWORK_METADATA_FILE \ --dataDir:$DATA_DIR \ --nodename:${1} \ - --validator:${V_PREFIX}0.privkey \ - --validator:${V_PREFIX}1.privkey \ - --validator:${V_PREFIX}2.privkey \ - --validator:${V_PREFIX}3.privkey \ - --validator:${V_PREFIX}4.privkey \ - --validator:${V_PREFIX}5.privkey \ - --validator:${V_PREFIX}6.privkey \ - --validator:${V_PREFIX}7.privkey \ - --validator:${V_PREFIX}8.privkey \ - --validator:${V_PREFIX}9.privkey \ --tcpPort:$PORT \ --udpPort:$PORT \ $NAT_FLAG \ diff --git a/tests/simulation/start.sh b/tests/simulation/start.sh index 9be7bae38..9795bd089 100755 --- a/tests/simulation/start.sh +++ b/tests/simulation/start.sh @@ -7,8 +7,8 @@ set -eu # Set a default value for the env vars usually supplied by nimbus Makefile -NUM_VALIDATORS=${VALIDATORS:-100} -NUM_NODES=${NODES:-9} +export NUM_VALIDATORS=${VALIDATORS:-100} +export NUM_NODES=${NODES:-9} cd "$SIM_ROOT" mkdir -p "$SIMULATION_DIR"