2019-02-28 21:21:29 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-11-25 11:46:47 +00:00
|
|
|
# https://github.com/koalaman/shellcheck/wiki/SC2034
|
|
|
|
# shellcheck disable=2034
|
|
|
|
true
|
|
|
|
|
2019-02-28 21:21:29 +00:00
|
|
|
PWD_CMD="pwd"
|
|
|
|
# get native Windows paths on Mingw
|
|
|
|
uname | grep -qi mingw && PWD_CMD="pwd -W"
|
|
|
|
|
2019-11-25 11:46:47 +00:00
|
|
|
cd "$(dirname "$0")"
|
2019-09-01 15:02:49 +00:00
|
|
|
|
2019-02-28 21:21:29 +00:00
|
|
|
SIM_ROOT="$($PWD_CMD)"
|
|
|
|
|
2019-03-28 15:18:59 +00:00
|
|
|
# Set a default value for the env vars usually supplied by a Makefile
|
2019-11-25 11:46:47 +00:00
|
|
|
cd "$(git rev-parse --show-toplevel)"
|
2019-03-28 15:18:59 +00:00
|
|
|
: ${GIT_ROOT:="$($PWD_CMD)"}
|
|
|
|
cd - &>/dev/null
|
2019-02-28 21:21:29 +00:00
|
|
|
|
2019-10-23 13:22:35 +00:00
|
|
|
# When changing these, also update the readme section on running simulation
|
|
|
|
# so that the run_node example is correct!
|
2020-06-18 05:56:47 +00:00
|
|
|
NUM_VALIDATORS=${VALIDATORS:-128}
|
2019-11-26 17:02:27 +00:00
|
|
|
TOTAL_NODES=${NODES:-4}
|
2019-11-11 01:28:13 +00:00
|
|
|
TOTAL_USER_NODES=${USER_NODES:-0}
|
|
|
|
TOTAL_SYSTEM_NODES=$(( TOTAL_NODES - TOTAL_USER_NODES ))
|
2020-06-22 18:22:45 +00:00
|
|
|
BOOTSTRAP_NODE=$(( TOTAL_NODES - 1 ))
|
2020-09-01 13:38:34 +00:00
|
|
|
USE_BN_VC_VALIDATOR_SPLIT=${BN_VC_VALIDATOR_SPLIT:-yes}
|
2019-07-01 12:36:01 +00:00
|
|
|
|
2019-03-28 15:18:59 +00:00
|
|
|
SIMULATION_DIR="${SIM_ROOT}/data"
|
2019-10-17 13:18:58 +00:00
|
|
|
METRICS_DIR="${SIM_ROOT}/prometheus"
|
2019-03-28 15:18:59 +00:00
|
|
|
VALIDATORS_DIR="${SIM_ROOT}/validators"
|
2020-06-01 19:48:20 +00:00
|
|
|
SECRETS_DIR="${SIM_ROOT}/secrets"
|
2019-10-29 16:46:41 +00:00
|
|
|
SNAPSHOT_FILE="${SIMULATION_DIR}/state_snapshot.ssz"
|
2019-10-28 23:04:52 +00:00
|
|
|
NETWORK_BOOTSTRAP_FILE="${SIMULATION_DIR}/bootstrap_nodes.txt"
|
2020-11-07 18:00:31 +00:00
|
|
|
BEACON_NODE_BIN="${GIT_ROOT}/build/nimbus_beacon_node"
|
|
|
|
VALIDATOR_CLIENT_BIN="${GIT_ROOT}/build/nimbus_validator_client"
|
2020-07-17 20:59:50 +00:00
|
|
|
DEPOSIT_CONTRACT_BIN="${GIT_ROOT}/build/deposit_contract"
|
2020-06-22 18:22:45 +00:00
|
|
|
BOOTSTRAP_ENR_FILE="${SIMULATION_DIR}/node-${BOOTSTRAP_NODE}/beacon_node.enr"
|
2020-07-09 22:08:54 +00:00
|
|
|
NETWORK_METADATA_FILE="${SIMULATION_DIR}/network.json"
|
2020-07-17 20:59:50 +00:00
|
|
|
DEPOSITS_FILE="${SIMULATION_DIR}/deposits.json"
|
2019-11-11 01:28:13 +00:00
|
|
|
|
2020-07-09 22:08:54 +00:00
|
|
|
if [[ "$USE_GANACHE" == "yes" ]]; then
|
|
|
|
WEB3_ARG="--web3-url=ws://localhost:8545"
|
|
|
|
else
|
|
|
|
WEB3_ARG=""
|
|
|
|
fi
|
2020-06-16 18:38:51 +00:00
|
|
|
|
2019-11-11 01:28:13 +00:00
|
|
|
BASE_P2P_PORT=30000
|
2020-03-16 22:28:54 +00:00
|
|
|
BASE_RPC_PORT=7000
|
2019-10-17 13:18:58 +00:00
|
|
|
BASE_METRICS_PORT=8008
|
2020-03-24 11:13:07 +00:00
|
|
|
|