Quick and dirty script for running a Rpi tmux demos

This commit is contained in:
Zahary Karadjov 2019-10-09 00:34:46 +09:00
parent 360afe48a3
commit 5f271fd82e
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
3 changed files with 31 additions and 2 deletions

20
tests/simulation/tmux_demo.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
# Read in variables
set -a
source "$(dirname "$0")/vars.sh"
cd $(dirname "$0")
rm -rf data
tmux new-session -s 'beacon_node' -d
# maybe these should be moved to a user config file
tmux set-option -g history-limit 999999
tmux set -g mouse on
tmux send-keys -t 0 './start.sh' Enter
tmux new-window -n "demo_node" "./wait_master_node.sh && ./run_node.sh $NUM_NODES"
tmux attach-session -d

View File

@ -13,8 +13,8 @@ cd $(git rev-parse --show-toplevel)
: ${GIT_ROOT:="$($PWD_CMD)"}
cd - &>/dev/null
NUM_VALIDATORS=${VALIDATORS:-1000}
NUM_NODES=${NODES:-4}
NUM_VALIDATORS=${VALIDATORS:-192}
NUM_NODES=${NODES:-2}
NUM_MISSING_NODES=${MISSING_NODES:-1}
SIMULATION_DIR="${SIM_ROOT}/data"

View File

@ -0,0 +1,9 @@
#!/bin/bash
if [ ! -f "${MASTER_NODE_ADDRESS_FILE}" ]; then
echo Waiting for master node...
while [ ! -f "${MASTER_NODE_ADDRESS_FILE}" ]; do
sleep 0.1
done
fi