forked from consensus-shipyard/mir
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·28 lines (25 loc) · 881 Bytes
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
NODE_0_LOG="./node_0.log"
NODE_1_LOG="./node_1.log"
NODE_2_LOG="./node_2.log"
NODE_3_LOG="./node_3.log"
rm -rf ./node_*.log
function quoted {
SPACE=""
for arg in "$@"; do
printf "%s" "$SPACE\"$arg\""
SPACE=" "
done
printf "\n"
}
tmux new-session -d -s "demo" \; \
new-window -t "demo" \; \
\
split-window -t "demo:0" -v \; \
split-window -t "demo:0.0" -h \; \
split-window -t "demo:0.2" -h \; \
\
send-keys -t "demo:0.0" "go run ./samples/bcb-demo $(quoted "$@") 0 2>&1 | tee $NODE_0_LOG" Enter \; \
send-keys -t "demo:0.1" "go run ./samples/bcb-demo $(quoted "$@") 1 2>&1 | tee $NODE_1_LOG" Enter \; \
send-keys -t "demo:0.2" "go run ./samples/bcb-demo $(quoted "$@") 2 2>&1 | tee $NODE_2_LOG" Enter \; \
send-keys -t "demo:0.3" "go run ./samples/bcb-demo $(quoted "$@") 3 2>&1 | tee $NODE_3_LOG" Enter \; \
attach-session -t "demo:0.0"