百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
H

hello-world-avs

> 编程语言
开源

Hello World AVS

100 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

Hello World AVS

Hello World AVS

Welcome to the Hello World AVS. This project shows you the simplest functionality you can expect from an AVS. It will give you a concrete understanding of the basic components. For new users, please find this video walkthrough of the hello world AVS repository.

Architecture

AVS User Flow

  1. AVS consumer requests a "Hello World" message to be generated and signed.
  2. HelloWorld contract receives the request and emits a NewTaskCreated event for the request.
  3. All Operators who are registered to the AVS and has staked, delegated assets takes this request. Operator generates the requested message, hashes it, and signs the hash with their private key.
  4. Each Operator submits their signed hash back to the HelloWorld AVS contract.
  5. If the Operator is registered to the AVS and has the minimum needed stake, the submission is accepted.

That's it. This simple flow highlights some of the core mechanics of how AVSs work.

Slashing

[!WARNING] This example does not use the new operator-sets workflow. Please refer to ELIP-002 for more details. For an example of the new workflow, check out the Incredible Squaring examples (Go version here, Rust version here).

The example includes a simple slashing condition: "a task MUST be responded by enough operators before N blocks have passed since the task creation". You can modify the OPERATOR_RESPONSE_PERCENTAGE value in the .env file to adjust the chance of an operator responding to a task. In case this condition isn't satisfied by some operator, anyone can permissionlessly slash them via calling HelloWorldServiceManager.slashOperator.

For the Rust example, we have a challenger that listens for new tasks and checks whether the operators have responded. If not, challenger is authorized to slash the operator.

Local Devnet Deployment

The following instructions explain how to manually deploy the AVS from scratch including EigenLayer and AVS specific contracts using Foundry (forge) to a local anvil chain, and start Typescript Operator application and tasks.

Development Environment

This section describes the tooling required for local development.

Non-Nix Environment

Install dependencies:

  • Node
  • Typescript
  • ts-node
  • tcs
  • npm
  • Foundry
  • ethers

Nix Environment

On Nix platforms, if you already have the proper Nix configuration, you can build the project's artifacts inside a nix develop shell

bash
nix develop

Otherwise, please refer to installed and configured section.

Quick start (TypeScript)

Start Anvil Chain

In terminal window #1, execute the following commands:

bash

# Install npm packages
npm install

# Start local anvil chain
npm run start:anvil

Deploy Contracts and Start Operator

Open a separate terminal window #2, execute the following commands

bash
# Setup .env file
cp .env.example .env
cp contracts/.env.example contracts/.env

# Updates dependencies if necessary and builds the contracts 
npm run build:forge

# Deploy the EigenLayer contracts
npm run deploy:core

# Deploy the Hello World AVS contracts
npm run deploy:hello-world

# (Optional) Update ABIs
npm run extract:abis

# Start the Operator application
npm run start:operator

Create Hello-World-AVS Tasks

Open a separate terminal window #3, execute the following commands

bash
# Start the createNewTasks application 
npm run start:traffic

Create and Claim Distribution

In a terminal, start a new instance of anvil and deploy the core and avs contracts

bash
# Start anvil
npm run start:anvil
# Deploy the EigenLayer contracts
npm run deploy:core

# Deploy the Hello World AVS contracts
npm run deploy:hello-world

In another terminal, run:

bash
# Create distribution roots
npm run create-distributions-root

# Claim created distribution
npm run claim-distributions

To run operator directed rewards distribution, run:

bash
#Create distribution roots
npm run create-operator-directed-distributions-root

# Claim created rewards distribution
npm run claim-distributions

Quick start (Rust)

For Rust example, we have a simple operator that monitors new tasks and responds to them, a spammer that generates random tasks and a challeger that listens for new tasks and checks the operators response, if found that operator did not respond to the task, it will slash the operator.

Anvil Deployment

  1. Start Anvil Chain

In terminal window #1, execute the following commands:

bash
# Start local anvil chain
anvil
  1. Deploy Contracts

Open a separate terminal window #2, execute the following commands

bash
# Setup .env file
cp .env.example .env
cp contracts/.env.example contracts/.env

# Builds the contracts
make build-contracts

# Deploy the EigenLayer contracts
make deploy-eigenlayer-contracts

# Deploy the Hello World AVS contracts
make deploy-helloworld-contracts
  1. Start Challenge Manager

In terminal window #2, execute the following command

bash
# Start the Challenge Manager
make start-rust-challenger
  1. Start Rust Operator

In terminal window #3, execute the following command

bash
# Start the Operator
make start-rust-operator
  1. Spam Tasks

Open a separate terminal window #4, execute the following command

bash
# Start sending tasks
make spam-rust-tasks

Testing

  1. Build anvil state with deployed contracts
bash
# Build contracts
make build-contracts

# Starts anvil in the background with the --dump-state flag, builds and deploys the 
# contracts, and generates a state.json file for use in tests.
make build-anvil-state-with-deployed-contracts
  1. Run tests
bash
cargo test --workspace

Help and Support

For help and support deploying and modifying this repo for your AVS, please:

  1. Open a ticket via the intercom link at support.eigenlayer.xyz.
  2. Include the necessary troubleshooting information for your environment:
  • Local anvil testing:
    • Redeploy your local test using --revert-strings debug flag via the following commands and retest: npm run deploy:core-debug && npm run deploy:hello-world-debug
    • Include the full stacktrace from your error as a .txt file attachment.
    • Create a minimal repo that demonstrates the behavior (fork or otherwise)
    • Steps require to reproduce issue (compile and cause the error)
  • Holesky testing:
    • Ensure contracts are verified on Holesky. Eg forge verify-contract --chain-id 17000 --num-of-optimizations 200 src/YourContract.sol:YourContract YOUR_CONTRACT_ADDRESS
    • Send us your transaction hash where your contract is failing. We will use Tenderly to debug (adjust gas limit) and/or cast to re-run the transaction (eg cast call --trace "trace_replayTransaction(0xTransactionHash)").

Contact Us

If you're planning to build an AVS and would like to speak with a member of the EigenLayer DevRel team to discuss your ideas or architecture, please fill out this form and we'll be in touch shortly: EigenLayer AVS Intro Call

Disclaimers

  • This repo is meant currently intended for local anvil development testing. Holesky deployment support will be added shortly.
  • Users who wish to build an AVS for Production purposes will want to migrate from the ECDSAServiceManagerBase implementation in HelloWorldServiceManager.sol to a BLS style architecture using RegistryCoordinator.

Appendix (Future Capabilities In Progress)

Adding a New Strategy

Potential Enhancements to the AVS (for learning purposes)

The architecture can be further enhanced via:

  • the nature of the request is more sophisticated than generating a constant string
  • the operators might need to coordinate with each other
  • the type of signature is different based on the constraints of the service
  • the type and amount of security used to secure the AVS

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rust

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言