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!
|
2019-10-08 15:34:46 +00:00
|
|
|
NUM_VALIDATORS=${VALIDATORS:-192}
|
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 ))
|
|
|
|
MASTER_NODE=$(( TOTAL_NODES - 1 ))
|
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-05-11 18:35:53 +00:00
|
|
|
BEACON_NODE_BIN="${GIT_ROOT}/build/beacon_node"
|
2020-05-22 17:04:52 +00:00
|
|
|
VALIDATOR_CLIENT_BIN="${GIT_ROOT}/build/validator_client"
|
2020-05-11 18:35:53 +00:00
|
|
|
DEPLOY_DEPOSIT_CONTRACT_BIN="${GIT_ROOT}/build/deposit_contract"
|
2020-03-23 11:26:44 +00:00
|
|
|
MASTER_NODE_ADDRESS_FILE="${SIMULATION_DIR}/node-${MASTER_NODE}/beacon_node.address"
|
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
|
|
|
|
|
|
|
if [[ "$USE_GANACHE" == "yes" ]]; then
|
|
|
|
WEB3_ARG=--web3-url=ws://localhost:8545
|
|
|
|
else
|
|
|
|
WEB3_ARG=""
|
|
|
|
DEPOSIT_CONTRACT_ADDRESS="0x"
|
|
|
|
fi
|
2019-10-17 13:18:58 +00:00
|
|
|
|
2020-06-05 09:57:40 +00:00
|
|
|
# uncomment to enable the use of VCs in addition to BNs - will split the validators equally
|
|
|
|
#SPLIT_VALIDATORS_BETWEEN_BN_AND_VC="yes"
|