Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20312de8db | ||
|
|
c6ed8f21dc | ||
|
|
67e17540dd | ||
|
|
fd96cca24b | ||
|
|
f44601975e | ||
|
|
f1a68dc61b | ||
|
|
e51c636187 | ||
|
|
e89f308fe1 | ||
|
|
9fd70e67c8 | ||
|
|
03f290767f | ||
|
|
cde83f14e0 | ||
|
|
c4506d565b | ||
|
|
dbb7064a8e | ||
|
|
1de1456273 | ||
|
|
23b2d7493b | ||
|
|
8765396533 | ||
|
|
7d621a6353 | ||
|
|
4f6c5f06a2 |
13
.gitignore
vendored
13
.gitignore
vendored
@ -1 +1,12 @@
|
||||
ssh.bat
|
||||
ssh.bat
|
||||
visibility/
|
||||
visibility/visibility.py
|
||||
visibility/peerlist.xml
|
||||
quilibrium_for_pros.sh
|
||||
backup_ozgur.sh
|
||||
backup.sh
|
||||
backup/backup.sh
|
||||
backup/backup_ozgur.sh
|
||||
quilibrium_for_pros.sh
|
||||
dataworker.py
|
||||
balance.sh
|
||||
@ -53,9 +53,9 @@ sudo sysctl -p
|
||||
# Step 6:Download Ceremonyclient
|
||||
echo "⏳Downloading Ceremonyclient"
|
||||
sleep 2 # Add a 2-second delay
|
||||
git clone https://github.com/QuilibriumNetwork/ceremonyclient.git
|
||||
git clone https://source.quilibrium.com/quilibrium/ceremonyclient.git
|
||||
cd ~/ceremonyclient
|
||||
git checkout release
|
||||
git checkout release-cdn
|
||||
|
||||
# Step 7:Build Docker Container
|
||||
echo "⏳Building Ceremonyclient Container"
|
||||
|
||||
@ -2,17 +2,13 @@
|
||||
|
||||
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
|
||||
|
||||
|
||||
# Step 1: Update and Upgrade the Machine
|
||||
echo "Updating the machine"
|
||||
echo "⏳Processing..."
|
||||
sleep 2 # Add a 2-second delay
|
||||
sudo apt update
|
||||
sudo apt upgrade -y
|
||||
sudo apt install git -y
|
||||
@ -31,21 +27,23 @@ else
|
||||
fi
|
||||
sudo sysctl -p
|
||||
|
||||
|
||||
# Step 8:Download Ceremonyclient
|
||||
# Step 3:Download Ceremonyclient
|
||||
echo "⏳Downloading Ceremonyclient"
|
||||
sleep 1 # Add a 1-second delay
|
||||
cd ~
|
||||
if [ -d "ceremonyclient" ]; then
|
||||
echo "Directory ceremonyclient already exists, skipping git clone..."
|
||||
else
|
||||
until git clone https://github.com/QuilibriumNetwork/ceremonyclient.git; do
|
||||
until git clone https://source.quilibrium.com/quilibrium/ceremonyclient.git; do
|
||||
echo "Git clone failed, retrying..."
|
||||
sleep 2
|
||||
done
|
||||
fi
|
||||
cd ~/ceremonyclient/
|
||||
git checkout release
|
||||
git checkout release-cdn
|
||||
|
||||
# Set the version number
|
||||
VERSION="1.4.18"
|
||||
|
||||
# Get the system architecture
|
||||
ARCH=$(uname -m)
|
||||
@ -56,22 +54,24 @@ HOME=$(eval echo ~$HOME_DIR)
|
||||
# Use the home directory in the path
|
||||
NODE_PATH="$HOME/ceremonyclient/node"
|
||||
|
||||
# Step10.1:Determine the ExecStart line based on the architecture
|
||||
# Step4: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
|
||||
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
|
||||
# Step5:Create 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 <<EOF
|
||||
[Unit]
|
||||
Description=Ceremony Client Go App Service
|
||||
@ -90,12 +90,4 @@ sudo systemctl daemon-reload
|
||||
sudo systemctl enable ceremonyclient
|
||||
|
||||
# Start the ceremonyclient service
|
||||
echo "✅Starting Ceremonyclient Service"
|
||||
sleep 1 # Add a 1-second delay
|
||||
sudo service ceremonyclient start
|
||||
|
||||
# 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
|
||||
sudo journalctl -u ceremonyclient.service -f --no-hostname -o cat
|
||||
sudo service ceremonyclient start
|
||||
476
quilibrium_for_dummies.sh
Normal file
476
quilibrium_for_dummies.sh
Normal file
@ -0,0 +1,476 @@
|
||||
#!/bin/bash -i
|
||||
|
||||
# Source .bashrc to make GO work if it is not working
|
||||
source ~/.bashrc
|
||||
|
||||
clear
|
||||
|
||||
# Set the version number
|
||||
VERSION="1.4.20"
|
||||
|
||||
# Determine the ExecStart line based on the architecture
|
||||
ARCH=$(uname -m)
|
||||
OS=$(uname -s)
|
||||
|
||||
# Determine the node binary name based on the architecture and OS
|
||||
if [ "$ARCH" = "x86_64" ]; then
|
||||
if [ "$OS" = "Linux" ]; then
|
||||
NODE_BINARY="node-$VERSION-linux-amd64"
|
||||
GO_BINARY="go1.20.14.linux-amd64.tar.gz"
|
||||
elif [ "$OS" = "Darwin" ]; then
|
||||
NODE_BINARY="node-$VERSION-darwin-amd64"
|
||||
GO_BINARY="go1.20.14.linux-amd64.tar.gz"
|
||||
fi
|
||||
elif [ "$ARCH" = "aarch64" ]; then
|
||||
if [ "$OS" = "Linux" ]; then
|
||||
NODE_BINARY="node-$VERSION-linux-arm64"
|
||||
GO_BINARY="go1.20.14.linux-arm64.tar.gz"
|
||||
elif [ "$OS" = "Darwin" ]; then
|
||||
NODE_BINARY="node-$VERSION-darwin-arm64"
|
||||
GO_BINARY="go1.20.14.linux-arm64.tar.gz"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Function for each menu option
|
||||
install_prerequisites() {
|
||||
echo "Installing prerequisites..."
|
||||
sleep 1 # Add a 1-second delay
|
||||
|
||||
echo "Updating the machine"
|
||||
echo "⏳Processing..."
|
||||
sleep 1 # Add a 1-second delay
|
||||
|
||||
# Fof DEBIAN OS - Check if sudo and git is installed
|
||||
# Step 1.1: Prepare Machine
|
||||
if ! command -v sudo &> /dev/null
|
||||
then
|
||||
echo "sudo could not be found"
|
||||
echo "Installing sudo..."
|
||||
su -c "apt update && apt install sudo -y"
|
||||
else
|
||||
echo "sudo is installed"
|
||||
fi
|
||||
# ınstall git if not installed
|
||||
if ! command -v git &> /dev/null
|
||||
then
|
||||
echo "git could not be found"
|
||||
echo "Installing git..."
|
||||
su -c "apt update && apt install git -y"
|
||||
else
|
||||
echo "git is installed"
|
||||
fi
|
||||
|
||||
# Update the machine
|
||||
sudo apt update
|
||||
sudo apt upgrade -y
|
||||
|
||||
# Install cpu limit and gawk
|
||||
apt install cpulimit -y
|
||||
apt install gawk -y #incase it is not installed
|
||||
|
||||
# Download and install Go
|
||||
wget https://go.dev/dl/$GO_BINARY || { echo "Failed to download Node! Exiting..."; exit_message; exit 1; }
|
||||
sudo tar -xvf $GO_BINARY || { echo "Failed to extract Go! Exiting..."; exit_message; exit 1; }
|
||||
sudo rm -rf /usr/local/go || { echo "Failed to remove existing Go! Exiting..."; exit_message; exit 1; }
|
||||
sudo mv go /usr/local || { echo "Failed to move go! Exiting..."; exit_message; exit 1; }
|
||||
sudo rm $GO_BINARY || { echo "Failed to remove downloaded archive! Exiting..."; exit_message; exit 1; }
|
||||
|
||||
|
||||
# Set Go environment variables
|
||||
echo "⏳Setting Go environment variables..."
|
||||
sleep 2 # Add a 2-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 2 # Add a 2-second delay
|
||||
|
||||
# Check GO Version
|
||||
go version
|
||||
sleep 2 # Add a 2-second delay
|
||||
|
||||
# Install gRPCurl
|
||||
echo "⏳Installing gRPCurl"
|
||||
sleep 1 # Add a 1-second delay
|
||||
go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest
|
||||
}
|
||||
|
||||
# Install Node
|
||||
install_node() {
|
||||
echo "Installing node..."
|
||||
# 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
|
||||
|
||||
# Check if directory ~/ceremonyclient exists, download from github
|
||||
if [ -d ~/ceremonyclient ]; then
|
||||
# Check if backup directory ~/backup/qnode_keys exists, if not create it
|
||||
if [ ! -d ~/backup/qnode_keys ]; then
|
||||
mkdir -p ~/backup/qnode_keys
|
||||
fi
|
||||
|
||||
# Check if files exist, then backup
|
||||
if [ -f ~/ceremonyclient/node/.config/keys.yml ]; then
|
||||
cp ~/ceremonyclient/node/.config/keys.yml ~/backup/qnode_keys/
|
||||
echo "✅ Backup of keys.yml created in ~/backup/qnode_keys folder"
|
||||
fi
|
||||
|
||||
if [ -f ~/ceremonyclient/node/.config/config.yml ]; then
|
||||
cp ~/ceremonyclient/node/.config/config.yml ~/backup/qnode_keys/
|
||||
echo "✅ Backup of config.yml created in ~/backup/qnode_keys folder"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Download Ceremonyclient
|
||||
echo "⏳Downloading Ceremonyclient"
|
||||
sleep 1 # Add a 1-second delay
|
||||
cd ~
|
||||
if [ -d "ceremonyclient" ]; then
|
||||
echo "Directory ceremonyclient already exists, skipping git clone..."
|
||||
else
|
||||
until git clone https://source.quilibrium.com/quilibrium/ceremonyclient.git || git clone https://git.quilibrium-mirror.ch/agostbiro/ceremonyclient.git; do
|
||||
echo "Git clone failed, retrying..."
|
||||
sleep 2
|
||||
done
|
||||
fi
|
||||
cd ~/ceremonyclient/
|
||||
git remote set-url origin https://source.quilibrium.com/quilibrium/ceremonyclient.git || git remote set-url origin https://git.quilibrium-mirror.ch/agostbiro/ceremonyclient.git
|
||||
git checkout release-cdn-cdn
|
||||
|
||||
|
||||
|
||||
# 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 2 # Add a 2-second delay
|
||||
|
||||
# Check if the file exists before attempting to remove it
|
||||
if [ -f "/lib/systemd/system/ceremonyclient.service" ]; then
|
||||
# If the file exists, remove it
|
||||
rm /lib/systemd/system/ceremonyclient.service
|
||||
echo "ceremonyclient.service file removed."
|
||||
else
|
||||
# If the file does not exist, inform the user
|
||||
echo "ceremonyclient.service file does not exist. No action taken."
|
||||
fi
|
||||
|
||||
sudo tee /lib/systemd/system/ceremonyclient.service > /dev/null <<EOF
|
||||
[Unit]
|
||||
Description=Ceremony Client Go App Service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=5s
|
||||
WorkingDirectory=$NODE_PATH
|
||||
ExecStart=$EXEC_START
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable ceremonyclient
|
||||
|
||||
# Start the ceremonyclient service
|
||||
echo "✅Starting Ceremonyclient Service"
|
||||
sleep 1 # Add a 1-second delay
|
||||
sudo service ceremonyclient start
|
||||
|
||||
# See the logs of the ceremonyclient service
|
||||
echo "🎉Welcome to Quilibrium Ceremonyclient"
|
||||
}
|
||||
|
||||
configure_grpcurl() {
|
||||
echo "Configuring grpcurl..."
|
||||
line_exists() {
|
||||
grep -qF "$1" "$2"
|
||||
}
|
||||
|
||||
# Enable gRPC
|
||||
echo "Enabling gRPC..."
|
||||
cd "$HOME/ceremonyclient/node" || { echo "Failed to change directory to ~/ceremonyclient/node! Exiting..."; exit 1; }
|
||||
|
||||
# Check if the line listenGrpcMultiaddr: /ip4/127.0.0.1/tcp/8337 exists
|
||||
if ! line_exists "listenGrpcMultiaddr: /ip4/127.0.0.1/tcp/8337" .config/config.yml; then
|
||||
# Check if the line listenGrpcMultiaddr: "" exists
|
||||
if line_exists "listenGrpcMultiaddr: \"\"" .config/config.yml; then
|
||||
# Substitute listenGrpcMultiaddr: "" with listenGrpcMultiaddr: /ip4/127.0.0.1/tcp/8337
|
||||
sudo sed -i 's#^listenGrpcMultiaddr:.*$#listenGrpcMultiaddr: /ip4/127.0.0.1/tcp/8337#' .config/config.yml || { echo "Failed to enable gRPC! Exiting..."; exit 1; }
|
||||
else
|
||||
# Add listenGrpcMultiaddr: /ip4/127.0.0.1/tcp/8337
|
||||
echo "listenGrpcMultiaddr: /ip4/127.0.0.1/tcp/8337" | sudo tee -a .config/config.yml > /dev/null || { echo "Failed to enable gRPC! Exiting..."; exit 1; }
|
||||
fi
|
||||
else
|
||||
echo "gRPC already enabled."
|
||||
fi
|
||||
|
||||
|
||||
# Check if the line listenRESTMultiaddr: /ip4/127.0.0.1/tcp/8338 exists
|
||||
if ! line_exists "listenRESTMultiaddr: /ip4/127.0.0.1/tcp/8338" .config/config.yml; then
|
||||
# Check if the line listenRESTMultiaddr: "" exists
|
||||
if line_exists "listenRESTMultiaddr: \"\"" .config/config.yml; then
|
||||
# Substitute listenRESTMultiaddr: "" with listenRESTMultiaddr: /ip4/127.0.0.1/tcp/8338
|
||||
sudo sed -i 's#^listenRESTMultiaddr:.*$#listenRESTMultiaddr: /ip4/127.0.0.1/tcp/8338#' .config/config.yml || { echo "Failed to enable gRPC! Exiting..."; exit 1; }
|
||||
else
|
||||
# Add listenRESTMultiaddr: /ip4/127.0.0.1/tcp/8338
|
||||
echo "listenRESTMultiaddr: /ip4/127.0.0.1/tcp/8338" | sudo tee -a .config/config.yml > /dev/null || { echo "Failed to enable gRPC! Exiting..."; exit 1; }
|
||||
fi
|
||||
else
|
||||
echo "gRPC already enabled."
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Enable Stats Collection
|
||||
echo "Enabling Stats Collection..."
|
||||
if ! line_exists " statsMultiaddr: \"/dns/stats.quilibrium.com/tcp/443\"" .config/config.yml; then
|
||||
sudo sed -i '/^ *engine:/a\ statsMultiaddr: "/dns/stats.quilibrium.com/tcp/443"' .config/config.yml || { echo "Failed to enable Stats Collection! Exiting..."; exit 1; }
|
||||
else
|
||||
echo "Stats Collection already enabled."
|
||||
fi
|
||||
|
||||
# Check if both lines were added successfully
|
||||
if line_exists "listenGrpcMultiaddr: /ip4/127.0.0.1/tcp/8337" .config/config.yml && line_exists " statsMultiaddr: \"/dns/stats.quilibrium.com/tcp/443\"" .config/config.yml; then
|
||||
echo "Success: The script successfully edited your config.yml file."
|
||||
else
|
||||
echo "ERROR: The script failed to correctly edit your config.yml file."
|
||||
echo "You may want to follow the online guide to do it manually."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "gRPC calls setup was successful."
|
||||
}
|
||||
|
||||
update_node() {
|
||||
echo "Updating node..."
|
||||
service ceremonyclient stop
|
||||
|
||||
apt install cpulimit -y
|
||||
apt install gawk -y #incase it is not installed
|
||||
|
||||
# Download Binary
|
||||
echo "⏳ Downloading New Release v$VERSION"
|
||||
cd ~/ceremonyclient
|
||||
git remote set-url origin https://source.quilibrium.com/quilibrium/ceremonyclient.git || git remote set-url origin https://git.quilibrium-mirror.ch/agostbiro/ceremonyclient.git
|
||||
git pull
|
||||
git checkout release-cdn-cdn
|
||||
|
||||
# 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"
|
||||
|
||||
# Re-Create Ceremonyclient Service
|
||||
echo "⏳ Re-Creating Ceremonyclient Service"
|
||||
sleep 2 # Add a 2-second delay
|
||||
SERVICE_FILE="/lib/systemd/system/ceremonyclient.service"
|
||||
if [ ! -f "$SERVICE_FILE" ]; then
|
||||
echo "📝 Creating new ceremonyclient service file..."
|
||||
if ! sudo tee "$SERVICE_FILE" > /dev/null <<EOF
|
||||
[Unit]
|
||||
Description=Ceremony Client Go App Service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=5s
|
||||
WorkingDirectory=$NODE_PATH
|
||||
ExecStart=$EXEC_START
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
then
|
||||
echo "❌ Error: Failed to create ceremonyclient service file." >&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "🔍 Checking existing ceremonyclient service file..."
|
||||
# Check if the required lines exist and if they are different
|
||||
if ! grep -q "WorkingDirectory=$NODE_PATH" "$SERVICE_FILE" || ! grep -q "ExecStart=$EXEC_START" "$SERVICE_FILE"; then
|
||||
echo "🔄 Updating existing ceremonyclient service file..."
|
||||
# Replace the existing lines with new values
|
||||
sudo sed -i "s|WorkingDirectory=.*|WorkingDirectory=$NODE_PATH|" "$SERVICE_FILE"
|
||||
sudo sed -i "s|ExecStart=.*|ExecStart=$EXEC_START|" "$SERVICE_FILE"
|
||||
else
|
||||
echo "✅ No changes needed."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Start the ceremonyclient service
|
||||
echo "✅ Starting Ceremonyclient Service"
|
||||
sleep 2 # Add a 2-second delay
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable ceremonyclient
|
||||
sudo service ceremonyclient start
|
||||
|
||||
# See the logs of the ceremonyclient service
|
||||
echo "🎉 Welcome to Quilibrium Ceremonyclient v$VERSION"
|
||||
}
|
||||
|
||||
check_visibility() {
|
||||
echo "⏳Processing..."
|
||||
sleep 2 # Add a 2-second delay
|
||||
|
||||
# Bootstrap peer list
|
||||
bootstrap_peers=(
|
||||
"EiDpYbDwT2rZq70JNJposqAC+vVZ1t97pcHbK8kr5G4ZNA=="
|
||||
"EiCcVN/KauCidn0nNDbOAGMHRZ5psz/lthpbBeiTAUEfZQ=="
|
||||
"EiDhVHjQKgHfPDXJKWykeUflcXtOv6O2lvjbmUnRrbT2mw=="
|
||||
"EiDHhTNA0yf07ljH+gTn0YEk/edCF70gQqr7QsUr8RKbAA=="
|
||||
"EiAnwhEcyjsHiU6cDCjYJyk/1OVsh6ap7E3vDfJvefGigw=="
|
||||
"EiB75ZnHtAOxajH2hlk9wD1i9zVigrDKKqYcSMXBkKo4SA=="
|
||||
"EiDEYNo7GEfMhPBbUo+zFSGeDECB0RhG0GfAasdWp2TTTQ=="
|
||||
"EiCzMVQnCirB85ITj1x9JOEe4zjNnnFIlxuXj9m6kGq1SQ=="
|
||||
)
|
||||
|
||||
# Run the grpcurl command and capture its output
|
||||
output=$(grpcurl -plaintext localhost:8337 quilibrium.node.node.pb.NodeService.GetNetworkInfo)
|
||||
|
||||
# Check if any of the specific peers are in the output
|
||||
visible=false
|
||||
for peer in "${bootstrap_peers[@]}"; do
|
||||
if [[ $output == *"$peer"* ]]; then
|
||||
visible=true
|
||||
echo "You see $peer as a bootstrap peer"
|
||||
else
|
||||
echo "Peer $peer not found"
|
||||
fi
|
||||
done
|
||||
|
||||
if $visible ; then
|
||||
echo "Great, your node is visible!"
|
||||
else
|
||||
echo "Sorry, your node is not visible. Please restart your node and try again."
|
||||
fi
|
||||
}
|
||||
|
||||
node_info() {
|
||||
echo "Getting node info..."
|
||||
cd ~/ceremonyclient/node && ./$NODE_BINARY -node-info
|
||||
}
|
||||
|
||||
|
||||
node_logs() {
|
||||
echo "Getting node logs..."
|
||||
sudo journalctl -u ceremonyclient.service -f --no-hostname -o cat
|
||||
# sudo journalctl -u ceremonyclient.service -n 100 --no-hostname -o cat
|
||||
}
|
||||
|
||||
restart_node() {
|
||||
echo "Restarting node..."
|
||||
service ceremonyclient restart
|
||||
}
|
||||
|
||||
stop_node() {
|
||||
echo "Stopping node..."
|
||||
service ceremonyclient stop
|
||||
echo "Node stopped"
|
||||
}
|
||||
|
||||
|
||||
# Menu
|
||||
while true; do
|
||||
clear
|
||||
echo "This script is made with ❤️ by 0xOzgur.eth @ https://quilibrium.space"
|
||||
echo "Welcome to Quilibrium for Dummies!"
|
||||
|
||||
echo "
|
||||
_____ _ _ _ _ _
|
||||
/ ___ \ (_) (_) | (_)
|
||||
| | | |_ _ _| |_| | _ ____ _ _ _ ____
|
||||
| | |_| | | | | | | || \ / ___) | | | | \
|
||||
\ \____| |_| | | | | |_) ) | | | |_| | | | |
|
||||
\_____)\____|_|_|_|____/|_| |_|\____|_|_|_|
|
||||
|
||||
___
|
||||
/ __)
|
||||
| |__ ___ ____
|
||||
| __) _ \ / ___)
|
||||
| | | |_| | |
|
||||
_| \___/|_|
|
||||
|
||||
_____ _
|
||||
(____ \ (_)
|
||||
_ \ \ _ _ ____ ____ _ ____ ___
|
||||
| | | | | | | \| \| |/ _ )/___)
|
||||
| |__/ /| |_| | | | | | | | ( (/ /|___ |
|
||||
|_____/ \____|_|_|_|_|_|_|_|\____|___/
|
||||
"
|
||||
|
||||
echo "Welcome you Dummy!"
|
||||
echo "Please follow insturctions very carefully"
|
||||
echo "Please install prerequisites first, then install node, lastly configure grpcurl."
|
||||
echo "Do not forget to restart the node after configuration."
|
||||
echo ""
|
||||
echo "Quilibrium Version: $VERSION"
|
||||
echo ""
|
||||
echo "Please choose an option:"
|
||||
echo ""
|
||||
echo "1) Install Prerequisites 5) Check Visibility 9) Stop Node"
|
||||
echo "2) Install Node 6) Node Info e) Exit"
|
||||
echo "3) Configure grpCurl 7) Node Logs "
|
||||
echo "4) Update Node 8) Restart Node"
|
||||
|
||||
echo ""
|
||||
read -p "Enter your choice: " choice
|
||||
|
||||
case $choice in
|
||||
1) install_prerequisites ;;
|
||||
2) install_node ;;
|
||||
3) configure_grpcurl ;;
|
||||
4) update_node ;;
|
||||
5) check_visibility ;;
|
||||
6) node_info ;;
|
||||
7) node_logs ;;
|
||||
8) restart_node ;;
|
||||
9) stop_node ;;
|
||||
e) break ;;
|
||||
*) echo "Invalid option, please try again." ;;
|
||||
esac
|
||||
echo ""
|
||||
read -n 1 -s -r -p "Press any key to continue"
|
||||
done
|
||||
@ -1,6 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
service ceremonyclient stop
|
||||
apt install unzip -y
|
||||
rm -r $HOME/ceremonyclient/node/.config/store && wget -qO- https://snapshots.cherryservers.com/quilibrium/store.zip > /tmp/store.zip && unzip -j -o /tmp/store.zip -d $HOME/ceremonyclient/node/.config/store && rm /tmp/store.zip
|
||||
service ceremonyclient start
|
||||
58
update.sh
58
update.sh
@ -1,58 +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 "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
|
||||
|
||||
# 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
|
||||
|
||||
# Get the system architecture
|
||||
ARCH=$(uname -m)
|
||||
|
||||
# Get the current user's home directory
|
||||
HOME=$(eval echo ~$HOME_DIR)
|
||||
|
||||
# Use the home directory in the path
|
||||
NODE_PATH="$HOME/ceremonyclient/node"
|
||||
|
||||
# Step10.1:Determine the ExecStart line based on the architecture
|
||||
if [ "$ARCH" = "x86_64" ]; then
|
||||
EXEC_START="$NODE_PATH/node-1.4.18-linux-amd64"
|
||||
elif [ "$ARCH" = "aarch64" ]; then
|
||||
EXEC_START="$NODE_PATH/node-1.4.18-linux-arm64"
|
||||
elif [ "$ARCH" = "arm64" ]; then
|
||||
EXEC_START="$NODE_PATH/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
|
||||
|
||||
# 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
|
||||
echo "✅ Starting Ceremonyclient Service"
|
||||
sleep 2 # Add a 2-second delay
|
||||
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"
|
||||
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
|
||||
sudo journalctl -u ceremonyclient.service -f --no-hostname -o cat
|
||||
48
update/update.sh
Normal file
48
update/update.sh
Normal file
@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set the version number
|
||||
VERSION="1.4.20"
|
||||
|
||||
# Step 0: Welcome
|
||||
echo "This script is made with ❤️ by https://quilibrium.space @ 0xOzgur.eth for scalepod.io"
|
||||
sleep 2 # Add a 2-second delay
|
||||
|
||||
# Stop the ceremonyclient service
|
||||
service ceremonyclient stop
|
||||
|
||||
# Step 1:Download Binary
|
||||
cd ~/ceremonyclient
|
||||
git pull
|
||||
git checkout release-cdn
|
||||
|
||||
# Get the current user's home directory
|
||||
HOME=$(eval echo ~$HOME_DIR)
|
||||
|
||||
# Use the home directory in the path
|
||||
NODE_PATH="$HOME/ceremonyclient/node"
|
||||
EXEC_START="$NODE_PATH/release_autorun.sh"
|
||||
|
||||
# Step 3:Re-Create Ceremonyclient Service
|
||||
rm /lib/systemd/system/ceremonyclient.service
|
||||
sudo tee /lib/systemd/system/ceremonyclient.service > /dev/null <<EOF
|
||||
[Unit]
|
||||
Description=Ceremony Client Go App Service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=5s
|
||||
WorkingDirectory=$NODE_PATH
|
||||
ExecStart=$EXEC_START
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
# Step 3: Update the ExecStart line in the Ceremonyclient Service file
|
||||
# sudo sed -i "s|ExecStart=.*|ExecStart=$EXEC_START|" /lib/systemd/system/ceremonyclient.service
|
||||
|
||||
# Step 4:Start the ceremonyclient service
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable ceremonyclient
|
||||
sudo service ceremonyclient start
|
||||
@ -13,7 +13,7 @@ service ceremonyclient stop
|
||||
echo "⏳ Downloading New Release v1.4.18"
|
||||
cd ~/ceremonyclient
|
||||
git pull
|
||||
git checkout release
|
||||
git checkout release-cdn
|
||||
|
||||
# Step 7:Build Docker Container
|
||||
echo "⏳Building Ceremonyclient Container"
|
||||
49
update/update_arm64.sh
Normal file
49
update/update_arm64.sh
Normal file
@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set the version number
|
||||
VERSION="1.4.18"
|
||||
|
||||
# Step 0: Welcome
|
||||
echo "This script is made with ❤️ by https://quilibrium.space @ 0xOzgur.eth for scalepod.io"
|
||||
sleep 2 # Add a 2-second delay
|
||||
|
||||
# Stop the ceremonyclient service
|
||||
service ceremonyclient stop
|
||||
|
||||
# Step 1:Download Binary
|
||||
cd ~/ceremonyclient
|
||||
git remote set-url origin https://source.quilibrium.com/quilibrium/ceremonyclient.git
|
||||
git pull
|
||||
git checkout release-cdn
|
||||
|
||||
# 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/node-$VERSION-linux-arm64"
|
||||
|
||||
# Step 3:Re-Create Ceremonyclient Service
|
||||
rm /lib/systemd/system/ceremonyclient.service
|
||||
sudo tee /lib/systemd/system/ceremonyclient.service > /dev/null <<EOF
|
||||
[Unit]
|
||||
Description=Ceremony Client Go App Service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=5s
|
||||
WorkingDirectory=$NODE_PATH
|
||||
ExecStart=$EXEC_START
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
# Step 3: Update the ExecStart line in the Ceremonyclient Service file
|
||||
# sudo sed -i "s|ExecStart=.*|ExecStart=$EXEC_START|" /lib/systemd/system/ceremonyclient.service
|
||||
|
||||
# Step 4:Start the ceremonyclient service
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable ceremonyclient
|
||||
sudo service ceremonyclient start
|
||||
Loading…
Reference in New Issue
Block a user