CodeBlockLabs
CommunityPromo VPS
  • Welcome
  • Getting Started
    • What is Node?
    • Your First Nodes
  • Blockchain Nodes
    • Aztec Network
      • Installation
      • Auto Restart
    • Banano
      • Installation
      • Node Configuration
      • RPC Command
      • Cli Command
      • Other
    • BlockCast
      • Installation
    • BlockX
      • Installation
      • Useful Command
    • Elys
      • Installation
      • Useful Command
    • Ethereum
    • LayerEdge
      • Installation
      • Automation
    • Lumera
      • Installation
      • Useful Command
      • Snapshot
    • RaiBlocksOne
      • Installation
      • RPC Command
      • Other
    • RaiCoin
      • Installation
      • Node Configuration
      • RPC Command
      • Other
    • Selfchain
      • Installation
      • Useful Command
      • Snapshot
    • Symphony
      • Installation
      • Useful Command
      • Snapshot
      • Oracle
      • Patch
  • Other
    • Automation Scripts
      • Auto Send
    • Blockchain Explorer
    • Go Version Manager (Multi Go)
    • NodeJS
    • Proxmox
      • Proxmox Installation
      • Proxmox FAQ
    • WSL
      • Linux Packages
Powered by GitBook
On this page
  1. Blockchain Nodes
  2. Aztec Network

Auto Restart

bash script for auto restart the aztec nodes if there is an error.

Create new file named run_aztech.sh

sudo nano run_aztec.sh

then add code below:

#!/bin/bash

# Function to run the aztec command
run_aztec() {
    aztec start --node --archiver --sequencer \
        --network alpha-testnet \
        --l1-rpc-urls http://YOUR_RPC_URL \
        --l1-consensus-host-urls http://YOUR_BEACON_URL \
        --sequencer.validatorPrivateKey YOUR_PRIVATE_KEY\
        --sequencer.coinbase YOUR_ADDRESS \
        --p2p.p2pIp 38.102.84.231 \
        --p2p.maxTxPoolSize 1000000000 \
        --port 8081
}

# Trap Ctrl+C (SIGINT) to exit the script
trap "echo 'Script stopped by user'; exit" SIGINT

# Main loop
while true; do
    echo "Starting aztec command..."
    run_aztec
    
    # If the command fails, wait 5 seconds before restarting
    if [ $? -ne 0 ]; then
        echo "Command failed or exited. Restarting in 5 seconds..."
        sleep 5
    else
        # If the command exited successfully (unlikely in this case), break the loop
        echo "Command exited successfully. Stopping."
        break
    fi
done

use CTRL+X , Y , Enter to save the file

allow the file to be executed

chmod +x run_aztec.sh

to run the script you just need to use command:

./run_aztec.sh

Stopping the command you'll need to use CTRL+C

PreviousInstallationNextBanano

Last updated 3 days ago