Allow setting the number of missing nodes

This commit is contained in:
Zahary Karadjov 2019-03-29 01:42:45 +02:00 committed by zah
parent c32a833bf7
commit 82282928c3
2 changed files with 3 additions and 2 deletions

View File

@ -15,8 +15,8 @@ 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 )))
FIRST_VALIDATOR_IDX=$(printf '%07d' $(( (NUM_VALIDATORS / ($NUM_NODES + $NUM_MISSING_NODES)) * $1 )))
LAST_VALIDATOR_IDX=$(printf '%07d' $(( (NUM_VALIDATORS / ($NUM_NODES + $NUM_MISSING_NODES)) * ($1 + 1) - 1 )))
mkdir -p $DATA_DIR/validators
rm -f $DATA_DIR/validators/*

View File

@ -9,6 +9,7 @@ set -eu
export NUM_VALIDATORS=${VALIDATORS:-100}
export NUM_NODES=${NODES:-9}
export NUM_MISSING_NODES=${MISSING_NODES:-1}
cd "$SIM_ROOT"
mkdir -p "$SIMULATION_DIR"