forked from CryptoCashBack-Hub/CCB_Sripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CCB_install.sh
184 lines (162 loc) · 5.04 KB
/
CCB_install.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
#!/bin/bash
HEIGHT=15
WIDTH=40
CHOICE_HEIGHT=6
BACKTITLE="CCBC Masternode Setup Wizard"
TITLE="CCBC VPS Setup"
MENU="Choose one of the following options:"
OPTIONS=(1 "Install New VPS Server"
2 "Update to new version VPS Server"
3 "Start CCBC Masternode"
4 "Stop CCBC Masternode"
5 "CCBC Server Status"
6 "Rebuild CCBC Masternode Index")
CHOICE=$(whiptail --clear\
--backtitle "$BACKTITLE" \
--title "$TITLE" \
--menu "$MENU" \
$HEIGHT $WIDTH $CHOICE_HEIGHT \
"${OPTIONS[@]}" \
2>&1 >/dev/tty)
clear
case $CHOICE in
1)
echo Starting the install process.
echo Checking and installing VPS server prerequisites. Please wait.
echo -e "Checking if swap space is needed."
PHYMEM=$(free -g|awk '/^Mem:/{print $2}')
SWAP=$(swapon -s)
if [[ "$PHYMEM" -lt "2" && -z "$SWAP" ]];
then
echo -e "${GREEN}Server is running with less than 2G of RAM, creating 2G swap file.${NC}"
dd if=/dev/zero of=/swapfile bs=1024 count=2M
chmod 600 /swapfile
mkswap /swapfile
swapon -a /swapfile
else
echo -e "${GREEN}The server running with at least 2G of RAM, or SWAP exists.${NC}"
fi
if [[ $(lsb_release -d) != *16.04* ]]; then
echo -e "${RED}You are not running Ubuntu 16.04. Installation is cancelled.${NC}"
exit 1
fi
if [[ $EUID -ne 0 ]]; then
echo -e "${RED}$0 must be run as root.${NC}"
exit 1
fi
clear
sudo apt update
sudo apt-get -y upgrade
sudo apt-get install git -y
sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils -y
sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev -y
sudo apt-get install libboost-all-dev -y
sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:bitcoin/bitcoin -y
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev -y
sudo apt-get install libminiupnpc-dev -y
sudo apt-get install libzmq3-dev -y
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler -y
sudo apt-get install libqt4-dev libprotobuf-dev protobuf-compiler -y
clear
echo VPS Server prerequisites installed.
echo Configuring server firewall.
sudo apt-get install -y ufw
sudo ufw allow 5520
sudo ufw allow ssh/tcp
sudo ufw limit ssh/tcp
sudo ufw logging on
echo "y" | sudo ufw enable
sudo ufw status
echo Server firewall configuration completed.
echo Downloading AquilaX install files.
wget https://github.com/CryptoCashBack-Hub/CCBC/releases/download/v1.0.0.1/CCBC-linux.tar.gz
echo Download complete.
echo Installing CCBC.
tar -xvf CCBC-linux.tar.gz
chmod 775 ./ccbcd
chmod 775 ./ccbc-cli
echo Concierge install complete.
sudo rm -rf CCBC-linux.tar.gz
clear
echo Now ready to setup CCBC configuration file.
RPCUSER=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
RPCPASSWORD=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
EXTIP=`curl -s4 icanhazip.com`
echo Please input your private key.
read GENKEY
mkdir -p /root/.ccbc && touch /root/.ccbc/ccbc.conf
cat << EOF > /root/.ccbc/ccbc.conf
rpcuser=$RPCUSER
rpcpassword=$RPCPASSWORD
rpcallowip=127.0.0.1
server=1
listen=1
daemon=1
staking=1
rpcallowip=127.0.0.1
rpcport=15520
port=5520
addnode=144.202.16.251:5520
addnode=104.238.159.161:5520
addnode=178.128.116.146:5520
addnode=95.179.199.170:5520
addnode=158.69.143.106:5520
addnode=95.216.145.35:5520
addnode=45.32.123.247:5520
logtimestamps=1
maxconnections=256
masternode=1
externalip=$EXTIP
masternodeprivkey=$GENKEY
EOF
clear
./ccbcd -daemon
./ccbc-cli stop
./ccbcd -daemon
clear
echo CCBC configuration file created successfully.
echo CCBC Server Started Successfully using the command ./ccbcd -daemon
echo If you get a message asking to rebuild the database, please hit Ctr + C and run ./ccbcd -daemon -reindex
echo If you still have further issues please reach out to support in our Discord channel.
echo Please use the following Private Key when setting up your wallet: $GENKEY
;;
2)
sudo ./ccbc-cli -daemon stop
echo "! Stopping CCBC Daemon !"
echo Configuring server firewall.
sudo apt-get install -y ufw
sudo ufw allow 5520
sudo ufw allow ssh/tcp
sudo ufw limit ssh/tcp
sudo ufw logging on
echo "y" | sudo ufw enable
sudo ufw status
echo Server firewall configuration completed.
echo "! Removing Concierge !"
sudo rm -rf CCBC-linux.tar.gz
wget https://github.com/CryptoCashBack-Hub/CCBC/releases/download/v1.0.0.1/CCBC-linux.tar.gz
echo Download complete.
echo Installing CCBC.
tar -xvf CCBC-linux.tar.gz
chmod 775 ./ccbcd
chmod 775 ./ccbc-cli
sudo rm -rf CCBC-linux.tar.gz
./ccbcd -daemon
echo CCBC install complete.
;;
3)
./ccbcd -daemon
echo "If you get a message asking to rebuild the database, please hit Ctr + C and rebuild CCBC Index. (Option 6)"
;;
4)
./ccbc-cli stop
;;
5)
./ccbc-cli getinfo
;;
6)
./ccbcd -daemon -reindex
;;
esac