Remove the multinet scripts to avoid conflicts with PR #510

This commit is contained in:
Zahary Karadjov 2019-10-29 18:51:19 +02:00
parent 6664f1689f
commit e5dd7cb708
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
12 changed files with 0 additions and 504 deletions

7
multinet/.gitignore vendored
View File

@ -1,7 +0,0 @@
data
lighthouse
validators
trinity
prysm
lodestar
artemis

View File

@ -1,10 +0,0 @@
#!/bin/bash
# Lighthouse genesis state
curl localhost:5052/beacon/state?slot=0 | python -m json.tool | sed 's/"0x/"/' > /tmp/lighthouse_state.json
# Format nimbus the same
cat data/state_snapshot.json | python -m json.tool | sed 's/"0x/"/' > /tmp/nimbus_state.json
diff -uw /tmp/nimbus_state.json /tmp/lighthouse_state.json

View File

@ -1,34 +0,0 @@
#!/bin/bash
ETH2_PM=${ETH2_PM_PATH:-"eth2.0-pm"}
set -eu
echo Locating zcli...
if ! command -v zcli; then
go get -tags preset_minimal github.com/protolambda/zcli
fi
if [[ ! -d "$ETH2_PM" ]]; then
git clone https://github.com/ethereum/eth2.0-pm "$ETH2_PM"
fi
# Fetch genesis time, as set up by start.sh
if command -v jq; then
# requires the jq package for json parsing
genesis_time=$(jq '.genesis_time' data/state_snapshot.json)
else
# grep -P for perl parsing, not available on Mac
genesis_time=$(grep -oP '(?<=genesis_time": )\w+(?=,)' data/state_snapshot.json)
fi
echo Genesis time was $genesis_time
zcli genesis mock \
--count 16 \
--genesis-time $genesis_time \
--keys "${ETH2_PM}/interop/mocked_start/keygen_10000_validators.yaml" \
--out data/zcli_genesis.ssz
zcli diff state data/zcli_genesis.ssz data/state_snapshot.ssz

View File

@ -1,57 +0,0 @@
#!/bin/bash
set -eo pipefail
# Read in variables
source "$(dirname "$0")/vars.sh"
# set up the environment
source "${SIM_ROOT}/../env.sh"
cd "$SIM_ROOT"
rm -rf "$SIMULATION_DIR"
mkdir -p "$SIMULATION_DIR"
mkdir -p "$VALIDATORS_DIR"
cd "$GIT_ROOT"
make update deps
NIMFLAGS="-d:chronicles_log_level=DEBUG --warnings:off --hints:off --opt:speed"
# For interop, we run the minimal config
DEFS="-d:const_preset=minimal"
LAST_VALIDATOR_NUM=$(( NUM_VALIDATORS - 1 ))
LAST_VALIDATOR="$VALIDATORS_DIR/v$(printf '%07d' $LAST_VALIDATOR_NUM).deposit.json"
[[ -x "$BEACON_NODE_BIN" ]] || {
echo "Building $BEACON_NODE_BIN ($DEFS)"
nim c -o:"$BEACON_NODE_BIN" $NIMFLAGS $DEFS beacon_chain/beacon_node
}
if [ ! -f "${LAST_VALIDATOR}" ]; then
$BEACON_NODE_BIN makeDeposits \
--quickstart-deposits="${NUM_VALIDATORS}" \
--deposits-dir="$VALIDATORS_DIR"
fi
if [ ! -f "${SNAPSHOT_FILE}" ]; then
$BEACON_NODE_BIN \
--data-dir="${SIMULATION_DIR}/node-0" \
createTestnet \
--validators-dir="${VALIDATORS_DIR}" \
--total-validators="${NUM_VALIDATORS}" \
--output-genesis="${SNAPSHOT_FILE}" \
--output-bootstrap-file="${SIMULATION_DIR}/bootstrap_nodes.txt" \
--bootstrap-address=127.0.0.1 \
--bootstrap-port=50000 \
--genesis-offset=30 # Delay in seconds
fi
# Delete any leftover address files from a previous session
if [ -f "${MASTER_NODE_ADDRESS_FILE}" ]; then
rm "${MASTER_NODE_ADDRESS_FILE}"
fi

View File

@ -1,31 +0,0 @@
#!/bin/bash
./make_genesis.sh
# multitail support
MULTITAIL="${MULTITAIL:-multitail}" # to allow overriding the program name
USE_MULTITAIL="${USE_MULTITAIL:-no}" # make it an opt-in
type "$MULTITAIL" &>/dev/null || USE_MULTITAIL="no"
if [ "$USE_MULTITAIL" != "no" ]; then
COMMANDS=()
# "multitail" closes the corresponding panel when a command exits, so let's make sure it doesn't exit
COMMANDS+=( " -cT ansi -t 'nimbus' -l './run_nimbus.sh 10 5; echo [node execution completed]; while true; do sleep 100; done'" )
COMMANDS+=( " -cT ansi -t 'trinity' -l 'sleep 3; ./run_trinity.sh 0 5; echo [node execution completed]; while true; do sleep 100; done'" )
COMMANDS+=( " -cT ansi -t 'lighthouse' -l 'sleep 3; ./run_lighthouse.sh 5 5; echo [node execution completed]; while true; do sleep 100; done'" )
COMMANDS+=( " -cT ansi -t 'prysm' -l 'sleep 3; ./run_prysm.sh 15 5; echo [node execution completed]; while true; do sleep 100; done'" )
COMMANDS+=( " -cT ansi -t 'lodestar' -l 'sleep 3; ./run_lodestar.sh 20 5; echo [node execution completed]; while true; do sleep 100; done'" )
COMMANDS+=( " -cT ansi -t 'artemis' -l 'sleep 3; ./run_artemis.sh 25 5; echo [node execution completed]; while true; do sleep 100; done'" )
eval $MULTITAIL -s 3 -M 0 -x \"Multichain\" "${COMMANDS[@]}"
else
trap 'kill -9 -- -$$' SIGINT EXIT SIGTERM
./run_nimbus.sh &
sleep 2
./run_trinity.sh &
./run_lighthouse.sh &
./run_prysm.sh &
./run_lodestar &
./run_artemis.sh &
wait
fi

View File

@ -1,79 +0,0 @@
#!/bin/bash
# https://github.com/PegaSysEng/artemis#build-instructions
set -eu
VALIDATORS_START=${1:-0}
VALIDATORS_NUM=${2:-5}
VALIDATORS_TOTAL=${3:-25}
SRCDIR=${ARTEMIS_PATH:-"artemis"}
CWD=`pwd`
echo $CWD
print_java_install_msg() {
MSG+="OpenJDK 11 is missing. Please install it "
if [[ "$OSTYPE" == "linux-gnu" ]]; then
MSG+=" with 'sudo apt install openjdk-11-jdk'"
elif [[ "$OSTYPE" == "darwin"* ]]; then
MSG+=" with 'brew tap AdoptOpenJDK/openjdk && brew cask install adoptopenjdk11'"
fi
echo MSG;
}
# Is Java installed?
if ! command -v java; then
print_java_install_msg;
exit 1;
fi
# Is openjdk-11-jdk installed?
if [[ $(java -version 2>&1) != *"OpenJDK"* ]]; then
print_java_install_msg;
exit 1;
fi
command -v gradle > /dev/null || { echo "install gradle (https://gradle.org/install/)"; exit 1; }
[[ -d "$SRCDIR" ]] || {
bash <(curl -s https://raw.githubusercontent.com/PegaSysEng/artemis/master/scripts/clone-repo.sh)
pushd "$SRCDIR"
./gradlew distTar installDist
popd
}
if command -v jq > /dev/null; then
GENESIS_TIME=$(jq '.genesis_time' data/state_snapshot.json)
else
GENESIS_TIME=$(grep '"genesis_time"' data/state_snapshot.json | grep -o '[0-9]*,' | sed 's/.$//')
fi
pushd "$SRCDIR"
NUM_NODES=1
GENESIS_FILE="$CWD/data/state_snapshot.ssz"
sh scripts/configurator.sh "config/config.toml" networkMode "\"jvmlibp2p"\"
sh scripts/configurator.sh "config/config.toml" numValidators $VALIDATORS_TOTAL
sh scripts/configurator.sh "config/config.toml" numNodes $NUM_NODES
sh scripts/configurator.sh "config/config.toml" active true
sh scripts/configurator.sh "config/config.toml" genesisTime $GENESIS_TIME
sh scripts/configurator.sh "config/config.toml" ownedValidatorStartIndex $VALIDATORS_START
sh scripts/configurator.sh "config/config.toml" ownedValidatorCount $VALIDATORS_NUM
sh scripts/configurator.sh "config/config.toml" startState "\"$GENESIS_FILE"\"
PEERS="$(cat ../data/bootstrap_nodes.txt)"
ARTEMIS_PEERS=$(echo [\"$PEERS\"] )
sed -i.bak 's/bootnodes/peers/g' config/config.toml
rm -f config/config.toml.bak
sh scripts/configurator.sh "config/config.toml" peers $ARTEMIS_PEERS
sh scripts/configurator.sh "config/config.toml" discovery "\"static\""
sh scripts/configurator.sh "config/config.toml" isBootnode false
cp config/config.toml build/install/artemis/bin/
popd
set -x
cd "$SRCDIR/build/install/artemis/bin/" && ./artemis --config=config.toml --logging=DEBUG;

View File

@ -1,75 +0,0 @@
#!/bin/bash
# https://github.com/sigp/lighthouse/blob/master/docs/interop.md
set -eu
VALIDATORS_START=${1:-0}
VALIDATORS_NUM=${2:-5}
VALIDATORS_TOTAL=${3:-30}
SRCDIR=${LIGHTHOUSE_PATH:-"lighthouse"}
echo Locating protoc...
if ! command -v protoc; then
MSG="protoc (the Google Protobuf compiler) is missing. Please install it manually"
if [[ "$OSTYPE" == "linux-gnu" ]]; then
MSG+=" with sudo apt install protobuf-compiler"
elif [[ "$OSTYPE" == "darwin"* ]]; then
MSG+=" with 'brew install protobuf'"
elif [[ "$OSTYPE" == "cygwin" ]]; then
# POSIX compatibility layer and Linux environment emulation for Windows
MSG+=""
elif [[ "$OSTYPE" == "msys" ]]; then
# Lightweight shell and GNU utilities compiled for Windows (part of MinGW)
MSG+=""
elif [[ "$OSTYPE" == "win32" ]]; then
# I'm not sure this can happen.
MSG+=""
elif [[ "$OSTYPE" == "freebsd"* ]]; then
# ...
MSG+=""
else
# Unknown.
MSG+=""
fi
echo $MSG
exit 1
fi
command -v cargo > /dev/null || { echo "install rust first (https://rust-lang.org)"; exit 1; }
[[ -d "$SRCDIR" ]] || {
git clone https://github.com/sigp/lighthouse.git "$SRCDIR"
pushd "$SRCDIR"
git checkout interop # temporary interop branch - will get merged soon I expect!
cargo update
popd
}
pushd "$SRCDIR"
cargo build --release
popd
# Fetch genesis time, as set up by start.sh
if command -v jq > /dev/null; then
GENESIS_TIME=$(jq '.genesis_time' data/state_snapshot.json)
else
GENESIS_TIME=$(grep -oP '(?<=genesis_time": )\w+(?=,)' data/state_snapshot.json)
fi
echo Genesis time was $GENESIS_TIME
set -x
trap 'kill -9 -- -$$' SIGINT EXIT SIGTERM
cd "$SRCDIR/target/release"
#$export RUST_LOG=libp2p=trace,multistream=trace,gossipsub=trace
# fresh start!
rm -rf ~/.lighthouse
./beacon_node --libp2p-addresses="/ip4/127.0.0.1/tcp/50000" testnet --spec minimal quick $VALIDATORS_TOTAL $GENESIS_TIME &
./validator_client testnet -b insecure $VALIDATORS_START $VALIDATORS_NUM

View File

@ -1,44 +0,0 @@
#!/bin/bash
set -eu
VALIDATORS_START=${1:-5}
VALIDATORS_NUM=${2:-5}
VALIDATORS_TOTAL=${3:-30}
SRCDIR=${LODESTAR_PATH:-"lodestar"}
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
command -v nvm > /dev/null || { echo "install nvm first (https://github.com/nvm-sh/nvm#installation-and-update)"; exit 1; }
# Install node 10 LTS
echo Switching to node 10..
nvm install 10 && nvm use 10
[[ -d "$SRCDIR" ]] || {
git clone git@github.com:ChainSafe/lodestar.git "$SRCDIR"
pushd "$SRCDIR"
command -v yarn > /dev/null || { npm install --global yarn ; }
yarn install
npx lerna bootstrap
popd
}
set -x
trap 'kill -9 -- -$$' SIGINT EXIT SIGTERM
cd "$SRCDIR/packages/lodestar"
# Start
# -v is optional
./bin/lodestar interop -p minimal --db l1 \
-q ../../../data/state_snapshot.ssz \
--multiaddrs /ip4/127.0.0.1/tcp/19004 \
--bootnodes "$(cat ../../../data/bootstrap_nodes.txt)" \
-r -v $VALIDATORS_START,$(($VALIDATORS_START+$VALIDATORS_NUM))

View File

@ -1,43 +0,0 @@
#!/bin/bash
set -eu
VALIDATORS_START=${1:-20}
VALIDATORS_NUM=${2:-5}
VALIDATORS_TOTAL=${3:-30}
source "$(dirname "$0")/vars.sh"
cd "$GIT_ROOT"
DATA_DIR="${SIMULATION_DIR}/node-0"
V_PREFIX="${VALIDATORS_DIR}/v$(printf '%06d' 0)"
PORT=$(printf '5%04d' 0)
NAT_FLAG="--nat:none"
if [ "${NAT:-}" == "1" ]; then
NAT_FLAG="--nat:any"
fi
mkdir -p $DATA_DIR/validators
rm -f $DATA_DIR/validators/*
pushd $VALIDATORS_DIR >/dev/null
cp $(seq -s " " -f v%07g.privkey $VALIDATORS_START $(($VALIDATORS_START+$VALIDATORS_NUM-1))) $DATA_DIR/validators
popd >/dev/null
rm -rf "$DATA_DIR/dump"
mkdir -p "$DATA_DIR/dump"
set -x
trap 'kill -9 -- -$$' SIGINT EXIT SIGTERM
./env.sh $BEACON_NODE_BIN \
--status-bar:off \
--data-dir:$DATA_DIR \
--node-name:0 \
--tcp-port:$PORT \
--udp-port:$PORT \
$NAT_FLAG \
--state-snapshot:$SNAPSHOT_FILE

View File

@ -1,54 +0,0 @@
#!/bin/bash
set -eu
trap 'kill -9 -- -$$' SIGINT EXIT SIGTERM
VALIDATORS_START=${1:-15}
VALIDATORS_NUM=${2:-5}
VALIDATORS_TOTAL=${3:-30}
SRCDIR=${PRYSM_PATH:-"prysm"}
command -v bazel > /dev/null || { echo "install bazel build tool first (https://docs.bazel.build/versions/master/install.html)"; exit 1; }
command -v go > /dev/null || { echo "install go first (https://golang.org/doc/install)"; exit 1; }
# This script assumes amd64. Prysm builds for other architectures, but keeping it simple
# for this start script.
OS=""
if [[ "$OSTYPE" == "linux-gnu" ]]; then
OS+="linux_amd64"
elif [[ "$OSTYPE" == "darwin"* ]]; then
OS+="darwin_amd64"
else
# Windows builds do work, but it would make this script more complicated.
# Allowing for Mac and Linux only for the moment.
echo "Only Mac and Linux builds supported at this time"
fi
[[ -d "$SRCDIR" ]] || {
git clone https://github.com/prysmaticlabs/prysm.git "$SRCDIR"
pushd "$SRCDIR"
bazel build --define ssz=minimal //beacon-chain //validator
popd
}
set -x
cd "$SRCDIR"
rm -rf /tmp/beacon-prysm
"$(bazel info bazel-bin)/beacon-chain/${OS}_stripped/beacon-chain" \
--datadir /tmp/beacon-prysm \
--pprof --verbosity=debug \
--bootstrap-node= \
--peer=$(cat ../data/bootstrap_nodes.txt) \
--interop-eth1data-votes \
--deposit-contract=0xD775140349E6A5D12524C6ccc3d6A1d4519D4029 \
--interop-genesis-state ../data/state_snapshot.ssz &
sleep 3
"$(bazel info bazel-bin)/validator/${OS}_pure_stripped/validator" \
--interop-start-index=$VALIDATORS_START \
--interop-num-validators=$VALIDATORS_NUM

View File

@ -1,45 +0,0 @@
#!/bin/bash
set -eu
VALIDATORS_START=${1:-10}
VALIDATORS_NUM=${2:-5}
VALIDATORS_TOTAL=${3:-30}
SRCDIR=${TRINITY_PATH:-"trinity"}
command -v python3 > /dev/null || { echo "install python3 first (https://wiki.python.org/moin/BeginnersGuide/Download)"; exit 1; }
[[ -d "$SRCDIR" ]] || {
git clone git@github.com:ethereum/trinity.git "$SRCDIR"
pushd "$SRCDIR"
git checkout interop # temporary interop branch - will get merged soon I expect!
python3 -m venv _ve
. _ve/bin/activate
pip install -e .[eth2-dev]
popd
}
set -x
trap 'kill -9 -- -$$' SIGINT EXIT SIGTERM
cd "$SRCDIR"
. _ve/bin/activate
rm -rf /tmp/bb
VALIDATORS=$(seq $VALIDATORS_START $(($VALIDATORS_START+$VALIDATORS_NUM-1)) | paste -d ',' -s -)
PYTHONWARNINGS=ignore::DeprecationWarning trinity-beacon \
-l DEBUG \
--trinity-root-dir /tmp/bb \
--beacon-nodekey='aaaaaaaa' \
--preferred_nodes="$(cat ../data/bootstrap_nodes.txt)" \
interop \
--validators $VALIDATORS \
--genesis-state-ssz-path ../data/state_snapshot.ssz

View File

@ -1,25 +0,0 @@
#!/bin/bash
PWD_CMD="pwd"
# get native Windows paths on Mingw
uname | grep -qi mingw && PWD_CMD="pwd -W"
cd $(dirname $0)
SIM_ROOT="$($PWD_CMD)"
# Set a default value for the env vars usually supplied by a Makefile
cd $(git rev-parse --show-toplevel)
: ${GIT_ROOT:="$($PWD_CMD)"}
cd - &>/dev/null
NUM_VALIDATORS=${VALIDATORS:-25}
NUM_NODES=${NODES:-1}
NUM_MISSING_NODES=${MISSING_NODES:-2}
SIMULATION_DIR="${SIM_ROOT}/data"
VALIDATORS_DIR="${SIM_ROOT}/validators"
SNAPSHOT_FILE="${SIMULATION_DIR}/state_snapshot.ssz"
NETWORK_BOOTSTRAP_FILE="${SIMULATION_DIR}/bootstrap_nodes.txt"
BEACON_NODE_BIN="${SIMULATION_DIR}/beacon_node"
MASTER_NODE_ADDRESS_FILE="${SIMULATION_DIR}/node-0/beacon_node.address"