Compare commits

...

72 Commits

Author SHA1 Message Date
f2c938231f 更新 quilibrium_for_dummies.sh 2024-11-24 20:28:40 +08:00
0xOzgur
2312eafac9 v2.0.4.1 2024-11-24 09:04:56 +03:00
0xOzgur
f3275c41b5 v2.0.4 2024-11-19 10:28:12 +03:00
0xOzgur
ff573b2a03 node-monitor added 2024-11-16 13:41:10 +03:00
0xOzgur
ecefd31235 v2.0.3.4 2024-11-13 23:57:25 +03:00
0xOzgur
a02b6eb574 qclient version fix 2024-11-12 12:59:24 +03:00
0xOzgur
209ad4660b node version 2.0.3.3 2024-11-12 12:58:37 +03:00
0xOzgur
c827fa90cf node version 2.0.3.2 2024-11-12 08:22:15 +03:00
0xOzgur
0823ee32ec node version 2.0.3.1 2024-11-11 08:40:08 +03:00
0xOzgur
7d5b487215 v2.0.3 2024-11-10 11:01:29 +03:00
0xOzgur
9b14d5a520 VERSION="2.0.3-b7-testnet" 2024-11-09 08:46:50 +03:00
0xOzgur
9125cffbaa git remove at Testnet 2024-11-08 14:31:30 +03:00
0xOzgur
988b8a887c VERSION="2.0.3-b6-testnet" 2024-11-08 14:24:39 +03:00
0xOzgur
a1451a909d version update 2024-11-08 12:03:35 +03:00
0xOzgur
d50cf856cd testnet update 2024-11-08 08:42:17 +03:00
0xOzgur
dcf3003f08 v2.0.2.4 2024-11-01 10:11:26 +03:00
0xOzgur
11f4113474 client download path changed 2024-10-30 00:30:38 +03:00
0xOzgur
f5cf64efc9 v2.0.2.3 2024-10-29 10:25:47 +03:00
0xOzgur
548702b50b translate 2024-10-28 19:08:45 +03:00
0xOzgur
c33614b635 adds 2024-10-28 19:08:01 +03:00
0xOzgur
48172426e0 increment check script 2024-10-28 00:58:49 +03:00
0xOzgur
c6d915c53e install bugfix 2024-10-27 18:31:26 +03:00
0xOzgur
5dc914c24a v2.0.2.2 2024-10-27 12:44:04 +03:00
0xOzgur
1ec19b3019 v2.0.2.1 2024-10-26 16:34:55 +03:00
0xOzgur
d57a356b90 Quickfix v2.0.2 2024-10-25 23:15:37 +03:00
0xOzgur
4d28144a55 v2.0.2 Update 2024-10-25 22:52:49 +03:00
0xOzgur
9ed4fa3d4e v2.0.1 2024-10-23 23:03:10 +03:00
0xOzgur
1f2eaa6975 testnet bugfix 2024-10-19 14:04:52 +03:00
0xOzgur
80aef0962a testnet script added 2024-10-19 13:55:23 +03:00
0xOzgur
6782c1e13d v2.0.0.8 2024-10-18 10:43:58 +03:00
0xOzgur
39aaf629a2 Node Version 2.0.0.7 2024-10-17 11:26:57 +03:00
0xOzgur
4afa56731b v2.0.0.6 2024-10-17 08:59:21 +03:00
0xOzgur
802ba45c34 v2.0.0.5 2024-10-17 08:02:15 +03:00
0xOzgur
72852c3cd7 v2.0.0.4 2024-10-16 01:50:58 +03:00
0xOzgur
787bab2286 v2.0.0.5 2024-10-16 01:11:30 +03:00
0xOzgur
ed4e3c6f22 v2.0.0.4 update 2024-10-16 00:03:45 +03:00
0xOzgur
db9661f08e bugfix 2024-10-15 21:28:13 +03:00
0xOzgur
53ab479a2a bugfix 2024-10-15 21:27:52 +03:00
0xOzgur
b026ae6b0b bugfix 2024-10-15 21:21:43 +03:00
0xOzgur
19bbde5494 profile update 2024-10-15 21:19:13 +03:00
0xOzgur
a34ad7f4fe VERSION="2.0.0.3"
qClientVERSION="2.0.0.2"
2024-10-15 08:45:10 +03:00
0xOzgur
8ea3d5a7c8 Merge branch 'main' of https://github.com/0xOzgur/QuilibriumAutoInstaller 2024-10-14 21:39:34 +03:00
0xOzgur
29552953a2 Node-2.0.0.2 qClient-2.0.0.1 update 2024-10-14 21:39:28 +03:00
0xOzgur
5332ed8b7b
Update quilibrium_for_dummies.sh 2024-10-14 19:41:05 +03:00
0xOzgur
e1796b286b Final cut 2024-10-14 13:59:08 +03:00
0xOzgur
7e4149e6de download binaries 2024-10-14 13:46:59 +03:00
0xOzgur
23f096aef3 node binary fix 2024-10-14 13:38:29 +03:00
0xOzgur
7183808a57 node path 2024-10-14 13:34:26 +03:00
0xOzgur
4dc6475dea service fix again 2024-10-14 13:34:10 +03:00
0xOzgur
d179135de5 service fix 2024-10-14 13:31:07 +03:00
0xOzgur
d0f4d5e192 Revert "service fix"
This reverts commit 90cd1450a0.
2024-10-14 13:30:37 +03:00
0xOzgur
90cd1450a0 service fix 2024-10-14 13:27:33 +03:00
0xOzgur
effb4a30d4 bugfix 2024-10-14 13:24:32 +03:00
0xOzgur
475a4d9b8b update.sh 2024-10-14 12:58:06 +03:00
0xOzgur
9df893b595 node binary fix 2024-10-14 12:43:30 +03:00
0xOzgur
bb5e7e28f5 qclient fix 2024-10-14 12:43:01 +03:00
0xOzgur
3c3a255250 release_autorun 2024-10-14 11:25:12 +03:00
0xOzgur
c4be2044bc fix 2024-10-14 11:16:54 +03:00
0xOzgur
1b6d04e02c baseurl fix 2024-10-14 11:15:05 +03:00
0xOzgur
b15a557596 osarch bugfix 2024-10-14 11:11:53 +03:00
0xOzgur
297423fc32
Merge pull request #27 from 0xOzgur/v2.0
V2.0
2024-10-14 11:10:13 +03:00
0xOzgur
159dc19467 Merge branch 'v2.0' of https://github.com/0xOzgur/QuilibriumAutoInstaller into v2.0 2024-10-14 11:09:48 +03:00
0xOzgur
448cc5d4c3 arch bugfix 2024-10-14 11:09:39 +03:00
0xOzgur
8e2e026010
Update README.md 2024-10-14 11:06:00 +03:00
0xOzgur
e5c57e3adf
Merge pull request #23 from 0xOzgur/v2.0
v2.0 Updates
2024-10-14 10:49:41 +03:00
0xOzgur
717709978b
Merge branch 'main' into v2.0 2024-10-14 10:49:30 +03:00
0xOzgur
67d41bfcb6 v2.0.0.1 2024-10-14 10:44:12 +03:00
0xOzgur
e5045d14f8 v2.0.0 update 2024-10-12 22:55:59 +03:00
0xOzgur
c8ea7a9e57
Merge pull request #26 from 0xOzgur/v1.4.21.1
service edit for SIGINT
2024-10-12 13:52:24 +03:00
0xOzgur
3b64d6b3b9 service update SIGINT 2024-10-11 21:39:04 +03:00
0xOzgur
d13ce008e7
Merge pull request #24 from 0xOzgur/v1.4.21.1
v1.4.21.1 Patch update
2024-08-22 12:22:50 +03:00
0xOzgur
34bd27e6ed v2.0 Updates 2024-08-07 14:26:26 +03:00
16 changed files with 849 additions and 116 deletions

View File

@ -6,9 +6,8 @@ This script is an all-in-one quil usage software for newcomers.
For installation and first run, please run
wget https://raw.githubusercontent.com/0xOzgur/QuilibriumTools/main/quilibrium_for_dummies.sh
chmod u+x quilibrium_for_dummies.sh
./quilibrium_for_dummies.sh
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;
@ -18,8 +17,7 @@ After first run, when you need to reach your node, you need to run only;
**Autoinstaller Script for Quilibrium as a Service**
Use below command to install v1.4.21.1
Use below command to install v2.0
wget -O - https://raw.githubusercontent.com/0xOzgur/QuilibriumTools/main/install/install_quilibrium_service.sh | bash
@ -27,7 +25,8 @@ Use below command to install v1.4.21.1
**Autoupdater**
If you need to update your node from previous version to 1.4.21.1, apply below command
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

View File

@ -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

View File

@ -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
View 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

View File

@ -1,31 +1,73 @@
#!/bin/bash
# Set the version number
VERSION="1.4.21.1"
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-$VERSION-linux-amd64"
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-$VERSION-darwin-amd64"
GO_BINARY="go1.22.44.linux-amd64.tar.gz"
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-$VERSION-linux-arm64"
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-$VERSION-darwin-arm64"
GO_BINARY="go1.22.4.linux-arm64.tar.gz"
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..."

View File

@ -3,7 +3,7 @@
cd ~
# Step 0: Welcome
echo "This script is made with ❤️ by 0xOzgur.eth @ https://quilibrium.space "
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!"
@ -121,7 +121,7 @@ git checkout release-cdn
# Build Ceremonyclient qClient
echo "⏳Building qCiient"
sleep 1 # Add a 1-second delay
cd ~/ceremonyclient/client
cd ~/ceremonyclient/node
GOEXPERIMENT=arenas go build -o qclient main.go
# Step 5:Determine the ExecStart line based on the architecture
@ -129,7 +129,7 @@ GOEXPERIMENT=arenas go build -o qclient main.go
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"
# Create Ceremonyclient Service
echo "⏳Creating Ceremonyclient Service"
@ -156,7 +156,7 @@ RestartSec=5s
WorkingDirectory=$NODE_PATH
ExecStart=$EXEC_START
KillSignal=SIGINT
TimeoutStopSec=30s
TimeoutStopSec=75s
[Install]
WantedBy=multi-user.target

View File

@ -3,7 +3,7 @@
cd ~
# Step 0: Welcome
echo "This script is made with ❤️ by 0xOzgur.eth @ https://quilibrium.space"
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
@ -61,7 +61,8 @@ git checkout release-cdn
echo "⏳Building Ceremonyclient Container"
sleep 2 # Add a 2-second delay
docker build --build-arg GIT_COMMIT=$(git log -1 --format=%h) -t quilibrium:1.4.21.1 .1.4.21.1
docker build --build-arg GIT_COMMIT=$(git log -1 --format=%h) -t quilibrium:2.0 .2.0
# Step 8:Run Ceremonyclient Container

View File

@ -1,11 +1,12 @@
#!/bin/bash
# Set the version number
VERSION="1.4.21.1"
VERSION="2.0.4.1"
qClientVERSION="2.0.4.1"
cd ~
# Step 0: Welcome
echo "This script is made with ❤️ by 0xOzgur.eth @ https://quilibrium.space "
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!"
@ -36,15 +37,6 @@ else
echo "git is installed"
fi
# if ! command -v cpulimit &> /dev/null
# then
# echo "cpulimit could not be found"
# echo "Installing cpulimit..."
# su -c "apt update && apt install cpulimit -y"
# else
# echo "cpulimit is installed"
# fi
sudo apt upgrade -y
# Step 2: Adjust network buffer sizes
@ -96,6 +88,70 @@ cd ~/ceremonyclient/
# 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
#==========================
# 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)
@ -105,11 +161,11 @@ 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-1.4.19.1-linux-amd64"
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-1.4.19.1-darwin-arm64"
QCLIENT_BINARY="qclient-$qClientVERSION-darwin-arm64"
fi
elif [ "$ARCH" = "aarch64" ]; then
if [ "$OS" = "Linux" ]; then
@ -118,17 +174,66 @@ elif [ "$ARCH" = "aarch64" ]; then
elif [ "$OS" = "Darwin" ]; then
NODE_BINARY="node-$VERSION-darwin-arm64"
GO_BINARY="go1.22.4.linux-arm64.tar.gz"
QCLIENT_BINARY="qclient-1.4.19.1-linux-arm64"
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
cd ~/ceremonyclient/client
wget https://releases.quilibrium.com/$QCLIENT_BINARY
mv $QCLIENT_BINARY qclient
chmod +x 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
# Step 5:Determine the ExecStart line based on the architecture
# Get the current user's home directory
@ -136,7 +241,7 @@ 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"
@ -163,7 +268,7 @@ RestartSec=5s
WorkingDirectory=$NODE_PATH
ExecStart=$EXEC_START
KillSignal=SIGINT
TimeoutStopSec=30s
TimeoutStopSec=75s
[Install]
WantedBy=multi-user.target

173
install/testnet.sh Normal file
View 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
View 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

View File

@ -28,15 +28,16 @@ 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-1.4.21.1-linux-amd64'
NODE_BINARY='node-2.0-linux-amd64'
elif [ "$OS" = "Darwin" ]; then
NODE_BINARY='node-1.4.21.1-darwin-amd64'
NODE_BINARY='node-2.0-darwin-amd64'
fi
elif [ "$ARCH" = "aarch64" ]; then
if [ "$OS" = "Linux" ]; then
NODE_BINARY='node-1.4.21.1-linux-arm64'
NODE_BINARY='node-2.0-linux-arm64'
elif [ "$OS" = "Darwin" ]; then
NODE_BINARY='node-1.4.21.1-darwin-arm64'
NODE_BINARY='node-2.0-darwin-arm64'
fi
fi

View File

@ -17,23 +17,22 @@ alias wttr='curl wttr.in'
neofetch
# 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 ~'
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 ~'
# 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.21-linux-amd64 -node-info && cd ~"
alias db-console="cd ~/ceremonyclient/node && ./node-1.4.21-linux-amd64 --db-console && cd ~"
alias balance="cd ~/ceremonyclient/node && ./node-1.4.21-linux-amd64 -balance && 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 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"

View File

@ -7,7 +7,8 @@ clear
# Set the version number
VERSION="1.4.21.1"
VERSION="2.0.4.1"
qClientVERSION="2.0.4.1"
# Determine the ExecStart line based on the architecture
@ -19,11 +20,11 @@ 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-$VERSION-linux-amd64"
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-$VERSION-darwin-arm64"
QCLIENT_BINARY="qclient-$qClientVERSION-darwin-arm64"
fi
elif [ "$ARCH" = "aarch64" ]; then
if [ "$OS" = "Linux" ]; then
@ -32,17 +33,17 @@ elif [ "$ARCH" = "aarch64" ]; then
elif [ "$OS" = "Darwin" ]; then
NODE_BINARY="node-$VERSION-darwin-arm64"
GO_BINARY="go1.22.4.linux-arm64.tar.gz"
QCLIENT_BINARY="qclient-$VERSION-linux-arm64"
QCLIENT_BINARY="qclient-$qClientVERSION-linux-arm64"
fi
fi
# URLs for scripts
UPDATE_URL="https://raw.githubusercontent.com/0xOzgur/QuilibriumTools/main/update.sh"
PREREQUISITES_URL="https://raw.githubusercontent.com/0xOzgur/QuilibriumTools/main/install/Install_prerequisites.sh"
NODE_INSTALL_URL="https://raw.githubusercontent.com/0xOzgur/QuilibriumTools/main/install/install_quilibrium_service.sh"
GRPCURL_CONFIG_URL="https://raw.githubusercontent.com/0xOzgur/QuilibriumTools/main/configuration/config.sh"
NODE_UPDATE_URL="https://raw.githubusercontent.com/0xOzgur/QuilibriumTools/main/update/update.sh"
CHECK_VISIBILITY_URL="https://raw.githubusercontent.com/0xOzgur/QuilibriumTools/main/visibility_check.sh"
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() {
@ -102,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 "
_____ _ _ _ _ _
/ ___ \ (_) (_) | (_)
@ -160,4 +160,4 @@ echo "
esac
echo ""
read -n 1 -s -r -p "Press any key to continue"
done
done

View File

@ -1,9 +1,12 @@
#!/bin/bash
VERSION="1.4.21.1"
VERSION="2.0.4.1"
qClientVERSION="2.0.4.1"
# Step 0: Welcome
echo "This script is made with ❤️ by 0xOzgur.eth @ https://quilibrium.space"
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..."
@ -12,6 +15,20 @@ sleep 5 # Add a 5-second delay
# Stop the ceremonyclient service
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
# apt install cpulimit -y
# apt install gawk -y #incase it is not installed
@ -24,6 +41,72 @@ git checkout main
git branch -D release
git pull
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)
@ -34,11 +117,11 @@ 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-1.4.19.1-linux-amd64"
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-1.4.19.1-darwin-arm64"
QCLIENT_BINARY="qclient-$qClientVERSION-darwin-arm64"
fi
elif [ "$ARCH" = "aarch64" ]; then
if [ "$OS" = "Linux" ]; then
@ -47,33 +130,85 @@ elif [ "$ARCH" = "aarch64" ]; then
elif [ "$OS" = "Darwin" ]; then
NODE_BINARY="node-$VERSION-darwin-arm64"
GO_BINARY="go1.22.4.linux-arm64.tar.gz"
QCLIENT_BINARY="qclient-1.4.19.1-linux-arm64"
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
echo "Updating qClient"
sleep 1 # Add a 1-second delay
cd ~/ceremonyclient/client
rm -f qclient
wget https://releases.quilibrium.com/$QCLIENT_BINARY
mv $QCLIENT_BINARY qclient
chmod +x 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"
# Re-Create Ceremonyclient Service
echo "⏳ Re-Creating Ceremonyclient Service"
# Step 6:Create Ceremonyclient Service
echo "⏳ 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
# 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
@ -84,37 +219,21 @@ RestartSec=5s
WorkingDirectory=$NODE_PATH
ExecStart=$EXEC_START
KillSignal=SIGINT
TimeoutStopSec=30s
TimeoutStopSec=75s
[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
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 5 # Add a 5-second delay
sleep 2 # Add a 2-second delay
sudo journalctl -u ceremonyclient.service -f --no-hostname -o cat

View File

@ -1,9 +1,9 @@
#!/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.21.1!"
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
@ -13,7 +13,7 @@ service ceremonyclient stop
# Step 1:Download Binary
echo "⏳ Downloading New Release v1.4.21.1"
echo "⏳ Downloading New Release v2.0"
cd ~/ceremonyclient
git pull
@ -23,7 +23,7 @@ git checkout release-cdn
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.21.1 .
docker build --build-arg GIT_COMMIT=$(git log -1 --format=%h) -t quilibrium -t quilibrium:2.0 .
# Step 8:Run Ceremonyclient Container

View File

@ -1,7 +1,7 @@
#!/bin/bash
# Step 0: Welcome
echo "This script is made with ❤️ by 0xOzgur.eth @ https://quilibrium.space"
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..."