GithubHelp home page GithubHelp logo

luandt / hello-world-avs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from layr-labs/hello-world-avs

0.0 0.0 0.0 273.45 MB

Hello World AVS

License: MIT License

Shell 5.68% Rust 20.99% TypeScript 37.08% Makefile 2.20% Dockerfile 0.09% Solidity 33.96%

hello-world-avs's Introduction

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.

hello-world-png

There are 5 steps to this AVS:

  • AVS consumer requests a "Hello World" message to be generated and signed
  • AVS takes on the request by emitting an event for operators to pick up the request
  • any operator who is staked to serve this AVS takes this request, generates this message and signs it
  • the operator submits this message with their signature back to the AVS
  • if the operator is in fact 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.

Where additional sophistication with AVSs come into the picture:

  • 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
  • and so on...

Quick Start

Dependencies

  1. npm
  2. Foundry
  3. Docker
    • Make sure Docker is running

Following NodeJS packages:

  1. tcs
  2. ethers

Steps

Typescript

  1. Run yarn install
  2. Run cp .env.local .env
  3. Run make start-chain-with-contracts-deployed
    • This will build the contracts, start an Anvil chain, deploy the contracts to it, and leaves the chain running in the current terminal
  4. Open new terminal tab and run make start-operator
    • This will compile the AVS software and start monitering new tasks
  5. Open new terminal tab and run make spam-tasks (Optional)
    • This will spam the AVS with random names every 15 seconds

Rust lang

Anvil
  1. Run make start-chain-with-contracts-deployed

    • This will build the contracts, start an Anvil chain, deploy the contracts to it, and leaves the chain running in the current terminal
  2. Run make start-rust-operator

  3. Run make spam-rust-tasks

Tests are supported in anvil only . Make sure to run the 1st command before running the tests:

cargo test --workspace
Holesky Testnet
Contract Name Holesky Address
Hello World Service Manager 0x3361953F4a9628672dCBcDb29e91735fb1985390
Delegation Manager 0xA44151489861Fe9e3055d95adC98FbD462B948e7
Avs Directory 0x055733000064333CaDDbC92763c58BF0192fFeBf

You don't need to run any script for holesky testnet.

  1. Use the HOLESKY_ namespace env parameters in the code , instead of normal parameters.

  2. Run make start-rust-operator

  3. Run make spam-rust-tasks

Extensions

  • Operator needs a minimum stake amount to make submissions
  • Add another strategy to the AVS
  • Operator must respond within a certain number of blocks

Deployment on Holesky

To deploy the Hello World AVS contracts to the Holesky network, follow these steps:

  1. Ensure you have the necessary RPC URL and private key for the Holesky network.
  2. Run the deployment script using Foundry:
    forge script script/HoleskyDeployer.s.sol:HoleskyDeployer --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast -vvvv
    Replace $RPC_URL with your Holesky RPC URL and $PRIVATE_KEY with your private key.

Adding a New Strategy

To add a new strategy to the Hello World AVS, follow the guide provided in AddNewStrategy.md. This guide walks you through the necessary steps to add and whitelist a new strategy for the AVS.

hello-world-avs's People

Contributors

gajesh2007 avatar nimavaziri avatar supernovahs avatar leopaul36 avatar wawrzek avatar wesfloyd avatar gabrielstoica avatar goofylfg avatar dabit3 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.