forked from SaujanaOK/Node-TestNet-Guide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aya.sh
67 lines (53 loc) · 3.33 KB
/
aya.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
clear
echo -e "\e[96m"
echo -e " ********** ** "
echo -e " **//////// "
echo -e "/** ****** ** ** ** ****** ******* ****** "
echo -e "/********* //////** /** /** /** //////** //**///** //////** "
echo -e "////////** ******* /** /** /** ******* /** /** ******* "
echo -e " /** **////** /** /** **/** **////** /** /** **////** "
echo -e " ******** //********//******//*** //******** *** /**//********"
echo -e "//////// //////// ////// /// //////// /// // //////// "
echo -e "\e[0m"
sleep 2
# Install Package
sudo apt-get update && sudo apt-get install tar
# Stop Node
cd $HOME/inery-node/inery.setup/master.node && ./stop.sh
# Backup data state
cp -r $HOME/inery-node/inery.setup/master.node/blockchain/data/state/shared_memory.bin $HOME/inery-node/shared_memory.bin.backup
# Backup data reversible
mkdir -p $HOME/inery-node/reversible
cp -r $HOME/inery-node/inery.setup/master.node/blockchain/data/blockchain/blocks/reversible/shared_memory.bin $HOME/inery-node/reversible/shared_memory.bin.backup
# Download latest snapshot
cd $HOME/inery-node/inery.setup/master.node/blockchain && rm -rf data; curl -L https://snap.shot.belajarcrypto.tech/inery/data_latest.tar.lz4 | tar -Ilz4 -xf - -C $HOME/inery-node/inery.setup/master.node/blockchain; source ~/.bashrc && which nodine || source ~/.bash_profile
# Restore Data backup
rm -rf $HOME/inery-node/inery.setup/master.node/blockchain/data/state/shared_memory.bin
mv -i $HOME/inery-node/shared_memory.bin.backup $HOME/inery-node/inery.setup/master.node/blockchain/data/state/shared_memory.bin
rm -rf $HOME/inery-node/inery.setup/master.node/blockchain/data/blockchain/blocks/reversible/shared_memory.bin
mv -i $HOME/inery-node/reversible/shared_memory.bin.backup $HOME/inery-node/inery.setup/master.node/blockchain/data/blockchain/blocks/reversible/shared_memory.bin
rm -rf $HOME/inery-node/reversible; source ~/.bashrc && which nodine || source ~/.bash_profile
# Restore data utama 1A
cp -r $HOME/inery-node/inery.setup/master.node/blockchain/data/blockchain/blocks $HOME/inery-node
# Restore data utama 1B
cd $HOME/inery-node/inery.setup/master.node/blockchain/data/ && rm -rf blockchain; mkdir blockchain
mv -i $HOME/inery-node/blocks $HOME/inery-node/inery.setup/master.node/blockchain/data/blockchain/
# Restore data utama 2A
cd $HOME/inery-node/inery.setup/master.node/blockchain/data/blockchain/blocks
cp -r blocks.index $HOME/inery-node
cp -r reversible $HOME/inery-node
cp -r blocks.log $HOME/inery-node
# Restore data utama 2B
cd $HOME/inery-node/inery.setup/master.node/blockchain/data/blockchain && rm -rf blocks; mkdir -p blocks
mv -i $HOME/inery-node/blocks.index $HOME/inery-node/inery.setup/master.node/blockchain/data/blockchain/blocks
mv -i $HOME/inery-node/reversible $HOME/inery-node/inery.setup/master.node/blockchain/data/blockchain/blocks
mv -i $HOME/inery-node/blocks.log $HOME/inery-node/inery.setup/master.node/blockchain/data/blockchain/blocks
# Save variable
cd $HOME/inery-node/inery.setup/master.node; source ~/.bashrc && which nodine || source ~/.bash_profile
# Hapus Installan
cd
rm -rf $HOME/aya.sh && rm -rf $HOME/ineysnapshot.sh
# Restart Node
cd $HOME/inery-node/inery.setup/master.node/ && ./start.sh; tail -f blockchain/nodine.log
# End