forked from HKEOS/Ghostbusters-Testnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
installGhostbusters.sh
520 lines (432 loc) · 18.4 KB
/
installGhostbusters.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
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
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
#!/bin/bash
##########################################
## Created by ##
## Bohdan Kossak, CryptoLions.io ##
## ##
## Edited for Ghostbusters Testnet by ##
## Igor Lins e Silva, EOS Rio ##
## Jae Chung, HKEOS ##
##########################################
GLOBAL_PATH=$(pwd)
source "$(dirname $0)/params.sh"
NODE_HTTP_SRV_ADDR="$NODE_NET_ADDR:$NODE_API_PORT"
NODE_P2P_LST_ENDP="$NODE_NET_ADDR:$NODE_P2P_PORT"
NODE_P2P_SRV_ADDR="$NODE_HOST:$NODE_P2P_PORT"
NODE_HTTPS_SERVER_ADDR="$NODE_HOST:$NODE_SSL_PORT"
if [[ $ISBP == true ]]; then
TESTNET="$TESTNET-$PRODUCER_NAME"
else
TESTNET="$TESTNET-node"
fi
echo "$TESTNET" > testnet.name;
BASE_CONFIG=$GLOBAL_PATH/base_config.ini;
echo "Work directory: $TESTNET";
# Validations
if [[ $ISBP == true ]]; then
if [[ $PRODUCER_NAME == "<producer-name>" || $PRODUCER_NAME == "" ]]; then
echo "Please define a producer name!";
exit 1;
fi
if [[ ${#PRODUCER_NAME} != 12 ]]; then
echo "Producer name must be exactly 12 characters long!";
exit 1;
fi
if [[ $AGENT_NAME == "<producer-name>" || $AGENT_NAME == "" ]]; then
echo "Please define an agent name!";
exit 1;
fi
if [[ $PRODUCER_PUB_KEY == "<pub-key>" || $PRODUCER_PUB_KEY == "" ]]; then
echo "Please define a producer public key!";
exit 1;
fi
fi
if [[ $NODE_SSL_PORT == "" ]]; then
if [[ $NODE_API_PORT == "<api-port>" || $NODE_API_PORT == "" ]]; then
echo "Please define a http api port!";
exit 1;
fi
fi
PRODUCER_PRIV_KEY_DEF="!! INSERT HERE PRIVATE KEY TO THIS PUBLIC ADDRESS !!";
TESTNET_DIR="$GLOBAL_PATH/$TESTNET";
if [[ $EOS_SOURCE_DIR == "" ]]; then
EOS_SOURCE_DIR="$GLOBAL_PATH/eos-source"
fi
WALLET_DIR="$GLOBAL_PATH/wallet"
# Download sources
if [[ ! -d $EOS_SOURCE_DIR ]]; then
echo "..:: Downloading EOS Sources ::..";
mkdir $EOS_SOURCE_DIR
cd $EOS_SOURCE_DIR
git clone https://github.com/EOS-Mainnet/eos.git ./
git checkout $TAG
git submodule update --init --recursive
cd $GLOBAL_PATH
fi
# Compile Sources
if [[ ! -d $EOS_SOURCE_DIR/build ]]; then
echo "..:: Compiling EOS Sources ::..";
cd $EOS_SOURCE_DIR
git pull
./eosio_build.sh
cd $GLOBAL_PATH
fi
# Check version
EOS_GIT_BRANCH=$(git -C $EOS_SOURCE_DIR branch | grep '*' | cut -f 5 -d' ' | cut -f1 -d')');
echo "Source code at branch $EOS_GIT_BRANCH";
EOS_VERSION=$("$EOS_SOURCE_DIR/build/programs/nodeos/nodeos" --version)
echo "Current nodeos version: $EOS_VERSION";
if [[ "$EOS_VERSION" != "$EOS_TARGET_VERSION" ]]; then
echo "Wrong version, $EOS_TARGET_VERSION required!";
exit 1
fi
# Creating Wallet Folder and files
signature='#!/bin/bash
#######################################################
## ##
## Script Created by CryptoLions, HKEOS and EOS Rio ##
## For EOS Ghostbusters Testnet ##
## ##
## https://github.com/CryptoLions ##
## https://github.com/eosrio ##
## https://github.com/HKEOS/Ghostbusters-Testnet ##
## ##
#######################################################\n\n';
if [[ ! -d $WALLET_DIR ]]; then
echo "..:: Creating Wallet Dir: $WALLET_DIR ::..";
mkdir $WALLET_DIR
echo "..:: Creating Wallet start.sh ::..";
# Creating start.sh for wallet
echo -ne "$signature" > $WALLET_DIR/start.sh
echo "DATADIR=$WALLET_DIR" >> $WALLET_DIR/start.sh
echo "\$DATADIR/stop.sh" >> $WALLET_DIR/start.sh
echo "$EOS_SOURCE_DIR/build/programs/keosd/keosd --data-dir \$DATADIR --http-server-address $WALLET_HOST:$WALLET_PORT \"\$@\" > $WALLET_DIR/stdout.txt 2> $WALLET_DIR/stderr.txt & echo \$! > \$DATADIR/wallet.pid" >> $WALLET_DIR/start.sh
echo "echo \"Wallet started\"" >> $WALLET_DIR/start.sh
chmod u+x $WALLET_DIR/start.sh
# Creating stop.sh for wallet
echo -ne "$signature" > $WALLET_DIR/stop.sh
echo "DIR=$WALLET_DIR" >> $WALLET_DIR/stop.sh
echo '
if [ -f $DIR"/wallet.pid" ]; then
pid=$(cat $DIR"/wallet.pid")
echo $pid
kill $pid
rm -r $DIR"/wallet.pid"
echo -ne "Stopping Wallet"
while true; do
[ ! -d "/proc/$pid/fd" ] && break
echo -ne "."
sleep 1
done
echo -ne "\rWallet stopped. \n"
fi
' >> $WALLET_DIR/stop.sh
chmod u+x $WALLET_DIR/stop.sh
fi
#start Wallet
echo "..:: Starting Wallet ::.."
if [[ ! -f $WALLET_DIR/wallet.pid ]]; then
$WALLET_DIR/start.sh
fi
#################### TESTNET #################################
# Creating TestNet Folder and files
if [[ ! -d $TESTNET_DIR ]]; then
echo "..:: Creating Testnet Dir: $TESTNET_DIR ::..";
mkdir $TESTNET_DIR
# Creating node start.sh
echo "..:: Creating start.sh ::..";
echo -ne "$signature" > $TESTNET_DIR/start.sh
echo "NODEOS=$EOS_SOURCE_DIR/build/programs/nodeos/nodeos" >> $TESTNET_DIR/start.sh
echo "DATADIR=$TESTNET_DIR" >> $TESTNET_DIR/start.sh
echo -ne "\n";
echo "\$DATADIR/stop.sh" >> $TESTNET_DIR/start.sh
echo -ne "\n";
echo "\$NODEOS --data-dir \$DATADIR --config-dir \$DATADIR \"\$@\" > \$DATADIR/stdout.txt 2> \$DATADIR/stderr.txt & echo \$! > \$DATADIR/nodeos.pid" >> $TESTNET_DIR/start.sh
chmod u+x $TESTNET_DIR/start.sh
# Creating node stop.sh
echo "..:: Creating stop.sh ::..";
echo -ne "$signature" > $TESTNET_DIR/stop.sh
echo "DIR=$TESTNET_DIR" >> $TESTNET_DIR/stop.sh
echo -ne "\n";
echo '
if [ -f $DIR"/nodeos.pid" ]; then
pid=$(cat $DIR"/nodeos.pid")
echo $pid
kill $pid
rm -r $DIR"/nodeos.pid"
echo -ne "Stopping Nodeos"
while true; do
[ ! -d "/proc/$pid/fd" ] && break
echo -ne "."
sleep 1
done
echo -ne "\rNodeos stopped. \n"
fi
' >> $TESTNET_DIR/stop.sh
chmod u+x $TESTNET_DIR/stop.sh
# Creating cleos.sh
echo "..:: Creating cleos.sh ::..";
echo -ne "$signature" > $TESTNET_DIR/cleos.sh
echo "CLEOS=$EOS_SOURCE_DIR/build/programs/cleos/cleos" >> $TESTNET_DIR/cleos.sh
echo -ne "\n"
if [[ $NODE_SSL_PORT != "" ]]; then
echo "\$CLEOS -u https://$NODE_HTTP_SRV_ADDR --wallet-url http://127.0.0.1:$WALLET_PORT \"\$@\"" >> $TESTNET_DIR/cleos.sh
else
echo "\$CLEOS -u http://$NODE_HTTP_SRV_ADDR --wallet-url http://127.0.0.1:$WALLET_PORT \"\$@\"" >> $TESTNET_DIR/cleos.sh
fi
chmod u+x $TESTNET_DIR/cleos.sh
# schema.json
echo "..:: Downloading schema.json ::..";
curl https://raw.githubusercontent.com/eosrio/bp-info-standard/master/schema.json > schema.json
# bp_info_sample.json
echo "..:: Downloading bp_info_sample.json ::..";
curl https://raw.githubusercontent.com/eosrio/bp-info-standard/master/bp_info_sample.json > bp_info_sample.json
# autolaunch.sh
echo "..:: Downloading autolaunch.sh ::..";
curl https://raw.githubusercontent.com/HKEOS/Ghostbusters-Testnet/master/autolaunch.sh > $TESTNET_DIR/autolaunch.sh
chmod u+x $TESTNET_DIR/autolaunch.sh
# config.ini
echo -ne "\n\n..:: Creating config.ini ::..\n\n";
if [[ $ISBP == true && $PRODUCER_PRIV_KEY == "" ]]; then
echo -n $'\E[0;33m'
echo "!!! PRIV KEY SECTION !!! You can enter your private key here and it will be imported in wallet and inserted in config.ini. I can skip this step (Enter) and do it manually before start"
echo -ne "PRIV KEY (Enter skip):"
read PRODUCER_PRIV_KEY
echo -n $'\E[0;37m'
fi
if [[ $ISBP == true ]]; then
if [[ $PRODUCER_PRIV_KEY == "" ]]; then
PRODUCER_PRIV_KEY=$PRODUCER_PRIV_KEY_DEF
else
if [[ ! -f $WALLET_DIR/default.wallet ]]; then
WALLET_LOG=$( $TESTNET_DIR/cleos.sh wallet create)
echo "$WALLET_LOG" > wallet_pass.txt
fi
fi
$TESTNET_DIR/cleos.sh wallet import $PRODUCER_PRIV_KEY
fi
if [[ $PEER_PUB_KEY == "" ]]; then
PEER_PUB_KEY="$PRODUCER_PUB_KEY";
fi
if [[ $PEER_PRIV_KEY == "" ]]; then
PEER_PRIV_KEY="$PRODUCER_PRIV_KEY";
fi
echo "### EOS Ghostbusters Testnet Config file. Autogenerated by script." > $BASE_CONFIG
echo '
blocks-dir = "blocks"
chain-state-db-size-mb = 1024
reversible-blocks-db-size-mb = 340
contracts-console = false
# actor-whitelist =
# actor-blacklist =
# contract-whitelist =
# contract-blacklist =
# filter-on =
# https-client-root-cert =
https-client-validate-peers = 1
http-server-address = '$NODE_HTTP_SRV_ADDR'
p2p-listen-endpoint = '$NODE_P2P_LST_ENDP'
p2p-server-address = '$NODE_P2P_SRV_ADDR'
p2p-max-nodes-per-host = 1
access-control-allow-credentials = false
# access-control-allow-origin =
# access-control-allow-headers =
# access-control-max-age =
' >> $BASE_CONFIG
if [[ $NODE_SSL_PORT != "" ]]; then
echo '
# SSL
# Filename with https private key in PEM format. Required for https (eosio::http_plugin)
https-server-address = '$NODE_HTTPS_SERVER_ADDR'
# Filename with the certificate chain to present on https connections. PEM format. Required for https. (eosio::http_plugin)
https-certificate-chain-file = '$SSL_CERT_FILE'
# Filename with https private key in PEM format. Required for https (eosio::http_plugin)
https-private-key-file = '$SSL_PRIV_KEY'
' >> $BASE_CONFIG
else
echo '
# SSL
# Filename with https private key in PEM format. Required for https (eosio::http_plugin)
# https-server-address =
# Filename with the certificate chain to present on https connections. PEM format. Required for https. (eosio::http_plugin)
# https-certificate-chain-file =
# Filename with https private key in PEM format. Required for https (eosio::http_plugin)
# https-private-key-file =
' >> $BASE_CONFIG
fi
echo '
allowed-connection = specified
max-clients = 25
connection-cleanup-period = 30
network-version-match = 1
sync-fetch-span = 100
max-implicit-request = 1500
enable-stale-production = false
pause-on-startup = false
max-transaction-time = 100000
max-irreversible-block-age = -1
txn-reference-block-lag = 0
unlock-timeout = 900
plugin = eosio::chain_plugin
plugin = eosio::history_plugin
agent-name = '$AGENT_NAME'
' >> $BASE_CONFIG
echo 'peer-private-key = ["'$PEER_PUB_KEY'","'$PEER_PRIV_KEY'"]' >> $BASE_CONFIG;
if [[ $ISBP == true ]]; then
echo 'signature-provider = '$PRODUCER_PUB_KEY'=KEY:'$PRODUCER_PRIV_KEY'' >> $BASE_CONFIG;
echo "producer-name = $PRODUCER_NAME" >> $BASE_CONFIG;
echo "plugin = eosio::producer_plugin" >> $BASE_CONFIG;
else
echo "producer-name = $PRODUCER_NAME" >> $BASE_CONFIG;
echo "plugin = eosio::producer_plugin" >> $BASE_CONFIG;
echo "plugin = eosio::chain_api_plugin" >> $BASE_CONFIG;
echo "plugin = eosio::history_api_plugin" >> $BASE_CONFIG;
fi
echo "$PEER_LIST" >> $BASE_CONFIG
echo "$PEER_KEYS" >> $BASE_CONFIG
fi
########### NODE SCRIPTS #################
# Register Producer
echo '..:: Creating your registerProducer.sh ::..'
echo -ne "$signature" > $TESTNET_DIR/bp01_registerProducer.sh
echo "./cleos.sh system regproducer $PRODUCER_NAME $PRODUCER_PUB_KEY \"$PRODUCER_URL\" -p $PRODUCER_NAME" >> $TESTNET_DIR/bp01_registerProducer.sh
chmod u+x $TESTNET_DIR/bp01_registerProducer.sh
# UnRegister Producer
echo '..:: Creating your unRegisterProducer.sh ::..'
echo -ne "$signature" > $TESTNET_DIR/bp06_unRegisterProducer.sh
echo "./cleos.sh system unregprod $PRODUCER_NAME -p $PRODUCER_NAME" >> $TESTNET_DIR/bp06_unRegisterProducer.sh
chmod u+x $TESTNET_DIR/bp06_unRegisterProducer.sh
# Stake EOS Tokens
echo '..:: Creating Stake script stakeTokens.sh ::..'
echo -ne "$signature" > $TESTNET_DIR/bp02_stakeTokens.sh
echo "#./cleos.sh system delegatebw $PRODUCER_NAME $PRODUCER_NAME \"1000.0000 EOS\" \"1000.0000 EOS\" -p $PRODUCER_NAME" >> $TESTNET_DIR/bp02_stakeTokens.sh
echo "./cleos.sh push action eosio delegatebw '{\"from\":\"$PRODUCER_NAME\", \"receiver\":\"$PRODUCER_NAME\", \"stake_net_quantity\": \"1000.0000 EOS\", \"stake_cpu_quantity\": \"1000.0000 EOS\", \"transfer\": true}' -p $PRODUCER_NAME" >> $TESTNET_DIR/bp02_stakeTokens.sh
chmod u+x $TESTNET_DIR/bp02_stakeTokens.sh
# Unstake EOS Tokens
echo '..:: Creating Unstake script unStakeTokens.sh ::..'
echo -ne "$signature" > $TESTNET_DIR/bp05_unStakeTokens.sh
echo "./cleos.sh system undelegatebw $PRODUCER_NAME $PRODUCER_NAME \"1000.0000 EOS\" \"1000.0000 EOS\" -p $PRODUCER_NAME" >> $TESTNET_DIR/bp05_unStakeTokens.sh
chmod u+x $TESTNET_DIR/bp05_unStakeTokens.sh
# Vote Producer
echo '..:: Creating Vote script voteProducer.sh ::..'
echo -ne "$signature" > $TESTNET_DIR/bp03_voteProducer.sh
echo "./cleos.sh system voteproducer prods $PRODUCER_NAME $PRODUCER_NAME -p $PRODUCER_NAME" >> $TESTNET_DIR/bp03_voteProducer.sh
echo "#./cleos.sh system voteproducer prods $PRODUCER_NAME $PRODUCER_NAME tiger lion -p $PRODUCER_NAME" >> $TESTNET_DIR/bp03_voteProducer.sh
chmod u+x $TESTNET_DIR/bp03_voteProducer.sh
# Claim rewards
echo '..:: Creating ClaimReward script claimReward.sh ::..'
echo -ne "$signature" > $TESTNET_DIR/bp04_claimReward.sh
echo "./cleos.sh system claimrewards $PRODUCER_NAME -p $PRODUCER_NAME" >> $TESTNET_DIR/bp04_claimReward.sh
chmod u+x $TESTNET_DIR/bp04_claimReward.sh
# This script will generate the ghostbusters.conf and my-peer-info files
cd $GLOBAL_PATH
umask 077
#generate wiregaurd keys and set source
if [ ! -f privatekey ] && [ ! -f publickey ]; then
echo -e "Generating wireguard keys..."
wg genkey | tee privatekey | wg pubkey > publickey
fi
#generate ghostbuster.conf
echo -e "Generating ghostbuster.conf..."
echo -e "[Interface]\nPrivateKey = $(cat privatekey)\nSaveConfig = true\nDNS = 1.1.1.1" > ghostbusters.conf
echo -e "ListenPort = $WIREGUARD_PORT" >> ghostbusters.conf
echo -e "Address = $WIREGUARD_PRIVATE_IP/22" >> ghostbusters.conf
sudo cp ghostbusters.conf /etc/wireguard/.
#Wireguard
echo -e "Generating my-peer-info file..."
echo -e "#Wireguard" >> my-peer-info
echo -e "[Peer]" > my-peer-info
echo -e "PublicKey = $(cat publickey)" >> my-peer-info
echo -e "AllowedIPs = $WIREGUARD_PRIVATE_IP/32" >> my-peer-info
echo -e "Endpoint = $NODE_PUBLIC_IP:$WIREGUARD_PORT" >> my-peer-info
echo -e "PersistentKeepAlive = 20" >> my-peer-info
echo -e "\n" >> my-peer-info
echo -e "\n" >> my-peer-info
echo -e "#EOS" >> my-peer-info
echo -e "[EOS]" >> my-peer-info
echo -e "p2p-peer-address = $WIREGUARD_PRIVATE_IP:$EOS_P2P_PORT" >> my-peer-info
echo -e "peer-key = \"$EOS_PUBLIC_KEY\"" >> my-peer-info
# Check if Keybase is installed
if ! which keybase > /dev/null; then
echo -e "Keybase not installed. Exiting..."
exit 1;
fi
## Check KBFS mount point
echo
echo "--------------- VERIFYING KEYBASE FILE SYSTEM ---------------";
echo
KBFS_MOUNT=$(keybase status | grep mount | cut -f 2 -d: | sed -e 's/^\s*//' -e '/^$/d');
## Restart Keybase if needed
if [ ! -d "$KBFS_MOUNT" ]; then
echo "KBFS is not running!";
run_keybase
sleep 3
else
echo "KBFS mount point: $KBFS_MOUNT";
echo
fi
keybaseUser=$(keybase status | grep Username: | cut -f2- -d: | sed -e 's/^\s*//' -e '/^$/d');
echo "Keybase user = $keybaseUser";
cd ~/kbfs/team/eos_ghostbusters/ip_list
touch $NODE_HOST@$keybaseUser
# FINISH MESSAGE
FINISHTEXT="\n .====================================================================.\n"
FINISHTEXT+=" |====================================================================|\n"
FINISHTEXT+=" |˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙...::: INSTALLATION COMPLETED :::...˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙|\n"
FINISHTEXT+=" |˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙|\n"
FINISHTEXT+=" |˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙- Ghostbusters Testnet Node Info -˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙|\n"
FINISHTEXT+=" | ˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙|\n"
FINISHTEXT+=" \_-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-_/\n"
FINISHTEXT+="\n"
FINISHTEXT+="\n"
FINISHTEXT+=" Your wallet password was stored in the file wallet_pass.txt\n"
FINISHTEXT+=" Please use it to unlock your wallet: ./cleos.sh wallet unlock\n"
FINISHTEXT+="\n _____________________________________________________________________\n"
FINISHTEXT+=" |\n"
FINISHTEXT+=" | All scripts to manage your node are\n"
FINISHTEXT+=" | located in $TESTNET_DIR folder:\n"
FINISHTEXT+=" |\n"
FINISHTEXT+=" | start.sh.....................start your node\n"
FINISHTEXT+=" |\n"
FINISHTEXT+=" | stop.sh......................stop your node\n"
FINISHTEXT+=" |\n"
FINISHTEXT+=" | bp01_registerProducer.sh.....register producer\n"
FINISHTEXT+=" | .............................Use it to register in\n"
FINISHTEXT+=" | .............................the system contract\n"
FINISHTEXT+=" |\n"
FINISHTEXT+=" | bp02_stakeTokens.sh..........stake tokens\n"
FINISHTEXT+=" | .............................Use it to stake tokens before voting\n"
FINISHTEXT+=" |\n"
FINISHTEXT+=" | bp03_voteProducer.sh.........vote example\n"
FINISHTEXT+=" | .............................It will vote only in yourself.\n"
FINISHTEXT+=" | .............................You can add other producers\n"
FINISHTEXT+=" | .............................manually editing the script\n"
FINISHTEXT+=" |\n"
FINISHTEXT+=" | bp04_claimReward.sh..........claim producer rewards.\n"
FINISHTEXT+=" |\n"
FINISHTEXT+=" | bp05_unStakeTokens.sh........unstake tokens.\n"
FINISHTEXT+=" |\n"
FINISHTEXT+=" | bp06_unRegisterProducer.sh...unregister producer.\n"
FINISHTEXT+=" |\n"
FINISHTEXT+=" | If you inserted your private key, then everything is ready.\n"
FINISHTEXT+=" | So start and please wait until synced.\n"
FINISHTEXT+=" | Logs are located on stderr.txt (tail -f stderr.txt)\n"
FINISHTEXT+=" |\n"
FINISHTEXT+=" |\n"
FINISHTEXT+=" | To start/stop wallet use start.sh/stop.sh scripts in wallet folder.\n"
FINISHTEXT+=" | This installation script will start wallet by default.\n"
FINISHTEXT+=" | \n"
FINISHTEXT+=" | Installation script was disabled. To run again please chmod:\n"
FINISHTEXT+=" | chmod u+x $0\n"
FINISHTEXT+=" |\n"
FINISHTEXT+=" ._____________________________________________________________________\n\n"
echo -ne $FINISHTEXT
echo -ne $FINISHTEXT > ghostbusters.txt
echo
echo "This info was saved to ghostbusters.txt file"
echo
echo "You will now need to execute the following commands:"
echo "1 to publish your peer info to keybase >> ./publishPeerInfo my-peer-info"
echo "2 to start your wireguard interface >> sudo wg-quick up ghostbusters"
echo "3 to connect to the other ghostbusters peers >> ./updatePeers.sh"
read -n 1 -s -r -p "Press any key to continue"
chmod 644 $0