forked from Consensys/quorum-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
executable file
·94 lines (86 loc) · 2.28 KB
/
start.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
set -u
set -e
function usage() {
echo ""
echo "Usage:"
echo " $0 [raft | istanbul | clique] [tessera | constellation] [--tesseraOptions \"options for Tessera start script\"] [--blockPeriod blockPeriod] [--verbosity verbosity]"
echo ""
echo "Where:"
echo " raft | istanbul | clique : specifies which consensus algorithm to use"
echo " tessera | constellation (default = constellation): specifies which privacy implementation to use"
echo " --tesseraOptions: allows additional options as documented in tessera-start.sh usage which is shown below:"
echo " --blockPeriod: block period default is 5 seconds for IBFT and 50ms for Raft"
echo " --verbosity: verbosity for logging default is 3"
echo ""
./tessera-start.sh --help
exit -1
}
privacyImpl=tessera
tesseraOptions=
consensus=
blockPeriod=
verbosity=3
while (( "$#" )); do
case "$1" in
raft)
consensus=raft
shift
;;
istanbul)
consensus=istanbul
shift
;;
clique)
consensus=clique
shift
;;
tessera)
privacyImpl=tessera
shift
;;
constellation)
privacyImpl=constellation
shift
;;
--tesseraOptions)
tesseraOptions=$2
shift 2
;;
--blockPeriod)
blockPeriod=$2
shift 2
;;
--verbosity)
verbosity=$2
shift 2
;;
--help)
shift
usage
;;
*)
echo "Error: Unsupported command line parameter $1"
usage
;;
esac
done
if [ "$consensus" == "" ]; then
echo "Error: consensus not selected"
exit 1
fi
if [ "$blockPeriod" == "" ]; then
if [ "$consensus" == "raft" ]; then
blockPeriod=50
elif [ "$consensus" == "istanbul" ]; then
blockPeriod=5
fi
fi
if [ "$consensus" == "raft" ] && [ "$blockPeriod" -lt 50 ]; then
blockPeriod=50
fi
if [ "$consensus" == "clique" ]; then
./$consensus-start.sh $privacyImpl $tesseraOptions --verbosity $verbosity
else
./$consensus-start.sh $privacyImpl $tesseraOptions --verbosity $verbosity --blockPeriod $blockPeriod
fi