Compare commits

..

18 Commits

Author SHA1 Message Date
0xOzgur
20312de8db v1.4.20 update 2024-06-22 12:15:06 +03:00
0xOzgur
c6ed8f21dc fix 2024-06-15 14:56:05 +03:00
0xOzgur
67e17540dd restructure 2024-06-15 14:55:40 +03:00
0xOzgur
fd96cca24b gitignore 2024-06-15 14:52:48 +03:00
0xOzgur
f44601975e gitignore 2024-06-15 14:51:47 +03:00
0xOzgur
f1a68dc61b gitnore 2024-06-08 19:19:41 +03:00
0xOzgur
e51c636187 bugfix 2024-06-08 17:02:46 +03:00
0xOzgur
e89f308fe1 v1.4.19 2024-06-08 14:30:04 +03:00
0xOzgur
9fd70e67c8 Version update 2024-06-08 11:06:20 +03:00
0xOzgur
03f290767f gitignore 2024-06-08 11:01:40 +03:00
0xOzgur
cde83f14e0 bugfix 2024-05-30 15:42:04 +03:00
0xOzgur
c4506d565b New source added 2024-05-30 15:34:41 +03:00
0xOzgur
dbb7064a8e added arm64 update for scalept 2024-05-30 15:31:04 +03:00
0xOzgur
1de1456273 updated 2024-05-29 21:11:12 +03:00
0xOzgur
23b2d7493b updated 2024-05-29 21:10:39 +03:00
0xOzgur
8765396533 implemented version 2024-05-26 16:40:59 +03:00
0xOzgur
7d621a6353 prunned script for scalepod 2024-05-26 16:29:26 +03:00
0xOzgur
4f6c5f06a2 Branch for scalepod 2024-05-26 16:22:35 +03:00
20 changed files with 543 additions and 1429 deletions

3
.gitignore vendored
View File

@ -9,5 +9,4 @@ backup/backup.sh
backup/backup_ozgur.sh
quilibrium_for_pros.sh
dataworker.py
balance.sh
rsync.sh
balance.sh

View File

@ -1,40 +1,24 @@
# Quilibrium Tools
# QuilibriumAutoInstaller
Autoinstaller Script for Quilibrium as a Service
**Quilibrium for Dummies**
copy the all files at root folder.
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
chmod u+x Install_Quilibrium_Service.sh
chmod u+x config.sh
chmod u+x update.sh
./Install_Quilibrium_Service.sh
After installing your node, kindly wait for 10-15minutes then run config.sh
**Autoinstaller Script for Quilibrium as a Service**
./config.sh
Use below command to install v2.0
Do not forget go make
source ~/.bashrc
wget -O - https://raw.githubusercontent.com/0xOzgur/QuilibriumTools/main/install/install_quilibrium_service.sh | bash
and check
**Autoupdater**
go version
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
after installation.

View File

@ -1,7 +1,7 @@
#!/bin/bash
# Step 0: Welcome
echo "This script is prepared by 0xOzgur"
echo "This script is prepared by 0xOzgur.eth"
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"
echo "This script is prepared by 0xOzgur.eth"
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,196 +0,0 @@
#!/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,156 +0,0 @@
#!/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

View File

@ -1,177 +0,0 @@
#!/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

View File

@ -3,7 +3,7 @@
cd ~
# Step 0: Welcome
echo "This script is made with ❤️ by 0xOzgur @ https://quilibrium.space"
echo "This script is made with ❤️ by 0xOzgur.eth"
echo "⏳Enjoy and sit back while you are building your Quilibrium Ceremony Client!"
echo "⏳Processing..."
sleep 10 # Add a 10-second delay
@ -60,18 +60,15 @@ 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:2.0 .2.0
docker build --build-arg GIT_COMMIT=$(git log -1 --format=%h) -t quilibrium -t quilibrium:1.4.18 .
# Step 8:Run Ceremonyclient Container
echo "✅Running Ceremonyclient Container"
sleep 2 # Add a 2-second delay
docker compose -f docker/docker-compose.yml up -d
docker compose 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 -f docker/docker-compose.yml logs -f -n, --tail 100
docker compose logs -f -n, --tail 100

View File

@ -1,43 +1,17 @@
#!/bin/bash
# Set the version number
VERSION="2.0.4.1"
qClientVERSION="2.0.4.1"
#!/bin/bash -i
cd ~
# Step 0: Welcome
echo "This script is made with ❤️ by 0xOzgur @ https://quilibrium.space "
echo "This script is made with ❤️ by https://quilibrium.space @ 0xOzgur.eth"
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
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 update
sudo apt upgrade -y
sudo apt install git -y
# Step 2: Adjust network buffer sizes
echo "Adjusting network buffer sizes..."
@ -53,210 +27,51 @@ else
fi
sudo sysctl -p
# 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
# Step 3: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://github.com/QuilibriumNetwork/ceremonyclient.git || git clone https://source.quilibrium.com/quilibrium/ceremonyclient.git; do
until git clone https://source.quilibrium.com/quilibrium/ceremonyclient.git; do
echo "Git clone failed, retrying..."
sleep 2
done
fi
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
git checkout release-cdn
#==========================
# NODE BINARY DOWNLOAD
#==========================
# Set the version number
VERSION="1.4.18"
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
# Get the system 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"
# 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."
# 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"
else
# If the file does not exist, inform the user
echo "ceremonyclient.service file does not exist. No action taken."
echo "Unsupported architecture: $ARCH"
exit 1
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
@ -265,25 +80,14 @@ Description=Ceremony Client Go App Service
Type=simple
Restart=always
RestartSec=5s
WorkingDirectory=$NODE_PATH
WorkingDirectory=/root/ceremonyclient/node
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
# Start the ceremonyclient service
sudo service ceremonyclient start

View File

@ -1,173 +0,0 @@
#!/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

View File

@ -1,98 +0,0 @@
#!/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

@ -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,28 +21,7 @@ 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 ~'
@ -51,13 +30,12 @@ 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_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 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'
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'
alias nstop='service ceremonyclient stop'

View File

@ -1,38 +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
# 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"

28
profile/.profile_binary Normal file
View File

@ -0,0 +1,28 @@
# ~/.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'

37
profile/.profile_docker Normal file
View File

@ -0,0 +1,37 @@
# ~/.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'

View File

@ -6,10 +6,7 @@ source ~/.bashrc
clear
# Set the version number
VERSION="2.0.4.1"
qClientVERSION="2.0.4.1"
VERSION="1.4.20"
# Determine the ExecStart line based on the architecture
ARCH=$(uname -m)
@ -19,62 +16,376 @@ OS=$(uname -s)
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"
GO_BINARY="go1.20.14.linux-amd64.tar.gz"
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"
GO_BINARY="go1.20.14.linux-amd64.tar.gz"
fi
elif [ "$ARCH" = "aarch64" ]; then
if [ "$OS" = "Linux" ]; then
NODE_BINARY="node-$VERSION-linux-arm64"
GO_BINARY="go1.22.4.linux-arm64.tar.gz"
GO_BINARY="go1.20.14.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"
GO_BINARY="go1.20.14.linux-arm64.tar.gz"
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 ""
echo "⌛️ Preparing server with necessary apps and settings..."
wget --no-cache -O - "$PREREQUISITES_URL" | bash
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
}
# Install Node
install_node() {
echo ""
echo "⌛️ Installing node as a service..."
wget --no-cache -O - "$NODE_INSTALL_URL" | bash
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"
}
configure_grpcurl() {
echo ""
echo "⌛️ Configuring grpCurl..."
wget --no-cache -O - "$GRPCURL_CONFIG_URL" | bash
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."
}
update_node() {
echo ""
echo "⌛️ Updating node..."
wget --no-cache -O - "$NODE_UPDATE_URL" | bash
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"
}
check_visibility() {
echo ""
echo "⌛️ Checking visibility..."
wget --no-cache -O - "$CHECK_VISIBILITY_URL" | bash
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
}
node_info() {
@ -86,6 +397,7 @@ 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() {
@ -103,8 +415,9 @@ stop_node() {
# Menu
while true; do
clear
echo "This script is made with ❤️ by 0xOzgur @ https://quilibrium.space"
echo "This script is made with ❤️ by 0xOzgur.eth @ https://quilibrium.space"
echo "Welcome to Quilibrium for Dummies!"
echo "
_____ _ _ _ _ _
/ ___ \ (_) (_) | (_)
@ -137,10 +450,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
@ -160,4 +473,4 @@ echo "
esac
echo ""
read -n 1 -s -r -p "Press any key to continue"
done
done

View File

@ -1,213 +1,29 @@
#!/bin/bash
VERSION="2.0.4.1"
qClientVERSION="2.0.4.1"
# Set the version number
VERSION="1.4.20"
# Step 0: Welcome
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
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
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
service ceremonyclient stop
# apt install cpulimit -y
# apt install gawk -y #incase it is not installed
# Download Binary
echo "⏳ Downloading New Release v$VERSION"
# Step 1:Download Binary
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
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
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_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
EXEC_START="$NODE_PATH/release_autorun.sh"
# 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
@ -218,22 +34,15 @@ Restart=always
RestartSec=5s
WorkingDirectory=$NODE_PATH
ExecStart=$EXEC_START
KillSignal=SIGINT
TimeoutStopSec=75s
[Install]
WantedBy=multi-user.target
EOF
# Start the ceremonyclient service
echo "✅ Starting Ceremonyclient Service"
sleep 2 # Add a 2-second delay
# 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 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
sudo service ceremonyclient start

View File

@ -1,10 +1,8 @@
#!/bin/bash
# Step 0: Welcome
echo "This script is made with ❤️ by 0xOzgur"
echo "⏳Enjoy and sit back while you are upgrading your Quilibrium Node to v2.0!"
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 "⏳Processing..."
sleep 10 # Add a 10-second delay
@ -12,9 +10,7 @@ sleep 10 # Add a 10-second delay
service ceremonyclient stop
# Step 1:Download Binary
echo "⏳ Downloading New Release v2.0"
echo "⏳ Downloading New Release v1.4.18"
cd ~/ceremonyclient
git pull
git checkout release-cdn
@ -22,17 +18,15 @@ 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:2.0 .
docker build --build-arg GIT_COMMIT=$(git log -1 --format=%h) -t quilibrium -t quilibrium:1.4.18 .
# Step 8:Run Ceremonyclient Container
echo "✅Running Ceremonyclient Container"
sleep 2 # Add a 2-second delay
docker compose -f docker/docker-compose.yml up -d
docker compose 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 -f docker/docker-compose.yml logs -f -n, --tail 100
docker compose logs -f -n, --tail 100

49
update/update_arm64.sh Normal file
View File

@ -0,0 +1,49 @@
#!/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

View File

@ -1,40 +0,0 @@
#!/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