Compare commits
209 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f2c938231f | |||
|
|
2312eafac9 | ||
|
|
f3275c41b5 | ||
|
|
ff573b2a03 | ||
|
|
ecefd31235 | ||
|
|
a02b6eb574 | ||
|
|
209ad4660b | ||
|
|
c827fa90cf | ||
|
|
0823ee32ec | ||
|
|
7d5b487215 | ||
|
|
9b14d5a520 | ||
|
|
9125cffbaa | ||
|
|
988b8a887c | ||
|
|
a1451a909d | ||
|
|
d50cf856cd | ||
|
|
dcf3003f08 | ||
|
|
11f4113474 | ||
|
|
f5cf64efc9 | ||
|
|
548702b50b | ||
|
|
c33614b635 | ||
|
|
48172426e0 | ||
|
|
c6d915c53e | ||
|
|
5dc914c24a | ||
|
|
1ec19b3019 | ||
|
|
d57a356b90 | ||
|
|
4d28144a55 | ||
|
|
9ed4fa3d4e | ||
|
|
1f2eaa6975 | ||
|
|
80aef0962a | ||
|
|
6782c1e13d | ||
|
|
39aaf629a2 | ||
|
|
4afa56731b | ||
|
|
802ba45c34 | ||
|
|
72852c3cd7 | ||
|
|
787bab2286 | ||
|
|
ed4e3c6f22 | ||
|
|
db9661f08e | ||
|
|
53ab479a2a | ||
|
|
b026ae6b0b | ||
|
|
19bbde5494 | ||
|
|
a34ad7f4fe | ||
|
|
8ea3d5a7c8 | ||
|
|
29552953a2 | ||
|
|
5332ed8b7b | ||
|
|
e1796b286b | ||
|
|
7e4149e6de | ||
|
|
23f096aef3 | ||
|
|
7183808a57 | ||
|
|
4dc6475dea | ||
|
|
d179135de5 | ||
|
|
d0f4d5e192 | ||
|
|
90cd1450a0 | ||
|
|
effb4a30d4 | ||
|
|
475a4d9b8b | ||
|
|
9df893b595 | ||
|
|
bb5e7e28f5 | ||
|
|
3c3a255250 | ||
|
|
c4be2044bc | ||
|
|
1b6d04e02c | ||
|
|
b15a557596 | ||
|
|
297423fc32 | ||
|
|
159dc19467 | ||
|
|
448cc5d4c3 | ||
|
|
8e2e026010 | ||
|
|
e5c57e3adf | ||
|
|
717709978b | ||
|
|
67d41bfcb6 | ||
|
|
e5045d14f8 | ||
|
|
c8ea7a9e57 | ||
|
|
3b64d6b3b9 | ||
|
|
928011a593 | ||
|
|
d13ce008e7 | ||
|
|
c4b620e2ca | ||
|
|
9615e8faa3 | ||
|
|
34bd27e6ed | ||
|
|
f477c418d8 | ||
|
|
ebaa722ebe | ||
|
|
b52472ef85 | ||
|
|
7225452f60 | ||
|
|
f234126431 | ||
|
|
d55c8a8487 | ||
|
|
5704a6ce25 | ||
|
|
2175c84b3e | ||
|
|
b5bdda8901 | ||
|
|
9d28327cb4 | ||
|
|
ee266e1528 | ||
|
|
b7351c9c6b | ||
|
|
46897a04d3 | ||
|
|
1318ad6740 | ||
|
|
1c0ecc9919 | ||
|
|
71ed1dcd32 | ||
|
|
449b50797d | ||
|
|
adbd6cd7a2 | ||
|
|
27901379a3 | ||
|
|
643923797e | ||
|
|
195ad00db1 | ||
|
|
8419d50248 | ||
|
|
627a44042a | ||
|
|
c9c716a113 | ||
|
|
d2688fcd87 | ||
|
|
9b3ed5eed8 | ||
|
|
4d3631d487 | ||
|
|
31f88060c4 | ||
|
|
5adb5177f0 | ||
|
|
8ce35b1746 | ||
|
|
fbff05db89 | ||
|
|
c7ae28405a | ||
|
|
47bb92c6ce | ||
|
|
240e1cfc8d | ||
|
|
e0120dac9c | ||
|
|
136af1b15d | ||
|
|
57f852f1ac | ||
|
|
a062172f1a | ||
|
|
c0ac0a4a46 | ||
|
|
c6f176abb2 | ||
|
|
a5e8832d8d | ||
|
|
7a00f8ffdf | ||
|
|
bc1eb08d58 | ||
|
|
fa3e82aa85 | ||
|
|
956585ed4e | ||
|
|
2069841d2f | ||
|
|
c4e00be250 | ||
|
|
291dd31a57 | ||
|
|
f4c5e66ea6 | ||
|
|
681d806f30 | ||
|
|
1c0d9586db | ||
|
|
d5b0c668c1 | ||
|
|
bea51fe17b | ||
|
|
de9542cb4d | ||
|
|
ece7cc99e7 | ||
|
|
ad0f459898 | ||
|
|
176fbf4543 | ||
|
|
56d5307400 | ||
|
|
d1a428d0f6 | ||
|
|
4e1133546b | ||
|
|
8596cfea71 | ||
|
|
d2b4df7ad8 | ||
|
|
918a64a834 | ||
|
|
4f7d5c54aa | ||
|
|
8687537cb5 | ||
|
|
42b9f2b650 | ||
|
|
346130533a | ||
|
|
c64153f427 | ||
|
|
55a3f761c1 | ||
|
|
696f66a26a | ||
|
|
e0bcb99a5a | ||
|
|
0236ba0d3a | ||
|
|
d5ae8050a1 | ||
|
|
83060941d7 | ||
|
|
b62a91cf2c | ||
|
|
1ab7cd19b6 | ||
|
|
2d9a6a0749 | ||
|
|
b3ac438fc5 | ||
|
|
efc5e68875 | ||
|
|
13c8b7915b | ||
|
|
233466c307 | ||
|
|
a14cb04925 | ||
|
|
28ec70a7b2 | ||
|
|
8765312b88 | ||
|
|
eef854aec6 | ||
|
|
6cf9a1617c | ||
|
|
39261ea361 | ||
|
|
ffb5e52aa7 | ||
|
|
bdc7dabda8 | ||
|
|
1060a4ee98 | ||
|
|
8aeeab10cb | ||
|
|
b625d27cea | ||
|
|
0a2d718f74 | ||
|
|
ab135eaed8 | ||
|
|
e43d9c6036 | ||
|
|
5cbcd5e2bf | ||
|
|
01afd16d83 | ||
|
|
69a594a187 | ||
|
|
8a1bc3bdcd | ||
|
|
93b7d0396d | ||
|
|
d41ee72b83 | ||
|
|
1f151bba56 | ||
|
|
7cc266b3bf | ||
|
|
40f35ee7b0 | ||
|
|
ed3f3da764 | ||
|
|
1605b9760b | ||
|
|
f324b96234 | ||
|
|
027c4ce037 | ||
|
|
a30a15962e | ||
|
|
e57c430c3a | ||
|
|
5287bb53fe | ||
|
|
4db3cbd9be | ||
|
|
9fc67358f0 | ||
|
|
70e8404239 | ||
|
|
c77c7d5bb0 | ||
|
|
818226c0a6 | ||
|
|
ca88976007 | ||
|
|
40dc35a13b | ||
|
|
3272158d76 | ||
|
|
351ecd112b | ||
|
|
0813c30b07 | ||
|
|
4be79f3706 | ||
|
|
0a0f6a3f8d | ||
|
|
9d60332c45 | ||
|
|
9acf091d43 | ||
|
|
736f2f5385 | ||
|
|
6df2c7e7dd | ||
|
|
04c635d88e | ||
|
|
ec6b4cd464 | ||
|
|
b5341de1e6 | ||
|
|
5adf25d7a1 | ||
|
|
889b300c07 | ||
|
|
f098ae0f9d | ||
|
|
d6697b952e |
3
.gitignore
vendored
3
.gitignore
vendored
@ -9,4 +9,5 @@ backup/backup.sh
|
||||
backup/backup_ozgur.sh
|
||||
quilibrium_for_pros.sh
|
||||
dataworker.py
|
||||
balance.sh
|
||||
balance.sh
|
||||
rsync.sh
|
||||
44
README.md
44
README.md
@ -1,24 +1,40 @@
|
||||
# QuilibriumAutoInstaller
|
||||
Autoinstaller Script for Quilibrium as a Service
|
||||
# Quilibrium Tools
|
||||
|
||||
copy the all files at root folder.
|
||||
**Quilibrium for Dummies**
|
||||
|
||||
chmod u+x Install_Quilibrium_Service.sh
|
||||
chmod u+x config.sh
|
||||
chmod u+x update.sh
|
||||
This script is an all-in-one quil usage software for newcomers.
|
||||
|
||||
For installation and first run, please run
|
||||
|
||||
rm -f quilibrium_for_dummies.sh && wget https://raw.githubusercontent.com/0xOzgur/QuilibriumTools/main/quilibrium_for_dummies.sh && chmod +x quilibrium_for_dummies.sh && ./quilibrium_for_dummies.sh
|
||||
|
||||
|
||||
After first run, when you need to reach your node, you need to run only;
|
||||
|
||||
./quilibrium_for_dummies.sh
|
||||
|
||||
./Install_Quilibrium_Service.sh
|
||||
|
||||
After installing your node, kindly wait for 10-15minutes then run config.sh
|
||||
|
||||
./config.sh
|
||||
**Autoinstaller Script for Quilibrium as a Service**
|
||||
|
||||
Do not forget go make
|
||||
Use below command to install v2.0
|
||||
|
||||
source ~/.bashrc
|
||||
|
||||
and check
|
||||
wget -O - https://raw.githubusercontent.com/0xOzgur/QuilibriumTools/main/install/install_quilibrium_service.sh | bash
|
||||
|
||||
go version
|
||||
|
||||
**Autoupdater**
|
||||
|
||||
after installation.
|
||||
|
||||
If you need to update your node from previous version to 2.0, apply below command
|
||||
|
||||
|
||||
wget -O - https://raw.githubusercontent.com/0xOzgur/QuilibriumTools/main/update/update.sh | bash
|
||||
|
||||
For easy management of your nodes I created some shortcodes. You can import .profile or .bash_profile (Some Debian installations) file and source. Then you can easily query node related infos.
|
||||
|
||||
**Check Your Node Visibility**
|
||||
|
||||
You can check if your node sees Q Inc Bootstraps. If you don't see you most probably will not get any rewards.
|
||||
|
||||
wget -O - https://raw.githubusercontent.com/0xOzgur/QuilibriumTools/main/visibility_check.sh | bash
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Step 0: Welcome
|
||||
echo "This script is prepared by 0xOzgur.eth"
|
||||
echo "This script is prepared by 0xOzgur"
|
||||
echo "Enjoy and sit back while you are configuring grpCurl for Quilibrium Ceremony Client!"
|
||||
echo "Processing..."
|
||||
sleep 10 # Add a 10-second delay
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Step 0: Welcome
|
||||
echo "This script is prepared by 0xOzgur.eth"
|
||||
echo "This script is prepared by 0xOzgur"
|
||||
echo "Enjoy and sit back while you are configuring grpCurl for Quilibrium Ceremony Client!"
|
||||
echo "Processing..."
|
||||
sleep 10 # Add a 10-second delay
|
||||
|
||||
196
increment_watch.sh
Normal file
196
increment_watch.sh
Normal file
@ -0,0 +1,196 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Terminal clearing function
|
||||
clear_screen() {
|
||||
clear
|
||||
echo "Log Monitoring Active - Press Ctrl+C to exit"
|
||||
echo "___________________________________________________________"
|
||||
}
|
||||
|
||||
# Global variables
|
||||
last_increment=""
|
||||
last_change_time=$(date +%s)
|
||||
last_decrease_time=$(date +%s)
|
||||
CHECK_INTERVAL=5 # Check interval (seconds)
|
||||
RESTART_THRESHOLD=$((5 * 60)) # 5 minutes (in seconds)
|
||||
RESTART_WAIT_TIME=$((1* 60)) # Wait 1 minute after restart
|
||||
last_restart_time=0
|
||||
increment_updated=""
|
||||
|
||||
# ANSI color codes
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
CYAN='\033[0;36m'
|
||||
RED='\033[0;31m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Service restart function
|
||||
restart_service() {
|
||||
local reason=$1
|
||||
echo -e "${RED}REASON FOR RESTART: $reason${NC}"
|
||||
echo "Restarting service..."
|
||||
sudo systemctl restart ceremonyclient.service
|
||||
last_restart_time=$(date +%s)
|
||||
last_change_time=$last_restart_time
|
||||
last_decrease_time=$last_restart_time
|
||||
|
||||
echo -e "${YELLOW}Service restarted. Waiting 5 minutes for logs to stabilize...${NC}"
|
||||
for i in {300..1}; do
|
||||
echo -ne "Remaining time: $i seconds\r"
|
||||
sleep 1
|
||||
done
|
||||
echo -e "\nWait time complete. Starting log analysis..."
|
||||
sleep 2
|
||||
}
|
||||
|
||||
# Continuously running while loop
|
||||
while true; do
|
||||
clear_screen
|
||||
current_time=$(date +%s)
|
||||
increment_updated=""
|
||||
|
||||
time_since_restart=$((current_time - last_restart_time))
|
||||
if [ $last_restart_time -ne 0 ] && [ $time_since_restart -lt $RESTART_WAIT_TIME ]; then
|
||||
remaining_wait=$((RESTART_WAIT_TIME - time_since_restart))
|
||||
echo -e "${YELLOW}It's been $time_since_restart seconds since the last restart."
|
||||
echo -e "Waiting $remaining_wait seconds before a new restart can be triggered...${NC}"
|
||||
else
|
||||
last_decrease=$(sudo journalctl -u ceremonyclient.service -o short-iso -n 2000 | grep 'publishing' | tail -n 20 | \
|
||||
awk -v current_time="$current_time" '
|
||||
BEGIN {
|
||||
total_time=0;
|
||||
total_decrement=0;
|
||||
count=0;
|
||||
last_decrease_gap=0;
|
||||
}
|
||||
{
|
||||
timestamp=$1;
|
||||
increment=gensub(/.*"increment":([0-9]+).*/, "\\1", "g", $0);
|
||||
cmd="date -d \"" timestamp "\" +%s";
|
||||
cmd | getline entry_time;
|
||||
close(cmd);
|
||||
|
||||
if (previous_time && previous_increment) {
|
||||
time_gap=entry_time-previous_time;
|
||||
decrement=previous_increment-increment;
|
||||
if (decrement > 0) {
|
||||
total_time+=time_gap;
|
||||
total_decrement+=decrement;
|
||||
count++;
|
||||
}
|
||||
};
|
||||
previous_time=entry_time;
|
||||
previous_increment=increment;
|
||||
}
|
||||
END {
|
||||
last_decrease_gap=(current_time - previous_time);
|
||||
printf "%d", last_decrease_gap;
|
||||
}')
|
||||
|
||||
current_increment=$(sudo journalctl -u ceremonyclient.service -o short-iso -n 1 | grep 'publishing' | awk -F'"increment":' '{print $2}' | awk -F',' '{print $1}')
|
||||
|
||||
if [ $time_since_restart -ge $RESTART_WAIT_TIME ] || [ $last_restart_time -eq 0 ]; then
|
||||
if [ ! -z "$last_decrease" ] && [ "$last_decrease" -gt "$RESTART_THRESHOLD" ]; then
|
||||
restart_service "Last decrease was $last_decrease seconds ago (more than 5 minutes)"
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ ! -z "$current_increment" ]; then
|
||||
if [ "$current_increment" != "$last_increment" ]; then
|
||||
last_increment=$current_increment
|
||||
last_change_time=$current_time
|
||||
increment_updated="${YELLOW}Increment value updated: $current_increment${NC}"
|
||||
else
|
||||
time_since_last_change=$((current_time - last_change_time))
|
||||
|
||||
if [ $time_since_last_change -ge $RESTART_THRESHOLD ]; then
|
||||
restart_service "Increment value has not changed for $time_since_last_change seconds"
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Log analysis output
|
||||
sudo journalctl -u ceremonyclient.service -o short-iso -n 2000 | grep 'publishing' | tail -n 20 | \
|
||||
awk -v current_time="$current_time" '
|
||||
BEGIN {
|
||||
total_time=0;
|
||||
total_decrement=0;
|
||||
count=0
|
||||
}
|
||||
{
|
||||
timestamp=$1;
|
||||
increment=gensub(/.*"increment":([0-9]+).*/, "\\1", "g", $0);
|
||||
cmd="date -d \"" timestamp "\" +%s";
|
||||
cmd | getline entry_time;
|
||||
close(cmd);
|
||||
|
||||
if (previous_time && previous_increment) {
|
||||
time_gap=entry_time-previous_time;
|
||||
decrement=previous_increment-increment;
|
||||
if (decrement > 0) {
|
||||
total_time+=time_gap;
|
||||
total_decrement+=decrement;
|
||||
count++;
|
||||
printf "Increment %s, Time Gap: %ss, Decrement: %s\n", increment, time_gap, decrement
|
||||
}
|
||||
};
|
||||
previous_time=entry_time;
|
||||
previous_increment=increment
|
||||
}
|
||||
END {
|
||||
last_decrement_gap=(current_time - previous_time);
|
||||
avg_time_per_decrement=(count > 0 && total_decrement > 0) ? total_time / total_decrement : 0;
|
||||
|
||||
printf "___________________________________________________________\n";
|
||||
printf "Last Decrease: %s Seconds ago\n", last_decrement_gap;
|
||||
}'
|
||||
|
||||
|
||||
# Ongoing statistics
|
||||
sudo journalctl -u ceremonyclient.service -o short-iso -n 2000 | grep 'publishing' | tail -n 20 | \
|
||||
awk -v current_time="$current_time" '
|
||||
BEGIN {
|
||||
total_time=0;
|
||||
total_decrement=0;
|
||||
count=0
|
||||
}
|
||||
{
|
||||
timestamp=$1;
|
||||
increment=gensub(/.*"increment":([0-9]+).*/, "\\1", "g", $0);
|
||||
cmd="date -d \"" timestamp "\" +%s";
|
||||
cmd | getline entry_time;
|
||||
close(cmd);
|
||||
|
||||
if (previous_time && previous_increment) {
|
||||
time_gap=entry_time-previous_time;
|
||||
decrement=previous_increment-increment;
|
||||
if (decrement > 0) {
|
||||
total_time+=time_gap;
|
||||
total_decrement+=decrement;
|
||||
count++;
|
||||
}
|
||||
};
|
||||
previous_time=entry_time;
|
||||
previous_increment=increment
|
||||
}
|
||||
END {
|
||||
avg_time_per_decrement=(count > 0 && total_decrement > 0) ? total_time / total_decrement : 0;
|
||||
|
||||
printf "Avg Publish Time per Unit Decrement: %.6f seconds\n", avg_time_per_decrement;
|
||||
printf "Time to reach 0 for your %s remaining Increments: %.2f days\n", previous_increment, (previous_increment * avg_time_per_decrement) / 86400;
|
||||
printf "___________________________________________________________\n";
|
||||
printf "Estimated time to reach 0 from different starting points:\n";
|
||||
printf "From 3,000,000: %.2f days\n", (3000000 * avg_time_per_decrement) / 86400;
|
||||
printf "From 2,500,000: %.2f days\n", (2500000 * avg_time_per_decrement) / 86400;
|
||||
printf "From 2,000,000: %.2f days\n", (2000000 * avg_time_per_decrement) / 86400;
|
||||
printf "From 1,500,000: %.2f days\n", (1500000 * avg_time_per_decrement) / 86400;
|
||||
printf "From 1,000,000: %.2f days\n", (1000000 * avg_time_per_decrement) / 86400;
|
||||
printf "From 500,000: %.2f days\n", (500000 * avg_time_per_decrement) / 86400;
|
||||
printf "From 250,000: %.2f days\n", (250000 * avg_time_per_decrement) / 86400;
|
||||
}'
|
||||
fi
|
||||
|
||||
sleep $CHECK_INTERVAL
|
||||
done
|
||||
156
install/Install_prerequisites.sh
Normal file
156
install/Install_prerequisites.sh
Normal file
@ -0,0 +1,156 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set the version number
|
||||
VERSION="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
|
||||
# Check if NODE_VERSION is empty
|
||||
if [ -z "$NODE_VERSION" ]; then
|
||||
NODE_VERSION=$(curl -s https://releases.quilibrium.com/release | grep -E "^node-[0-9]+(\.[0-9]+)*" | grep -v "dgst" | sed 's/^node-//' | cut -d '-' -f 1 | head -n 1)
|
||||
if [ -z "$NODE_VERSION" ]; then
|
||||
echo "❌ Error: Unable to determine NODE_VERSION automatically."
|
||||
echo "The script cannot proceed without a correct node version number."
|
||||
echo "Please try the manual step by step installation instead:"
|
||||
echo "https://docs.quilibrium.one/start/tutorials/node-step-by-step-installation"
|
||||
echo
|
||||
exit 1
|
||||
else
|
||||
echo "✅ Automatically determined NODE_VERSION: $NODE_VERSION"
|
||||
fi
|
||||
else
|
||||
echo "✅ Using specified NODE_VERSION: $NODE_VERSION"
|
||||
fi
|
||||
|
||||
# Determine qclient latest version
|
||||
# Check if QCLIENT_VERSION is empty
|
||||
if [ -z "$QCLIENT_VERSION" ]; then
|
||||
QCLIENT_VERSION=$(curl -s https://releases.quilibrium.com/qclient-release | grep -E "^qclient-[0-9]+(\.[0-9]+)*" | sed 's/^qclient-//' | cut -d '-' -f 1 | head -n 1)
|
||||
if [ -z "$QCLIENT_VERSION" ]; then
|
||||
echo "⚠️ Warning: Unable to determine QCLIENT_VERSION automatically. Continuing without it."
|
||||
echo "The script won't be able to install the qclient, but it will still install your node."
|
||||
echo "You can install the qclient later manually if you need to."
|
||||
echo
|
||||
sleep 1
|
||||
else
|
||||
echo "✅ Automatically determined QCLIENT_VERSION: $QCLIENT_VERSION"
|
||||
fi
|
||||
else
|
||||
echo "✅ Using specified QCLIENT_VERSION: $QCLIENT_VERSION"
|
||||
fi
|
||||
|
||||
echo
|
||||
|
||||
# Determine the node binary name based on the architecture and OS
|
||||
if [ "$ARCH" = "x86_64" ]; then
|
||||
if [ "$OS" = "Linux" ]; then
|
||||
NODE_BINARY="node-$NODE_VERSION-linux-amd64"
|
||||
GO_BINARY="go1.22.4.linux-amd64.tar.gz"
|
||||
[ -n "$QCLIENT_VERSION" ] && QCLIENT_BINARY="qclient-$QCLIENT_VERSION-linux-amd64"
|
||||
elif [ "$OS" = "Darwin" ]; then
|
||||
NODE_BINARY="node-$NODE_VERSION-darwin-amd64"
|
||||
GO_BINARY="go1.22.4.darwin-amd64.tar.gz"
|
||||
[ -n "$QCLIENT_VERSION" ] && QCLIENT_BINARY="qclient-$QCLIENT_VERSION-darwin-amd64"
|
||||
fi
|
||||
elif [ "$ARCH" = "aarch64" ]; then
|
||||
if [ "$OS" = "Linux" ]; then
|
||||
NODE_BINARY="node-$NODE_VERSION-linux-arm64"
|
||||
GO_BINARY="go1.22.4.linux-arm64.tar.gz"
|
||||
[ -n "$QCLIENT_VERSION" ] && QCLIENT_BINARY="qclient-$QCLIENT_VERSION-linux-arm64"
|
||||
elif [ "$OS" = "Darwin" ]; then
|
||||
NODE_BINARY="node-$NODE_VERSION-darwin-arm64"
|
||||
GO_BINARY="go1.22.4.darwin-arm64.tar.gz"
|
||||
[ -n "$QCLIENT_VERSION" ] && QCLIENT_BINARY="qclient-$QCLIENT_VERSION-darwin-arm64"
|
||||
fi
|
||||
else
|
||||
echo "❌ Error: Unsupported system architecture ($ARCH) or operating system ($OS)."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Installing prerequisites..."
|
||||
sleep 1 # Add a 1-second delay
|
||||
|
||||
echo "Updating the machine"
|
||||
echo "⏳Processing..."
|
||||
sleep 1 # Add a 1-second delay
|
||||
|
||||
# Fof DEBIAN OS - Check if sudo and git is installed
|
||||
# Step 1.1: Prepare Machine
|
||||
if ! command -v sudo &> /dev/null
|
||||
then
|
||||
echo "sudo could not be found"
|
||||
echo "Installing sudo..."
|
||||
su -c "apt update && apt install sudo -y"
|
||||
else
|
||||
echo "sudo is installed"
|
||||
fi
|
||||
# ınstall git if not installed
|
||||
if ! command -v git &> /dev/null
|
||||
then
|
||||
echo "git could not be found"
|
||||
echo "Installing git..."
|
||||
su -c "apt update && apt install git -y"
|
||||
else
|
||||
echo "git is installed"
|
||||
fi
|
||||
|
||||
# Update the machine
|
||||
sudo apt update
|
||||
sudo apt upgrade -y
|
||||
|
||||
# Install cpu limit and gawk
|
||||
apt install cpulimit -y
|
||||
apt install gawk -y #incase it is not installed
|
||||
|
||||
# Download and install Go
|
||||
wget https://go.dev/dl/$GO_BINARY || { echo "Failed to download Node! Exiting..."; exit_message; exit 1; }
|
||||
sudo tar -xvf $GO_BINARY || { echo "Failed to extract Go! Exiting..."; exit_message; exit 1; }
|
||||
sudo rm -rf /usr/local/go || { echo "Failed to remove existing Go! Exiting..."; exit_message; exit 1; }
|
||||
sudo mv go /usr/local || { echo "Failed to move go! Exiting..."; exit_message; exit 1; }
|
||||
sudo rm $GO_BINARY || { echo "Failed to remove downloaded archive! Exiting..."; exit_message; exit 1; }
|
||||
|
||||
|
||||
# Set Go environment variables
|
||||
echo "⏳Setting Go environment variables..."
|
||||
sleep 2 # Add a 2-second delay
|
||||
|
||||
# Check if GOROOT is already set
|
||||
if grep -q 'GOROOT=/usr/local/go' ~/.bashrc; then
|
||||
echo "GOROOT already set in ~/.bashrc."
|
||||
else
|
||||
echo 'GOROOT=/usr/local/go' >> ~/.bashrc
|
||||
echo "GOROOT set in ~/.bashrc."
|
||||
fi
|
||||
|
||||
# Check if GOPATH is already set
|
||||
if grep -q "GOPATH=$HOME/go" ~/.bashrc; then
|
||||
echo "GOPATH already set in ~/.bashrc."
|
||||
else
|
||||
echo "GOPATH=$HOME/go" >> ~/.bashrc
|
||||
echo "GOPATH set in ~/.bashrc."
|
||||
fi
|
||||
|
||||
# Check if PATH is already set
|
||||
if grep -q 'PATH=$GOPATH/bin:$GOROOT/bin:$PATH' ~/.bashrc; then
|
||||
echo "PATH already set in ~/.bashrc."
|
||||
else
|
||||
echo 'PATH=$GOPATH/bin:$GOROOT/bin:$PATH' >> ~/.bashrc
|
||||
echo "PATH set in ~/.bashrc."
|
||||
fi
|
||||
|
||||
# Source .bashrc to apply changes
|
||||
echo "⏳Sourcing .bashrc to apply changes"
|
||||
source ~/.bashrc
|
||||
sleep 2 # Add a 2-second delay
|
||||
|
||||
# Check GO Version
|
||||
go version
|
||||
sleep 2 # Add a 2-second delay
|
||||
|
||||
# Install gRPCurl
|
||||
echo "⏳Installing gRPCurl"
|
||||
sleep 1 # Add a 1-second delay
|
||||
go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest
|
||||
177
install/install.sh
Normal file
177
install/install.sh
Normal file
@ -0,0 +1,177 @@
|
||||
#!/bin/bash -i
|
||||
|
||||
cd ~
|
||||
|
||||
# Step 0: Welcome
|
||||
echo "This script is made with ❤️ by 0xOzgur @ https://quilibrium.space "
|
||||
echo "The script is prepared for Ubuntu machines. If you are using another operating system, please check the compatibility of the script."
|
||||
echo "The script doesn't install GO or GrpCurl packages. If you want to install them please visit https://docs.quilibrium.space/installing-prerequisites page."
|
||||
echo "⏳Enjoy and sit back while you are building your Quilibrium Node!"
|
||||
echo "⏳Processing..."
|
||||
sleep 10 # Add a 10-second delay
|
||||
|
||||
# Check if ceremonyclient service exists and stop it if it does
|
||||
if sudo systemctl status ceremonyclient &> /dev/null; then
|
||||
echo "Ceremonyclient service found. Stopping..."
|
||||
sudo service ceremonyclient stop
|
||||
sleep 2 # Add a 2-second delay
|
||||
fi
|
||||
|
||||
# Step 0: Increase Swap Space
|
||||
if [ ! -d /swap ]; then
|
||||
echo "Increasing swap space..."
|
||||
sudo mkdir /swap
|
||||
sudo fallocate -l 16G /swap/swapfile
|
||||
sudo chmod 600 /swap/swapfile
|
||||
sudo mkswap /swap/swapfile
|
||||
sudo swapon /swap/swapfile
|
||||
echo '/swap/swapfile swap swap defaults 0 0' | sudo tee -a /etc/fstab
|
||||
else
|
||||
echo "Swap space already exists, skipping swap increase..."
|
||||
fi
|
||||
|
||||
# Step 1: Update and Upgrade the Machine
|
||||
echo "Updating the machine"
|
||||
echo "⏳Processing..."
|
||||
sleep 2 # Add a 2-second delay
|
||||
apt update
|
||||
apt upgrade -y
|
||||
apt install sudo -y
|
||||
apt install git -y
|
||||
|
||||
# Step 2: Adjust network buffer sizes
|
||||
echo "Adjusting network buffer sizes..."
|
||||
if grep -q "^net.core.rmem_max=600000000$" /etc/sysctl.conf; then
|
||||
echo "net.core.rmem_max=600000000 found inside /etc/sysctl.conf, skipping..."
|
||||
else
|
||||
echo -e "\n# Change made to increase buffer sizes for better network performance for ceremonyclient\nnet.core.rmem_max=600000000" | sudo tee -a /etc/sysctl.conf > /dev/null
|
||||
fi
|
||||
if grep -q "^net.core.wmem_max=600000000$" /etc/sysctl.conf; then
|
||||
echo "net.core.wmem_max=600000000 found inside /etc/sysctl.conf, skipping..."
|
||||
else
|
||||
echo -e "\n# Change made to increase buffer sizes for better network performance for ceremonyclient\nnet.core.wmem_max=600000000" | sudo tee -a /etc/sysctl.conf > /dev/null
|
||||
fi
|
||||
sudo sysctl -p
|
||||
|
||||
|
||||
# Installing Go 1.20.14
|
||||
wget https://go.dev/dl/go1.22.4.linux-amd64.tar.gz
|
||||
sudo tar -xvf go1.22.4.linux-amd64.tar.gz || { echo "Failed to extract Go! Exiting..."; exit_message; exit 1; }
|
||||
sudo mv go /usr/local || { echo "Failed to move go! Exiting..."; exit_message; exit 1; }
|
||||
sudo rm go1.22.4.linux-amd64.tar.gz || { echo "Failed to remove downloaded archive! Exiting..."; exit_message; exit 1; }
|
||||
|
||||
|
||||
# Step 4: Set Go environment variables
|
||||
echo "⏳Setting Go environment variables..."
|
||||
sleep 5 # Add a 5-second delay
|
||||
|
||||
# Check if GOROOT is already set
|
||||
if grep -q 'GOROOT=/usr/local/go' ~/.bashrc; then
|
||||
echo "GOROOT already set in ~/.bashrc."
|
||||
else
|
||||
echo 'GOROOT=/usr/local/go' >> ~/.bashrc
|
||||
echo "GOROOT set in ~/.bashrc."
|
||||
fi
|
||||
|
||||
# Check if GOPATH is already set
|
||||
if grep -q "GOPATH=$HOME/go" ~/.bashrc; then
|
||||
echo "GOPATH already set in ~/.bashrc."
|
||||
else
|
||||
echo "GOPATH=$HOME/go" >> ~/.bashrc
|
||||
echo "GOPATH set in ~/.bashrc."
|
||||
fi
|
||||
|
||||
# Check if PATH is already set
|
||||
if grep -q 'PATH=$GOPATH/bin:$GOROOT/bin:$PATH' ~/.bashrc; then
|
||||
echo "PATH already set in ~/.bashrc."
|
||||
else
|
||||
echo 'PATH=$GOPATH/bin:$GOROOT/bin:$PATH' >> ~/.bashrc
|
||||
echo "PATH set in ~/.bashrc."
|
||||
fi
|
||||
|
||||
# Source .bashrc to apply changes
|
||||
echo "⏳Sourcing .bashrc to apply changes"
|
||||
source ~/.bashrc
|
||||
sleep 5 # Add a 5-second delay
|
||||
|
||||
# Check GO Version
|
||||
go version
|
||||
sleep 5 # Add a 5-second delay
|
||||
|
||||
# Install gRPCurl
|
||||
echo "⏳Installing gRPCurl"
|
||||
sleep 1 # Add a 1-second delay
|
||||
go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest
|
||||
|
||||
# Download Ceremonyclient
|
||||
echo "⏳Downloading Ceremonyclient"
|
||||
sleep 1 # Add a 1-second delay
|
||||
cd ~
|
||||
if [ -d "ceremonyclient" ]; then
|
||||
echo "Directory ceremonyclient already exists, skipping git clone..."
|
||||
else
|
||||
until git clone https://source.quilibrium.com/quilibrium/ceremonyclient.git || git clone https://git.quilibrium-mirror.ch/agostbiro/ceremonyclient.git; do
|
||||
echo "Git clone failed, retrying..."
|
||||
sleep 2
|
||||
done
|
||||
fi
|
||||
cd ~/ceremonyclient/
|
||||
git checkout release-cdn
|
||||
|
||||
# Build Ceremonyclient qClient
|
||||
echo "⏳Building qCiient"
|
||||
sleep 1 # Add a 1-second delay
|
||||
cd ~/ceremonyclient/node
|
||||
GOEXPERIMENT=arenas go build -o qclient main.go
|
||||
|
||||
# Step 5:Determine the ExecStart line based on the architecture
|
||||
# Get the current user's home directory
|
||||
HOME=$(eval echo ~$HOME_DIR)
|
||||
# Use the home directory in the path
|
||||
NODE_PATH="$HOME/ceremonyclient/node"
|
||||
EXEC_START="$NODE_PATH/$NODE_BINARY"
|
||||
|
||||
# Create Ceremonyclient Service
|
||||
echo "⏳Creating Ceremonyclient Service"
|
||||
sleep 1 # Add a 1-second delay
|
||||
|
||||
# Check if the file exists before attempting to remove it
|
||||
if [ -f "/lib/systemd/system/ceremonyclient.service" ]; then
|
||||
# If the file exists, remove it
|
||||
rm /lib/systemd/system/ceremonyclient.service
|
||||
echo "ceremonyclient.service file removed."
|
||||
else
|
||||
# If the file does not exist, inform the user
|
||||
echo "ceremonyclient.service file does not exist. No action taken."
|
||||
fi
|
||||
|
||||
sudo tee /lib/systemd/system/ceremonyclient.service > /dev/null <<EOF
|
||||
[Unit]
|
||||
Description=Ceremony Client Go App Service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=5s
|
||||
WorkingDirectory=$NODE_PATH
|
||||
ExecStart=$EXEC_START
|
||||
KillSignal=SIGINT
|
||||
TimeoutStopSec=75s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable ceremonyclient
|
||||
|
||||
# Step 7: Start the ceremonyclient service
|
||||
echo "✅Starting Ceremonyclient Service"
|
||||
sleep 1 # Add a 1-second delay
|
||||
sudo service ceremonyclient start
|
||||
|
||||
# Step 8: See the logs of the ceremonyclient service
|
||||
echo "🎉Welcome to Quilibrium Ceremonyclient"
|
||||
echo "⏳Please let it flow node logs at least 5 minutes then you can press CTRL + C to exit the logs."
|
||||
sleep 5 # Add a 5-second delay
|
||||
sudo journalctl -u ceremonyclient.service -f --no-hostname -o cat
|
||||
@ -3,7 +3,7 @@
|
||||
cd ~
|
||||
|
||||
# Step 0: Welcome
|
||||
echo "This script is made with ❤️ by 0xOzgur.eth"
|
||||
echo "This script is made with ❤️ by 0xOzgur @ https://quilibrium.space"
|
||||
echo "⏳Enjoy and sit back while you are building your Quilibrium Ceremony Client!"
|
||||
echo "⏳Processing..."
|
||||
sleep 10 # Add a 10-second delay
|
||||
@ -60,15 +60,18 @@ git checkout release-cdn
|
||||
# Step 7:Build Docker Container
|
||||
echo "⏳Building Ceremonyclient Container"
|
||||
sleep 2 # Add a 2-second delay
|
||||
docker build --build-arg GIT_COMMIT=$(git log -1 --format=%h) -t quilibrium -t quilibrium:1.4.18 .
|
||||
|
||||
docker build --build-arg GIT_COMMIT=$(git log -1 --format=%h) -t quilibrium:2.0 .2.0
|
||||
|
||||
|
||||
|
||||
# Step 8:Run Ceremonyclient Container
|
||||
echo "✅Running Ceremonyclient Container"
|
||||
sleep 2 # Add a 2-second delay
|
||||
docker compose up -d
|
||||
docker compose -f docker/docker-compose.yml up -d
|
||||
|
||||
# Step 9:Logs Ceremonyclient Container
|
||||
echo "🎉Welcome to Quilibrium Ceremonyclient"
|
||||
echo "⏳Please let it flow node logs at least 5 minutes then you can press CTRL + C to exit the logs."
|
||||
sleep 5 # Add a 5-second delay
|
||||
docker compose logs -f -n, --tail 100
|
||||
docker compose -f docker/docker-compose.yml logs -f -n, --tail 100
|
||||
|
||||
@ -1,17 +1,43 @@
|
||||
#!/bin/bash -i
|
||||
#!/bin/bash
|
||||
# Set the version number
|
||||
|
||||
VERSION="2.0.4.1"
|
||||
qClientVERSION="2.0.4.1"
|
||||
|
||||
cd ~
|
||||
# Step 0: Welcome
|
||||
echo "This script is made with ❤️ by https://quilibrium.space @ 0xOzgur.eth"
|
||||
echo "This script is made with ❤️ by 0xOzgur @ https://quilibrium.space "
|
||||
echo "The script is prepared for Ubuntu machines. If you are using another operating system, please check the compatibility of the script."
|
||||
echo "The script doesn't install GO or GrpCurl packages. If you want to install them please visit https://docs.quilibrium.space/installing-prerequisites page."
|
||||
echo "⏳Enjoy and sit back while you are building your Quilibrium Node!"
|
||||
echo "⏳Processing..."
|
||||
sleep 10 # Add a 10-second delay
|
||||
|
||||
# Step 1: Update and Upgrade the Machine
|
||||
sudo apt update
|
||||
echo "Updating the machine"
|
||||
echo "⏳Processing..."
|
||||
sleep 2 # Add a 2-second delay
|
||||
|
||||
# Fof DEBIAN OS - Check if sudo and git is installed
|
||||
if ! command -v sudo &> /dev/null
|
||||
then
|
||||
echo "sudo could not be found"
|
||||
echo "Installing sudo..."
|
||||
su -c "apt update && apt install sudo -y"
|
||||
else
|
||||
echo "sudo is installed"
|
||||
fi
|
||||
|
||||
if ! command -v git &> /dev/null
|
||||
then
|
||||
echo "git could not be found"
|
||||
echo "Installing git..."
|
||||
su -c "apt update && apt install git -y"
|
||||
else
|
||||
echo "git is installed"
|
||||
fi
|
||||
|
||||
sudo apt upgrade -y
|
||||
sudo apt install git -y
|
||||
|
||||
# Step 2: Adjust network buffer sizes
|
||||
echo "Adjusting network buffer sizes..."
|
||||
@ -27,51 +53,210 @@ else
|
||||
fi
|
||||
sudo sysctl -p
|
||||
|
||||
# Step 3:Download Ceremonyclient
|
||||
# Step 3: Check if directory ~/ceremonyclient exists, download from github
|
||||
if [ -d ~/ceremonyclient ]; then
|
||||
# Check if backup directory ~/backup/qnode_keys exists, if not create it
|
||||
if [ ! -d ~/backup/qnode_keys ]; then
|
||||
mkdir -p ~/backup/qnode_keys
|
||||
fi
|
||||
|
||||
# Check if files exist, then backup
|
||||
if [ -f ~/ceremonyclient/node/.config/keys.yml ]; then
|
||||
cp ~/ceremonyclient/node/.config/keys.yml ~/backup/qnode_keys/
|
||||
echo "✅ Backup of keys.yml created in ~/backup/qnode_keys folder"
|
||||
fi
|
||||
|
||||
if [ -f ~/ceremonyclient/node/.config/config.yml ]; then
|
||||
cp ~/ceremonyclient/node/.config/config.yml ~/backup/qnode_keys/
|
||||
echo "✅ Backup of config.yml created in ~/backup/qnode_keys folder"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Step 4:Download Ceremonyclient
|
||||
echo "⏳Downloading Ceremonyclient"
|
||||
sleep 1 # Add a 1-second delay
|
||||
cd ~
|
||||
if [ -d "ceremonyclient" ]; then
|
||||
echo "Directory ceremonyclient already exists, skipping git clone..."
|
||||
else
|
||||
until git clone https://source.quilibrium.com/quilibrium/ceremonyclient.git; do
|
||||
until git clone https://github.com/QuilibriumNetwork/ceremonyclient.git || git clone https://source.quilibrium.com/quilibrium/ceremonyclient.git; do
|
||||
echo "Git clone failed, retrying..."
|
||||
sleep 2
|
||||
done
|
||||
fi
|
||||
cd ~/ceremonyclient/
|
||||
git checkout release-cdn
|
||||
# git remote set-url origin https://github.com/QuilibriumNetwork/ceremonyclient.git || git remote set-url origin https://source.quilibrium.com/quilibrium/ceremonyclient.git
|
||||
git checkout release
|
||||
|
||||
# Set the version number
|
||||
VERSION="1.4.18"
|
||||
#==========================
|
||||
# NODE BINARY DOWNLOAD
|
||||
#==========================
|
||||
|
||||
# Get the system architecture
|
||||
get_os_arch() {
|
||||
local os=$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||
local arch=$(uname -m)
|
||||
|
||||
case "$os" in
|
||||
linux|darwin) ;;
|
||||
*) echo "Unsupported operating system: $os" >&2; return 1 ;;
|
||||
esac
|
||||
|
||||
case "$arch" in
|
||||
x86_64|amd64) arch="amd64" ;;
|
||||
arm64|aarch64) arch="arm64" ;;
|
||||
*) echo "Unsupported architecture: $arch" >&2; return 1 ;;
|
||||
esac
|
||||
|
||||
echo "${os}-${arch}"
|
||||
}
|
||||
|
||||
# Get the current OS and architecture
|
||||
OS_ARCH=$(get_os_arch)
|
||||
|
||||
# Base URL for the Quilibrium releases
|
||||
RELEASE_FILES_URL="https://releases.quilibrium.com/release"
|
||||
|
||||
# Fetch the list of files from the release page
|
||||
# Updated regex to allow for an optional fourth version number
|
||||
RELEASE_FILES=$(curl -s $RELEASE_FILES_URL | grep -oE "node-[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?-${OS_ARCH}(\.dgst)?(\.sig\.[0-9]+)?")
|
||||
|
||||
# Change to the download directory
|
||||
cd ~/ceremonyclient/node
|
||||
|
||||
# Download each file
|
||||
for file in $RELEASE_FILES; do
|
||||
echo "Downloading $file..."
|
||||
curl -L -o "$file" "https://releases.quilibrium.com/$file"
|
||||
|
||||
# Check if the download was successful
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Successfully downloaded $file"
|
||||
# Check if the file is the base binary (without .dgst or .sig suffix)
|
||||
if [[ $file =~ ^node-[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?-${OS_ARCH}$ ]]; then
|
||||
echo "Making $file executable..."
|
||||
chmod +x "$file"
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Successfully made $file executable"
|
||||
else
|
||||
echo "Failed to make $file executable"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "Failed to download $file"
|
||||
fi
|
||||
|
||||
echo "------------------------"
|
||||
done
|
||||
|
||||
echo "✅ Node binary download completed."
|
||||
|
||||
|
||||
|
||||
# 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
|
||||
|
||||
|
||||
get_os_arch() {
|
||||
local os=$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||
local arch=$(uname -m)
|
||||
|
||||
case "$os" in
|
||||
linux|darwin) ;;
|
||||
*) echo "Unsupported operating system: $os" >&2; return 1 ;;
|
||||
esac
|
||||
|
||||
case "$arch" in
|
||||
x86_64|amd64) arch="amd64" ;;
|
||||
arm64|aarch64) arch="arm64" ;;
|
||||
*) echo "Unsupported architecture: $arch" >&2; return 1 ;;
|
||||
esac
|
||||
|
||||
echo "${os}-${arch}"
|
||||
}
|
||||
|
||||
|
||||
# Step 4:Download qClient
|
||||
echo "⏳Downloading qClient"
|
||||
sleep 1 # Add a 1-second delay
|
||||
# Get the current OS and architecture
|
||||
OS_ARCH=$(get_os_arch)
|
||||
|
||||
# Base URL for the Quilibrium releases
|
||||
BASE_URL="https://releases.quilibrium.com/qclient-release"
|
||||
|
||||
# Fetch the list of files from the release page
|
||||
FILES=$(curl -s $BASE_URL | grep -oE "qclient-[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?-${OS_ARCH}(\.dgst)?(\.sig\.[0-9]+)?")
|
||||
|
||||
# Change to the download directory
|
||||
cd ~/ceremonyclient/node
|
||||
|
||||
# Download each file
|
||||
for file in $FILES; do
|
||||
echo "Downloading $file..."
|
||||
wget "https://releases.quilibrium.com/$file"
|
||||
|
||||
# Check if the download was successful
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Successfully downloaded $file"
|
||||
else
|
||||
echo "❌ Error: Failed to download $file"
|
||||
echo "Your node will still work, but you'll need to install the qclient manually later if needed."
|
||||
fi
|
||||
|
||||
echo "------------------------"
|
||||
done
|
||||
|
||||
//
|
||||
chmod +x qclient*
|
||||
echo "✅ qClient binary downloaded and configured successfully."
|
||||
|
||||
echo
|
||||
|
||||
# Step 5:Determine the ExecStart line based on the architecture
|
||||
# Get the current user's home directory
|
||||
HOME=$(eval echo ~$HOME_DIR)
|
||||
|
||||
# Use the home directory in the path
|
||||
NODE_PATH="$HOME/ceremonyclient/node"
|
||||
EXEC_START="$NODE_PATH/$NODE_BINARY"
|
||||
|
||||
# Step4:Determine the ExecStart line based on the architecture
|
||||
if [ "$ARCH" = "x86_64" ]; then
|
||||
EXEC_START="$NODE_PATH/node-$VERSION-linux-amd64"
|
||||
elif [ "$ARCH" = "aarch64" ]; then
|
||||
EXEC_START="$NODE_PATH/node-$VERSION-linux-arm64"
|
||||
elif [ "$ARCH" = "arm64" ]; then
|
||||
EXEC_START="$NODE_PATH/node-$VERSION-darwin-arm64"
|
||||
# Step 6:Create Ceremonyclient Service
|
||||
echo "⏳ Creating Ceremonyclient Service"
|
||||
sleep 2 # Add a 2-second delay
|
||||
|
||||
# Check if the file exists before attempting to remove it
|
||||
if [ -f "/lib/systemd/system/ceremonyclient.service" ]; then
|
||||
# If the file exists, remove it
|
||||
rm /lib/systemd/system/ceremonyclient.service
|
||||
echo "ceremonyclient.service file removed."
|
||||
else
|
||||
echo "Unsupported architecture: $ARCH"
|
||||
exit 1
|
||||
# If the file does not exist, inform the user
|
||||
echo "ceremonyclient.service file does not exist. No action taken."
|
||||
fi
|
||||
|
||||
# Step5:Create Ceremonyclient Service
|
||||
# Check if the ceremonyclient.service file exists
|
||||
if [ -f /lib/systemd/system/ceremonyclient.service ]; then
|
||||
# If it exists, remove it
|
||||
sudo rm /lib/systemd/system/ceremonyclient.service
|
||||
fi
|
||||
sudo tee /lib/systemd/system/ceremonyclient.service > /dev/null <<EOF
|
||||
[Unit]
|
||||
Description=Ceremony Client Go App Service
|
||||
@ -80,14 +265,25 @@ Description=Ceremony Client Go App Service
|
||||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=5s
|
||||
WorkingDirectory=/root/ceremonyclient/node
|
||||
WorkingDirectory=$NODE_PATH
|
||||
ExecStart=$EXEC_START
|
||||
KillSignal=SIGINT
|
||||
TimeoutStopSec=75s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable ceremonyclient
|
||||
|
||||
# Start the ceremonyclient service
|
||||
sudo service ceremonyclient start
|
||||
# Step 7: Start the ceremonyclient service
|
||||
echo "✅Starting Ceremonyclient Service"
|
||||
sleep 1 # Add a 1-second delay
|
||||
sudo service ceremonyclient start
|
||||
|
||||
# Step 8: See the logs of the ceremonyclient service
|
||||
echo "🎉Welcome to Quilibrium Ceremonyclient"
|
||||
echo "⏳Please let it flow node logs at least 5 minutes then you can press CTRL + C to exit the logs."
|
||||
sleep 5 # Add a 5-second delay
|
||||
sudo journalctl -u ceremonyclient.service -f --no-hostname -o cat
|
||||
|
||||
173
install/testnet.sh
Normal file
173
install/testnet.sh
Normal file
@ -0,0 +1,173 @@
|
||||
#!/bin/bash
|
||||
# Set the version number
|
||||
|
||||
VERSION="2.0.4.1-b7-testnet"
|
||||
qClientVERSION="2.0.4.1"
|
||||
|
||||
cd ~
|
||||
# Step 0: Welcome
|
||||
echo "This script is made with ❤️ by 0xOzgur @ https://quilibrium.space "
|
||||
echo "The script is prepared for Ubuntu machines. If you are using another operating system, please check the compatibility of the script."
|
||||
echo "This script will be building new fresh Node for Quilibrium Testnet. Your use is at your own risk. 0xOzgur does not accept any liability."
|
||||
echo "⏳Enjoy and sit back while you are building your Quilibrium Testnet Node!"
|
||||
echo "⏳Processing..."
|
||||
sleep 5 # Add a 10-second delay
|
||||
|
||||
# Step 1: Update and Upgrade the Machine
|
||||
echo "Updating the machine"
|
||||
echo "⏳Processing..."
|
||||
sleep 2 # Add a 2-second delay
|
||||
|
||||
# Fof DEBIAN OS - Check if sudo and git is installed
|
||||
if ! command -v sudo &> /dev/null
|
||||
then
|
||||
echo "sudo could not be found"
|
||||
echo "Installing sudo..."
|
||||
su -c "apt update && apt install sudo -y"
|
||||
else
|
||||
echo "sudo is installed"
|
||||
fi
|
||||
|
||||
if ! command -v git &> /dev/null
|
||||
then
|
||||
echo "git could not be found"
|
||||
echo "Installing git..."
|
||||
su -c "apt update && apt install git -y"
|
||||
else
|
||||
echo "git is installed"
|
||||
fi
|
||||
|
||||
sudo apt upgrade -y
|
||||
|
||||
# Step 2: Adjust network buffer sizes
|
||||
echo "Adjusting network buffer sizes..."
|
||||
if grep -q "^net.core.rmem_max=600000000$" /etc/sysctl.conf; then
|
||||
echo "net.core.rmem_max=600000000 found inside /etc/sysctl.conf, skipping..."
|
||||
else
|
||||
echo -e "\n# Change made to increase buffer sizes for better network performance for ceremonyclient\nnet.core.rmem_max=600000000" | sudo tee -a /etc/sysctl.conf > /dev/null
|
||||
fi
|
||||
if grep -q "^net.core.wmem_max=600000000$" /etc/sysctl.conf; then
|
||||
echo "net.core.wmem_max=600000000 found inside /etc/sysctl.conf, skipping..."
|
||||
else
|
||||
echo -e "\n# Change made to increase buffer sizes for better network performance for ceremonyclient\nnet.core.wmem_max=600000000" | sudo tee -a /etc/sysctl.conf > /dev/null
|
||||
fi
|
||||
sudo sysctl -p
|
||||
|
||||
# Step 4:Download Ceremonyclient
|
||||
echo "⏳Creating Testnet Directories"
|
||||
sleep 1 # Add a 1-second delay
|
||||
mkdir testnet
|
||||
cd ~/testnet
|
||||
mkdir ceremonyclient
|
||||
cd ~/testnet/ceremonyclient/
|
||||
|
||||
# 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
|
||||
|
||||
|
||||
#==========================
|
||||
# NODE BINARY DOWNLOAD
|
||||
#==========================
|
||||
|
||||
# Step 4:Download qClient
|
||||
echo "⏳Downloading qClient"
|
||||
sleep 1 # Add a 1-second delay
|
||||
cd ~/testnet/ceremonyclient/node
|
||||
wget https://releases.quilibrium.com/$NODE_BINARY
|
||||
chmod +x $NODE_BINARY
|
||||
echo "✅ Node binary for testnet downloaded and permissions configured completed."
|
||||
|
||||
#==========================
|
||||
# qCLIENT BINARY DOWNLOAD
|
||||
#==========================
|
||||
cd ~/testnet/ceremonyclient/client
|
||||
wget https://releases.quilibrium.com/$QCLIENT_BINARY
|
||||
chmod +x $QCLIENT_BINARY
|
||||
echo "✅ qClient binary for testnet downloaded and permissions configured completed."
|
||||
echo
|
||||
|
||||
# Step 5:Determine the ExecStart line based on the architecture
|
||||
# Get the current user's home directory
|
||||
HOME=$(eval echo ~$HOME_DIR)
|
||||
|
||||
# Use the home directory in the path
|
||||
NODE_PATH="$HOME/testnet/ceremonyclient/node"
|
||||
EXEC_START="$NODE_PATH/$NODE_BINARY"
|
||||
|
||||
# Step 6:Create Ceremonyclient Service
|
||||
echo "⏳ Stopping Ceremonyclient Service"
|
||||
service ceremonyclient stop
|
||||
sleep 2 # Add a 2-second delay
|
||||
|
||||
echo "⏳ Creating Ceremonyclient Testnet Service"
|
||||
sleep 2 # Add a 2-second delay
|
||||
|
||||
sudo tee /lib/systemd/system/qtestnet.service > /dev/null <<EOF
|
||||
[Unit]
|
||||
Description=Ceremony Client Testnet Service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=5s
|
||||
WorkingDirectory=$NODE_PATH
|
||||
ExecStart=$EXEC_START --signature-check=false --network=1
|
||||
KillSignal=SIGINT
|
||||
TimeoutStopSec=75s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
sudo systemctl daemon-reload
|
||||
# sudo systemctl enable ceremonyclient
|
||||
|
||||
# Step 7: Start the ceremonyclient service
|
||||
echo "✅Starting Ceremonyclient Testnet Service"
|
||||
sleep 1 # Add a 1-second delay
|
||||
sudo service qtestnet start
|
||||
|
||||
# Step 8: See the logs of the ceremonyclient service
|
||||
echo "🎉Welcome to Quilibrium Ceremonyclient VERSION"
|
||||
echo "⏳Please let it flow node logs at least 5 minutes then you can press CTRL + C to exit the logs."
|
||||
sleep 30 # Add a 5-second delay
|
||||
|
||||
CONFIG_FILE="$HOME/testnet/ceremonyclient/node/.config/config.yml"
|
||||
|
||||
# Backup the original file
|
||||
cp "$CONFIG_FILE" "${CONFIG_FILE}.bak"
|
||||
|
||||
# Comment out existing bootstrap peers
|
||||
sed -i '/bootstrapPeers:/,/^[^ ]/s/^ -/# -/' "$CONFIG_FILE"
|
||||
|
||||
# Add the new bootstrap peer
|
||||
sed -i '/bootstrapPeers:/a\ - /ip4/91.242.214.79/udp/8336/quic-v1/p2p/QmNSGavG2DfJwGpHmzKjVmTD6CVSyJsUFTXsW4JXt2eySR' "$CONFIG_FILE"
|
||||
|
||||
echo "Bootstrap peers updated in $CONFIG_FILE"
|
||||
echo "Original file backed up as ${CONFIG_FILE}.bak"
|
||||
|
||||
sudo service qtestnet restart
|
||||
sudo journalctl -u qtestnet.service -f --no-hostname -o cat
|
||||
98
node-monitor.sh
Normal file
98
node-monitor.sh
Normal file
@ -0,0 +1,98 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Define file paths for storing previous values
|
||||
seniority_file="/tmp/previous_seniority.txt"
|
||||
balance_file="/tmp/previous_balance.txt"
|
||||
|
||||
# Arrays to store the last 30 frame ages
|
||||
submitting_ages=()
|
||||
creating_ages=()
|
||||
|
||||
# Flags to track the detection of both messages
|
||||
submitting_proof_detected=false
|
||||
shard_ring_proof_detected=false
|
||||
|
||||
# Function to calculate the average of an array
|
||||
calculate_average() {
|
||||
local arr=("$@")
|
||||
local sum=0
|
||||
for age in "${arr[@]}"; do
|
||||
sum=$(echo "$sum + $age" | bc)
|
||||
done
|
||||
echo "scale=2; $sum / ${#arr[@]}" | bc
|
||||
}
|
||||
|
||||
# Monitor journalctl for the specific keywords
|
||||
sudo journalctl -u ceremonyclient.service -f --no-hostname -o cat | grep --line-buffered -E 'submitting data proof|creating data shard ring proof' | while read -r line
|
||||
do
|
||||
# Print a human-readable timestamp
|
||||
echo "$(date '+%Y-%m-%d %H:%M:%S') - $line"
|
||||
|
||||
# Check for each specific message, extract frame age, and update arrays
|
||||
if [[ "$line" == *"submitting data proof"* ]]; then
|
||||
submitting_proof_detected=true
|
||||
frame_age=$(echo "$line" | grep -oP '"frame_age":[0-9.]+(?=})' | cut -d: -f2)
|
||||
submitting_ages+=("$frame_age")
|
||||
# Keep only the last 30 frame ages
|
||||
if [ ${#submitting_ages[@]} -gt 30 ]; then
|
||||
submitting_ages=("${submitting_ages[@]:1}")
|
||||
fi
|
||||
elif [[ "$line" == *"creating data shard ring proof"* ]]; then
|
||||
shard_ring_proof_detected=true
|
||||
frame_age=$(echo "$line" | grep -oP '"frame_age":[0-9.]+(?=})' | cut -d: -f2)
|
||||
creating_ages+=("$frame_age")
|
||||
# Keep only the last 30 frame ages
|
||||
if [ ${#creating_ages[@]} -gt 30 ]; then
|
||||
creating_ages=("${creating_ages[@]:1}")
|
||||
fi
|
||||
fi
|
||||
|
||||
# Only proceed if both messages have been detected
|
||||
if $submitting_proof_detected && $shard_ring_proof_detected; then
|
||||
# Reset flags for the next cycle
|
||||
submitting_proof_detected=false
|
||||
shard_ring_proof_detected=false
|
||||
|
||||
# Print the averages for the last 30 frame ages
|
||||
echo "Average frame age for 'creating data shard ring proof': $(calculate_average "${creating_ages[@]}")"
|
||||
echo "Average frame age for 'submitting data proof': $(calculate_average "${submitting_ages[@]}")"
|
||||
|
||||
# Navigate to the ceremonyclient/node directory
|
||||
cd ~/ceremonyclient/node
|
||||
|
||||
# Run the token balance command and filter for the Total balance line
|
||||
total_balance=$(./qclient-2.0.4.1-linux-amd64 token balance | grep -oP 'Total balance: \K[0-9.]+')
|
||||
echo "Total balance: $total_balance"
|
||||
|
||||
# Run the node-info command and filter for specific lines
|
||||
node_info=$(./node-2.0.4.1-linux-amd64 -node-info)
|
||||
seniority=$(echo "$node_info" | grep -oP 'Seniority: \K[0-9]+')
|
||||
prover_ring=$(echo "$node_info" | grep 'Prover Ring')
|
||||
owned_balance=$(echo "$node_info" | grep 'Owned balance')
|
||||
|
||||
echo "$prover_ring"
|
||||
echo "Seniority: $seniority"
|
||||
echo "$owned_balance"
|
||||
|
||||
# Load previous values if they exist, otherwise set defaults
|
||||
previous_seniority=$(cat "$seniority_file" 2>/dev/null || echo "0")
|
||||
previous_balance=$(cat "$balance_file" 2>/dev/null || echo "0")
|
||||
|
||||
# Compare and check if Seniority and Total balance have increased
|
||||
if (( seniority > previous_seniority )); then
|
||||
echo "Seniority has increased from $previous_seniority to $seniority"
|
||||
else
|
||||
echo "Seniority has not increased."
|
||||
fi
|
||||
|
||||
if (( $(echo "$total_balance > $previous_balance" | bc -l) )); then
|
||||
echo "Total balance has increased from $previous_balance to $total_balance"
|
||||
else
|
||||
echo "Total balance has not increased."
|
||||
fi
|
||||
|
||||
# Store current Seniority and Total balance for the next iteration
|
||||
echo "$seniority" > "$seniority_file"
|
||||
echo "$total_balance" > "$balance_file"
|
||||
fi
|
||||
done
|
||||
@ -12,7 +12,7 @@ fi
|
||||
|
||||
export HISTTIMEFORMAT="%d/%m/%y %T "
|
||||
|
||||
|
||||
# Shortcuts for General Management
|
||||
alias e="exit"
|
||||
alias cm="ps -eo comm,pcpu --sort -pcpu | head -8; ps -eo comm,pmem --sort -pmem | head -8"
|
||||
alias st='curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3'
|
||||
@ -21,7 +21,28 @@ alias wttr='curl wttr.in'
|
||||
|
||||
neofetch
|
||||
|
||||
# Get system information
|
||||
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-2.0-linux-amd64'
|
||||
elif [ "$OS" = "Darwin" ]; then
|
||||
NODE_BINARY='node-2.0-darwin-amd64'
|
||||
fi
|
||||
elif [ "$ARCH" = "aarch64" ]; then
|
||||
if [ "$OS" = "Linux" ]; then
|
||||
NODE_BINARY='node-2.0-linux-arm64'
|
||||
elif [ "$OS" = "Darwin" ]; then
|
||||
NODE_BINARY='node-2.0-darwin-arm64'
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Shortcuts for Docker
|
||||
alias dpeer-count='cd ~/ceremonyclient/ && docker compose exec node grpcurl -plaintext -max-msg-sz 150000000 localhost:8337 quilibrium.node.node.pb.NodeService.GetPeerManifests | grep peerId | wc -l'
|
||||
alias dnode-info='cd ~/ceremonyclient/ && docker compose exec node node -node-info && cd ~'
|
||||
alias ddb-console='cd ~/ceremonyclient/ && - docker compose exec node node --db-console && cd ~'
|
||||
@ -30,12 +51,13 @@ alias dlog='cd ~/ceremonyclient/ && docker compose logs -f -n, --tail 100 && cd
|
||||
alias dstart='cd ~/ceremonyclient/ && docker compose up -d && cd ~'
|
||||
alias drestart='cd ~/ceremonyclient/ && docker compose down && docker compose up -d && cd ~'
|
||||
alias dstop='cd ~/ceremonyclient/ && docker compose down && cd ~'
|
||||
|
||||
# Shortcuts for Service
|
||||
alias peer-count='cd ~/ceremonyclient/node && grpcurl -plaintext -max-msg-sz 150000000 localhost:8337 quilibrium.node.node.pb.NodeService.GetPeerManifests | grep peerId | wc -l && cd ~'
|
||||
alias node-info='cd ~/ceremonyclient/node && ./node-1.4.18-linux-amd64 -node-info && cd ~'
|
||||
alias db-console='cd ~/ceremonyclient/node && ./node-1.4.18-linux-amd64 --db-console && cd ~'
|
||||
alias balance='cd ~/ceremonyclient/node && ./node-1.4.18-linux-amd64 -balance && cd ~'
|
||||
alias node-info='cd ~/ceremonyclient/node && ./${NODE_BINARY} -node-info && cd ~'
|
||||
alias db-console='cd ~/ceremonyclient/node && ./${NODE_BINARY} --db-console && cd ~'
|
||||
alias balance='cd ~/ceremonyclient/node && ./${NODE_BINARY} -balance && cd ~'
|
||||
alias nlog='sudo journalctl -u ceremonyclient.service -f --no-hostname -o cat'
|
||||
alias nstart='service ceremonyclient start'
|
||||
alias nrestart='service ceremonyclient restart'
|
||||
alias nstop='service ceremonyclient stop'
|
||||
alias nstop='service ceremonyclient stop'
|
||||
alias benchmark='last_next_difficulty=$(journalctl -u ceremonyclient -ocat -n 100 | grep difficulty | awk -F'"'"'[:,}]'"'"' '"'"'{for(i=1;i<=NF;i++){if($i~"next_difficulty_metric"){gsub(/[ "]/,"",$i); print $(i+1)}}}'"'"' | tail -n 1) && cpus=$(nproc) && echo "" && echo "Your Benchmark Details" && echo "Difficulty: $last_next_difficulty" && echo "CPU(s): $cpus" && if [ $cpus -gt 0 ]; then difficulty_per_core=$(echo "scale=2; ($cpus*$cpus*1000)/$last_next_difficulty" | bc); echo "Score: $difficulty_per_core"; fi'
|
||||
38
profile/.profile
Normal file
38
profile/.profile
Normal file
@ -0,0 +1,38 @@
|
||||
# ~/.profile: executed by Bourne-compatible login shells.
|
||||
|
||||
if [ "$BASH" ]; then
|
||||
if [ -f ~/.bashrc ]; then
|
||||
. ~/.bashrc
|
||||
fi
|
||||
fi
|
||||
|
||||
mesg n 2> /dev/null || true
|
||||
|
||||
# Shortcuts for General Management
|
||||
alias e="exit"
|
||||
alias cm="ps -eo comm,pcpu --sort -pcpu | head -8; ps -eo comm,pmem --sort -pmem | head -8"
|
||||
alias st='curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3'
|
||||
alias myip='curl icanhazip.com'
|
||||
alias wttr='curl wttr.in'
|
||||
|
||||
neofetch
|
||||
|
||||
# Shortcuts for Service
|
||||
alias peer-count="cd ~/ceremonyclient/node && grpcurl -plaintext -max-msg-sz 150000000 localhost:8337 quilibrium.node.node.pb.NodeService.GetPeerManifests | grep peerId | wc -l && cd ~"
|
||||
alias node-info="cd ~/ceremonyclient/node && ./node-2.0.4.1-linux-amd64 -node-info && cd ~"
|
||||
alias db-console="cd ~/ceremonyclient/node && ./node-2.0.4.1-linux-amd64 --db-console && cd ~"
|
||||
alias balance="cd ~/ceremonyclient/node && ./node-2.0.4.1-linux-amd64 -balance && cd ~"
|
||||
alias nlog="sudo journalctl -u ceremonyclient.service -f --no-hostname -o cat"
|
||||
alias increment="sudo journalctl -u ceremonyclient.service -f --no-hostname -o cat | grep time_taken"
|
||||
alias frame="sudo journalctl -u ceremonyclient.service -f --no-hostname -o cat | grep frame_number"
|
||||
alias nstart="service ceremonyclient start"
|
||||
alias nrestart="service ceremonyclient restart"
|
||||
alias nstop="service ceremonyclient stop"
|
||||
alias benchmark='increment=$(journalctl -u ceremonyclient -ocat -n 100 | grep increment | awk -F'\[:,\}\]' '\''{for(i=1;i<=NF;i++){if($i~"increment"){gsub(/[ "]/,"",$i); print $(i+1)}}}'\'' | tail -n 1) && difficulty=$(expr 200000 - $increment / 4) && cpus=$(nproc) && score=$(echo "scale=2; ($cpus*$cpus*1000)/$difficulty" | bc) && echo "" && echo "CPU(s): $cpus" && echo "Increment: $increment" && echo "Difficulty: $difficulty" && echo "Score: $score"'
|
||||
alias qbalance="cd ~/ceremonyclient/node && ./qclient-2.0.4.1-linux-amd64 token balance --public-rpc"
|
||||
alias qtoken="cd ~/ceremonyclient/node && ./qclient-2.0.4.1-linux-amd64 token coins --public-rpc"
|
||||
alias qmint="cd ~/ceremonyclient/node && ./qclient-2.0.4.1-linux-amd64 token mint all --public-rpc"
|
||||
alias qmerge="cd ~/ceremonyclient/node && ./qclient-2.0.4.1-linux-amd64 token merge all --public-rpc"
|
||||
alias mincrement="journalctl -u ceremonyclient.service -f --no-hostname -o cat -g 'publishing proof batch'-n 1000"
|
||||
alias qnode="cd ~/ceremonyclient/node"
|
||||
alias client="cd ~/ceremonyclient/node"
|
||||
@ -1,28 +0,0 @@
|
||||
# ~/.profile: executed by Bourne-compatible login shells.
|
||||
|
||||
if [ "$BASH" ]; then
|
||||
if [ -f ~/.bashrc ]; then
|
||||
. ~/.bashrc
|
||||
fi
|
||||
fi
|
||||
|
||||
mesg n 2> /dev/null || true
|
||||
|
||||
|
||||
alias e="exit"
|
||||
alias cm="ps -eo comm,pcpu --sort -pcpu | head -8; ps -eo comm,pmem --sort -pmem | head -8"
|
||||
alias st='curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3'
|
||||
alias myip='curl icanhazip.com'
|
||||
alias wttr='curl wttr.in'
|
||||
|
||||
neofetch
|
||||
|
||||
|
||||
alias peer-count='cd ~/ceremonyclient/node && grpcurl -plaintext -max-msg-sz 150000000 localhost:8337 quilibrium.node.node.pb.NodeService.GetPeerManifests | grep peerId | wc -l && cd ~'
|
||||
alias PeerManifests='cd ~/ceremonyclient/node && ./node-1.4.18-linux-amd64 -node-info && cd ~'
|
||||
alias db-console='cd ~/ceremonyclient/node && ./node-1.4.18-linux-amd64 --db-console && cd ~'
|
||||
alias balance='cd ~/ceremonyclient/node && ./node-1.4.18-linux-amd64 -balance && cd ~'
|
||||
alias nlog='sudo journalctl -u ceremonyclient.service -f --no-hostname -o cat'
|
||||
alias nstart='service ceremonyclient start'
|
||||
alias nrestart='service ceremonyclient restart'
|
||||
alias nstop='service ceremonyclient stop'
|
||||
@ -1,37 +0,0 @@
|
||||
# ~/.profile: executed by Bourne-compatible login shells.
|
||||
|
||||
if [ "$BASH" ]; then
|
||||
if [ -f ~/.bashrc ]; then
|
||||
. ~/.bashrc
|
||||
fi
|
||||
fi
|
||||
|
||||
mesg n 2> /dev/null || true
|
||||
|
||||
|
||||
alias e="exit"
|
||||
alias cm="ps -eo comm,pcpu --sort -pcpu | head -8; ps -eo comm,pmem --sort -pmem | head -8"
|
||||
alias st='curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3'
|
||||
alias myip='curl icanhazip.com'
|
||||
alias wttr='curl wttr.in'
|
||||
|
||||
neofetch
|
||||
|
||||
|
||||
alias dpeer-count='cd ~/ceremonyclient/ && docker compose exec node grpcurl -plaintext -max-msg-sz 150000000 localhost:8337 quilibrium.node.node.pb.NodeService.GetPeerManifests | grep peerId | wc -l'
|
||||
alias dnode-info='cd ~/ceremonyclient/ && docker compose exec node node -node-info && cd ~'
|
||||
alias ddb-console='cd ~/ceremonyclient/ && - docker compose exec node node --db-console && cd ~'
|
||||
alias dbalance='cd ~/ceremonyclient/ && docker compose exec node node -balance && cd ~'
|
||||
alias dlog='cd ~/ceremonyclient/ && docker compose logs -f -n, --tail 100 && cd ~'
|
||||
alias dstart='cd ~/ceremonyclient/ && docker compose up -d && cd ~'
|
||||
alias drestart='cd ~/ceremonyclient/ && docker compose down && docker compose up -d && cd ~'
|
||||
alias dstop='cd ~/ceremonyclient/ && docker compose down && cd ~'
|
||||
|
||||
alias peer-count='cd ~/ceremonyclient/node && grpcurl -plaintext -max-msg-sz 150000000 localhost:8337 quilibrium.node.node.pb.NodeService.GetPeerManifests | grep peerId | wc -l && cd ~'
|
||||
alias node-info='cd ~/ceremonyclient/node && ./node-1.4.18-linux-amd64 -node-info && cd ~'
|
||||
alias db-console='cd ~/ceremonyclient/node && ./node-1.4.18-linux-amd64 --db-console && cd ~'
|
||||
alias balance='cd ~/ceremonyclient/node && ./node-1.4.18-linux-amd64 -balance && cd ~'
|
||||
alias nlog='sudo journalctl -u ceremonyclient.service -f --no-hostname -o cat'
|
||||
alias nstart='service ceremonyclient start'
|
||||
alias nrestart='service ceremonyclient restart'
|
||||
alias nstop='service ceremonyclient stop'
|
||||
@ -6,7 +6,10 @@ source ~/.bashrc
|
||||
clear
|
||||
|
||||
# Set the version number
|
||||
VERSION="1.4.20"
|
||||
|
||||
VERSION="2.0.4.1"
|
||||
qClientVERSION="2.0.4.1"
|
||||
|
||||
|
||||
# Determine the ExecStart line based on the architecture
|
||||
ARCH=$(uname -m)
|
||||
@ -16,376 +19,62 @@ OS=$(uname -s)
|
||||
if [ "$ARCH" = "x86_64" ]; then
|
||||
if [ "$OS" = "Linux" ]; then
|
||||
NODE_BINARY="node-$VERSION-linux-amd64"
|
||||
GO_BINARY="go1.20.14.linux-amd64.tar.gz"
|
||||
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.20.14.linux-amd64.tar.gz"
|
||||
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.20.14.linux-arm64.tar.gz"
|
||||
GO_BINARY="go1.22.4.linux-arm64.tar.gz"
|
||||
elif [ "$OS" = "Darwin" ]; then
|
||||
NODE_BINARY="node-$VERSION-darwin-arm64"
|
||||
GO_BINARY="go1.20.14.linux-arm64.tar.gz"
|
||||
GO_BINARY="go1.22.4.linux-arm64.tar.gz"
|
||||
QCLIENT_BINARY="qclient-$qClientVERSION-linux-arm64"
|
||||
fi
|
||||
fi
|
||||
|
||||
# URLs for scripts
|
||||
UPDATE_URL="https://git.088.im/coosld/QuilibriumTools/raw/branch/main/update.sh"
|
||||
PREREQUISITES_URL="https://git.088.im/coosld/QuilibriumTools/raw/branch/main/install/Install_prerequisites.sh"
|
||||
NODE_INSTALL_URL="https://git.088.im/coosld/QuilibriumTools/raw/branch/main/install/install_quilibrium_service.sh"
|
||||
GRPCURL_CONFIG_URL="https://git.088.im/coosld/QuilibriumTools/raw/branch/main/configuration/config.sh"
|
||||
NODE_UPDATE_URL="https://git.088.im/coosld/QuilibriumTools/raw/branch/main/update/update.sh"
|
||||
CHECK_VISIBILITY_URL="https://git.088.im/coosld/QuilibriumTools/raw/branch/main/visibility_check.sh"
|
||||
|
||||
# Function for each menu option
|
||||
install_prerequisites() {
|
||||
echo "Installing prerequisites..."
|
||||
sleep 1 # Add a 1-second delay
|
||||
|
||||
echo "Updating the machine"
|
||||
echo "⏳Processing..."
|
||||
sleep 1 # Add a 1-second delay
|
||||
|
||||
# Fof DEBIAN OS - Check if sudo and git is installed
|
||||
# Step 1.1: Prepare Machine
|
||||
if ! command -v sudo &> /dev/null
|
||||
then
|
||||
echo "sudo could not be found"
|
||||
echo "Installing sudo..."
|
||||
su -c "apt update && apt install sudo -y"
|
||||
else
|
||||
echo "sudo is installed"
|
||||
fi
|
||||
# ınstall git if not installed
|
||||
if ! command -v git &> /dev/null
|
||||
then
|
||||
echo "git could not be found"
|
||||
echo "Installing git..."
|
||||
su -c "apt update && apt install git -y"
|
||||
else
|
||||
echo "git is installed"
|
||||
fi
|
||||
|
||||
# Update the machine
|
||||
sudo apt update
|
||||
sudo apt upgrade -y
|
||||
|
||||
# Install cpu limit and gawk
|
||||
apt install cpulimit -y
|
||||
apt install gawk -y #incase it is not installed
|
||||
|
||||
# Download and install Go
|
||||
wget https://go.dev/dl/$GO_BINARY || { echo "Failed to download Node! Exiting..."; exit_message; exit 1; }
|
||||
sudo tar -xvf $GO_BINARY || { echo "Failed to extract Go! Exiting..."; exit_message; exit 1; }
|
||||
sudo rm -rf /usr/local/go || { echo "Failed to remove existing Go! Exiting..."; exit_message; exit 1; }
|
||||
sudo mv go /usr/local || { echo "Failed to move go! Exiting..."; exit_message; exit 1; }
|
||||
sudo rm $GO_BINARY || { echo "Failed to remove downloaded archive! Exiting..."; exit_message; exit 1; }
|
||||
|
||||
|
||||
# Set Go environment variables
|
||||
echo "⏳Setting Go environment variables..."
|
||||
sleep 2 # Add a 2-second delay
|
||||
|
||||
# Check if GOROOT is already set
|
||||
if grep -q 'GOROOT=/usr/local/go' ~/.bashrc; then
|
||||
echo "GOROOT already set in ~/.bashrc."
|
||||
else
|
||||
echo 'GOROOT=/usr/local/go' >> ~/.bashrc
|
||||
echo "GOROOT set in ~/.bashrc."
|
||||
fi
|
||||
|
||||
# Check if GOPATH is already set
|
||||
if grep -q "GOPATH=$HOME/go" ~/.bashrc; then
|
||||
echo "GOPATH already set in ~/.bashrc."
|
||||
else
|
||||
echo "GOPATH=$HOME/go" >> ~/.bashrc
|
||||
echo "GOPATH set in ~/.bashrc."
|
||||
fi
|
||||
|
||||
# Check if PATH is already set
|
||||
if grep -q 'PATH=$GOPATH/bin:$GOROOT/bin:$PATH' ~/.bashrc; then
|
||||
echo "PATH already set in ~/.bashrc."
|
||||
else
|
||||
echo 'PATH=$GOPATH/bin:$GOROOT/bin:$PATH' >> ~/.bashrc
|
||||
echo "PATH set in ~/.bashrc."
|
||||
fi
|
||||
|
||||
# Source .bashrc to apply changes
|
||||
echo "⏳Sourcing .bashrc to apply changes"
|
||||
source ~/.bashrc
|
||||
sleep 2 # Add a 2-second delay
|
||||
|
||||
# Check GO Version
|
||||
go version
|
||||
sleep 2 # Add a 2-second delay
|
||||
|
||||
# Install gRPCurl
|
||||
echo "⏳Installing gRPCurl"
|
||||
sleep 1 # Add a 1-second delay
|
||||
go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest
|
||||
echo ""
|
||||
echo "⌛️ Preparing server with necessary apps and settings..."
|
||||
wget --no-cache -O - "$PREREQUISITES_URL" | bash
|
||||
}
|
||||
|
||||
# Install Node
|
||||
install_node() {
|
||||
echo "Installing node..."
|
||||
# Adjust network buffer sizes
|
||||
echo "Adjusting network buffer sizes..."
|
||||
if grep -q "^net.core.rmem_max=600000000$" /etc/sysctl.conf; then
|
||||
echo "net.core.rmem_max=600000000 found inside /etc/sysctl.conf, skipping..."
|
||||
else
|
||||
echo -e "\n# Change made to increase buffer sizes for better network performance for ceremonyclient\nnet.core.rmem_max=600000000" | sudo tee -a /etc/sysctl.conf > /dev/null
|
||||
fi
|
||||
if grep -q "^net.core.wmem_max=600000000$" /etc/sysctl.conf; then
|
||||
echo "net.core.wmem_max=600000000 found inside /etc/sysctl.conf, skipping..."
|
||||
else
|
||||
echo -e "\n# Change made to increase buffer sizes for better network performance for ceremonyclient\nnet.core.wmem_max=600000000" | sudo tee -a /etc/sysctl.conf > /dev/null
|
||||
fi
|
||||
sudo sysctl -p
|
||||
|
||||
# Check if directory ~/ceremonyclient exists, download from github
|
||||
if [ -d ~/ceremonyclient ]; then
|
||||
# Check if backup directory ~/backup/qnode_keys exists, if not create it
|
||||
if [ ! -d ~/backup/qnode_keys ]; then
|
||||
mkdir -p ~/backup/qnode_keys
|
||||
fi
|
||||
|
||||
# Check if files exist, then backup
|
||||
if [ -f ~/ceremonyclient/node/.config/keys.yml ]; then
|
||||
cp ~/ceremonyclient/node/.config/keys.yml ~/backup/qnode_keys/
|
||||
echo "✅ Backup of keys.yml created in ~/backup/qnode_keys folder"
|
||||
fi
|
||||
|
||||
if [ -f ~/ceremonyclient/node/.config/config.yml ]; then
|
||||
cp ~/ceremonyclient/node/.config/config.yml ~/backup/qnode_keys/
|
||||
echo "✅ Backup of config.yml created in ~/backup/qnode_keys folder"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Download Ceremonyclient
|
||||
echo "⏳Downloading Ceremonyclient"
|
||||
sleep 1 # Add a 1-second delay
|
||||
cd ~
|
||||
if [ -d "ceremonyclient" ]; then
|
||||
echo "Directory ceremonyclient already exists, skipping git clone..."
|
||||
else
|
||||
until git clone https://source.quilibrium.com/quilibrium/ceremonyclient.git || git clone https://git.quilibrium-mirror.ch/agostbiro/ceremonyclient.git; do
|
||||
echo "Git clone failed, retrying..."
|
||||
sleep 2
|
||||
done
|
||||
fi
|
||||
cd ~/ceremonyclient/
|
||||
git remote set-url origin https://source.quilibrium.com/quilibrium/ceremonyclient.git || git remote set-url origin https://git.quilibrium-mirror.ch/agostbiro/ceremonyclient.git
|
||||
git checkout release-cdn-cdn
|
||||
|
||||
|
||||
|
||||
# Get the current user's home directory
|
||||
HOME=$(eval echo ~$HOME_DIR)
|
||||
|
||||
# Use the home directory in the path
|
||||
NODE_PATH="$HOME/ceremonyclient/node"
|
||||
EXEC_START="$NODE_PATH/release_autorun.sh"
|
||||
|
||||
# Create Ceremonyclient Service
|
||||
echo "⏳ Creating Ceremonyclient Service"
|
||||
sleep 2 # Add a 2-second delay
|
||||
|
||||
# Check if the file exists before attempting to remove it
|
||||
if [ -f "/lib/systemd/system/ceremonyclient.service" ]; then
|
||||
# If the file exists, remove it
|
||||
rm /lib/systemd/system/ceremonyclient.service
|
||||
echo "ceremonyclient.service file removed."
|
||||
else
|
||||
# If the file does not exist, inform the user
|
||||
echo "ceremonyclient.service file does not exist. No action taken."
|
||||
fi
|
||||
|
||||
sudo tee /lib/systemd/system/ceremonyclient.service > /dev/null <<EOF
|
||||
[Unit]
|
||||
Description=Ceremony Client Go App Service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=5s
|
||||
WorkingDirectory=$NODE_PATH
|
||||
ExecStart=$EXEC_START
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable ceremonyclient
|
||||
|
||||
# Start the ceremonyclient service
|
||||
echo "✅Starting Ceremonyclient Service"
|
||||
sleep 1 # Add a 1-second delay
|
||||
sudo service ceremonyclient start
|
||||
|
||||
# See the logs of the ceremonyclient service
|
||||
echo "🎉Welcome to Quilibrium Ceremonyclient"
|
||||
echo ""
|
||||
echo "⌛️ Installing node as a service..."
|
||||
wget --no-cache -O - "$NODE_INSTALL_URL" | bash
|
||||
}
|
||||
|
||||
configure_grpcurl() {
|
||||
echo "Configuring grpcurl..."
|
||||
line_exists() {
|
||||
grep -qF "$1" "$2"
|
||||
}
|
||||
|
||||
# Enable gRPC
|
||||
echo "Enabling gRPC..."
|
||||
cd "$HOME/ceremonyclient/node" || { echo "Failed to change directory to ~/ceremonyclient/node! Exiting..."; exit 1; }
|
||||
|
||||
# Check if the line listenGrpcMultiaddr: /ip4/127.0.0.1/tcp/8337 exists
|
||||
if ! line_exists "listenGrpcMultiaddr: /ip4/127.0.0.1/tcp/8337" .config/config.yml; then
|
||||
# Check if the line listenGrpcMultiaddr: "" exists
|
||||
if line_exists "listenGrpcMultiaddr: \"\"" .config/config.yml; then
|
||||
# Substitute listenGrpcMultiaddr: "" with listenGrpcMultiaddr: /ip4/127.0.0.1/tcp/8337
|
||||
sudo sed -i 's#^listenGrpcMultiaddr:.*$#listenGrpcMultiaddr: /ip4/127.0.0.1/tcp/8337#' .config/config.yml || { echo "Failed to enable gRPC! Exiting..."; exit 1; }
|
||||
else
|
||||
# Add listenGrpcMultiaddr: /ip4/127.0.0.1/tcp/8337
|
||||
echo "listenGrpcMultiaddr: /ip4/127.0.0.1/tcp/8337" | sudo tee -a .config/config.yml > /dev/null || { echo "Failed to enable gRPC! Exiting..."; exit 1; }
|
||||
fi
|
||||
else
|
||||
echo "gRPC already enabled."
|
||||
fi
|
||||
|
||||
|
||||
# Check if the line listenRESTMultiaddr: /ip4/127.0.0.1/tcp/8338 exists
|
||||
if ! line_exists "listenRESTMultiaddr: /ip4/127.0.0.1/tcp/8338" .config/config.yml; then
|
||||
# Check if the line listenRESTMultiaddr: "" exists
|
||||
if line_exists "listenRESTMultiaddr: \"\"" .config/config.yml; then
|
||||
# Substitute listenRESTMultiaddr: "" with listenRESTMultiaddr: /ip4/127.0.0.1/tcp/8338
|
||||
sudo sed -i 's#^listenRESTMultiaddr:.*$#listenRESTMultiaddr: /ip4/127.0.0.1/tcp/8338#' .config/config.yml || { echo "Failed to enable gRPC! Exiting..."; exit 1; }
|
||||
else
|
||||
# Add listenRESTMultiaddr: /ip4/127.0.0.1/tcp/8338
|
||||
echo "listenRESTMultiaddr: /ip4/127.0.0.1/tcp/8338" | sudo tee -a .config/config.yml > /dev/null || { echo "Failed to enable gRPC! Exiting..."; exit 1; }
|
||||
fi
|
||||
else
|
||||
echo "gRPC already enabled."
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Enable Stats Collection
|
||||
echo "Enabling Stats Collection..."
|
||||
if ! line_exists " statsMultiaddr: \"/dns/stats.quilibrium.com/tcp/443\"" .config/config.yml; then
|
||||
sudo sed -i '/^ *engine:/a\ statsMultiaddr: "/dns/stats.quilibrium.com/tcp/443"' .config/config.yml || { echo "Failed to enable Stats Collection! Exiting..."; exit 1; }
|
||||
else
|
||||
echo "Stats Collection already enabled."
|
||||
fi
|
||||
|
||||
# Check if both lines were added successfully
|
||||
if line_exists "listenGrpcMultiaddr: /ip4/127.0.0.1/tcp/8337" .config/config.yml && line_exists " statsMultiaddr: \"/dns/stats.quilibrium.com/tcp/443\"" .config/config.yml; then
|
||||
echo "Success: The script successfully edited your config.yml file."
|
||||
else
|
||||
echo "ERROR: The script failed to correctly edit your config.yml file."
|
||||
echo "You may want to follow the online guide to do it manually."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "gRPC calls setup was successful."
|
||||
echo ""
|
||||
echo "⌛️ Configuring grpCurl..."
|
||||
wget --no-cache -O - "$GRPCURL_CONFIG_URL" | bash
|
||||
}
|
||||
|
||||
update_node() {
|
||||
echo "Updating node..."
|
||||
service ceremonyclient stop
|
||||
|
||||
apt install cpulimit -y
|
||||
apt install gawk -y #incase it is not installed
|
||||
|
||||
# Download Binary
|
||||
echo "⏳ Downloading New Release v$VERSION"
|
||||
cd ~/ceremonyclient
|
||||
git remote set-url origin https://source.quilibrium.com/quilibrium/ceremonyclient.git || git remote set-url origin https://git.quilibrium-mirror.ch/agostbiro/ceremonyclient.git
|
||||
git pull
|
||||
git checkout release-cdn-cdn
|
||||
|
||||
# Get the current user's home directory
|
||||
HOME=$(eval echo ~$HOME_DIR)
|
||||
|
||||
# Use the home directory in the path
|
||||
NODE_PATH="$HOME/ceremonyclient/node"
|
||||
EXEC_START="$NODE_PATH/release_autorun.sh"
|
||||
|
||||
# Re-Create Ceremonyclient Service
|
||||
echo "⏳ Re-Creating Ceremonyclient Service"
|
||||
sleep 2 # Add a 2-second delay
|
||||
SERVICE_FILE="/lib/systemd/system/ceremonyclient.service"
|
||||
if [ ! -f "$SERVICE_FILE" ]; then
|
||||
echo "📝 Creating new ceremonyclient service file..."
|
||||
if ! sudo tee "$SERVICE_FILE" > /dev/null <<EOF
|
||||
[Unit]
|
||||
Description=Ceremony Client Go App Service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=5s
|
||||
WorkingDirectory=$NODE_PATH
|
||||
ExecStart=$EXEC_START
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
then
|
||||
echo "❌ Error: Failed to create ceremonyclient service file." >&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "🔍 Checking existing ceremonyclient service file..."
|
||||
# Check if the required lines exist and if they are different
|
||||
if ! grep -q "WorkingDirectory=$NODE_PATH" "$SERVICE_FILE" || ! grep -q "ExecStart=$EXEC_START" "$SERVICE_FILE"; then
|
||||
echo "🔄 Updating existing ceremonyclient service file..."
|
||||
# Replace the existing lines with new values
|
||||
sudo sed -i "s|WorkingDirectory=.*|WorkingDirectory=$NODE_PATH|" "$SERVICE_FILE"
|
||||
sudo sed -i "s|ExecStart=.*|ExecStart=$EXEC_START|" "$SERVICE_FILE"
|
||||
else
|
||||
echo "✅ No changes needed."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Start the ceremonyclient service
|
||||
echo "✅ Starting Ceremonyclient Service"
|
||||
sleep 2 # Add a 2-second delay
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable ceremonyclient
|
||||
sudo service ceremonyclient start
|
||||
|
||||
# See the logs of the ceremonyclient service
|
||||
echo "🎉 Welcome to Quilibrium Ceremonyclient v$VERSION"
|
||||
echo ""
|
||||
echo "⌛️ Updating node..."
|
||||
wget --no-cache -O - "$NODE_UPDATE_URL" | bash
|
||||
}
|
||||
|
||||
check_visibility() {
|
||||
echo "⏳Processing..."
|
||||
sleep 2 # Add a 2-second delay
|
||||
|
||||
# Bootstrap peer list
|
||||
bootstrap_peers=(
|
||||
"EiDpYbDwT2rZq70JNJposqAC+vVZ1t97pcHbK8kr5G4ZNA=="
|
||||
"EiCcVN/KauCidn0nNDbOAGMHRZ5psz/lthpbBeiTAUEfZQ=="
|
||||
"EiDhVHjQKgHfPDXJKWykeUflcXtOv6O2lvjbmUnRrbT2mw=="
|
||||
"EiDHhTNA0yf07ljH+gTn0YEk/edCF70gQqr7QsUr8RKbAA=="
|
||||
"EiAnwhEcyjsHiU6cDCjYJyk/1OVsh6ap7E3vDfJvefGigw=="
|
||||
"EiB75ZnHtAOxajH2hlk9wD1i9zVigrDKKqYcSMXBkKo4SA=="
|
||||
"EiDEYNo7GEfMhPBbUo+zFSGeDECB0RhG0GfAasdWp2TTTQ=="
|
||||
"EiCzMVQnCirB85ITj1x9JOEe4zjNnnFIlxuXj9m6kGq1SQ=="
|
||||
)
|
||||
|
||||
# Run the grpcurl command and capture its output
|
||||
output=$(grpcurl -plaintext localhost:8337 quilibrium.node.node.pb.NodeService.GetNetworkInfo)
|
||||
|
||||
# Check if any of the specific peers are in the output
|
||||
visible=false
|
||||
for peer in "${bootstrap_peers[@]}"; do
|
||||
if [[ $output == *"$peer"* ]]; then
|
||||
visible=true
|
||||
echo "You see $peer as a bootstrap peer"
|
||||
else
|
||||
echo "Peer $peer not found"
|
||||
fi
|
||||
done
|
||||
|
||||
if $visible ; then
|
||||
echo "Great, your node is visible!"
|
||||
else
|
||||
echo "Sorry, your node is not visible. Please restart your node and try again."
|
||||
fi
|
||||
echo ""
|
||||
echo "⌛️ Checking visibility..."
|
||||
wget --no-cache -O - "$CHECK_VISIBILITY_URL" | bash
|
||||
}
|
||||
|
||||
node_info() {
|
||||
@ -397,7 +86,6 @@ node_info() {
|
||||
node_logs() {
|
||||
echo "Getting node logs..."
|
||||
sudo journalctl -u ceremonyclient.service -f --no-hostname -o cat
|
||||
# sudo journalctl -u ceremonyclient.service -n 100 --no-hostname -o cat
|
||||
}
|
||||
|
||||
restart_node() {
|
||||
@ -415,9 +103,8 @@ stop_node() {
|
||||
# Menu
|
||||
while true; do
|
||||
clear
|
||||
echo "This script is made with ❤️ by 0xOzgur.eth @ https://quilibrium.space"
|
||||
echo "This script is made with ❤️ by 0xOzgur @ https://quilibrium.space"
|
||||
echo "Welcome to Quilibrium for Dummies!"
|
||||
|
||||
echo "
|
||||
_____ _ _ _ _ _
|
||||
/ ___ \ (_) (_) | (_)
|
||||
@ -450,10 +137,10 @@ echo "
|
||||
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 "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
|
||||
@ -473,4 +160,4 @@ echo "
|
||||
esac
|
||||
echo ""
|
||||
read -n 1 -s -r -p "Press any key to continue"
|
||||
done
|
||||
done
|
||||
|
||||
221
update/update.sh
221
update/update.sh
@ -1,29 +1,213 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set the version number
|
||||
VERSION="1.4.20"
|
||||
|
||||
VERSION="2.0.4.1"
|
||||
qClientVERSION="2.0.4.1"
|
||||
|
||||
|
||||
# Step 0: Welcome
|
||||
echo "This script is made with ❤️ by https://quilibrium.space @ 0xOzgur.eth for scalepod.io"
|
||||
sleep 2 # Add a 2-second delay
|
||||
echo "This script is made with ❤️ by 0xOzgur @ https://quilibrium.space"
|
||||
echo "⏳Enjoy and sit back while you are upgrading your Quilibrium Node to v$VERSION!"
|
||||
echo "The script is prepared for Ubuntu machines. If you are using another operating system, please check the compatibility of the script."
|
||||
echo "⏳Processing..."
|
||||
sleep 5 # Add a 5-second delay
|
||||
|
||||
# Stop the ceremonyclient service
|
||||
service ceremonyclient stop
|
||||
echo "Updating node..."
|
||||
service ceremonyclient stop
|
||||
echo "⏳ Stopping the ceremonyclient service if it exists..."
|
||||
if systemctl is-active --quiet ceremonyclient; then
|
||||
if sudo systemctl stop ceremonyclient; then
|
||||
echo "🔴 Service stopped successfully."
|
||||
echo
|
||||
else
|
||||
echo "❌ Failed to stop the ceremonyclient service." >&2
|
||||
echo
|
||||
fi
|
||||
else
|
||||
echo "ℹ️ Ceremonyclient service is not active or does not exist."
|
||||
echo
|
||||
fi
|
||||
sleep 1
|
||||
|
||||
# Step 1:Download Binary
|
||||
# apt install cpulimit -y
|
||||
# apt install gawk -y #incase it is not installed
|
||||
|
||||
# Download Binary
|
||||
echo "⏳ Downloading New Release v$VERSION"
|
||||
cd ~/ceremonyclient
|
||||
git remote set-url origin https://github.com/QuilibriumNetwork/ceremonyclient.git
|
||||
git checkout main
|
||||
git branch -D release
|
||||
git pull
|
||||
git checkout release-cdn
|
||||
git checkout release
|
||||
echo "✅ Github repo updated to the latest changes successfully."
|
||||
echo
|
||||
|
||||
#==========================
|
||||
# NODE BINARY DOWNLOAD
|
||||
#==========================
|
||||
|
||||
get_os_arch() {
|
||||
local os=$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||
local arch=$(uname -m)
|
||||
|
||||
case "$os" in
|
||||
linux|darwin) ;;
|
||||
*) echo "Unsupported operating system: $os" >&2; return 1 ;;
|
||||
esac
|
||||
|
||||
case "$arch" in
|
||||
x86_64|amd64) arch="amd64" ;;
|
||||
arm64|aarch64) arch="arm64" ;;
|
||||
*) echo "Unsupported architecture: $arch" >&2; return 1 ;;
|
||||
esac
|
||||
|
||||
echo "${os}-${arch}"
|
||||
}
|
||||
|
||||
# Get the current OS and architecture
|
||||
OS_ARCH=$(get_os_arch)
|
||||
|
||||
# Base URL for the Quilibrium releases
|
||||
RELEASE_FILES_URL="https://releases.quilibrium.com/release"
|
||||
|
||||
# Fetch the list of files from the release page
|
||||
# Updated regex to allow for an optional fourth version number
|
||||
RELEASE_FILES=$(curl -s $RELEASE_FILES_URL | grep -oE "node-[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?-${OS_ARCH}(\.dgst)?(\.sig\.[0-9]+)?")
|
||||
|
||||
# Change to the download directory
|
||||
cd ~/ceremonyclient/node
|
||||
|
||||
# Download each file
|
||||
for file in $RELEASE_FILES; do
|
||||
echo "Downloading $file..."
|
||||
curl -L -o "$file" "https://releases.quilibrium.com/$file"
|
||||
|
||||
# Check if the download was successful
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Successfully downloaded $file"
|
||||
# Check if the file is the base binary (without .dgst or .sig suffix)
|
||||
if [[ $file =~ ^node-[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?-${OS_ARCH}$ ]]; then
|
||||
echo "Making $file executable..."
|
||||
chmod +x "$file"
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Successfully made $file executable"
|
||||
else
|
||||
echo "Failed to make $file executable"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "Failed to download $file"
|
||||
fi
|
||||
|
||||
echo "------------------------"
|
||||
done
|
||||
|
||||
echo "✅ Node binary download completed."
|
||||
|
||||
|
||||
|
||||
# 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
|
||||
|
||||
get_os_arch() {
|
||||
local os=$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||
local arch=$(uname -m)
|
||||
|
||||
case "$os" in
|
||||
linux|darwin) ;;
|
||||
*) echo "Unsupported operating system: $os" >&2; return 1 ;;
|
||||
esac
|
||||
|
||||
case "$arch" in
|
||||
x86_64|amd64) arch="amd64" ;;
|
||||
arm64|aarch64) arch="arm64" ;;
|
||||
*) echo "Unsupported architecture: $arch" >&2; return 1 ;;
|
||||
esac
|
||||
|
||||
echo "${os}-${arch}"
|
||||
}
|
||||
|
||||
# Step 4:Update qClient
|
||||
|
||||
# Get the current OS and architecture
|
||||
OS_ARCH=$(get_os_arch)
|
||||
|
||||
# Base URL for the Quilibrium releases
|
||||
BASE_URL="https://releases.quilibrium.com/qclient-release"
|
||||
|
||||
# Fetch the list of files from the release page
|
||||
FILES=$(curl -s $BASE_URL | grep -oE "qclient-[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?-${OS_ARCH}(\.dgst)?(\.sig\.[0-9]+)?")
|
||||
|
||||
# Change to the download directory
|
||||
cd ~/ceremonyclient/node
|
||||
|
||||
# Download each file
|
||||
for file in $FILES; do
|
||||
echo "Downloading $file..."
|
||||
wget "https://releases.quilibrium.com/$file"
|
||||
|
||||
# Check if the download was successful
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Successfully downloaded $file"
|
||||
else
|
||||
echo "❌ Error: Failed to download $file"
|
||||
echo "Your node will still work, but you'll need to install the qclient manually later if needed."
|
||||
fi
|
||||
|
||||
echo "------------------------"
|
||||
done
|
||||
|
||||
chmod +x qclient*
|
||||
echo "✅ qClient binary downloaded and configured successfully."
|
||||
|
||||
echo
|
||||
|
||||
# Get the current user's home directory
|
||||
HOME=$(eval echo ~$HOME_DIR)
|
||||
|
||||
# Use the home directory in the path
|
||||
NODE_PATH="$HOME/ceremonyclient/node"
|
||||
EXEC_START="$NODE_PATH/release_autorun.sh"
|
||||
EXEC_START="$NODE_PATH/$NODE_BINARY"
|
||||
|
||||
# Step 6:Create Ceremonyclient Service
|
||||
echo "⏳ Creating Ceremonyclient Service"
|
||||
sleep 2 # Add a 2-second delay
|
||||
|
||||
# Check if the file exists before attempting to remove it
|
||||
if [ -f "/lib/systemd/system/ceremonyclient.service" ]; then
|
||||
# If the file exists, remove it
|
||||
rm /lib/systemd/system/ceremonyclient.service
|
||||
echo "ceremonyclient.service file removed."
|
||||
else
|
||||
# If the file does not exist, inform the user
|
||||
echo "ceremonyclient.service file does not exist. No action taken."
|
||||
fi
|
||||
|
||||
# Step 3:Re-Create Ceremonyclient Service
|
||||
rm /lib/systemd/system/ceremonyclient.service
|
||||
sudo tee /lib/systemd/system/ceremonyclient.service > /dev/null <<EOF
|
||||
[Unit]
|
||||
Description=Ceremony Client Go App Service
|
||||
@ -34,15 +218,22 @@ Restart=always
|
||||
RestartSec=5s
|
||||
WorkingDirectory=$NODE_PATH
|
||||
ExecStart=$EXEC_START
|
||||
KillSignal=SIGINT
|
||||
TimeoutStopSec=75s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
# Step 3: Update the ExecStart line in the Ceremonyclient Service file
|
||||
# sudo sed -i "s|ExecStart=.*|ExecStart=$EXEC_START|" /lib/systemd/system/ceremonyclient.service
|
||||
|
||||
# Step 4:Start the ceremonyclient service
|
||||
# Start the ceremonyclient service
|
||||
echo "✅ Starting Ceremonyclient Service"
|
||||
sleep 2 # Add a 2-second delay
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable ceremonyclient
|
||||
sudo service ceremonyclient start
|
||||
sudo systemctl start ceremonyclient
|
||||
|
||||
# See the logs of the ceremonyclient service
|
||||
echo "🎉 Welcome to Quilibrium Ceremonyclient v$VERSION"
|
||||
echo "⏳ Please let it flow node logs at least 5 minutes then you can press CTRL + C to exit the logs."
|
||||
sleep 2 # Add a 2-second delay
|
||||
sudo journalctl -u ceremonyclient.service -f --no-hostname -o cat
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Step 0: Welcome
|
||||
echo "This script is made with ❤️ by 0xOzgur.eth"
|
||||
echo "⏳Enjoy and sit back while you are upgrading your Quilibrium Node to v1.4.18!"
|
||||
|
||||
echo "This script is made with ❤️ by 0xOzgur"
|
||||
echo "⏳Enjoy and sit back while you are upgrading your Quilibrium Node to v2.0!"
|
||||
|
||||
echo "⏳Processing..."
|
||||
sleep 10 # Add a 10-second delay
|
||||
|
||||
@ -10,7 +12,9 @@ sleep 10 # Add a 10-second delay
|
||||
service ceremonyclient stop
|
||||
|
||||
# Step 1:Download Binary
|
||||
echo "⏳ Downloading New Release v1.4.18"
|
||||
|
||||
echo "⏳ Downloading New Release v2.0"
|
||||
|
||||
cd ~/ceremonyclient
|
||||
git pull
|
||||
git checkout release-cdn
|
||||
@ -18,15 +22,17 @@ git checkout release-cdn
|
||||
# Step 7:Build Docker Container
|
||||
echo "⏳Building Ceremonyclient Container"
|
||||
sleep 2 # Add a 2-second delay
|
||||
docker build --build-arg GIT_COMMIT=$(git log -1 --format=%h) -t quilibrium -t quilibrium:1.4.18 .
|
||||
|
||||
docker build --build-arg GIT_COMMIT=$(git log -1 --format=%h) -t quilibrium -t quilibrium:2.0 .
|
||||
|
||||
|
||||
# Step 8:Run Ceremonyclient Container
|
||||
echo "✅Running Ceremonyclient Container"
|
||||
sleep 2 # Add a 2-second delay
|
||||
docker compose up -d
|
||||
docker compose -f docker/docker-compose.yml up -d
|
||||
|
||||
# Step 9:Logs Ceremonyclient Container
|
||||
echo "🎉Welcome to Quilibrium Ceremonyclient"
|
||||
echo "⏳Please let it flow node logs at least 5 minutes then you can press CTRL + C to exit the logs."
|
||||
sleep 5 # Add a 5-second delay
|
||||
docker compose logs -f -n, --tail 100
|
||||
docker compose -f docker/docker-compose.yml logs -f -n, --tail 100
|
||||
@ -1,49 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set the version number
|
||||
VERSION="1.4.18"
|
||||
|
||||
# Step 0: Welcome
|
||||
echo "This script is made with ❤️ by https://quilibrium.space @ 0xOzgur.eth for scalepod.io"
|
||||
sleep 2 # Add a 2-second delay
|
||||
|
||||
# Stop the ceremonyclient service
|
||||
service ceremonyclient stop
|
||||
|
||||
# Step 1:Download Binary
|
||||
cd ~/ceremonyclient
|
||||
git remote set-url origin https://source.quilibrium.com/quilibrium/ceremonyclient.git
|
||||
git pull
|
||||
git checkout release-cdn
|
||||
|
||||
# Get the current user's home directory
|
||||
HOME=$(eval echo ~$HOME_DIR)
|
||||
|
||||
# Use the home directory in the path
|
||||
NODE_PATH="$HOME/ceremonyclient/node"
|
||||
EXEC_START="$NODE_PATH/node-$VERSION-linux-arm64"
|
||||
|
||||
# Step 3:Re-Create Ceremonyclient Service
|
||||
rm /lib/systemd/system/ceremonyclient.service
|
||||
sudo tee /lib/systemd/system/ceremonyclient.service > /dev/null <<EOF
|
||||
[Unit]
|
||||
Description=Ceremony Client Go App Service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=5s
|
||||
WorkingDirectory=$NODE_PATH
|
||||
ExecStart=$EXEC_START
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
# Step 3: Update the ExecStart line in the Ceremonyclient Service file
|
||||
# sudo sed -i "s|ExecStart=.*|ExecStart=$EXEC_START|" /lib/systemd/system/ceremonyclient.service
|
||||
|
||||
# Step 4:Start the ceremonyclient service
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable ceremonyclient
|
||||
sudo service ceremonyclient start
|
||||
40
visibility_check.sh
Normal file
40
visibility_check.sh
Normal file
@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Step 0: Welcome
|
||||
echo "This script is made with ❤️ by 0xOzgur @ https://quilibrium.space"
|
||||
echo "⏳You need GO and grpcurl installed and configured on your machine to run this script. If you don't have them, please install and configure grpcurl first."
|
||||
echo "You can find the installation instructions at https://docs.quilibrium.space/installing-prerequisites"
|
||||
echo "⏳Processing..."
|
||||
sleep 5 # Add a 5-second delay
|
||||
|
||||
# Bootstrap peer list
|
||||
bootstrap_peers=(
|
||||
"EiDpYbDwT2rZq70JNJposqAC+vVZ1t97pcHbK8kr5G4ZNA=="
|
||||
"EiCcVN/KauCidn0nNDbOAGMHRZ5psz/lthpbBeiTAUEfZQ=="
|
||||
"EiDhVHjQKgHfPDXJKWykeUflcXtOv6O2lvjbmUnRrbT2mw=="
|
||||
"EiDHhTNA0yf07ljH+gTn0YEk/edCF70gQqr7QsUr8RKbAA=="
|
||||
"EiAnwhEcyjsHiU6cDCjYJyk/1OVsh6ap7E3vDfJvefGigw=="
|
||||
"EiB75ZnHtAOxajH2hlk9wD1i9zVigrDKKqYcSMXBkKo4SA=="
|
||||
"EiDEYNo7GEfMhPBbUo+zFSGeDECB0RhG0GfAasdWp2TTTQ=="
|
||||
"EiCzMVQnCirB85ITj1x9JOEe4zjNnnFIlxuXj9m6kGq1SQ=="
|
||||
)
|
||||
|
||||
# Run the grpcurl command and capture its output
|
||||
output=$(grpcurl -plaintext localhost:8337 quilibrium.node.node.pb.NodeService.GetNetworkInfo)
|
||||
|
||||
# Check if any of the specific peers are in the output
|
||||
visible=false
|
||||
for peer in "${bootstrap_peers[@]}"; do
|
||||
if [[ $output == *"$peer"* ]]; then
|
||||
visible=true
|
||||
echo "You see $peer as a bootstrap peer"
|
||||
else
|
||||
echo "Peer $peer not found"
|
||||
fi
|
||||
done
|
||||
|
||||
if $visible ; then
|
||||
echo "Great, your node is visible!"
|
||||
else
|
||||
echo "Sorry, your node is not visible. Please restart your node and wait 15 minutes then try again."
|
||||
fi
|
||||
Loading…
Reference in New Issue
Block a user