From d2688fcd87d3ccacea2c258880d2612e4e279731 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Wed, 12 Jun 2024 20:01:36 +0300 Subject: [PATCH] Variables update --- install/install_quilibrium_service.sh | 29 +++++++--------- profile/.profile | 13 ++++--- update_arm64.sh | 49 --------------------------- 3 files changed, 21 insertions(+), 70 deletions(-) delete mode 100644 update_arm64.sh diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index 9060654..04a9e65 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -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) diff --git a/profile/.profile b/profile/.profile index 749ff93..9c8debf 100644 --- a/profile/.profile +++ b/profile/.profile @@ -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' \ No newline at end of file +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"' \ No newline at end of file diff --git a/update_arm64.sh b/update_arm64.sh deleted file mode 100644 index 8af5786..0000000 --- a/update_arm64.sh +++ /dev/null @@ -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 <