How to Run a Sequencer Node
Background
The Aztec sequencer node is critical infrastructure responsible for ordering transactions and producing blocks.
When transactions enter the network, the sequencer node bundles them into blocks, checking various constraints such as gas limits, block size, and transaction validity. Before a block can be published, it must be validated by a committee of other sequencer nodes (validators in this context) who re-execute the transactions to verify their correctness. These validators attest to the block's validity by signing it, and once enough attestations are collected (two-thirds of the committee plus one), the sequencer can submit the block to L1.
The archiver component complements this process by maintaining historical chain data. It continuously monitors L1 for new blocks, processes them, and maintains a synchronized view of the chain state. This includes managing contract data, transaction logs, and L1-to-L2 messages, making it essential for network synchronization and data availability.
Prerequisites
Before following this guide, make sure you:
- Have the
aztec
tool installed - Are running a Linux or MacOS machine with access to a terminal
Setting Up Your Sequencer
This guide will describe how to setup your sequencer using the aztec start
command. For more advanced setups, refer to the Advanced Configuration section below.
The aztec start
tool is a one-stop-shop for running your sequencer on any Aztec Network. It assigns default values to several config variables based on a --network
flag and launches a docker container running the sequencer software.
To use the aztec start
command, you need to obtain the following:
RPCs
-
An L1 execution client (for reading transactions and state). It can be specified via the
--l1-rpc-urls
flag when usingaztec start
or via the env varETHEREUM_HOSTS
. -
An L1 consensus client (for blobs). It can be specified via the
--l1-consensus-host-urls
flag when usingaztec start
or via the env varL1_CONSENSUS_HOST_URLS
. -
To reduce load on your consensus endpoint, the Aztec sequencer supports an optional (but recommended) remote server that serves blobs to the client. You can pass your own or use one provided by a trusted party via the
--sequencer.blobSinkUrl
flag when usingaztec start
, or via the env varBLOB_SINK_URL
.
Ethereum Keys
You will need an Ethereum private key and the corresponding public address. The private key is set via the --sequencer.validatorPrivateKey
flag while the public address should be specified via the --sequencer.coinbase
flag.
The private key is needed as your validator will post blocks to Ethereum, and the public address will be the recipient of any block rewards.
Networking
You MUST forward your ports. Your router must send UDP and TCP traffic on port 40400
(unless you changed the default) to your IP address on your local network. Failure to do so may result in your sequencer not participating on the p2p network.
As a tip, configure your router to give your MAC address the same IP address every time it does a DHCP refresh.
You also need to grab your external IP address and pass it along to the --p2p.p2pIp
when using aztec start
.
Sepolia ETH
You'll need Sepolia ETH to cover gas costs. Here are some options:
- Use a PoW faucet like Sepolia PoW Faucet
- Ask in our Discord community (and remember to pay it forward when you can!)
Now Start Your Sequencer
To boot up a sequencer using aztec start
, run the following command:
aztec start --network alpha-testnet \
--l1-rpc-urls https://example.com \
--l1-consensus-host-urls https://example.com \
--sequencer.validatorPrivateKey 0xYourPrivateKey \
--sequencer.coinbase 0xYourAddress
--p2p.p2pIp 999.99.999.99
For a full overview of all available commands, check out the CLI reference sheet.
If you are unable to determine your public ip. Running the command curl ifconfig.me
can retrieve it for you.
Register as a Validator
Once your node is fully synced, you can register as a validator using the add-l1-validator
command:
aztec add-l1-validator \
--network alpha-testnet \
--l1-rpc-urls https://eth-sepolia.g.example.com/example/your-key \
--private-key your-private-key \
--attester your-validator-address \
--proposer-eoa your-validator-address \
--staking-asset-handler 0xF739D03e98e23A7B65940848aBA8921fF3bAc4b2 \
--l1-chain-id 11155111 \
Advanced Configuration
Using Environment Variables
Every flag in the aztec start
command corresponds to an environment variable. You can see the variable names by running aztec start --help
. A reference is provided here.
For example:
--l1-rpc-urls
maps toETHEREUM_HOSTS
--l1-consensus-host-urls
maps toL1_CONSENSUS_HOSTS_URLS
You can create a .env
file with these variables:
ETHEREUM_HOSTS=https://example.com
L1_CONSENSUS_HOST_URLS=https://example.com
# Add other configuration variables as needed
Then source this file before running your command:
source .env
aztec start --network alpha-testnet --archiver --node --sequencer # other flags...
Using a Docker Compose
If you would like to run in a docker compose, you can use a configuration like the one below:
name: aztec-node
services:
network_mode: host # Optional, run with host networking
node:
image: aztecprotocol/aztec:0.85.0-alpha-testnet.2
environment:
ETHEREUM_HOSTS: ""
L1_CONSENSUS_HOST_URLS: ""
DATA_DIRECTORY: /data
VALIDATOR_PRIVATE_KEY: $VALIDATOR_PRIVATE_KEY
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 start --node --archiver --sequencer'
ports:
- 40400:40400/tcp
- 40400:40400/udp
- 8080:8080
volumes:
- /home/my-node/node:/data # Local directory
Troubleshooting
L1 Access
If you're hosting your own Ethereum execution or consensus client locally (rather than using an external RPC like Alchemy), you need to ensure that the prover node inside Docker can reach it.
By default, Docker runs containers on a bridge network that isolates them from the host machine’s network interfaces. This means localhost inside the container won’t point to the host’s localhost.
To fix this:
Option 1: Use the special hostname host.docker.internal This tells Docker to route traffic from the container to the host machine. For example:
--l1-rpc-urls http://host.docker.internal:8545
Option 2: Add a host network entry to your Docker Compose file (advanced users)
This gives your container direct access to the host’s network stack, but removes Docker’s network isolation. Add to your docker-compose.yml
network_mode: "host"
⚠️ Note: network_mode: "host" only works on Linux. On macOS and Windows, use host.docker.internal
.
Happy sequencing!