-
Notifications
You must be signed in to change notification settings - Fork 18
/
MNUpdaterTestnet.sh
67 lines (60 loc) · 1.59 KB
/
MNUpdaterTestnet.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
#!/bin/bash
while [ 1 ]; do
git fetch --all
sleep 5
status=$(git status)
if [[ $status == *"up-to-date"* ]] || [[ $status == *"up to date"* ]]; then
echo Anon up-to-date
else
echo Stopping ANON Node
./src/anon-cli -testnet stop
sleep 5
echo Anon repo is not up to date. Updating anon repo...
git pull origin master
sleep 5
echo Rebuilding anon node
sleep 5
make -j ${nproc}
echo Fetching Params
sleep 5
./anonutil/fetch-params.sh
echo Running ANON daemon
./src/anond -testnet -reindex -daemon
sleep 10
echo Resetting mnsync
./src/anon-cli -testnet mnsync reset
assetid=$(./src/anon-cli -testnet mnsync status | grep "AssetID" | cut -c 14-16)
assetname=$(./src/anon-cli -testnet mnsync status | grep "AssetName")
while [ $assetid != "999" ]; do
assetid=$(./src/anon-cli -testnet mnsync status | grep "AssetID" | cut -c 14-16)
echo -n MNSYNC in progress
echo -n .
sleep 1
echo -n .
sleep 1
echo -n .
sleep 1
echo -n .
sleep 1
echo -n .
sleep 1
echo -n .
sleep 1
echo -n .
sleep 1
echo -n .
sleep 1
echo -n .
sleep 1
echo .
sleep 1
echo $assetname
sleep 5
done
echo Masternode has successfully started with asset id: $assetid.
echo Starting masternodes:
sleep 2
./src/anon-cli -testnet masternode start-all
fi
sleep 30
done