-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathquorum-node.sh
More file actions
executable file
·102 lines (89 loc) · 4.58 KB
/
quorum-node.sh
File metadata and controls
executable file
·102 lines (89 loc) · 4.58 KB
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
95
96
97
98
99
100
101
102
if [ $# -eq 0 ]
then
if [ -d "bcData/node" ];
then
geth --datadir ./bcData/node --mine --port 23000 --rpc --rpccorsdomain "*" --rpcaddr 0.0.0.0 --rpcapi "admin,debug,eth,miner,net,personal,shh,txpool,web3,istanbul" --rpcport 8545 --ipcpath "geth.ipc" --gasprice 0 --targetgaslimit 999999999999999999 --istanbul.blockperiod 3 --permissioned --verbosity 2 2>&1 | tee /dynamo/bcData/quorum.log
fi
if [ ! -d "bcData/node" ];
then
mkdir bcData/node
mkdir bcData/node/keystore
mkdir bcData/node/geth
cd bcData/node
istanbul setup --num 1 --nodes --verbose --save
mv ./0/nodekey ./
cd ../..
cp ./bcData/node/nodekey ./bcData/node/geth/
mv ./bcData/node/genesis.json ./bcData/node/genesis-temp.json
#cat ./node/genesis-temp.json | jq --arg assetsContract_code "$assetsContract_code" --arg streamsContract_code "$streamsContract_code" --arg atomicSwapContract_code "$atomicSwapContract_code" '.gasLimit="0xde0b6b3a763ffff" | .alloc["0000000000000000000000000000000000000001"].balance="0x446c3b15f9926687d2c40534fdb564000000000000" | .alloc["0000000000000000000000000000000000000002"].balance="0x446c3b15f9926687d2c40534fdb564000000000000" | .alloc["0000000000000000000000000000000000000003"].balance="0x446c3b15f9926687d2c40534fdb564000000000000" | .alloc["0000000000000000000000000000000000000001"].constructor=$assetsContract_code | .alloc["0000000000000000000000000000000000000002"].constructor=$streamsContract_code | .alloc["0000000000000000000000000000000000000003"].constructor=$atomicSwapContract_code' >> ./node/genesis.json
cat ./bcData/node/genesis-temp.json | jq '.gasLimit="0xde0b6b3a763ffff"' >> ./bcData/node/genesis.json
rm ./bcData/node/genesis-temp.json
geth --datadir ./bcData/node init ./bcData/node/genesis.json
rm ./bcData/node/nodekey
echo '[]' >./bcData/node/permissioned-nodes.json
echo '[]' >./bcData/node/static-nodes.json
geth --datadir ./bcData/node --mine --port 23000 --rpc --rpccorsdomain "*" --rpcaddr 0.0.0.0 --rpcapi "admin,debug,eth,miner,net,personal,shh,txpool,web3,istanbul" --rpcport 8545 --ipcpath "geth.ipc" --gasprice 0 --targetgaslimit 999999999999999999 --istanbul.blockperiod 3 --permissioned --verbosity 2 2>&1 | tee /dynamo/bcData/quorum.log
fi
fi
if [ $# -eq 2 ]
then
if [ -d "bcData/node" ];
then
geth --datadir ./bcData/node --port 23000 --rpc --rpccorsdomain "*" --rpcaddr 0.0.0.0 --rpcapi "admin,debug,eth,miner,net,personal,shh,txpool,web3,istanbul" --rpcport 8545 --ipcpath "geth.ipc" --gasprice 0 --targetgaslimit 999999999999999999 --istanbul.blockperiod 3 --permissioned --verbosity 2 2>&1 | tee /dynamo/bcData/quorum.log
fi
if [ ! -d "bcData/node" ];
then
mkdir bcData/node
mkdir bcData/node/keystore
mkdir bcData/node/geth
cd bcData/node
istanbul setup --num 1 --nodes --verbose --save
mv ./0/nodekey ./
cd ../..
cp ./bcData/node/nodekey ./bcData/node/geth/
cat <<EOF >./bcData/node/static-nodes.json
$1
EOF
cat <<EOF >./bcData/node/permissioned-nodes.json
$1
EOF
rm -rf ./bcData/node/genesis.json
cat <<EOF >./bcData/node/genesis.json
$2
EOF
geth --datadir ./bcData/node init ./bcData/node/genesis.json
rm ./bcData/node/nodekey
geth --datadir ./bcData/node --port 23000 --rpc --rpccorsdomain "*" --rpcaddr 0.0.0.0 --rpcapi "admin,debug,eth,miner,net,personal,shh,txpool,web3,istanbul" --rpcport 8545 --ipcpath "geth.ipc" --gasprice 0 --targetgaslimit 999999999999999999 --istanbul.blockperiod 3 --permissioned --verbosity 2 2>&1 | tee /dynamo/bcData/quorum.log
fi
fi
if [ $# -eq 3 ]
then
if [ -d "bcData/node" ];
then
geth --datadir ./bcData/node --mine --port 23000 --rpc --rpccorsdomain "*" --rpcaddr 0.0.0.0 --rpcapi "admin,debug,eth,miner,net,personal,shh,txpool,web3,istanbul" --rpcport 8545 --ipcpath "geth.ipc" --gasprice 0 --targetgaslimit 999999999999999999 --istanbul.blockperiod 3 --permissioned --verbosity 2 2>&1 | tee /dynamo/bcData/quorum.log
fi
if [ ! -d "bcData/node" ];
then
mkdir bcData/node
mkdir bcData/node/keystore
mkdir bcData/node/geth
cd bcData/node
istanbul setup --num 1 --nodes --verbose --save
mv ./0/nodekey ./
cd ../..
cp ./bcData/node/nodekey ./bcData/node/geth/
cat <<EOF >./bcData/node/static-nodes.json
$1
EOF
cat <<EOF >./bcData/node/permissioned-nodes.json
$1
EOF
rm -rf ./bcData/node/genesis.json
cat <<EOF >./bcData/node/genesis.json
$2
EOF
geth --datadir ./bcData/node init ./bcData/node/genesis.json
rm ./bcData/node/nodekey
geth --datadir ./bcData/node --mine --port 23000 --rpc --rpccorsdomain "*" --rpcaddr 0.0.0.0 --rpcapi "admin,debug,eth,miner,net,personal,shh,txpool,web3,istanbul" --rpcport 8545 --ipcpath "geth.ipc" --gasprice 0 --targetgaslimit 999999999999999999 --istanbul.blockperiod 3 --permissioned --verbosity 2 2>&1 | tee /dynamo/bcData/quorum.log
fi
fi