From cad712b2e5bcf9ce8c2091e36712aed63ac44e5f Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sat, 25 May 2024 12:21:12 +0300 Subject: [PATCH 01/33] .profile files --- profile/.bash_profile | 7 +++---- profile/.profile_binary | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/profile/.bash_profile b/profile/.bash_profile index 355cc09..d47885e 100644 --- a/profile/.bash_profile +++ b/profile/.bash_profile @@ -13,7 +13,6 @@ fi export HISTTIMEFORMAT="%d/%m/%y %T " - 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' @@ -24,9 +23,9 @@ neofetch alias peer-count='cd ~/ceremonyclient/node && grpcurl -plaintext -max-msg-sz 150000000 localhost:8337 quilibrium.node.node.pb.NodeService.GetPeerInfo | grep peerId | wc -l && cd ~' -alias node-info='cd ~/ceremonyclient/node && GOEXPERIMENT=arenas go run ./... -node-info && cd ~' -alias db-console='cd ~/ceremonyclient/node && - GOEXPERIMENT=arenas go run ./... --db-console && cd ~' -alias balance='cd ~/ceremonyclient/node && GOEXPERIMENT=arenas go run ./... -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' diff --git a/profile/.profile_binary b/profile/.profile_binary index 4d8fe80..98b382b 100644 --- a/profile/.profile_binary +++ b/profile/.profile_binary @@ -19,9 +19,9 @@ neofetch alias peer-count='cd ~/ceremonyclient/node && grpcurl -plaintext -max-msg-sz 150000000 localhost:8337 quilibrium.node.node.pb.NodeService.GetPeerInfo | grep peerId | wc -l && cd ~' -alias node-info='cd ~/ceremonyclient/node && ./node -node-info && cd ~' -alias db-console='cd ~/ceremonyclient/node && ./node --db-console && cd ~' -alias balance='cd ~/ceremonyclient/node && ./node -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' From 0aaca3d925a113f7ca3e6e51675e4a0664e5df08 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sat, 25 May 2024 12:27:17 +0300 Subject: [PATCH 02/33] rm old file --- profile/.profile_service | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 profile/.profile_service diff --git a/profile/.profile_service b/profile/.profile_service deleted file mode 100644 index a66b535..0000000 --- a/profile/.profile_service +++ /dev/null @@ -1,28 +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 - - -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.GetPeerInfo | grep peerId | wc -l && cd ~' -alias node-info='cd ~/ceremonyclient/node && GOEXPERIMENT=arenas go run ./... -node-info && cd ~' -alias db-console='cd ~/ceremonyclient/node && - GOEXPERIMENT=arenas go run ./... --db-console && cd ~' -alias balance='cd ~/ceremonyclient/node && GOEXPERIMENT=arenas go run ./... -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' From 3a5923d97b9c170965c68e219406fad552e5e6e3 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sat, 25 May 2024 13:14:27 +0300 Subject: [PATCH 03/33] update script for multi platform --- update.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/update.sh b/update.sh index 485c978..b19b536 100644 --- a/update.sh +++ b/update.sh @@ -15,6 +15,21 @@ cd ~/ceremonyclient git pull git checkout release +# Get the system architecture +ARCH=$(uname -m) + +# Determine the ExecStart line based on the architecture +if [ "$ARCH" = "x86_64" ]; then + EXEC_START="/root/ceremonyclient/node/node-1.4.18-linux-amd64" +elif [ "$ARCH" = "aarch64" ]; then + EXEC_START="/root/ceremonyclient/node/node-1.4.18-linux-arm64" +elif [ "$ARCH" = "arm64" ]; then + EXEC_START="/root/ceremonyclient/node/node-1.4.18-darwin-arm64" +else + echo "Unsupported architecture: $ARCH" + exit 1 +fi + # Step 3:Re-Create Ceremonyclient Service echo "⏳ Re-Creating Ceremonyclient Service" sleep 2 # Add a 2-second delay @@ -28,7 +43,7 @@ Type=simple Restart=always RestartSec=5s WorkingDirectory=/root/ceremonyclient/node -ExecStart=/root/ceremonyclient/node/node-1.4.18-linux-amd64 +ExecStart=$EXEC_START [Install] WantedBy=multi-user.target From a45261ec880704b5c7b7ba6137ce129864588050 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sat, 25 May 2024 15:05:01 +0300 Subject: [PATCH 04/33] rm other architecture updates --- profile/.profile_binary | 2 +- updateAmd64.sh | 48 ----------------------------------------- updateDarwinArm64.sh | 48 ----------------------------------------- updateLinuxArm64.sh | 48 ----------------------------------------- 4 files changed, 1 insertion(+), 145 deletions(-) delete mode 100644 updateAmd64.sh delete mode 100644 updateDarwinArm64.sh delete mode 100644 updateLinuxArm64.sh diff --git a/profile/.profile_binary b/profile/.profile_binary index 98b382b..8cd490f 100644 --- a/profile/.profile_binary +++ b/profile/.profile_binary @@ -19,7 +19,7 @@ neofetch alias peer-count='cd ~/ceremonyclient/node && grpcurl -plaintext -max-msg-sz 150000000 localhost:8337 quilibrium.node.node.pb.NodeService.GetPeerInfo | grep peerId | wc -l && cd ~' -alias node-info='cd ~/ceremonyclient/node && ./node-1.4.18-linux-amd64 -node-info && 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' diff --git a/updateAmd64.sh b/updateAmd64.sh deleted file mode 100644 index 485c978..0000000 --- a/updateAmd64.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -# 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 "⏳Processing..." -sleep 10 # Add a 10-second delay - -# Stop the ceremonyclient service -service ceremonyclient stop - -# Step 1:Download Binary -echo "⏳ Downloading New Release v1.4.18" -cd ~/ceremonyclient -git pull -git checkout release - -# Step 3:Re-Create Ceremonyclient Service -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 < /dev/null < Date: Sat, 25 May 2024 15:46:50 +0300 Subject: [PATCH 05/33] install 1.4.18 --- install/install_binary.sh | 79 --------------------------- install/install_quilibrium_service.sh | 45 +++++++++------ 2 files changed, 27 insertions(+), 97 deletions(-) delete mode 100644 install/install_binary.sh diff --git a/install/install_binary.sh b/install/install_binary.sh deleted file mode 100644 index 4612ba1..0000000 --- a/install/install_binary.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash - -cd ~ - -# Step 0: Welcome -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 - -# Step 1: Update and Upgrade the Machine -echo "Updating the machine" -echo "⏳Processing..." -sleep 2 # Add a 2-second delay -apt-get update -apt-get 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:Download Ceremonyclient -echo "⏳Downloading Ceremonyclient" -sleep 2 # Add a 2-second delay -git clone https://github.com/QuilibriumNetwork/ceremonyclient.git - -cd ~/ceremonyclient/node - -# Step 4:Download Binary -echo "⏳Downloading Binary" -sleep 2 # Add a 2-second delay -wget https://github.com/QuilibriumNetwork/ceremonyclient/releases/download/v1.4.17/node-1.4.17-linux-amd64.bin -ls -mv node*.bin node - -# Step 5:Make the file executable -echo "⏳Making the Binary executable" -sleep 2 # Add a 2-second delay -chmod +x node - -# Step 6:Create Ceremonyclient Service -echo "⏳Creating Ceremonyclient Service" -sleep 2 # Add a 2-second delay -sudo tee /lib/systemd/system/ceremonyclient.service > /dev/null < /dev/null < Date: Sat, 25 May 2024 16:59:36 +0300 Subject: [PATCH 06/33] docker-service separation --- profile/.profile_docker | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/profile/.profile_docker b/profile/.profile_docker index b08e305..6d91198 100644 --- a/profile/.profile_docker +++ b/profile/.profile_docker @@ -18,11 +18,20 @@ alias wttr='curl wttr.in' neofetch -alias peer-count='cd ~/ceremonyclient/ && docker compose exec node grpcurl -plaintext -max-msg-sz 5000000 localhost:8337 quilibrium.node.node.pb.NodeService.GetPeerInfo | grep peerId | wc -l' -alias node-info='cd ~/ceremonyclient/ && docker compose exec node node -node-info && cd ~' -alias db-console='cd ~/ceremonyclient/ && - docker compose exec node node --db-console && cd ~' -alias balance='cd ~/ceremonyclient/ && docker compose exec node node -balance && cd ~' -alias nlog='cd ~/ceremonyclient/ && docker compose logs -f -n, --tail 100 && cd ~' -alias nstart='cd ~/ceremonyclient/ && docker compose up -d && cd ~' -alias nrestart='cd ~/ceremonyclient/ && docker compose down && docker compose up -d && cd ~' -alias nstop='cd ~/ceremonyclient/ && docker compose down && cd ~' \ No newline at end of file +alias dpeer-count='cd ~/ceremonyclient/ && docker compose exec node grpcurl -plaintext -max-msg-sz 5000000 localhost:8337 quilibrium.node.node.pb.NodeService.GetPeerInfo | 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.GetPeerInfo | 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' \ No newline at end of file From 9533377ee959af66124535244e6c44d5b2cef1e6 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sat, 25 May 2024 17:47:05 +0300 Subject: [PATCH 07/33] docker_install update --- install/install_docker.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install/install_docker.sh b/install/install_docker.sh index aed9097..65158d2 100644 --- a/install/install_docker.sh +++ b/install/install_docker.sh @@ -55,11 +55,12 @@ echo "⏳Downloading Ceremonyclient" sleep 2 # Add a 2-second delay git clone https://github.com/QuilibriumNetwork/ceremonyclient.git cd ~/ceremonyclient +git checkout release # 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:1.4.17 . +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" From 5d037e59bbf0d55f9681a963f5a3c6c50965e354 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sat, 25 May 2024 18:01:55 +0300 Subject: [PATCH 08/33] bugfix --- install/install_quilibrium_service.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index 564a549..7d449c0 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -86,6 +86,7 @@ echo "⏳Downloading Ceremonyclient" sleep 1 # Add a 1-second delay cd ~ git clone https://github.com/QuilibriumNetwork/ceremonyclient.git +cd ~/ceremonyclient git checkout release # Step 9: Build Ceremonyclient qClient From c3fa3fa581f4bcb4aa6fecdeb7a50175b1caab79 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sat, 25 May 2024 18:08:51 +0300 Subject: [PATCH 09/33] prune service autoinstaller --- install/install_quilibrium_service.sh | 57 +-------------------------- 1 file changed, 1 insertion(+), 56 deletions(-) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index 7d449c0..fdec658 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -32,69 +32,14 @@ fi sudo sysctl -p -# Step 3:Installing Go 1.20.14 -wget https://go.dev/dl/go1.20.14.linux-amd64.tar.gz -sudo tar -xvf go1.20.14.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.20.14.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 - -# Step 5: Source .bashrc to apply changes -echo "⏳Sourcing .bashrc to apply changes" -source ~/.bashrc -sleep 5 # Add a 5-second delay - -# Step 6: Check GO Version -go version -sleep 5 # Add a 5-second delay - -# Step 7:Install gRPCurl -echo "⏳Installing gRPCurl" -sleep 1 # Add a 1-second delay -go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest - # Step 8:Download Ceremonyclient echo "⏳Downloading Ceremonyclient" sleep 1 # Add a 1-second delay cd ~ git clone https://github.com/QuilibriumNetwork/ceremonyclient.git -cd ~/ceremonyclient +cd ~/ceremonyclient/ git checkout release -# Step 9: Build Ceremonyclient qClient -echo "⏳Building qCiient" -sleep 1 # Add a 1-second delay -cd ~/ceremonyclient/client -GOEXPERIMENT=arenas go build -o qclient main.go - # Get the system architecture ARCH=$(uname -m) From d6697b952ee1defdcd5278889435452df089ea24 Mon Sep 17 00:00:00 2001 From: LaMat <65860122+lamat1111@users.noreply.github.com> Date: Sat, 25 May 2024 18:26:18 +0200 Subject: [PATCH 10/33] Update install_quilibrium_service.sh added check if ceremonyclient folder exists and remove it check if service file exists before trying to remove it --- install/install_quilibrium_service.sh | 46 +++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index fdec658..e1a5103 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -31,8 +31,30 @@ else fi sudo sysctl -p +# Step 3: Check if directory ~/ceremonyclient exists and remove it +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 + + # Remove existing directory ~/ceremonyclient + echo "🗑️ Removing existing directory ~/ceremonyclient..." + rm -rf ~/ceremonyclient +fi -# Step 8:Download Ceremonyclient +# Step 4:Download Ceremonyclient echo "⏳Downloading Ceremonyclient" sleep 1 # Add a 1-second delay cd ~ @@ -43,7 +65,7 @@ git checkout release # Get the system architecture ARCH=$(uname -m) -# Step10.1:Determine the ExecStart line based on the architecture +# Step 5:Determine the ExecStart line based on the architecture if [ "$ARCH" = "x86_64" ]; then EXEC_START="/root/ceremonyclient/node/node-1.4.18-linux-amd64" elif [ "$ARCH" = "aarch64" ]; then @@ -55,10 +77,20 @@ else exit 1 fi -# Step10.2:Create Ceremonyclient Service +# Step 6:Create Ceremonyclient Service echo "⏳ Re-Creating Ceremonyclient Service" sleep 2 # Add a 2-second delay -rm /lib/systemd/system/ceremonyclient.service + +# 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: Sun, 26 May 2024 13:45:14 +0300 Subject: [PATCH 11/33] fixed for non root users --- install/install_quilibrium_service.sh | 12 +++++++++--- profile/.bash_profile | 11 ++++++++++- profile/.profile_binary | 2 +- profile/.profile_docker | 4 ++-- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index fdec658..1f93528 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -43,13 +43,19 @@ git checkout release # Get the system architecture ARCH=$(uname -m) +# Get the current user's home directory +HOME_DIR=$(eval echo ~$USER) + +# Use the home directory in the path +PATH="$HOME_DIR/ceremonyclient/node" + # Step10.1:Determine the ExecStart line based on the architecture if [ "$ARCH" = "x86_64" ]; then - EXEC_START="/root/ceremonyclient/node/node-1.4.18-linux-amd64" + EXEC_START="$PATH/node-1.4.18-linux-amd64" elif [ "$ARCH" = "aarch64" ]; then - EXEC_START="/root/ceremonyclient/node/node-1.4.18-linux-arm64" + EXEC_START="$PATH/node-1.4.18-linux-arm64" elif [ "$ARCH" = "arm64" ]; then - EXEC_START="/root/ceremonyclient/node/node-1.4.18-darwin-arm64" + EXEC_START="$PATH/node-1.4.18-darwin-arm64" else echo "Unsupported architecture: $ARCH" exit 1 diff --git a/profile/.bash_profile b/profile/.bash_profile index d47885e..feb6541 100644 --- a/profile/.bash_profile +++ b/profile/.bash_profile @@ -22,7 +22,16 @@ 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.GetPeerInfo | grep peerId | wc -l && cd ~' +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 ~' diff --git a/profile/.profile_binary b/profile/.profile_binary index 8cd490f..78060e1 100644 --- a/profile/.profile_binary +++ b/profile/.profile_binary @@ -18,7 +18,7 @@ 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.GetPeerInfo | grep peerId | wc -l && 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 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 ~' diff --git a/profile/.profile_docker b/profile/.profile_docker index 6d91198..50bdeff 100644 --- a/profile/.profile_docker +++ b/profile/.profile_docker @@ -18,7 +18,7 @@ alias wttr='curl wttr.in' neofetch -alias dpeer-count='cd ~/ceremonyclient/ && docker compose exec node grpcurl -plaintext -max-msg-sz 5000000 localhost:8337 quilibrium.node.node.pb.NodeService.GetPeerInfo | grep peerId | wc -l' +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 ~' @@ -27,7 +27,7 @@ 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.GetPeerInfo | grep peerId | wc -l && 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 ~' From 49e6758bcd19699ab8ba64f7c4ff92736bd73b47 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sun, 26 May 2024 14:16:14 +0300 Subject: [PATCH 12/33] non root user fix --- install/install_quilibrium_service.sh | 2 +- update.sh | 30 +++++++++++---------------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index 1f93528..d872c0b 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 +apt install sudo -y #for non root Debian OS users apt install git -y # Step 2: Adjust network buffer sizes diff --git a/update.sh b/update.sh index b19b536..73c6795 100644 --- a/update.sh +++ b/update.sh @@ -18,13 +18,19 @@ git checkout release # Get the system architecture ARCH=$(uname -m) -# Determine the ExecStart line based on the architecture +# Get the current user's home directory +HOME_DIR=$(eval echo ~$USER) + +# Use the home directory in the path +PATH="$HOME_DIR/ceremonyclient/node" + +# Step10.1:Determine the ExecStart line based on the architecture if [ "$ARCH" = "x86_64" ]; then - EXEC_START="/root/ceremonyclient/node/node-1.4.18-linux-amd64" + EXEC_START="$PATH/node-1.4.18-linux-amd64" elif [ "$ARCH" = "aarch64" ]; then - EXEC_START="/root/ceremonyclient/node/node-1.4.18-linux-arm64" + EXEC_START="$PATH/node-1.4.18-linux-arm64" elif [ "$ARCH" = "arm64" ]; then - EXEC_START="/root/ceremonyclient/node/node-1.4.18-darwin-arm64" + EXEC_START="$PATH/node-1.4.18-darwin-arm64" else echo "Unsupported architecture: $ARCH" exit 1 @@ -33,21 +39,9 @@ fi # Step 3:Re-Create Ceremonyclient Service 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 < Date: Sun, 26 May 2024 14:24:00 +0300 Subject: [PATCH 13/33] added go and grpcurl installation --- install/install_quilibrium_service.sh | 48 +++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index d872c0b..e4fe448 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -31,6 +31,54 @@ else fi sudo sysctl -p +# Installing Go 1.20.14 +wget https://go.dev/dl/go1.20.14.linux-amd64.tar.gz +sudo tar -xvf go1.20.14.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.20.14.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 # Step 8:Download Ceremonyclient echo "⏳Downloading Ceremonyclient" From b33314b2db14876cdab23df5dde38c796c437be3 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sun, 26 May 2024 14:29:52 +0300 Subject: [PATCH 14/33] fix --- install/install_quilibrium_service.sh | 50 +-------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index e4fe448..f601eab 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 users +apt install sudo -y #for non root Debian OS apt install git -y # Step 2: Adjust network buffer sizes @@ -31,54 +31,6 @@ else fi sudo sysctl -p -# Installing Go 1.20.14 -wget https://go.dev/dl/go1.20.14.linux-amd64.tar.gz -sudo tar -xvf go1.20.14.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.20.14.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 # Step 8:Download Ceremonyclient echo "⏳Downloading Ceremonyclient" 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 15/33] 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 16/33] 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 17/33] 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 18/33] 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 19/33] 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 f098ae0f9dc98c52a8d432ea8618f222ba4b0442 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sun, 26 May 2024 14:54:09 +0300 Subject: [PATCH 20/33] bugfix --- install/install_quilibrium_service.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index f601eab..f3e0fa2 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_DIR=$(eval echo ~$USER) # Use the home directory in the path -PATH="$HOME_DIR/ceremonyclient/node" +#PATH="$HOME_DIR/ceremonyclient/node" # Step10.1:Determine the ExecStart line based on the architecture if [ "$ARCH" = "x86_64" ]; then @@ -74,7 +74,7 @@ Type=simple Restart=always RestartSec=5s WorkingDirectory=/root/ceremonyclient/node -ExecStart=$EXEC_START +ExecStart=/root/ceremonyclient/node/$PATH [Install] WantedBy=multi-user.target From 889b300c07bff20ec537511908827afc24f8fc93 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sun, 26 May 2024 14:56:52 +0300 Subject: [PATCH 21/33] bugfix --- install/install_quilibrium_service.sh | 8 ++++---- update.sh | 16 ++++------------ 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index f3e0fa2..37d9db8 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -51,11 +51,11 @@ ARCH=$(uname -m) # 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="/root/ceremonyclient/node/node-1.4.18-linux-amd64" elif [ "$ARCH" = "aarch64" ]; then - EXEC_START="$PATH/node-1.4.18-linux-arm64" + EXEC_START="/root/ceremonyclient/node/node-1.4.18-linux-arm64" elif [ "$ARCH" = "arm64" ]; then - EXEC_START="$PATH/node-1.4.18-darwin-arm64" + EXEC_START="/root/ceremonyclient/node/node-1.4.18-darwin-arm64" else echo "Unsupported architecture: $ARCH" exit 1 @@ -74,7 +74,7 @@ Type=simple Restart=always RestartSec=5s WorkingDirectory=/root/ceremonyclient/node -ExecStart=/root/ceremonyclient/node/$PATH +ExecStart=$EXEC_START [Install] WantedBy=multi-user.target diff --git a/update.sh b/update.sh index 73c6795..bdba073 100644 --- a/update.sh +++ b/update.sh @@ -18,19 +18,13 @@ git checkout release # Get the system architecture ARCH=$(uname -m) -# Get the current user's home directory -HOME_DIR=$(eval echo ~$USER) - -# Use the home directory in the path -PATH="$HOME_DIR/ceremonyclient/node" - -# Step10.1:Determine the ExecStart line based on the architecture +# Determine the ExecStart line based on the architecture if [ "$ARCH" = "x86_64" ]; then - EXEC_START="$PATH/node-1.4.18-linux-amd64" + EXEC_START="/root/ceremonyclient/node/node-1.4.18-linux-amd64" elif [ "$ARCH" = "aarch64" ]; then - EXEC_START="$PATH/node-1.4.18-linux-arm64" + EXEC_START="/root/ceremonyclient/node/node-1.4.18-linux-arm64" elif [ "$ARCH" = "arm64" ]; then - EXEC_START="$PATH/node-1.4.18-darwin-arm64" + EXEC_START="/root/ceremonyclient/node/node-1.4.18-darwin-arm64" else echo "Unsupported architecture: $ARCH" exit 1 @@ -39,8 +33,6 @@ fi # Step 3:Re-Create Ceremonyclient Service echo "⏳ Re-Creating Ceremonyclient Service" sleep 2 # Add a 2-second delay - -# Update the ExecStart line in the service file sudo sed -i "s|ExecStart=.*|ExecStart=$EXEC_START|" /lib/systemd/system/ceremonyclient.service # Step 4:Start the ceremonyclient service From 5adf25d7a1d75feeac91f809f45ed88135e8a143 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sun, 26 May 2024 15:00:22 +0300 Subject: [PATCH 22/33] bugfix --- update.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/update.sh b/update.sh index bdba073..b19b536 100644 --- a/update.sh +++ b/update.sh @@ -33,7 +33,21 @@ fi # Step 3:Re-Create Ceremonyclient Service echo "⏳ Re-Creating Ceremonyclient Service" sleep 2 # Add a 2-second delay -sudo sed -i "s|ExecStart=.*|ExecStart=$EXEC_START|" /lib/systemd/system/ceremonyclient.service +rm /lib/systemd/system/ceremonyclient.service +sudo tee /lib/systemd/system/ceremonyclient.service > /dev/null < Date: Sun, 26 May 2024 15:15:32 +0300 Subject: [PATCH 23/33] 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 24/33] 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 25/33] 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 26/33] 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 27/33] 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 28/33] 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 29/33] 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 30/33] 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 31/33] 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 32/33] 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 < Date: Sun, 26 May 2024 17:14:14 +0300 Subject: [PATCH 33/33] typo --- 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 507fa67..0e62ec1 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -2,7 +2,7 @@ cd ~ # Step 0: Welcome -echo "This script is made with ❤️ by https://quilibrium.space @ 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!"