From 60f3cec2eb562d1324add6e4e1230601aff0efcd Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sun, 26 May 2024 13:45:14 +0300 Subject: [PATCH 01/22] 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 02/22] 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 03/22] 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 04/22] 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 05/22] 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 06/22] 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 07/22] 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 08/22] 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 09/22] 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 10/22] 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 11/22] 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 12/22] 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 13/22] 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 14/22] 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 15/22] 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 16/22] 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 17/22] 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 18/22] 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 19/22] 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 20/22] 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 21/22] 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 22/22] 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 <