-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathinit
More file actions
executable file
·344 lines (308 loc) · 9.52 KB
/
init
File metadata and controls
executable file
·344 lines (308 loc) · 9.52 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
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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
#!/bin/bash
#
# init for notary node required dependencies and repos
# setup config file first to indicate 1st or 3rd party server
# after setup you will still need to create wp_7776/wp_7779 file
#
# Usage: ./init <include any param value to run without sudo commands>
#
# @see https://docs.komodoplatform.com/notary/setup-Komodo-Notary-Node.html#create-wp-7776
# @author webworker01
#
set -e
scriptpath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source $scriptpath/main
if [[ ! -z $1 ]]; then
usesudo=0
else
usesudo=1
fi
if (( usesudo > 0 )); then
log "init" "installing dependencies"
#dependencies
sudo apt-get update && sudo apt-get upgrade -y
nntoolsinstall="jq bc dc htop libevent-dev"
if (( thirdpartycoins > 0 )); then
# install g++ 7 compiler for chips for now
aptinstall="g++-9"
fi
boost_apt_version=$(apt show libboost-system-dev 2>/dev/null | grep Version | awk '{print $2}' | cut -d . -f -2)
if (( $(echo "$boost_apt_version <= 1.71" | bc -l) )); then
boostinstall="libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev"
fi
sudo apt-get install ${nntoolsinstall} ${aptinstall-} ${boostinstall-} build-essential pkg-config libc6-dev m4 g++-multilib \
autoconf libtool ncurses-dev zlib1g-dev wget curl bsdmainutils automake cmake clang libsodium-dev libcurl4-gnutls-dev \
libssl-dev git unzip python2.7 python3 python3-zmq -y
#nanomsg - for iguana
if [[ ! -f "/usr/local/include/nanomsg/nn.h" ]]; then
log "init" "installing nanomsg"
cd $HOME
git clone https://github.com/nanomsg/nanomsg
cd nanomsg
cmake . -DNN_TESTS=OFF -DNN_ENABLE_DOC=OFF
make -j$(expr $(nproc) - 1)
sudo make install
sudo ldconfig
cd $HOME
rm -rf nanomsg
else
log "init" "/usr/local/include/nanomsg already exists, continuing..."
fi
fi
#komodo
if [[ ! -d "$HOME/komodo" ]]; then
log "init" "installing Komodo"
cd $HOME
git clone https://github.com/KomodoPlatform/komodo
cd komodo
$HOME/komodo/zcutil/fetch-params-alt.sh
$scriptpath/build kmd
if (( usesudo > 0 )); then
sudo ln -sf /home/$USER/komodo/src/komodo-cli /usr/local/bin/komodo-cli
sudo ln -sf /home/$USER/komodo/src/komodod /usr/local/bin/komodod
fi
#create komodo.conf
randusername=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
randpassword=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
if (( thirdpartycoins < 1 )); then
blocknotify="blocknotify=$HOME/nntools/minerfixer %s"
fi
mkdir -p $HOME/.komodo
cat <<EOF > $HOME/.komodo/komodo.conf
rpcuser=user$randusername
rpcpassword=pass$randpassword
txindex=1
server=1
daemon=1
rpcworkqueue=256
rpcbind=127.0.0.1
rpcallowip=127.0.0.1
rpcport=7771
$blocknotify
EOF
chmod 600 $HOME/.komodo/komodo.conf
echo "pubkey=$nn_pubkey" > $HOME/komodo/src/pubkey.txt
else
log "init" "$HOME/komodo already exists, continuing..."
fi
#Iguana
if [[ ! -d "$HOME/dPoW" ]]; then
log "init" "installing dPoW"
cd $HOME
git clone https://github.com/KomodoPlatform/dPoW -b master --single-branch
cd dPoW
# git checkout beta_season3
echo "pubkey=$nn_pubkey" > $HOME/komodo/src/pubkey.txt
else
log "init" "$HOME/dPoW already exists, continuing..."
fi
if (( thirdpartycoins < 1 )); then
#litecoin
if [[ ! -d "$HOME/litecoin" ]]; then
log "init" "installing LTC"
cd $HOME
git clone https://github.com/litecoin-project/litecoin.git -b 0.16 --single-branch
$scriptpath/build ltc
#litecoin.conf
randusername=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
randpassword=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
mkdir -p $HOME/.litecoin
cat <<EOF > $HOME/.litecoin/litecoin.conf
rpcuser=user$randusername
rpcpassword=pass$randpassword
txindex=1
server=1
daemon=1
rpcworkqueue=256
rpcbind=127.0.0.1
rpcallowip=127.0.0.1
rpcport=9332
listen=0
listenonion=0
onlynet=ipv4
# deprecatedrpc=estimatefee
# maxmempool=500
EOF
chmod 600 $HOME/.litecoin/litecoin.conf
else
log "init" "$HOME/litecoin already exists, continuing..."
fi
else
#CHIPS
if [[ ! -d "$HOME/chips" ]]; then
log "init" "installing CHIPS"
cd $HOME
git clone https://github.com/chips-blockchain/chips.git
cd chips
git checkout 6e7560a
$scriptpath/build chips
#chips.conf
randusername=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
randpassword=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
mkdir -p $HOME/.chips
cat <<EOF > $HOME/.chips/chips.conf
rpcuser=user$randusername
rpcpassword=pass$randpassword
txindex=1
server=1
daemon=1
rpcworkqueue=256
rpcbind=127.0.0.1
rpcallowip=127.0.0.1
deprecatedrpc=signrawtransaction
EOF
chmod 600 $HOME/.chips/chips.conf
else
log "init" "$HOME/chips3 already exists, continuing..."
fi
#EMC2
if [[ ! -d "$HOME/einsteinium" ]]; then
log "init" "installing EMC2"
cd $HOME
git clone https://github.com/emc2foundation/einsteinium
cd einsteinium
git checkout c329ae6
$scriptpath/build emc2
#einsteinium.conf
randusername=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
randpassword=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
mkdir -p $HOME/.einsteinium
cat <<EOF > $HOME/.einsteinium/einsteinium.conf
rpcuser=user$randusername
rpcpassword=pass$randpassword
txindex=1
server=1
daemon=1
rpcworkqueue=256
rpcbind=127.0.0.1
rpcallowip=127.0.0.1
#listen=0
listenonion=0
onlynet=ipv4
EOF
chmod 600 $HOME/.einsteinium/einsteinium.conf
else
log "init" "$HOME/einsteinium already exists, continuing..."
fi
#VRSC
if [[ ! -d "$HOME/VerusCoin" ]]; then
log "init" "installing VRSC"
cd $HOME
git clone https://github.com/VerusCoin/VerusCoin
cd VerusCoin
git checkout 81dac44
$scriptpath/build vrsc
else
log "init" "$HOME/VerusCoin already exists, continuing..."
fi
#AYA
if [[ ! -d "$HOME/AYAv2" ]]; then
log "init" "installing AYA"
cd $HOME
git clone https://github.com/KomodoPlatform/AYAv2
cd AYAv2
git checkout 94e6bc0
$scriptpath/build aya
#aryacoin.conf
randusername=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
randpassword=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
mkdir -p $HOME/.aryacoin
cat <<EOF > $HOME/.aryacoin/aryacoin.conf
rpcuser=user$randusername
rpcpassword=pass$randpassword
txindex=1
server=1
daemon=1
litemode=1
rpcworkqueue=256
rpcbind=127.0.0.1
rpcallowip=127.0.0.1
#listen=0
listenonion=0
onlynet=ipv4
#maxconnections=8
EOF
chmod 600 $HOME/.aryacoin/aryacoin.conf
else
log "init" "$HOME/AYAv2 already exists, continuing..."
fi
#Marmara
if [[ ! -d "$HOME/marmara" ]]; then
log "init" "installing MCL"
cd $HOME
git clone https://github.com/marmarachain/marmara.git
cd marmara
git checkout a92d834
$scriptpath/build mcl
else
log "init" "$HOME/marmara already exists, continuing..."
fi
#SFUSD
if [[ ! -d "$HOME/sfusd-core" ]]; then
log "init" "installing SFUSD"
cd $HOME
git clone https://github.com/pbcllc/sfusd-core.git
cd sfusd-core
git checkout 4e79e1b
$scriptpath/build sfusd
#sfusd.conf
randusername=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
randpassword=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
cd $HOME
mkdir -p $HOME/.smartusd
cat <<EOF > $HOME/.smartusd/smartusd.conf
rpcuser=user$randusername
rpcpassword=pass$randpassword
txindex=1
server=1
daemon=1
rpcworkqueue=256
rpcbind=127.0.0.1
rpcallowip=127.0.0.1
deprecatedrpc=signrawtransaction
EOF
chmod 600 $HOME/.smartusd/smartusd.conf
else
log "init" "$HOME/sfusd-core already exists, continuing..."
fi
#TOKEL
if [[ ! -d "$HOME/tokel" ]]; then
log "init" "installing TOKEL"
cd $HOME
git clone https://github.com/TokelPlatform/tokel -b tokel
cd tokel
git checkout 65d50d0
$scriptpath/build tokel
else
log "init" "$HOME/tokel already exists, continuing..."
fi
#MIL
if [[ ! -d "$HOME/mil" ]]; then
log "init" "installing MIL"
cd $HOME
git clone https://github.com/emc2foundation/mil -b master
cd mil
git checkout 578bed7
$scriptpath/build mil
#mil.conf
randusername=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
randpassword=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
mkdir -p $HOME/.mil
cat <<EOF > $HOME/.mil/mil.conf
rpcuser=user$randusername
rpcpassword=pass$randpassword
txindex=1
server=1
daemon=1
rpcworkqueue=256
rpcbind=127.0.0.1
rpcallowip=127.0.0.1
EOF
chmod 600 $HOME/.mil/mil.conf
else
log "init" "$HOME/mil already exists, continuing..."
fi
fi
echo
echo "Done! You must create wp_7776 or wp_7779 file https://docs.komodoplatform.com/notary/setup-Komodo-Notary-Node.html#create-wp-7776 and import your private keys"
log "init" "init completed"