8000 GitHub - 0xmoei/aztec-network: A step by step guide on How to Install Aztec Network Sequencer on Testnet
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

0xmoei/aztec-network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

62 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Aztec Network Sequencer Node

A step by step guide on How to Run Sequencer Node on Aztec Network Testnet & Earn Apprentice Role.

  • What types of nodes can participate in the testnet?
    • Sequencer: proposes blocks, validates blocks from others, and votes on upgrades.
    • Prover: generates ZK proofs that attest to roll-up integrity.

Roles Info

Sequecner Nodes will receive a certain role for their contribution on Discord.

After running and syncing your Sequencer node, You can go through Get Role step.


Hardware Requirements

Sequencer Node HW Requirements
RAM CPU Disk
8-16 GB 4-9 cores 100+ GB SSD
  • Prover Node: Requiring ~40x machines with 16 cores and 128GB RAM
  • I don't run Prover since it's for data-center computing systems, not me.

Windows Users: must install Ubuntu on Windows using this guide, then continue further steps.

VPS Users: can get started via a VPS with 4 cores CPU, 8GB RAM! Purchase here


1. Install Dependecies

  • Update packages:
sudo apt-get update && sudo apt-get upgrade -y
  • Install Packages:
sudo apt install curl iptables build-essential git wget lz4 jq make gcc nano automake autoconf tmux htop nvme-cli libgbm1 pkg-config libssl-dev libleveldb-dev tar clang bsdmainutils ncdu unzip libleveldb-dev  -y
  • Install Docker:
sudo apt update -y && sudo apt upgrade -y
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done

sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

echo \
  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt update -y && sudo apt upgrade -y

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

# Test Docker
sudo docker run hello-world

sudo systemctl enable docker
sudo systemctl restart docker

2. Install Aztec Tools

bash -i <(curl -s https://install.aztec.network)
echo 'export PATH="$HOME/.aztec/bin:$PATH"' >> ~/.bashrc

source ~/.bashrc
  • Restart your Terminal now to apply changes.
  • Check if you installed successfully:
aztec

3. Update Aztec

aztec-up latest

4. Obtain RPC URLs

  • Find a 3rd party that supports Sepolia RPC URL & Sepolia BEACON URL APIs.
  • Most of your usage is RPC URL. I recommend to use Alchemy for RPC URL & Use drpc for Beacon URL.

More details on RPC solutions:

Get Your Own RPC by Running Geth & Prysm Nodes

  • You can run your own local RPC nodes by following this guide: geth-prysm-node. You may need 600-1000 GB SSD

Free:

  • RPC URL: Create a Sepolia Ethereum HTTP API in Alchemy
  • BEACON RPC: Create an account on drpc and search for Sepolia Ethereum Beacon Chain Endpoints.

image

Paid:

For example: Ankr is supporting RPC URL & Beacon URL. You can Register, Fund it with a little USDT via your wallet, Create a project, get your normal sepolia rpc and beacon sepolia rpc.

image

image

You can run your own Geth & Prysm nodes to get your own RPC URL & BEACON RPC or find any other 3rd party solutions


5. Generate Ethereum Keys

Get an EVM Wallet with Private Key and Public Address saved.


6. Get Sepolia ETH

Fund your Ethereum Wallet with ETH Sepolia


7. Find IP

curl ipv4.icanhazip.com
  • Save it

8. Enable Firewall & Open Ports

# Firewall
ufw allow 22
ufw allow ssh
ufw enable

# Sequencer
ufw allow 40400
ufw allow 8080

9. Run Sequencer Node

You can run Sequencer Node through one of these two methods: Docker or CLI

Method 1: Run via Docker (Recommended)

  • Delete CLI Node
# Stop docker containers
docker stop $(docker ps -q --filter "ancestor=aztecprotocol/aztec") && docker rm $(docker ps -a -q --filter "ancestor=aztecprotocol/aztec")

# Stop screens
screen -ls | grep -i aztec | awk '{print $1}' | xargs -I {} screen -X -S {} quit
  • Create aztec directory:
mkdir aztec
  • Get into aztec directory:
cd aztec
  • Create .env
nano .env
  • Replace the following code in .env
ETHEREUM_RPC_URL=RPC_URL
CONSENSUS_BEACON_URL=BEACON_URL
VALIDATOR_PRIVATE_KEY=0xYourPrivateKey
COINBASE=0xYourAddress
P2P_IP=P2P_IP
  • Replace the following variables before you Run Node:

    • RPC_URL & BEACON_URL: Step 4
    • 0xYourPrivateKey: Your EVM wallet private key starting with 0x...
    • 0xYourAddress: Your EVM wallet public address starting with 0x...
    • P2P_IP: Your server IP (Step 7)
  • Create docker-compose.yml:

nano docker-compose.yml
  • Replace the following code in docker-compose.yml
services:
  aztec-node:
    container_name: aztec-sequencer
    network_mode: host 
    image: aztecprotocol/aztec:latest
    restart: unless-stopped
    environment:
      ETHEREUM_HOSTS: ${ETHEREUM_RPC_URL}
      L1_CONSENSUS_HOST_URLS: ${CONSENSUS_BEACON_URL}
      DATA_DIRECTORY: /data
      VALIDATOR_PRIVATE_KEY: ${VALIDATOR_PRIVATE_KEY}
      COINBASE: ${COINBASE}
      P2P_IP: ${P2P_IP}
      LOG_LEVEL: debug
    entrypoint: >
      sh -c 'node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js start --network alpha-testnet --node --archiver --sequencer'
    ports:
      - 40400:40400/tcp
      - 40400:40400/udp
      - 8080:8080
    volumes:
      - /root/.aztec/alpha-testnet/data/:/data

Note: My node data directory configued in docker-compose.yml is /root/.aztec/alpha-testnet/data/, yours can be anything.

  • Run Node Docker:
docker compose up -d
  • Node Logs:
docker compose logs -fn 1000
  • Optional: Stop and Kill Node
docker compose down -v
  • Done, you can now head to Step 10.

Method 2: Run via CLI

  • Open screen
screen -S aztec
  • Run Node
aztec start --node --archiver --sequencer \
  --network alpha-testnet \
  --l1-rpc-urls RPC_URL  \
  --l1-consensus-host-urls BEACON_URL \
  --sequencer.validatorPrivateKey 0xYourPrivateKey \
  --sequencer.coinbase 0xYourAddress \
  --p2p.p2pIp IP

Replace the following variables before you Run Node:

  • RPC_URL & BEACON_URL: Step 4
  • 0xYourPrivateKey: Your EVM wallet private key starting with 0x...
  • 0xYourAddress: Your EVM wallet public address starting with 0x...
  • IP: Your server IP (Step 7)

Optional Commands:

Screen Commands:

  • Minimze screen: Ctrl + A + D
  • Return to screen: screen -r aztec
  • Kill screen (when inside): Ctrl+`C+
  • Kill screen (when outside): screen -XS aztec quit

10. Sync Node

After entering the command, your node starts running, It takes a few minutes for your node to get synced.

  • Check the latest synced block number of your sequencer:
curl -s -X POST -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","method":"node_getL2Tips","params":[],"id":67}' \
http://localhost:8080 | jq -r ".result.proven.number"

11. Register Validator

Make sure your Sequencer node is fully synced, before you proceed with Validator registration

aztec add-l1-validator \
  --l1-rpc-urls RPC_URL \
  --private-key your-private-key \
  --attester your-validator-address \
  --proposer-eoa your-validator-address \
  --staking-asset-handler 0xF739D03e98e23A7B65940848aBA8921fF3bAc4b2 \
  --l1-chain-id 11155111

Replace RPC_URL, your-validator-address & 2x your-validator-address, then proceed

  • Note: There's a daily quota of 5 validators registration per day, if you get error, try again tommorrow.
  • If your Validator's Registration was successfull, you can check its stats on Aztec Scan

12. Verify Node's Peer ID:

Find your Node's Peer ID:

sudo docker logs $(docker ps -q --filter ancestor=aztecprotocol/aztec:latest | head -n 1) 2>&1 | grep -i "peerId" | grep -o '"peerId":"[^"]*"' | cut -d'"' -f4 | head -n 1
  • This reveals your Node's Peer ID, Now search it on Nethermind Explorer
  • Note: It might takes some hours for your node to show up in Nethermind Explorer after it fully synced.

Sequencer/Validator Health Check

  • Validator attestation stats:

https://t.me/aztec_seer_bot

image


πŸ”ƒ Update Sequencer Node

1- Stop Node:

docker stop $(docker ps -q --filter "ancestor=aztecprotocol/aztec") && docker rm $(docker ps -a -q --filter "ancestor=aztecprotocol/aztec")

screen -ls | grep -i aztec | awk '{print $1}' | xargs -I {} screen -X -S {} quit

2- Update Node:

source ~/.bashrc
aztec-up latest

3- Delete old data:

rm -rf ~/.aztec/alpha-testnet/data/

4- Re-run Node

  • CLI nodes: Re-run using your previous CLI command.
  • Docker nodes: Re-run by entering cd aztec && docker compose up -d
    • Docker nodes: Ensure your docker-compose.yml file is updated to match my configuration provided in the guide.
  • For more detailed steps, return to Step 9: Run Sequencer Node to re-run your node.

Troubleshooting:

If you encountered: ERROR: world-state:block_stream Error processing block stream: Error: Obtained L1 to L2 messages failed to be hashed to the block inHash

  • You have to stop your node, delete data and restart it.
  • Follow Update Node steps

Get Guardian Discord Role:

Claim the Guardian role as you are running a Sequencer Node and keep an uptime.

  • To claim:

    • Go to the upgrade-role channel
    • Type /checkip
    • Enter your IP & Node Address
  • If you are not eligible to claim the Guardian role, wait until the next snapshot.

About

A step by step guide on How to Install Aztec Network Sequencer on Testnet

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0