forked from energywebfoundation/authority-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdater.sh
executable file
·265 lines (222 loc) · 9.26 KB
/
updater.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
#!/usr/bin/env bash
# Command command line parameters
while [ "$1" != "" ]; do
case $1 in
-n | --service-name ) shift
SERVICE_NAME=$1
;;
-c | --chain-path ) shift
CHAIN_PATH=$1
;;
* ) return
esac
shift
done
# mv ../authority_node/chain/keys/ethereum ../authority_node/chain/keys/Tobalaba
# cp ./skel/authority.yml ../authority_node/docker-compose.yml
# cp ./config/chain.json ../authority_node/config/chain.json
# sudo systemctl restart ${SERVICE_NAME}
# sudo mkdir ../authority_node/chain/keys/Tobalaba/ 2>> /dev/null
# sudo cp ../authority_node/chain/keys/ethereum/UTC* ../authority_node/chain/keys/Tobalaba/ 2>> /dev/null
# cp ./config/enodeList.list ../authority_node/config/enodeList.list
# MINER=$(tail -n 1 ../authority_node/config/authority.toml)
# cp ./config/authority.toml ../authority_node/config/authority.toml
# echo "${MINER}" >> ../authority_node/config/authority.toml
# sudo systemctl restart [email protected]
# --- ADDED NETSTATS
# mkdir -v ../authority_node/monitor
# cp -v ./skel/eth-netstats.json ../authority_node/monitor/app.json
# cp -v ./skel/authority.yml ../authority_node/docker-compose.yml
# --- FORK 1
# MINER=$(tail -n 1 ../authority_node/config/authority.toml)
# cp ./config/authority.toml ../authority_node/config/authority.toml
# echo "${MINER}" >> ../authority_node/config/authority.toml
# cp ./config/chain.json ../authority_node/config/chain.json
# rm -rf ../authority_node/chain/chains/Tobalaba
# sudo systemctl stop [email protected]
# docker pull parity/parity:nightly
# sudo systemctl start [email protected]
# --- Change gas price
# sudo systemctl stop [email protected]
# MINER=$(tail -n 1 ../authority_node/config/authority.toml)
# cp ./config/authority.toml ../authority_node/config/authority.toml
# echo "${MINER}" >> ../authority_node/config/authority.toml
# sudo systemctl start [email protected]
# --- Change gas limit to 2 bill
# MINER=$(tail -n 1 ../authority_node/config/authority.toml)
# cp ./config/authority.toml ../authority_node/config/authority.toml
# echo "${MINER}" >> ../authority_node/config/authority.toml
# sudo systemctl start [email protected]
# --- Change gas back to 8 mill
# MINER=$(tail -c 61 ../authority_node/config/authority.toml)
# cp ./config/authority.toml ../authority_node/config/authority.toml
# echo "${MINER}" >> ../authority_node/config/authority.toml
# sudo systemctl stop [email protected]
# sudo systemctl start [email protected]
# --- Migration to energyweb repository
# git remote rm origin
# git remote add origin http://github.com/energywebfoundation/authority-node.git
# git pull
# git branch --set-upstream-to=origin/master master
# git pull --no-edit
# --- Change gas settings
# sudo systemctl stop [email protected]
# MINER=$(tail -n 1 ../authority_node/config/authority.toml)
# cp ./config/authority.toml ../authority_node/config/authority.toml
# echo "${MINER}" >> ../authority_node/config/authority.toml
# cp ./skel/authority.yml ../authority_node/docker-compose.yml
# sudo systemctl start [email protected]
# --- Extend enode list
# sudo systemctl stop [email protected]
# cp ./config/enodeList.list ../authority_node/config/enodeList.list
# sudo systemctl start [email protected]
# --- Change gas settings
# sudo systemctl stop [email protected]
# MINER=$(tail -n 1 ../authority_node/config/authority.toml)
# cp ./config/authority.toml ../authority_node/config/authority.toml
# echo "${MINER}" >> ../authority_node/config/authority.toml
# sudo systemctl start [email protected]
# --- Netstats restart
# sudo systemctl restart [email protected]
# --- Change uncleBlockCount in chain file
# cp ./config/chain.json ../authority_node/config/chain.json
# sudo systemctl restart [email protected]
# --- Hardfork 2 Wasm
# cp ./config/chain.json ../authority_node/config/chain.json
# sudo systemctl restart [email protected]
# --- wasm docker
# sudo systemctl stop [email protected]
# docker pull parity/parity:nightly
# sudo systemctl start [email protected]
# --- fixed old config toml
# sudo systemctl stop [email protected]
# cp ./config/authority.toml ../authority_node/config/authority.toml
# sudo systemctl start [email protected]
#
# --- 2018 Autumm update
#
# --- revert to v1.9.x
# sudo systemctl stop [email protected]
# cp ./config/authority-for-1.9.toml ../authority_node/config/authority.toml
# docker pull parity/parity:v1.9.7
# sudo systemctl start [email protected]
# autummupdate () {
# pre-pull the image
# docker pull parity/parity:v1.11.8
# Stop parity
# sudo systemctl stop [email protected]
# Copy new compose file with updated version
# cp ./skel/authority.yml ../authority_node/docker-compose.yml
# Copy new toml with txqueue settings
# MINER=$(tail -n 1 ../authority_node/config/authority.toml)
# cp ./config/authority.toml ../authority_node/config/authority.toml
# echo "${MINER}" >> ../authority_node/config/authority.toml
# Copy new chain definition
# cp ./config/chain-new.json ../authority_node/config/chain.json
# restart the compose file
# sudo systemctl start [email protected]
#}
# -- First batch
#if grep 'Eneco' ../authority_node/monitor/app.json
#then
# exit 0
#fi
#if grep 'ENGIE Authority Node' ../authority_node/monitor/app.json
#then
# exit 0
#fi
#if grep 'Elia Group' ../authority_node/monitor/app.json
#then
# exit 0
#fi
#if grep 'SP Group' ../authority_node/monitor/app.json
#then
# exit 0
#fi
# -- Second batch
#if grep 'TWL' ../authority_node/monitor/app.json
#then
# exit 0
#fi
#if grep 'DigitalVirtues - Signal' ../authority_node/monitor/app.json
#then
# exit 0
#fi
#if grep 'OLI Systems GmbH' ../authority_node/monitor/app.json
#then
# exit 0
#fi
#if grep 'innogy authority node Tobalaba Net' ../authority_node/monitor/app.json
#then
# exit 0
#fi
#if grep 'GridSingularity' ../authority_node/monitor/app.json
#then
# exit 0
#fi
#autummupdate
# --- tobalaba rescue attack machine
# if grep 'Eneco' ../authority_node/monitor/app.json
# then
# echo "engine_signer = \"0xcff3cbbdb3c09e3e250ba6ce3e9ab4d147adc6fc\"" >> ../authority_node/config/authority.toml
#fi
#if grep 'ENGIE Authority Node' ../authority_node/monitor/app.json
#then
# echo "engine_signer = \"0xfF8d78d3dB79f46C018a3CCC04CaB24B4C263fe5\"" >> ../authority_node/config/authority.toml
#fi
#if grep 'TWL' ../authority_node/monitor/app.json
#then
# echo "engine_signer = \"0x6A2b1a140ad141Ef571E91D9Ed2B2fC6fA294317\"" >> ../authority_node/config/authority.toml
#fi
#if grep 'Elia Group' ../authority_node/monitor/app.json
#then
# echo "engine_signer = \"0xB5e8C1Bf705F10Bf4531941600F7D0a5bAb7f5E8\"" >> ../authority_node/config/authority.toml
#fi
#if grep 'SP Group' ../authority_node/monitor/app.json
#then
# echo "engine_signer = \"0xa0Fc126bF3423E36001a33395FF42c14F2017733\"" >> ../authority_node/config/authority.toml
#fi
#if grep 'Centrica' ../authority_node/monitor/app.json
#then
# echo "engine_signer = \"0xa3c898f7f02709ad8716a1d4d75fcd2647dfa97a\"" >> ../authority_node/config/authority.toml
#fi
#if grep 'Shell' ../authority_node/monitor/app.json
#then
# echo "engine_signer = \"0xB3E182cB4B4717c06991c39A59b21f002Cf0a61f\"" >> ../authority_node/config/authority.toml
#fi
#if grep 'innogy authority node Tobalaba Net' ../authority_node/monitor/app.json
#then
# echo "engine_signer = \"0x78d0558d9489e7f846a0cf9f40b1d917244615e2\"" >> ../authority_node/config/authority.toml
#fi
#if grep 'GridSingularity' ../authority_node/monitor/app.json
#then
# echo "engine_signer = \"0x84318cAE5bF44f8EE9093980d77247cD30dEF2E3\"" >> ../authority_node/config/authority.toml
#fi
# if grep "Parity Technologies' Authority Node #0" ../authority_node/monitor/app.json
# then
# echo "engine_signer = \"0x78d0558d9489e7f846a0cf9f40b1d917244615e2\"" >> ../authority_node/config/authority.toml
# fi
# --- wasm fork
# cp ./config/chain.json ../authority_node/config/chain.json
# sudo systemctl restart [email protected]
# --- update to 1.12
# sudo systemctl stop [email protected]
# docker pull parity/parity:nightly
# sudo systemctl start [email protected]
#if grep 'WiproPOA' ../authority_node/monitor/app.json
#then
# sudo systemctl stop [email protected]
#docker pull parity/parity:v1.9.3
#cp ./skel/authority.yml ../authority_node/docker-compose.yml
# sudo systemctl start [email protected]
#fi
# sudo systemctl stop [email protected]
# docker pull parity/parity:nightly
# sudo systemctl start [email protected]
if grep 'TWL' ../authority_node/monitor/app.json
then
sudo systemctl stop [email protected]
cp ./skel/authority.yml ../authority_node/docker-compose.yml
sudo systemctl start [email protected]
fi
echo "$(date)" > ../authority_node/latest_update