aboutsummaryrefslogtreecommitdiff
path: root/scripts/faulty_leader_demo.sh
diff options
context:
space:
mode:
authorDeterminant <ted.sybil@gmail.com>2020-02-25 16:53:27 -0500
committerDeterminant <ted.sybil@gmail.com>2020-02-25 16:53:27 -0500
commitab5b9793e80c7235707eb33c67c92d55d8d18cca (patch)
treeeb1117f58eee02adc5dc6fef2c7ec05e90e6ce10 /scripts/faulty_leader_demo.sh
parent601fe38247a8232694a3c9af282c179e6ad1720d (diff)
add a faulty leader example
Diffstat (limited to 'scripts/faulty_leader_demo.sh')
-rwxr-xr-xscripts/faulty_leader_demo.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/faulty_leader_demo.sh b/scripts/faulty_leader_demo.sh
new file mode 100755
index 0000000..a4df108
--- /dev/null
+++ b/scripts/faulty_leader_demo.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+killall hotstuff-app
+./examples/hotstuff-app --conf ./hotstuff-sec0.conf > log0 2>&1 &
+leader_pid="$!"
+rep=({1..3})
+if [[ $# -gt 0 ]]; then
+ rep=($@)
+fi
+for i in "${rep[@]}"; do
+ echo "starting replica $i"
+ #valgrind --leak-check=full ./examples/hotstuff-app --conf hotstuff-sec${i}.conf > log${i} 2>&1 &
+ #gdb -ex r -ex bt -ex q --args ./examples/hotstuff-app --conf hotstuff-sec${i}.conf > log${i} 2>&1 &
+ ./examples/hotstuff-app --conf ./hotstuff-sec${i}.conf > log${i} 2>&1 &
+done
+echo "All replicas started. Let's issue some commands to be replicated (in 5 sec)..."
+sleep 5
+echo "Start issuing commands and the leader will be killed in 5 seconds"
+./examples/hotstuff-client --idx 0 --iter -1 --max-async 4 &
+cli_pid=$!
+sleep 5
+kill "$leader_pid"
+echo "Leader is dead. Let's try to restart our clients (because the simple clients don't timeout/retry some lost requests)."
+kill "$cli_pid"
+./examples/hotstuff-client --idx 0 --iter -1 --max-async 4