Set up EigenLayer Operator

Step-by-step guide to registering as an operator with Ava Protocol AVS and running the operator software using Docker.

This guide will walk you through the process of registering as an operator to Ava OProtocol AVS and running the Ava Protocol software.

This guide focus on running everything with-in docker container. If you don't want to use docker container, you can follow other guide instead

Prerequisite

An operator need to be onboard and setup their own operator with EigenLayer, following the official document

Software/Hardware Requirement

  • Operating System: Linux, MacOS

  • CPU: x64/arm.

  • vCPUs: 1

  • Memory: 1GiB

  • Storage: 100GB

  • EC2 Equivalent: c6gd.medium, m6g.medium, c7a.medium, c6g.large

  • Expected Network Utilization:

    • Total download bandwidth usage: 1 Mbps
    • Upload bandwidth usage: 1 Mbps
  • Incoming Ports: open firewall for these ports. If you customize the docker compose port then adjust accordingly.

    • Mainnet: 9190, 9191.
    • Holesky: 9290, 9291.
  • Outgoing Ports: 2206

If your cloud providers support Arm CPU, we suggest to use Arm because it's more cost effective.

Operator Setup

1. Clone this repository

git clone git@github.com:AvaProtocol/ap-operator-setup.git

cd ap-operator-setup

We had two directory call holesky and ethereum. To setup testnet, you will do everything inside hokesky directory. For mainnet deployment, you would use files inside ethereum directory.

2. Prepare config file and credential

To setup for holesky testnet, we would do everything inside holesky directory. To setup for ethereum mainnet, we would do everything inside ethereum directory.

Inside holesky or ethereum directory, We will need to prepare 2 files: .env and config.yaml.

  1. Make sure you are under ethereum or holesky direction, and prepare .env file

    cp .env.example .env
    
  2. Then, edit it and fill in these information:

    Specify your operator’s keystore location and password. These are to be used to commit to your registered operator.

    - ECDSA_KEYSTORE_PATH=
    - ECDSA_KEY_PASSWORD=
    - BLS_KEYSTORE_PATH=
    - BLS_KEY_PASSWORD=
    

    Besides, the DB_PATH is to specify the local path to store your operator’s data for our AVS.

    - DB_PATH=
    

    We don't use high io so you can store on a normal volume such as gp3 with 3000 IOPS on EC2.

    If the default ports of PUBLIC_NODEAPI_PORT and PUBLIC_METRICS_PORT were used by different processes, you can also set them to any available ports in your env file too. Make sure to also open firewall to allow traffic incoming to these 2 ports. The default value are:

    • Mainnet: 9190 for metric port, 9191 for node api port.
    • Holesky: 9290 for metric port, 9291 for node api port.
  3. Next, we will create config.yaml file for operator:

    cp config.yaml.example config.yaml
    

    Change the value of operator_address to your own operator wallet address.

3. One-time task: Register your operator to Ava Protocol AVS

This step is only needed to be done once per operator. Also, recall that you would need to cd into holesky for testnet and ethereum for mainnet before running anything.

docker compose run ap-operator register --config=/app/config.yaml

To check the registration status at any given time you can also do:

docker compose run ap-operator status --config=/app/config.yaml

Ensure that you successfully register your operator before moving to step 3.

4. Start to run our AVS

At this point, you're ready to run your AVS. Optionally you can consider setting up alias key by following set up alias keys to avoid direct access to EigenLayer ECDSA operator key. You can also switch to the alias key setup at a later time. There is no requirement on following the exact ordering.

  1. Make sure you are under ./ethereum or ./holesky directory.

  2. Run the following command to start the operator

    docker compose pull
    
    docker compose up --force-recreate -d
    

    Once the operator is up and running, the output log will look like below.

    docker compose up --force-recreate -d
    [+] Running 1/0
    ✔ Container ap_operator  Created
    ✔ Container ap_operator  Started
    

    To view the operator log itself, you can do:

    docker compose logs -f
    

    The log should appear similar to this:

    ap_operator  | {"level":"info","ts":1719529804.5644045,"caller":"operator/operator.go:263","msg":"Connect to aggregator aggregator-holesky.avaprotocol.org:2206"}
    ap_operator  | {"level":"info","ts":1719529804.8751178,"caller":"operator/operator.go:307","msg":"Operator info","operatorId":[74,60,26,85,160,147,136,79,102,183,189,62,99,76,192,151,203,7,97,85,230,236,25,160,46,242,83,194,177,93,63,163],"operatorAddr":"0x2273e70Ea0F159985a9312e875839CbF242f162e","operatorG1Pubkey":"E([13980129839750270625587959504067205960106881892608925358182969477593110597180,2713793992502006479543294653290264953732656227600455037615150886215476630684])","operatorG2Pubkey":"E([10006440951214432193970386287330007898372605552301114697229665952718363326438+2917899138783614023915162275072742305856792653861495716209344717215206657922*u,20465317265628248898772842070116958367267377808142334627836040792686631701030+11895853732396257221594908719294998059804388586884333547663795174064486592588*u])"}
    ap_operator  | {"level":"info","ts":1719529805.3309655,"caller":"operator/operator.go:330","msg":"Starting operator."}
    ap_operator  | {"level":"info","ts":1719529805.3310997,"caller":"nodeapi/nodeapi.go:104","msg":"Starting node api server at address 0.0.0.0:9010"}
    ap_operator  | {"level":"info","ts":1719529805.33198,"caller":"metrics/eigenmetrics.go:81","msg":"Starting metrics server at port 0.0.0.0:9090"}
    ap_operator  | {"level":"info","ts":1719529805.3321455,"caller":"nodeapi/nodeapi.go:238","msg":"node api server running","addr":"0.0.0.0:9010"}
    

Use Watchtower For Auto-update

To perform auto update, we use watchtower. It watches ap_operator container and check for the docker image update.

The ap_operator uses image tag avaprotocol/ap-avs:latest and not pin to a version. Once a new image is pushed to docker hub and tag with latest, watchtower detects that a new image has been pushed, it will pull the new avaprotocol/ap-avs:latest docker image. Then it will recreate the operator container using the new docker image.

Obviously this kind of update will only work when there is no config change required. If there is a configuration change that requires you to set a flag in the config, then we will need to perform a manually config change and then update. However, we try hard to make the update painless and majority of time we can let it auto updated.

To run the auto update simply perform:

# make sure you're inside the `watchtower` directory.
# then bring up docker compose
docker compose up -d

you should see something like this

 ✔ Container watchtower  Started

To check the log you can do:

docker compose logs -f

And it should show up like this:

❯ docker compose logs -f
watchtower  | time="2024-07-03T00:01:58Z" level=info msg="Watchtower 1.7.1"
watchtower  | time="2024-07-03T00:01:58Z" level=info msg="Using no notifications"
watchtower  | time="2024-07-03T00:01:58Z" level=info msg="Only checking containers which name matches \"ap_operator\""
watchtower  | time="2024-07-03T00:01:58Z" level=info msg="Scheduling first run: 2024-07-03 08:01:58 +0000 UTC"
watchtower  | time="2024-07-03T00:01:58Z" level=info msg="Note that the first check will be performed in 7 hours, 59 minutes, 59 seconds"

You can read more about the watchtower with advanced feature such as Slack notification and build your own docker compose based on our file here.

FAQ

How to update

# pull the lastest change from our repository
git pull

# cd into either mainnet or holesky directory depend on mainne or testnet
cd ethereum

# then issue a pull command to fetch latest image
docker compose pull

# finally restart the container with the new image
docker compose up --force-recreate -d

How to configure auto update

If you want to configure auto update, check our instruction in watchtower

How to check that my operator is working

When your operator connects to aggregator, it will reports telemetry which we can check to ensure your operator is working properly. We're currently working on prometheus metrics and dashboard to provide operator with visibility.

Beside, you will see some log indicate that the operator is working and processing task that our aggregator asked it to do.

You can also visit the telemetry dashboard

Testnet Operator Status Page

https://aggregator-holesky.avaprotocol.org/telemetry

Ethereum Operator Status Page

https://aggregator.avaprotocol.org/telemetry