#!/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