improve tests/simulation/start.sh and friends [skip ci]
This commit is contained in:
parent
b6f4fa5532
commit
33a9370c99
2
Makefile
2
Makefile
|
@ -76,7 +76,7 @@ clean_eth2_network_simulation_files:
|
||||||
rm -rf tests/simulation/{data,validators}
|
rm -rf tests/simulation/{data,validators}
|
||||||
|
|
||||||
eth2_network_simulation: | build deps p2pd clean_eth2_network_simulation_files
|
eth2_network_simulation: | build deps p2pd clean_eth2_network_simulation_files
|
||||||
GIT_ROOT="$$PWD" BUILD_OUTPUTS_DIR="./build" $(ENV_SCRIPT) tests/simulation/start.sh
|
GIT_ROOT="$$PWD" BUILD_OUTPUTS_DIR="./build" tests/simulation/start.sh
|
||||||
|
|
||||||
testnet0 testnet1: | build deps p2pd
|
testnet0 testnet1: | build deps p2pd
|
||||||
NIM_PARAMS="$(NIM_PARAMS)" $(ENV_SCRIPT) scripts/build_testnet_node.sh $@
|
NIM_PARAMS="$(NIM_PARAMS)" $(ENV_SCRIPT) scripts/build_testnet_node.sh $@
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
. $(dirname $0)/vars.sh
|
source "$(dirname "$0")/vars.sh"
|
||||||
cd "$GIT_ROOT"
|
cd "$GIT_ROOT"
|
||||||
|
|
||||||
DATA_DIR="${SIMULATION_DIR}/node-${1}"
|
DATA_DIR="${SIMULATION_DIR}/node-${1}"
|
||||||
|
@ -21,9 +21,9 @@ LAST_VALIDATOR_IDX=$(( (NUM_VALIDATORS / ($NUM_NODES + $NUM_MISSING_NODES)) * ($
|
||||||
mkdir -p $DATA_DIR/validators
|
mkdir -p $DATA_DIR/validators
|
||||||
rm -f $DATA_DIR/validators/*
|
rm -f $DATA_DIR/validators/*
|
||||||
|
|
||||||
pushd $VALIDATORS_DIR
|
pushd $VALIDATORS_DIR >/dev/null
|
||||||
cp $(seq -s " " -f v%07g.privkey $FIRST_VALIDATOR_IDX $LAST_VALIDATOR_IDX) $DATA_DIR/validators
|
cp $(seq -s " " -f v%07g.privkey $FIRST_VALIDATOR_IDX $LAST_VALIDATOR_IDX) $DATA_DIR/validators
|
||||||
popd
|
popd >/dev/null
|
||||||
|
|
||||||
$BEACON_NODE_BIN \
|
$BEACON_NODE_BIN \
|
||||||
--network:$NETWORK_METADATA_FILE \
|
--network:$NETWORK_METADATA_FILE \
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -euo pipefail
|
set -eo pipefail
|
||||||
|
|
||||||
# Read in variables
|
# Read in variables
|
||||||
. "$(dirname "$0")/vars.sh"
|
source "$(dirname "$0")/vars.sh"
|
||||||
|
|
||||||
|
# set up the environment
|
||||||
|
source "${SIM_ROOT}/../../env.sh"
|
||||||
|
|
||||||
# Set DEPOSIT_WEB3_URL_ARG to empty to get genesis state from file, not using web3
|
# Set DEPOSIT_WEB3_URL_ARG to empty to get genesis state from file, not using web3
|
||||||
# export DEPOSIT_WEB3_URL_ARG=--depositWeb3Url=ws://localhost:8545
|
# export DEPOSIT_WEB3_URL_ARG=--depositWeb3Url=ws://localhost:8545
|
||||||
|
@ -16,7 +19,7 @@ mkdir -p "$VALIDATORS_DIR"
|
||||||
|
|
||||||
cd "$GIT_ROOT"
|
cd "$GIT_ROOT"
|
||||||
|
|
||||||
NIMFLAGS="-d:chronicles_log_level=DEBUG --hints:off --opt:speed --debuginfo"
|
NIMFLAGS="-d:chronicles_log_level=DEBUG --hints:off --warnings:off --opt:speed --debuginfo"
|
||||||
|
|
||||||
# Run with "SHARD_COUNT=4 ./start.sh" to change these
|
# Run with "SHARD_COUNT=4 ./start.sh" to change these
|
||||||
DEFS=""
|
DEFS=""
|
||||||
|
@ -29,11 +32,11 @@ LAST_VALIDATOR_NUM=$(( NUM_VALIDATORS - 1 ))
|
||||||
LAST_VALIDATOR="$VALIDATORS_DIR/v$(printf '%07d' $LAST_VALIDATOR_NUM).deposit.json"
|
LAST_VALIDATOR="$VALIDATORS_DIR/v$(printf '%07d' $LAST_VALIDATOR_NUM).deposit.json"
|
||||||
|
|
||||||
echo "Building $BEACON_NODE_BIN ($DEFS)"
|
echo "Building $BEACON_NODE_BIN ($DEFS)"
|
||||||
"$SIM_ROOT/../../env.sh" nim c -o:"$BEACON_NODE_BIN" $NIMFLAGS $DEFS beacon_chain/beacon_node
|
nim c -o:"$BEACON_NODE_BIN" $NIMFLAGS $DEFS beacon_chain/beacon_node
|
||||||
|
|
||||||
if [ ! -f "${LAST_VALIDATOR}" ]; then
|
if [ ! -f "${LAST_VALIDATOR}" ]; then
|
||||||
echo Building $DEPLOY_DEPOSIT_CONTRACT_BIN
|
echo Building $DEPLOY_DEPOSIT_CONTRACT_BIN
|
||||||
"$SIM_ROOT/../../env.sh" nim c -o:"$DEPLOY_DEPOSIT_CONTRACT_BIN" $NIMFLAGS $DEFS --hints:off -d:release beacon_chain/deploy_deposit_contract
|
nim c -o:"$DEPLOY_DEPOSIT_CONTRACT_BIN" $NIMFLAGS $DEFS -d:release beacon_chain/deploy_deposit_contract
|
||||||
|
|
||||||
if [ "$DEPOSIT_WEB3_URL_ARG" != "" ]; then
|
if [ "$DEPOSIT_WEB3_URL_ARG" != "" ]; then
|
||||||
DEPOSIT_CONTRACT_ADDRESS=$($DEPLOY_DEPOSIT_CONTRACT_BIN $DEPOSIT_WEB3_URL_ARG)
|
DEPOSIT_CONTRACT_ADDRESS=$($DEPLOY_DEPOSIT_CONTRACT_BIN $DEPOSIT_WEB3_URL_ARG)
|
||||||
|
|
Loading…
Reference in New Issue