Skip to content

Commit 549c45f

Browse files
committed
finalising for testing
1 parent 594dd82 commit 549c45f

File tree

1,817 files changed

+690332
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,817 files changed

+690332
-0
lines changed

.env

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CHAINID=9818821
2+
BOOTNODE=""

chaindata/.gitkeep

Whitespace-only changes.

format-package.sh

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
#!/bin/bash
2+
set -e
3+
4+
GREEN='\033[0;32m'
5+
RED='\033[0;31m'
6+
ORANGE='\033[0;33m'
7+
NC='\033[0m' # No Color
8+
9+
#########################################################################
10+
totalRpc=0
11+
totalValidator=0
12+
totalNodes=$(($totalRpc + $totalValidator))
13+
14+
#########################################################################
15+
16+
#+-----------------------------------------------------------------------------------------------+
17+
#| |
18+
#| FUNCTIONS |
19+
#| |
20+
#+------------------------------------------------------------------------------------------------+
21+
22+
countNodes(){
23+
local i=1
24+
totalNodes=$(ls -l | grep -c ^d)
25+
while [[ $i -le $totalNodes ]]; do
26+
27+
if [ -f "./chaindata/node$i/.rpc" ]; then
28+
# ((++totalRpc))
29+
((totalRpc += 1))
30+
else
31+
if [ -f "./chaindata/node$i/.validator" ]; then
32+
# ((++totalValidator))
33+
((totalValidator += 1))
34+
fi
35+
fi
36+
37+
((i += 1))
38+
done
39+
}
40+
41+
displayStatus(){
42+
# start the node
43+
echo -e "\n${GREEN}All the existing node installation and corresponding data has been deleted "
44+
}
45+
46+
task1(){
47+
# update and upgrade the server TASK 1
48+
echo -e "\n\n${ORANGE}TASK: ${RED}[FORMATTING INSTALLATION]${NC}\n"
49+
while true; do
50+
read -p "Are you sure want to continue and completly format & delte all the existing node installations? (Y/N) " yn
51+
case $yn in
52+
[Yy]* )
53+
echo -e "${RED} Format in progress..."
54+
cd ./chaindata
55+
rm -rf ./*
56+
cd ../tmp
57+
rm -rf ./*
58+
cd ../
59+
displayStatus
60+
break;;
61+
[Nn]* ) exit;;
62+
* ) echo "Please answer yes or no.";;
63+
esac
64+
done
65+
echo -e "\n${GREEN}[TASK PASSED]${NC}\n"
66+
}
67+
68+
displayWelcome(){
69+
# display welcome message
70+
echo -e "\n\n\t${ORANGE}Total RPC installed: $totalRpc"
71+
echo -e "\t${ORANGE}Total Validators installed: $totalValidator"
72+
echo -e "\t${ORANGE}Total nodes installed: $totalNodes"
73+
echo -e "\n\n${ORANGE}
74+
\t+------------------------------------------------------------------+
75+
\t| PAY ATTENTION !
76+
\t| Running this tool will delete all exixting node installation and corresponding data
77+
\t| Remember to backup any data that you need before running this
78+
\t+------------------------------------------------------------------+
79+
${NC}\n"
80+
81+
echo -e "${ORANGE}
82+
\t+------------------------------------------------+
83+
\t+------------------------------------------------+
84+
${NC}"
85+
}
86+
87+
88+
#########################################################################
89+
90+
#+-----------------------------------------------------------------------------------------------+
91+
#| |
92+
#| |
93+
#| MAIN |
94+
#| |
95+
#| |
96+
#+-----------------------------------------------------------------------------------------------+
97+
finalize(){
98+
countNodes
99+
displayWelcome
100+
task1
101+
}
102+
103+
finalize

genesis.json

+46
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)