From c0e9df0c20175670c538dc4a33c9386c7e1ffb46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Thu, 5 Sep 2019 12:19:08 +0200 Subject: [PATCH] set up env vars for run_node.sh --- interop/README.md | 4 +++- interop/run_node.sh | 4 ++-- interop/start.sh | 11 +++++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/interop/README.md b/interop/README.md index ce07f6b60..89f0e73a7 100644 --- a/interop/README.md +++ b/interop/README.md @@ -21,8 +21,10 @@ make update deps # build dependencies Look in the scripts for options - the default config is a small setup using the `minimal` state spec. ``` +cd interop + # Clear data from previous run, then start a new simulation -rm -rf data ; ./start.sh +rm -rf data; ./start.sh # In a separate terminal, can run another beacon node, such as lighthouse: ./run_lighthouse.sh diff --git a/interop/run_node.sh b/interop/run_node.sh index fc7f2b38c..e5eaecd17 100755 --- a/interop/run_node.sh +++ b/interop/run_node.sh @@ -21,9 +21,9 @@ LAST_VALIDATOR_IDX=$(( (NUM_VALIDATORS / ($NUM_NODES + $NUM_MISSING_NODES)) * ($ mkdir -p $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 -popd +popd >/dev/null $BEACON_NODE_BIN \ --network:$NETWORK_METADATA_FILE \ diff --git a/interop/start.sh b/interop/start.sh index 3cb117fa3..88172bc1e 100755 --- a/interop/start.sh +++ b/interop/start.sh @@ -1,9 +1,12 @@ #!/bin/bash -set -euo pipefail +set -eo pipefail # Read in variables -. "$(dirname "$0")/vars.sh" +source "$(dirname "$0")/vars.sh" + +# set up the environment +source "${SIM_ROOT}/../env.sh" cd "$SIM_ROOT" mkdir -p "$SIMULATION_DIR" @@ -13,7 +16,7 @@ cd "$GIT_ROOT" make update deps -NIMFLAGS="-d:chronicles_log_level=DEBUG --hints:off --opt:speed --debuginfo" +NIMFLAGS="-d:chronicles_log_level=DEBUG --hints:off --warnings:off --opt:speed --debuginfo" # For interop, we run the minimal config DEFS="-d:const_preset=minimal" @@ -23,7 +26,7 @@ LAST_VALIDATOR="$VALIDATORS_DIR/v$(printf '%07d' $LAST_VALIDATOR_NUM).deposit.js [[ -x "$BEACON_NODE_BIN" ]] || { 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