From 5287bb53fe55995787cea447342f0eafa9d747ba Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Wed, 29 May 2024 09:04:24 +0300 Subject: [PATCH 1/5] Install go and grpcurl added --- install/install.sh | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/install/install.sh b/install/install.sh index 6fc0a20..3591689 100644 --- a/install/install.sh +++ b/install/install.sh @@ -3,7 +3,9 @@ cd ~ # Step 0: Welcome -echo "This script is made with ❤️ by 0xOzgur.eth" +echo "This script is made with ❤️ by 0xOzgur.eth @ 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 @@ -86,13 +88,16 @@ go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest echo "⏳Downloading Ceremonyclient" sleep 1 # Add a 1-second delay cd ~ -git clone https://github.com/QuilibriumNetwork/ceremonyclient.git - -# Build Ceremonyclient -echo "⏳Building Ceremonyclient" -sleep 1 # Add a 1-second delay -cd ~/ceremonyclient/node -GOEXPERIMENT=arenas go install ./... +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 # Build Ceremonyclient qClient echo "⏳Building qCiient" @@ -100,6 +105,13 @@ sleep 1 # Add a 1-second delay cd ~/ceremonyclient/client 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/release_autorun.sh + # Create Ceremonyclient Service echo "⏳Creating Ceremonyclient Service" sleep 1 # Add a 1-second delay @@ -111,21 +123,22 @@ Description=Ceremony Client Go App Service Type=simple Restart=always RestartSec=5s -WorkingDirectory=/root/ceremonyclient/node -Environment=GOEXPERIMENT=arenas -ExecStart=/root/go/bin/node ./... +WorkingDirectory=$NODE_PATH +ExecStart=$EXEC_START [Install] WantedBy=multi-user.target EOF -systemctl enable ceremonyclient -# Start the ceremonyclient service +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 -service ceremonyclient start +sudo service ceremonyclient start -# See the logs of the ceremonyclient service +# 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 From e57c430c3afbbcd12f07b95022cb44c44775c378 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Wed, 29 May 2024 09:30:17 +0300 Subject: [PATCH 2/5] debian installer try --- install/install_quilibrium_service_debian.sh | 152 +++++++++++++++++++ profile/.profile_binary | 4 +- 2 files changed, 154 insertions(+), 2 deletions(-) create mode 100644 install/install_quilibrium_service_debian.sh diff --git a/install/install_quilibrium_service_debian.sh b/install/install_quilibrium_service_debian.sh new file mode 100644 index 0000000..9d1b8bb --- /dev/null +++ b/install/install_quilibrium_service_debian.sh @@ -0,0 +1,152 @@ +#!/bin/bash + +cd ~ +# Step 0: Welcome +echo "This script is made with ❤️ by 0xOzgur.eth @ 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 + +# Step 1: Update and Upgrade the Machine +echo "Updating the machine" +echo "⏳Processing..." +sleep 2 # Add a 2-second delay + +# Check if sudo 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 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 +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; do + echo "Git clone failed, retrying..." + sleep 2 + done +fi +cd ~/ceremonyclient/ +git checkout release + +# Set the version number +VERSION="1.4.18" + +# Get the system architecture +ARCH=$(uname -m) + +# 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" + +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 + echo "Unsupported architecture: $ARCH" + exit 1 +fi + +# 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 + +sudo tee /lib/systemd/system/ceremonyclient.service > /dev/null < Date: Wed, 29 May 2024 10:57:02 +0300 Subject: [PATCH 3/5] autorun.sh implement --- install/install_quilibrium_service_debian.sh | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/install/install_quilibrium_service_debian.sh b/install/install_quilibrium_service_debian.sh index 9d1b8bb..5d6e30c 100644 --- a/install/install_quilibrium_service_debian.sh +++ b/install/install_quilibrium_service_debian.sh @@ -14,7 +14,7 @@ echo "Updating the machine" echo "⏳Processing..." sleep 2 # Add a 2-second delay -# Check if sudo is installed +# Fof DEBIAN OS - Check if sudo and git is installed if ! command -v sudo &> /dev/null then echo "sudo could not be found" @@ -88,7 +88,7 @@ git checkout release VERSION="1.4.18" # Get the system architecture -ARCH=$(uname -m) +# ARCH=$(uname -m) # Step 5:Determine the ExecStart line based on the architecture # Get the current user's home directory @@ -96,17 +96,7 @@ HOME=$(eval echo ~$HOME_DIR) # Use the home directory in the path NODE_PATH="$HOME/ceremonyclient/node" - -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 - echo "Unsupported architecture: $ARCH" - exit 1 -fi +EXEC_START="$NODE_PATH/release_autorun.sh" # Step 6:Create Ceremonyclient Service echo "⏳ Creating Ceremonyclient Service" @@ -130,7 +120,7 @@ Description=Ceremony Client Go App Service Type=simple Restart=always RestartSec=5s -WorkingDirectory=/root/ceremonyclient/node +WorkingDirectory=$NODE_PATH ExecStart=$EXEC_START [Install] From 027c4ce037b82925cac6082363d29cb70223364a Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Wed, 29 May 2024 11:16:34 +0300 Subject: [PATCH 4/5] converted to release_autorun --- install/install_quilibrium_service.sh | 40 +++++++++++++++------------ update.sh | 21 ++------------ 2 files changed, 25 insertions(+), 36 deletions(-) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index 7ac79d7..5d6e30c 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -2,7 +2,6 @@ cd ~ # Step 0: Welcome - echo "This script is made with ❤️ by 0xOzgur.eth @ 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." @@ -15,9 +14,26 @@ echo "Updating the machine" echo "⏳Processing..." sleep 2 # Add a 2-second delay -sudo apt update +# 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 -sudo apt install git -y # Step 2: Adjust network buffer sizes @@ -72,7 +88,7 @@ git checkout release VERSION="1.4.18" # Get the system architecture -ARCH=$(uname -m) +# ARCH=$(uname -m) # Step 5:Determine the ExecStart line based on the architecture # Get the current user's home directory @@ -80,20 +96,10 @@ HOME=$(eval echo ~$HOME_DIR) # Use the home directory in the path NODE_PATH="$HOME/ceremonyclient/node" - -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 - echo "Unsupported architecture: $ARCH" - exit 1 -fi +EXEC_START="$NODE_PATH/release_autorun.sh" # Step 6:Create Ceremonyclient Service -echo "⏳ Re-Creating Ceremonyclient Service" +echo "⏳ Creating Ceremonyclient Service" sleep 2 # Add a 2-second delay # Check if the file exists before attempting to remove it @@ -114,7 +120,7 @@ Description=Ceremony Client Go App Service Type=simple Restart=always RestartSec=5s -WorkingDirectory=/root/ceremonyclient/node +WorkingDirectory=$NODE_PATH ExecStart=$EXEC_START [Install] diff --git a/update.sh b/update.sh index 633caec..afbb7a4 100644 --- a/update.sh +++ b/update.sh @@ -16,29 +16,12 @@ cd ~/ceremonyclient git pull git checkout release -# Set the version number -VERSION="1.4.18" - -# Get the system architecture -ARCH=$(uname -m) - # Get the current user's home directory HOME=$(eval echo ~$HOME_DIR) # Use the home directory in the path 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-$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 - echo "Unsupported architecture: $ARCH" - exit 1 -fi +EXEC_START="$NODE_PATH/release_autorun.sh" # Step 3:Re-Create Ceremonyclient Service echo "⏳ Re-Creating Ceremonyclient Service" @@ -52,7 +35,7 @@ Description=Ceremony Client Go App Service Type=simple Restart=always RestartSec=5s -WorkingDirectory=/root/ceremonyclient/node +WorkingDirectory=$NODE_PATH ExecStart=$EXEC_START [Install] From f324b96234d68c5edf86e002f5cbaa05a3379762 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Wed, 29 May 2024 11:42:55 +0300 Subject: [PATCH 5/5] remove debian script --- install/install_quilibrium_service_debian.sh | 142 ------------------- 1 file changed, 142 deletions(-) delete mode 100644 install/install_quilibrium_service_debian.sh diff --git a/install/install_quilibrium_service_debian.sh b/install/install_quilibrium_service_debian.sh deleted file mode 100644 index 5d6e30c..0000000 --- a/install/install_quilibrium_service_debian.sh +++ /dev/null @@ -1,142 +0,0 @@ -#!/bin/bash - -cd ~ -# Step 0: Welcome -echo "This script is made with ❤️ by 0xOzgur.eth @ 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 - -# 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 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 -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; do - echo "Git clone failed, retrying..." - sleep 2 - done -fi -cd ~/ceremonyclient/ -git checkout release - -# Set the version number -VERSION="1.4.18" - -# Get the system architecture -# ARCH=$(uname -m) - -# 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/release_autorun.sh" - -# 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 - -sudo tee /lib/systemd/system/ceremonyclient.service > /dev/null <