Variables update

This commit is contained in:
0xOzgur 2024-06-12 20:01:36 +03:00
parent 9b3ed5eed8
commit d2688fcd87
3 changed files with 21 additions and 70 deletions

View File

@ -1,5 +1,6 @@
#!/bin/bash
# Set the version number
VERSION="1.4.19"
cd ~
# Step 0: Welcome
echo "This script is made with ❤️ by 0xOzgur.eth @ https://quilibrium.space "
@ -33,17 +34,16 @@ 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
# 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
1.4.19
# Step 2: Adjust network buffer sizes
echo "Adjusting network buffer sizes..."
@ -85,17 +85,14 @@ 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
until git clone https://github.com/QuilibriumNetwork/ceremonyclient.git || git clone https://source.quilibrium.com/quilibrium/ceremonyclient.git; do
echo "Git clone failed, retrying..."
sleep 2
done
fi
cd ~/ceremonyclient/
git 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
# Set the version number
VERSION="1.4.19"
# 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
# Get the system architecture
# ARCH=$(uname -m)

View File

@ -17,6 +17,9 @@ alias wttr='curl wttr.in'
neofetch
# Version of the node binary to use
VERSION="1.4.19"
# Get system information
ARCH=$(uname -m)
OS=$(uname -s)
@ -24,15 +27,15 @@ 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.19-linux-amd64'
NODE_BINARY='node-$VERSION-linux-amd64'
elif [ "$OS" = "Darwin" ]; then
NODE_BINARY='node-1.4.19-darwin-amd64'
NODE_BINARY='node-$VERSION-darwin-amd64'
fi
elif [ "$ARCH" = "aarch64" ]; then
if [ "$OS" = "Linux" ]; then
NODE_BINARY='node-1.4.19-linux-arm64'
NODE_BINARY='node-$VERSION-linux-arm64'
elif [ "$OS" = "Darwin" ]; then
NODE_BINARY='node-1.4.19-darwin-arm64'
NODE_BINARY='node-$VERSION-darwin-arm64'
fi
fi
@ -55,4 +58,4 @@ 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 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"'

View File

@ -1,49 +0,0 @@
#!/bin/bash
# Set the version number
VERSION="1.4.19"
# 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