From 439b9abd2c2465727ddb14db2dd8bcbd37801b55 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sun, 26 May 2024 14:33:24 +0300 Subject: [PATCH 01/15] sudo test --- install/install_quilibrium_service.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index f601eab..f9cfe49 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -14,7 +14,7 @@ echo "⏳Processing..." sleep 2 # Add a 2-second delay apt update apt upgrade -y -apt install sudo -y #for non root Debian OS +#apt install sudo -y #for non root Debian OS apt install git -y # Step 2: Adjust network buffer sizes @@ -22,14 +22,14 @@ 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 + echo -e "\n# Change made to increase buffer sizes for better network performance for ceremonyclient\nnet.core.rmem_max=600000000" | 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 + echo -e "\n# Change made to increase buffer sizes for better network performance for ceremonyclient\nnet.core.wmem_max=600000000" | tee -a /etc/sysctl.conf > /dev/null fi -sudo sysctl -p +sysctl -p # Step 8:Download Ceremonyclient @@ -65,7 +65,7 @@ fi echo "⏳ Re-Creating Ceremonyclient Service" sleep 2 # Add a 2-second delay rm /lib/systemd/system/ceremonyclient.service -sudo tee /lib/systemd/system/ceremonyclient.service > /dev/null < /dev/null < Date: Sun, 26 May 2024 14:41:10 +0300 Subject: [PATCH 02/15] sudo --- install/install_quilibrium_service.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index f9cfe49..9ee4a40 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -14,7 +14,7 @@ echo "⏳Processing..." sleep 2 # Add a 2-second delay apt update apt upgrade -y -#apt install sudo -y #for non root Debian OS +apt install sudo -y #for non root Debian OS apt install git -y # Step 2: Adjust network buffer sizes @@ -22,14 +22,14 @@ 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" | tee -a /etc/sysctl.conf > /dev/null + 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" | tee -a /etc/sysctl.conf > /dev/null + 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 -sysctl -p +sudo sysctl -p # Step 8:Download Ceremonyclient @@ -65,7 +65,7 @@ fi echo "⏳ Re-Creating Ceremonyclient Service" sleep 2 # Add a 2-second delay rm /lib/systemd/system/ceremonyclient.service -tee /lib/systemd/system/ceremonyclient.service > /dev/null < /dev/null < Date: Sun, 26 May 2024 14:47:37 +0300 Subject: [PATCH 03/15] bugfix --- install/install_quilibrium_service.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index 9ee4a40..f601eab 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -90,4 +90,4 @@ service ceremonyclient start 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 -journalctl -u ceremonyclient.service -f --no-hostname -o cat \ No newline at end of file +sudo journalctl -u ceremonyclient.service -f --no-hostname -o cat \ No newline at end of file From 033d49832f8c63b7742242bfeb0482a428d93c88 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sun, 26 May 2024 14:48:22 +0300 Subject: [PATCH 04/15] bugfix --- install/install_quilibrium_service.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index f601eab..a1cf40a 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -14,7 +14,7 @@ echo "⏳Processing..." sleep 2 # Add a 2-second delay apt update apt upgrade -y -apt install sudo -y #for non root Debian OS +apt install sudo -y apt install git -y # Step 2: Adjust network buffer sizes From ef4586d288642808cd0ff8092cfdd7b16d2d8371 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sun, 26 May 2024 14:51:05 +0300 Subject: [PATCH 05/15] home --- install/install_quilibrium_service.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index a1cf40a..4104f80 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -44,10 +44,10 @@ git checkout release ARCH=$(uname -m) # Get the current user's home directory -HOME_DIR=$(eval echo ~$USER) +HOME=$(eval echo ~$USER) # Use the home directory in the path -PATH="$HOME_DIR/ceremonyclient/node" +PATH="$HOME/ceremonyclient/node" # Step10.1:Determine the ExecStart line based on the architecture if [ "$ARCH" = "x86_64" ]; then From d952905a81179d455e33e9777b12ce9b715e53b8 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sun, 26 May 2024 15:15:32 +0300 Subject: [PATCH 06/15] home and path variables fix --- install/install_quilibrium_service.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index 4104f80..9f25e18 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -44,18 +44,18 @@ git checkout release ARCH=$(uname -m) # Get the current user's home directory -HOME=$(eval echo ~$USER) +HOME=$(eval echo ~$HOME_DIR) # Use the home directory in the path -PATH="$HOME/ceremonyclient/node" +NODE_PATH="$HOME/ceremonyclient/node" # Step10.1:Determine the ExecStart line based on the architecture if [ "$ARCH" = "x86_64" ]; then - EXEC_START="$PATH/node-1.4.18-linux-amd64" + EXEC_START="$NODE_PATH/node-1.4.18-linux-amd64" elif [ "$ARCH" = "aarch64" ]; then - EXEC_START="$PATH/node-1.4.18-linux-arm64" + EXEC_START="$NODE_PATH/node-1.4.18-linux-arm64" elif [ "$ARCH" = "arm64" ]; then - EXEC_START="$PATH/node-1.4.18-darwin-arm64" + EXEC_START="$NODE_PATH/node-1.4.18-darwin-arm64" else echo "Unsupported architecture: $ARCH" exit 1 From 9fd68f6ddbf3e78c4742b047ad1234b5787afbb9 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sun, 26 May 2024 15:23:19 +0300 Subject: [PATCH 07/15] sudo fix --- install/install_quilibrium_service.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index 9f25e18..cead42a 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -64,7 +64,7 @@ fi # Step10.2:Create Ceremonyclient Service echo "⏳ Re-Creating Ceremonyclient Service" sleep 2 # Add a 2-second delay -rm /lib/systemd/system/ceremonyclient.service +sudo rm /lib/systemd/system/ceremonyclient.service sudo tee /lib/systemd/system/ceremonyclient.service > /dev/null < Date: Sun, 26 May 2024 15:30:21 +0300 Subject: [PATCH 08/15] git clone failed retry --- install/install_quilibrium_service.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index cead42a..6294b4e 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -36,7 +36,10 @@ sudo sysctl -p echo "⏳Downloading Ceremonyclient" sleep 1 # Add a 1-second delay cd ~ -git clone https://github.com/QuilibriumNetwork/ceremonyclient.git +until git clone https://github.com/QuilibriumNetwork/ceremonyclient.git; do + echo "Git clone failed, retrying..." + sleep 2 +done cd ~/ceremonyclient/ git checkout release From 3894f8ed4c62f32a6fe3c537464a50792a367543 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sun, 26 May 2024 15:34:38 +0300 Subject: [PATCH 09/15] sudo privileges --- install/install_quilibrium_service.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index 6294b4e..3b5bd49 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -82,12 +82,13 @@ ExecStart=$EXEC_START [Install] WantedBy=multi-user.target EOF -systemctl enable ceremonyclient +sudo systemctl daemon-reload +sudo systemctl enable ceremonyclient # Start the ceremonyclient service echo "✅Starting Ceremonyclient Service" sleep 1 # Add a 1-second delay -service ceremonyclient start +sudo service ceremonyclient start # See the logs of the ceremonyclient service echo "🎉Welcome to Quilibrium Ceremonyclient" From 4a70822a2663d6edcbd0865183a858721a34f277 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sun, 26 May 2024 15:36:44 +0300 Subject: [PATCH 10/15] ceremonyclient folder check --- install/install_quilibrium_service.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index 3b5bd49..a6ed419 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -36,10 +36,14 @@ sudo sysctl -p echo "⏳Downloading Ceremonyclient" sleep 1 # Add a 1-second delay cd ~ -until git clone https://github.com/QuilibriumNetwork/ceremonyclient.git; do - echo "Git clone failed, retrying..." - sleep 2 -done +if [ -d "ceremonyclient" ]; then + echo "Directory ceremonyclient already exists, skipping git clone..." +else + until git clone https://github.com/QuilibriumNetwork/ceremonyclient.git; do + echo "Git clone failed, retrying..." + sleep 2 + done +fi cd ~/ceremonyclient/ git checkout release From d8ea7cc18e7b806f1fda4da9d545034776a4b640 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sun, 26 May 2024 15:44:46 +0300 Subject: [PATCH 11/15] sudo fix try --- install/install_quilibrium_service.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index a6ed419..d5bfcbb 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -12,10 +12,10 @@ sleep 10 # Add a 10-second delay 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 +sudo apt update +sudo apt upgrade -y +sudo apt install sudo -y +sudo apt install git -y # Step 2: Adjust network buffer sizes echo "Adjusting network buffer sizes..." From e8979dca8d2a408d2d7712b9af08d8c3df0cbe19 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sun, 26 May 2024 15:46:13 +0300 Subject: [PATCH 12/15] get sudo priviledge --- install/install_quilibrium_service.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index d5bfcbb..6cd1a20 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -1,5 +1,8 @@ #!/bin/bash -i +# Ask for the sudo password upfront +sudo -v + cd ~ # Step 0: Welcome echo "This script is made with ❤️ by 0xOzgur.eth" From 48ba3870ee75f38d3f9bf1e9fc21542a76d196fd Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sun, 26 May 2024 16:02:03 +0300 Subject: [PATCH 13/15] bug fix --- install/install_quilibrium_service.sh | 5 +---- update.sh | 17 +++++++++-------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index 6cd1a20..bc7435b 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -1,11 +1,9 @@ #!/bin/bash -i -# Ask for the sudo password upfront -sudo -v - cd ~ # Step 0: Welcome echo "This script is made with ❤️ by 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 "⏳Enjoy and sit back while you are building your Quilibrium Node!" echo "⏳Processing..." sleep 10 # Add a 10-second delay @@ -17,7 +15,6 @@ echo "⏳Processing..." sleep 2 # Add a 2-second delay sudo apt update sudo apt upgrade -y -sudo apt install sudo -y sudo apt install git -y # Step 2: Adjust network buffer sizes diff --git a/update.sh b/update.sh index 73c6795..31d8b46 100644 --- a/update.sh +++ b/update.sh @@ -3,6 +3,7 @@ # Step 0: Welcome echo "This script is made with ❤️ by 0xOzgur.eth" echo "⏳Enjoy and sit back while you are upgrading your Quilibrium Node to v1.4.18!" +echo "The script is prepared for Ubuntu machines. If you are using another operating system, please check the compatibility of the script." echo "⏳Processing..." sleep 10 # Add a 10-second delay @@ -19,18 +20,18 @@ git checkout release ARCH=$(uname -m) # Get the current user's home directory -HOME_DIR=$(eval echo ~$USER) +HOME=$(eval echo ~$HOME_DIR) # Use the home directory in the path -PATH="$HOME_DIR/ceremonyclient/node" +NODE_PATH="$HOME/ceremonyclient/node" # Step10.1:Determine the ExecStart line based on the architecture if [ "$ARCH" = "x86_64" ]; then - EXEC_START="$PATH/node-1.4.18-linux-amd64" + EXEC_START="$NODE_PATH/node-1.4.18-linux-amd64" elif [ "$ARCH" = "aarch64" ]; then - EXEC_START="$PATH/node-1.4.18-linux-arm64" + EXEC_START="$NODE_PATH/node-1.4.18-linux-arm64" elif [ "$ARCH" = "arm64" ]; then - EXEC_START="$PATH/node-1.4.18-darwin-arm64" + EXEC_START="$NODE_PATH/node-1.4.18-darwin-arm64" else echo "Unsupported architecture: $ARCH" exit 1 @@ -46,9 +47,9 @@ sudo sed -i "s|ExecStart=.*|ExecStart=$EXEC_START|" /lib/systemd/system/ceremony # Step 4:Start the ceremonyclient service echo "✅ Starting Ceremonyclient Service" sleep 2 # Add a 2-second delay -systemctl daemon-reload -systemctl enable ceremonyclient -service ceremonyclient start +sudo systemctl daemon-reload +sudo systemctl enable ceremonyclient +sudo service ceremonyclient start # See the logs of the ceremonyclient service echo "🎉 Welcome to Quilibrium Ceremonyclient v1.4.18" From b5341de1e6c064157062b4a43f0098fe5380aa84 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sun, 26 May 2024 16:39:40 +0300 Subject: [PATCH 14/15] implemented version --- install/install_quilibrium_service.sh | 12 ++++++++---- update.sh | 11 +++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index bc7435b..8aa0bb4 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -2,8 +2,9 @@ cd ~ # Step 0: Welcome -echo "This script is made with ❤️ by 0xOzgur.eth" +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 @@ -47,6 +48,9 @@ fi cd ~/ceremonyclient/ git checkout release +# Set the version number +VERSION="1.4.18" + # Get the system architecture ARCH=$(uname -m) @@ -58,11 +62,11 @@ NODE_PATH="$HOME/ceremonyclient/node" # Step10.1:Determine the ExecStart line based on the architecture if [ "$ARCH" = "x86_64" ]; then - EXEC_START="$NODE_PATH/node-1.4.18-linux-amd64" + EXEC_START="$NODE_PATH/node-$VERSION-linux-amd64" elif [ "$ARCH" = "aarch64" ]; then - EXEC_START="$NODE_PATH/node-1.4.18-linux-arm64" + EXEC_START="$NODE_PATH/node-$VERSION-linux-arm64" elif [ "$ARCH" = "arm64" ]; then - EXEC_START="$NODE_PATH/node-1.4.18-darwin-arm64" + EXEC_START="$NODE_PATH/node-$VERSION-darwin-arm64" else echo "Unsupported architecture: $ARCH" exit 1 diff --git a/update.sh b/update.sh index 31d8b46..de847e2 100644 --- a/update.sh +++ b/update.sh @@ -1,7 +1,7 @@ #!/bin/bash # Step 0: Welcome -echo "This script is made with ❤️ by 0xOzgur.eth" +echo "This script is made with ❤️ by https://quilibrium.space @ 0xOzgur.eth" echo "⏳Enjoy and sit back while you are upgrading your Quilibrium Node to v1.4.18!" echo "The script is prepared for Ubuntu machines. If you are using another operating system, please check the compatibility of the script." echo "⏳Processing..." @@ -16,6 +16,9 @@ cd ~/ceremonyclient git pull git checkout release +# Set the version number +VERSION="1.4.18" + # Get the system architecture ARCH=$(uname -m) @@ -27,11 +30,11 @@ NODE_PATH="$HOME/ceremonyclient/node" # Step10.1:Determine the ExecStart line based on the architecture if [ "$ARCH" = "x86_64" ]; then - EXEC_START="$NODE_PATH/node-1.4.18-linux-amd64" + EXEC_START="$NODE_PATH/node-$VERSION-linux-amd64" elif [ "$ARCH" = "aarch64" ]; then - EXEC_START="$NODE_PATH/node-1.4.18-linux-arm64" + EXEC_START="$NODE_PATH/node-$VERSION-linux-arm64" elif [ "$ARCH" = "arm64" ]; then - EXEC_START="$NODE_PATH/node-1.4.18-darwin-arm64" + EXEC_START="$NODE_PATH/node-$VERSION-darwin-arm64" else echo "Unsupported architecture: $ARCH" exit 1 From ec6b4cd4645e2a97d010285472ece599eba2b4b3 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sun, 26 May 2024 16:50:01 +0300 Subject: [PATCH 15/15] check if service file exist --- install/install_quilibrium_service.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index 8aa0bb4..c0d90bb 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -75,7 +75,11 @@ fi # Step10.2:Create Ceremonyclient Service echo "⏳ Re-Creating Ceremonyclient Service" sleep 2 # Add a 2-second delay -sudo rm /lib/systemd/system/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 <