-
Notifications
You must be signed in to change notification settings - Fork 11
/
quilibrium_for_dummies.sh
163 lines (138 loc) · 5.26 KB
/
quilibrium_for_dummies.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
#!/bin/bash -i
# Source .bashrc to make GO work if it is not working
source ~/.bashrc
clear
# Set the version number
VERSION="2.0.5"
qClientVERSION="2.0.4.1"
# Determine the ExecStart line based on the architecture
ARCH=$(uname -m)
OS=$(uname -s)
# Determine the node binary name based on the architecture and OS
if [ "$ARCH" = "x86_64" ]; then
if [ "$OS" = "Linux" ]; then
NODE_BINARY="node-$VERSION-linux-amd64"
GO_BINARY="go1.22.4.linux-amd64.tar.gz"
QCLIENT_BINARY="qclient-$qClientVERSION-linux-amd64"
elif [ "$OS" = "Darwin" ]; then
NODE_BINARY="node-$VERSION-darwin-amd64"
GO_BINARY="go1.22.44.linux-amd64.tar.gz"
QCLIENT_BINARY="qclient-$qClientVERSION-darwin-arm64"
fi
elif [ "$ARCH" = "aarch64" ]; then
if [ "$OS" = "Linux" ]; then
NODE_BINARY="node-$VERSION-linux-arm64"
GO_BINARY="go1.22.4.linux-arm64.tar.gz"
elif [ "$OS" = "Darwin" ]; then
NODE_BINARY="node-$VERSION-darwin-arm64"
GO_BINARY="go1.22.4.linux-arm64.tar.gz"
QCLIENT_BINARY="qclient-$qClientVERSION-linux-arm64"
fi
fi
# URLs for scripts
UPDATE_URL="https://raw.githubusercontent.com/0xOzgur/QuilibriumTools/main/update.sh"
PREREQUISITES_URL="https://raw.githubusercontent.com/0xOzgur/QuilibriumTools/main/install/Install_prerequisites.sh"
NODE_INSTALL_URL="https://raw.githubusercontent.com/0xOzgur/QuilibriumTools/main/install/install_quilibrium_service.sh"
GRPCURL_CONFIG_URL="https://raw.githubusercontent.com/0xOzgur/QuilibriumTools/main/configuration/config.sh"
NODE_UPDATE_URL="https://raw.githubusercontent.com/0xOzgur/QuilibriumTools/main/update/update.sh"
CHECK_VISIBILITY_URL="https://raw.githubusercontent.com/0xOzgur/QuilibriumTools/main/visibility_check.sh"
# Function for each menu option
install_prerequisites() {
echo ""
echo "⌛️ Preparing server with necessary apps and settings..."
wget --no-cache -O - "$PREREQUISITES_URL" | bash
}
# Install Node
install_node() {
echo ""
echo "⌛️ Installing node as a service..."
wget --no-cache -O - "$NODE_INSTALL_URL" | bash
}
configure_grpcurl() {
echo ""
echo "⌛️ Configuring grpCurl..."
wget --no-cache -O - "$GRPCURL_CONFIG_URL" | bash
}
update_node() {
echo ""
echo "⌛️ Updating node..."
wget --no-cache -O - "$NODE_UPDATE_URL" | bash
}
check_visibility() {
echo ""
echo "⌛️ Checking visibility..."
wget --no-cache -O - "$CHECK_VISIBILITY_URL" | bash
}
node_info() {
echo "Getting node info..."
cd ~/ceremonyclient/node && ./$NODE_BINARY -node-info
}
node_logs() {
echo "Getting node logs..."
sudo journalctl -u ceremonyclient.service -f --no-hostname -o cat
}
restart_node() {
echo "Restarting node..."
service ceremonyclient restart
}
stop_node() {
echo "Stopping node..."
service ceremonyclient stop
echo "Node stopped"
}
# Menu
while true; do
clear
echo "This script is made with ❤️ by 0xOzgur @ https://quilibrium.space"
echo "Welcome to Quilibrium for Dummies!"
echo "
_____ _ _ _ _ _
/ ___ \ (_) (_) | (_)
| | | |_ _ _| |_| | _ ____ _ _ _ ____
| | |_| | | | | | | || \ / ___) | | | | \
\ \____| |_| | | | | |_) ) | | | |_| | | | |
\_____)\____|_|_|_|____/|_| |_|\____|_|_|_|
___
/ __)
| |__ ___ ____
| __) _ \ / ___)
| | | |_| | |
_| \___/|_|
_____ _
(____ \ (_)
_ \ \ _ _ ____ ____ _ ____ ___
| | | | | | | \| \| |/ _ )/___)
| |__/ /| |_| | | | | | | | ( (/ /|___ |
|_____/ \____|_|_|_|_|_|_|_|\____|___/
"
echo "Welcome you Dummy!"
echo "Please follow insturctions very carefully"
echo "Please install prerequisites first, then install node, lastly configure grpcurl."
echo "Do not forget to restart the node after configuration."
echo ""
echo "Quilibrium Version: $VERSION"
echo ""
echo "Please choose an option:"
echo ""
echo "1) Install Prerequisites 5) Check Visibility 9) Stop Node"
echo "2) Install Node 6) Node Info e) Exit"
echo "3) Configure grpCurl 7) Node Logs"
echo "4) Update Node 8) Restart Node"
echo ""
read -p "Enter your choice: " choice
case $choice in
1) install_prerequisites ;;
2) install_node ;;
3) configure_grpcurl ;;
4) update_node ;;
5) check_visibility ;;
6) node_info ;;
7) node_logs ;;
8) restart_node ;;
9) stop_node ;;
e) break ;;
*) echo "Invalid option, please try again." ;;
esac
echo ""
read -n 1 -s -r -p "Press any key to continue"
done