forked from nibeshrestha/sailfish
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecution.sh
More file actions
executable file
·45 lines (34 loc) · 1019 Bytes
/
execution.sh
File metadata and controls
executable file
·45 lines (34 loc) · 1019 Bytes
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash
set -uo pipefail
if [ $# -lt 2 ]; then
echo "Usage: $0 <rounds> <endpoint1> [endpoint2 ...]" >&2
exit 1
fi
ROUNDS=$1
# drop the first arg, collect the rest as endpoints
shift
ENDPOINTS=("$@")
echo "Running $ROUNDS rounds against endpoints: ${ENDPOINTS[*]}"
# URL="127.0.0.1:8545 127.0.0.1:8546 127.0.0.1:8547 127.0.0.1:8548"
for (( i=1; i<=ROUNDS; i++ )); do
echo "=== Round $i of $ROUNDS ==="
echo "--- sending batch (#$i) ---"
python3 raw2_batches_main.py "${ENDPOINTS[@]}"
if [ $? -ne 0 ]; then
echo " raw2_batch_main.py failed on round $i"
exit 1
fi
echo " sleeping 5s before applying transitions..."
sleep 5
echo "--- state transition (#$i) ---"
python3 state_transition_with_retry.py "${ENDPOINTS[@]}"
if [ $? -ne 0 ]; then
echo " state_transition_with_retry.py failed on round $i"
exit 1
fi
if [ $i -lt $ROUNDS ]; then
echo " sleeping 3s before next round..."
sleep 3
fi
done
echo " All $ROUNDS rounds completed successfully."