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.
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.
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
- 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
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
aztec-up latest
- Find a 3rd party that supports Sepolia
RPC URL
& SepoliaBEACON URL
APIs. - Most of your usage is
RPC URL
. I recommend to use Alchemy forRPC URL
& Use drpc forBeacon URL
.
More details on RPC solutions:
- You can run your own local RPC nodes by following this guide: geth-prysm-node. You may need 600-1000 GB SSD
RPC URL
: Create a Sepolia Ethereum HTTP API in AlchemyBEACON RPC
: Create an account on drpc and search forSepolia Ethereum Beacon Chain
Endpoints.
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.
You can run your own Geth & Prysm nodes to get your own
RPC URL
&BEACON RPC
or find any other 3rd party solutions
Get an EVM Wallet with Private Key
and Public Address
saved.
Fund your Ethereum Wallet with ETH Sepolia
curl ipv4.icanhazip.com
- Save it
# Firewall
ufw allow 22
ufw allow ssh
ufw enable
# Sequencer
ufw allow 40400
ufw allow 8080
You can run Sequencer Node through one of these two methods: Docker
or CLI
- 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 40xYourPrivateKey
: Your EVM wallet private key starting with0x...
0xYourAddress
: Your EVM wallet public address starting with0x...
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.
- 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 40xYourPrivateKey
: Your EVM wallet private key starting with0x...
0xYourAddress
: Your EVM wallet public address starting with0x...
IP
: Your server IP (Step 7)
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
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"
- Check the latest block number of Aztec network: https://aztecscan.xyz/
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
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.
- Validator attestation stats:
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
source ~/.bashrc
aztec-up latest
rm -rf ~/.aztec/alpha-testnet/data/
CLI
nodes: Re-run using your previous CLI command.Docker
nodes: Re-run by enteringcd aztec && docker compose up -d
Docker
nodes: Ensure yourdocker-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.
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
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
- Go to the
-
If you are not eligible to claim the Guardian role, wait until the next snapshot.