From 5287bb53fe55995787cea447342f0eafa9d747ba Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Wed, 29 May 2024 09:04:24 +0300 Subject: [PATCH] Install go and grpcurl added --- install/install.sh | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/install/install.sh b/install/install.sh index 6fc0a20..3591689 100644 --- a/install/install.sh +++ b/install/install.sh @@ -3,7 +3,9 @@ cd ~ # Step 0: Welcome -echo "This script is made with ❤️ by 0xOzgur.eth" +echo "This script is made with ❤️ by 0xOzgur.eth @ https://quilibrium.space " +echo "The script is prepared for Ubuntu machines. If you are using another operating system, please check the compatibility of the script." +echo "The script doesn't install GO or GrpCurl packages. If you want to install them please visit https://docs.quilibrium.space/installing-prerequisites page." echo "⏳Enjoy and sit back while you are building your Quilibrium Node!" echo "⏳Processing..." sleep 10 # Add a 10-second delay @@ -86,13 +88,16 @@ go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest echo "⏳Downloading Ceremonyclient" sleep 1 # Add a 1-second delay cd ~ -git clone https://github.com/QuilibriumNetwork/ceremonyclient.git - -# Build Ceremonyclient -echo "⏳Building Ceremonyclient" -sleep 1 # Add a 1-second delay -cd ~/ceremonyclient/node -GOEXPERIMENT=arenas go install ./... +if [ -d "ceremonyclient" ]; then + echo "Directory ceremonyclient already exists, skipping git clone..." +else + until git clone https://github.com/QuilibriumNetwork/ceremonyclient.git; do + echo "Git clone failed, retrying..." + sleep 2 + done +fi +cd ~/ceremonyclient/ +git checkout release # Build Ceremonyclient qClient echo "⏳Building qCiient" @@ -100,6 +105,13 @@ sleep 1 # Add a 1-second delay cd ~/ceremonyclient/client GOEXPERIMENT=arenas go build -o qclient main.go +# Step 5:Determine the ExecStart line based on the architecture +# Get the current user's home directory +HOME=$(eval echo ~$HOME_DIR) +# Use the home directory in the path +NODE_PATH="$HOME/ceremonyclient/node" +EXEC_START="$NODE_PATH/release_autorun.sh + # Create Ceremonyclient Service echo "⏳Creating Ceremonyclient Service" sleep 1 # Add a 1-second delay @@ -111,21 +123,22 @@ Description=Ceremony Client Go App Service Type=simple Restart=always RestartSec=5s -WorkingDirectory=/root/ceremonyclient/node -Environment=GOEXPERIMENT=arenas -ExecStart=/root/go/bin/node ./... +WorkingDirectory=$NODE_PATH +ExecStart=$EXEC_START [Install] WantedBy=multi-user.target EOF -systemctl enable ceremonyclient -# Start the ceremonyclient service +sudo systemctl daemon-reload +sudo systemctl enable ceremonyclient + +# Step 7: Start the ceremonyclient service echo "✅Starting Ceremonyclient Service" sleep 1 # Add a 1-second delay -service ceremonyclient start +sudo service ceremonyclient start -# See the logs of the ceremonyclient service +# Step 8: See the logs of the ceremonyclient service echo "🎉Welcome to Quilibrium Ceremonyclient" echo "⏳Please let it flow node logs at least 5 minutes then you can press CTRL + C to exit the logs." sleep 5 # Add a 5-second delay