Building AVS with the EigenLayer BLS Template
Introduction
This will guide you through the process of utilizing our BLS Template for starting your own AVS with BLS-oriented Smart Contracts. The Incredible Squaring AVS is an example of an AVS that uses BLS contracts.
Generating your project with Cargo Tangle
1. Installation
$ cargo install cargo-tangle --git https://github.com/tangle-network/gadget --force
2. Generating your Project
To create a new BLS AVS, use the following command:
$ cargo tangle blueprint create --name <blueprint_name> --eigenlayer
Just replace <blueprint_name>
with the desired name for your AVS. Once you run this command, you will be asked a series
of questions regarding the configurations and setup for your project. Simply answer those questions when prompted; if
you aren't sure about a question, you likely just want the default selection that it starts on.
Note
If Soldeer fails to update/install the necessary dependencies upon generation, you may need to run it manually with the following command:
$ forge soldeer update -d
4. Hello, World!
Now that you have generated the project, you can test out the simple example by running:
$ cargo test
This test just shows that the template generates you a fresh, working AVS structure. All that's left is to add what you want!
5. Customizing your AVS
What you do from here is completely up to you, but we have plenty of resources to help you:
- The contracts generated with this template will be called TangleServiceManager.sol, TangleTaskManager.sol, and ITangleTaskManager.sol by default. You can use the find-and-replace function to change these to whatever you would like.
- Examples of different types of event listeners can be found here.
- A deeper dive into how jobs work can be found in the jobs section.