Quick Start
Instructions for installing the Othentic CLI and deploy a demo AVS.
Othentic does not run any network on its own. The Othentic CLI helps you build your own AVS using the Othentic Stack.
This guide references the Simple Price Oracle and demonstrates how to run it on Polygon Amoy Testnet (L2) and Ethereum Holesky Testnet (L1).
Prerequisites
Node v22.6.0 ⚠️ (must be exactly v22.6.0; using any other version will cause compatibility issues) and NPM, via NVM
Docker and docker-compose (see Docker website for instructions based on your OS)
At least 1.56
holETH
on Holešky Testnet (Faucet)At least 6
POL
on Polygon Amoy Testnet (Faucet)
Steps
Account requirements
For the purposes of the demo AVS, you'll need the following accounts:
Operator account x 3: Register 3 self-deploy Operator addresses for operator registration in the subsequent steps. You can also use this Script to create and fund these accounts. These funds are used to cover gas fees for operator registration on L1.
Ensure each account has at least 0.02
holETH
on Holešky.For the demo AVS,
operator1
will act as the Performer, Attester, and Aggregator, whileoperator2
andoperator3
will act as Attesters.Since the Aggregator needs funds on L2 to submit tasks on-chain, ensure
operator1
is funded on Amoy.
ERC-20 token address: the address of the token backing the AVS. For this guide, we'll use WETH.
Clone the github repository
Download the Simple Price Oracle Example repository
From here onward, we assume all commands run from the root of the Simple Price Oracle Example directory.
Configure the deployer account’s private key in the .env
file:
Make sure the Deployer account has at least ~1.5 holETH
To deploy the AVS’s contracts, run the following command:
By default, Othentic CLI deploys your contracts on Ethereum Holešky and Polygon Amoy testnets. To deploy on other chains, you shall specify the appropriate environment variables.
ERC20 is the token used to pay rewards. For detailed information on contract deployment and the available arguments, refer to the Contracts Deployment section.
When prompted, enter the Deployer account's private key to proceed with the deployment:
Once the private key is entered, the deployment will proceed, and transaction hashes for both L1 and L2 will be displayed. It deploys the necessary contracts on L1 (L1AvsTreasury, AvsGovernance, L1MessageHandler) and L2 (AttestationCenter, L2MessageHandler, OBLS, L2AvsTreasury) to run the AVS.
This is how the output will look:
Configure Environment Variables
To configure your environment, update the .env
file with the following deployed contract addresses and private keys. Retrieve the contract addresses by running:
Required Configuration:
Governance and Attestation Contract Addresses Add the contract addresses for governance and attestation center.
.envPrivate Keys for Performer, Aggregator and Attester Operators For the demo AVS, you can use the first operator's private key as the values for the performer and aggregator private keys. (As created in step 2)
.envDeployer Private Key Add the deployer private key as created in Step 2:
.envL1_CHAIN and L2_CHAIN Add the chain Ids. It is recommended to set these variable in the
.env
file to avoid specifying--l1-chain
in every command..env
Pre-configured
Pinata Configuration for IPFS: Used by the execution service to store the proof of task
.envBootstrap Node Configuration: Used to connect peers on the network
.env
In order to run the AVS Operators, it is required to setup their corresponding Ethereum accounts with the necessary metadata and stake on EigenLayer.
To deposit (restake) 0.01 stETH into the EigenLayer stETH staking contract, run the following command for all the three operators listed in your .env
file:
Enter operator's private key, select the stEth staking contract and enter the amount 0.012
If you don't have stETH
, the command will automatically convert holETH
into stETH
before depositing.
✅ Your internal Operators are now ready to opt-in to your AVS.
For this demo, you’ll need to register 3 internal Operators.
To Register as an operator for both EigenLayer and the AVS, run the following command three times, once for each operator:
When prompted, enter the Operator's private key. Note: In production, it is recommended to use separate keys for security purposes, as outlined in the Key Separation section.
Next, enter the governance contract address
Lastly, the Rewards Receiver address: Ideally, the rewards receiver address should be a smart contract that distributes rewards to all the stakers. You can leave this field empty to pass the Operator address by default.
Upon successful registration, the terminal will display the transaction hash on L2. This is how the output will look:
Run the AVS network
To run the demo AVS, navigate to the simple-price-oracle-avs-example
directory and execute the following command:
This command will build and start the AVS network, which consists of multiple services defined in the docker-compose.yml
file. The services set up are as follows:
3 Attester nodes: These nodes are responsible for validating and attesting task execution.
Aggregator node: Subscribes to
attestation
events from Attesters, aggregates their signatures, and submits an on chain transaction to the AttestationCenter contract.Validation service: Provides task validation functionality for the AVS.
Execution service: Provides task execution functionality for the AVS.
If you wish to rebuild existing images, update the Othentic CLI inside the docker images:
✅ Your demo AVS is completed.
Next,
Explore the quickstart repository Modify the various configurations, tailor the task execution logic to your use case, and run the AVS with your updates.
Define Task Specifications Create detailed task definitions based on your use case. Ensure that all parameters, including taskDefinitionId, are correctly configured for seamless execution.
Find all the CLI commands in the CLI Command Reference page.
Utility script for creating an account [Optional]
Prerequisites: Foundry (see Foundry Book for instructions)
If you don't have existing accounts to use as Operators, you can run this script to create and fund accounts on Holešky:
You can run the script by using sh <script-path>
, or make it executable with chmod a+x <script-path>
and then execute it with ./<script-path>
.
If you've deployed your contracts on chains other than the defaults, make sure to set the corresponding environment variables.
Last updated