This commit is contained in:
0xOzgur 2024-06-04 19:17:36 +03:00
commit 918a64a834
2 changed files with 69 additions and 3 deletions

View File

@ -1,5 +1,58 @@
#!/bin/bash -i
cd ~
# Step 0: Welcome
echo "This script is made with ❤️ by 0xOzgur.eth @ https://quilibrium.space "
echo "The script is prepared for Ubuntu machines. If you are using another operating system, please check the compatibility of the script."
echo "The script doesn't install GO or GrpCurl packages. If you want to install them please visit https://docs.quilibrium.space/installing-prerequisites page."
echo "⏳Enjoy and sit back while you are building your Quilibrium Node!"
echo "⏳Processing..."
sleep 10 # Add a 10-second delay
# Check if ceremonyclient service exists and stop it if it does
if sudo systemctl status ceremonyclient &> /dev/null; then
echo "Ceremonyclient service found. Stopping..."
sudo service ceremonyclient stop
sleep 2 # Add a 2-second delay
fi
# Step 0: Increase Swap Space
if [ ! -d /swap ]; then
echo "Increasing swap space..."
sudo mkdir /swap
sudo fallocate -l 16G /swap/swapfile
sudo chmod 600 /swap/swapfile
sudo mkswap /swap/swapfile
sudo swapon /swap/swapfile
echo '/swap/swapfile swap swap defaults 0 0' | sudo tee -a /etc/fstab
else
echo "Swap space already exists, skipping swap increase..."
fi
# Step 1: Update and Upgrade the Machine
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
# 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
# Installing Go 1.20.14
wget https://go.dev/dl/go1.20.14.linux-amd64.tar.gz
@ -81,6 +134,20 @@ EXEC_START="$NODE_PATH/release_autorun.sh"
# Create Ceremonyclient Service
echo "⏳Creating Ceremonyclient Service"
sleep 1 # Add a 1-second delay
# Check if the file exists before attempting to remove it
if [ -f "/lib/systemd/system/ceremonyclient.service" ]; then
# If the file exists, remove it
rm /lib/systemd/system/ceremonyclient.service
echo "ceremonyclient.service file removed."
else
# If the file does not exist, inform the user
echo "ceremonyclient.service file does not exist. No action taken."
fi
CPU_THREADS=$(nproc)
CPU_QUOTA=$(( CPU_THREADS * 90 ))
sudo tee /lib/systemd/system/ceremonyclient.service > /dev/null <<EOF
[Unit]
Description=Ceremony Client Go App Service
@ -89,7 +156,6 @@ Description=Ceremony Client Go App Service
Type=simple
Restart=always
RestartSec=5s
WorkingDirectory=$NODE_PATH
ExecStart=$EXEC_START

View File

@ -60,7 +60,7 @@ 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.18 .
docker build --build-arg GIT_COMMIT=$(git log -1 --format=%h) -t quilibrium:1.4.18 .
# Step 8:Run Ceremonyclient Container
echo "✅Running Ceremonyclient Container"
@ -71,4 +71,4 @@ docker compose -f docker/docker-compose.yml up -d
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
docker compose -f docker/docker-compose.yml logs -f -n, --tail 100
docker compose -f docker/docker-compose.yml logs -f -n, --tail 100