Network
EVM
Aztec
Info

You could get a "Apprentice" Role by executing this

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"

then you can see a result from it, then replace THE_RESULT with the output you have seen above

curl -s -X POST -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","method":"node_getArchiveSiblingPath","params":["THE_RESULT","THE_RESULT"],"id":67}' \
http://localhost:8080 | jq -r ".result"

You will see the Sync Proof which Copy the result, then you can go to https://discord.com/channels/1144692727120937080/1367196595866828982 (opens in a new tab) Type /operator start and fill those accordingly

Congratulations, the Apprentice role has been assigned!

HOW TO FIND MY PEERID?

Prerequisite:

NodeJS: v20 or 22

Execute the following commands

npm install libp2p-crypto peer-id buffer

Create a direcotory where we are working

mkdir -p $HOME/cvPeerID
cd $HOME/cvPeerID/
touch $HOME/cvPeerID/convertMyPeerId.mjs

Open this file

$HOME/cvPeerID/convertMyPeerId.mjs

Copy all of these lines

import { keys } from 'libp2p-crypto';
const { unmarshalPrivateKey, generateKeyPairFromSeed } = keys;
import PeerId from 'peer-id';
import { Buffer } from 'buffer';
import fs from 'node:fs/promises';
import os from 'node:os';
import path from 'node:path';
 
async function getPeerIdFromFile() {
    let hexEncodedPrivateKeyProtobuf;
    try {
        const filePath = path.join(os.homedir(), '.aztec', 'alpha-testnet', 'data', 'p2p-private-key');
        hexEncodedPrivateKeyProtobuf = (await fs.readFile(filePath, { encoding: 'utf8' })).trim();
    } catch (readError) {
        console.error(`Failed to read private key file: ${readError.message}`);
        return;
    }
 
    if (!hexEncodedPrivateKeyProtobuf || hexEncodedPrivateKeyProtobuf.length === 0) {
        console.error("Private key file is empty or invalid.");
        return;
    }
 
    try {
        const privateKey = await unmarshalPrivateKey(Buffer.from(hexEncodedPrivateKeyProtobuf, 'hex'));
        const peerId = await PeerId.createFromPrivKey(privateKey.bytes);
        console.log("PeerID:", peerId.toB58String());
    } catch (error) {
        console.error("Failed to convert primary key:", error.message);
        console.log("Trying alternative method (extract raw key)...");
 
        const hexRawPrivateKey = hexEncodedPrivateKeyProtobuf.substring(8);
        const rawPrivateKeyBytes = Buffer.from(hexRawPrivateKey, 'hex');
 
        if (rawPrivateKeyBytes.length === 32) {
            console.log("Creating PeerID from raw Ed25519 key...");
            try {
                const keyPair = await generateKeyPairFromSeed('Ed25519', rawPrivateKeyBytes, 256);
                const peerIdFromRaw = await PeerId.createFromPrivKey(keyPair.bytes);
                console.log("PeerID from raw key (Ed25519):", peerIdFromRaw.toB58String());
            } catch (e) {
                console.error("Failed to create PeerID from raw key:", e.message);
            }
        } else {
            console.error(`Raw key length (${rawPrivateKeyBytes.length} bytes) is not suitable for Ed25519 (should be 32 bytes). Raw key hex: ${hexRawPrivateKey}`);
        }
    }
}
 
getPeerIdFromFile();

You can check your p2p key by executing this

node $HOME/cvPeerID/convertMyPeerId.mjs

You Will see the Node PeerID in the result

How to register as Validator

After all has been set up, you can regist your Address to become a Validator

  aztec add-l1-validator \ 
  --l1-rpc-urls $ETH_SEPOLIA_RPC \
  --private-key $PRIVATE_KEY \
  --attester $WALLET_ADDRESS \
  --proposer-eoa $WALLET_ADDRESS \
  --staking-asset-handler 0xF739D03e98e23A7B65940848aBA8921fF3bAc4b2 \
  --l1-chain-id 11155111

How to stop nodes?

sudo systemctl disable --now aztec-sequencer
sudo systemctl disable --now aztec-sequencer
sudo rm -rf ~/.aztec