Skip to content

Commit c772c01

Browse files
authored
feat: eigen cli docs (#111)
* feat: eigen cli docs * chore: cli guide update * fix: missing file
1 parent 351bd1d commit c772c01

File tree

4 files changed

+185
-2
lines changed

4 files changed

+185
-2
lines changed

pages/developers/cli/_meta.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"installation": "Installation",
33
"quickstart": "Quickstart",
4-
"reference": "Reference"
4+
"reference": "Reference",
5+
"eigenlayer": "Eigenlayer AVSs"
56
}

pages/developers/cli/eigenlayer.mdx

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Eigenlayer CLI Commands
2+
3+
Our CLI provides commands for deploying and running Eigenlayer AVSs. We have two templates for quickly creating an AVS: the [BLS template](/developers/eigenlayer-avs/bls-template) and the [ECDSA template](/developers/eigenlayer-avs/ecdsa-template).
4+
5+
For a step-by-step example of using the BLS template, see [Deploying an Eigenlayer AVS](/developers/eigenlayer-avs/bls-example).
6+
7+
## Blueprint Commands
8+
9+
The blueprint commands allow you to create, deploy, and run Eigenlayer AVS services.
10+
11+
### Create a New AVS Project
12+
13+
```bash
14+
cargo tangle blueprint create -n <NAME> --eigenlayer [BLS|ECDSA]
15+
```
16+
17+
#### Create Options
18+
19+
- `-n, --name <NAME>`: Name of your AVS project
20+
- `--eigenlayer`: Specify either BLS or ECDSA variant
21+
22+
### Deploy AVS Contracts
23+
24+
```bash
25+
cargo tangle blueprint deploy eigenlayer [OPTIONS]
26+
```
27+
28+
#### Deploy Options
29+
30+
- `--rpc-url <URL>`: HTTP RPC endpoint to connect to (required unless --devnet is used)
31+
- `--contracts-path <PATH>`: Path to your contracts directory (defaults to "./contracts")
32+
- `--ordered-deployment`: Deploy contracts in an interactive ordered manner (if omitted, deploys as they are found)
33+
- `-w, --network <NETWORK>`: Network to deploy to (local, testnet, mainnet) [default: local]
34+
- `--devnet`: Start a local devnet using Anvil (only valid with --network local)
35+
- `-k, --keystore-path <PATH>`: Path to your keystore (defaults to ./keystore)
36+
37+
### Run AVS Service
38+
39+
```bash
40+
cargo tangle blueprint run [OPTIONS]
41+
```
42+
43+
#### Run Options
44+
45+
- `-p, --protocol eigenlayer`: Specify Eigenlayer protocol
46+
- `-u, --rpc-url <URL>`: HTTP RPC endpoint URL (required)
47+
- `-k, --keystore-path <PATH>`: Path to the keystore (defaults to ./keystore)
48+
- `-b, --binary-path <PATH>`: Path to the AVS binary (optional, will build if not provided)
49+
- `-w, --network <NETWORK>`: Network to connect to (local, testnet, mainnet)
50+
- `-d, --data-dir <PATH>`: Data directory path (defaults to ./data)
51+
- `-n, --bootnodes <NODES>`: Optional bootnodes to connect to
52+
- `-f, --settings-file <PATH>`: Path to the protocol settings env file (defaults to ./settings.env)
53+
54+
### Required Environment Variables for Eigenlayer
55+
56+
The following environment variables must be set in your settings.env file:
57+
58+
- `REGISTRY_COORDINATOR_ADDRESS`: Address of the Registry Coordinator contract
59+
- `OPERATOR_STATE_RETRIEVER_ADDRESS`: Address of the Operator State Retriever contract
60+
- `DELEGATION_MANAGER_ADDRESS`: Address of the Delegation Manager contract
61+
- `SERVICE_MANAGER_ADDRESS`: Address of the Service Manager contract
62+
- `STAKE_REGISTRY_ADDRESS`: Address of the Stake Registry contract
63+
- `STRATEGY_MANAGER_ADDRESS`: Address of the Strategy Manager contract
64+
- `AVS_DIRECTORY_ADDRESS`: Address of the AVS Directory contract
65+
- `REWARDS_COORDINATOR_ADDRESS`: Address of the Rewards Coordinator contract
66+
67+
## Example Workflow
68+
69+
1. **Create a New AVS Project**
70+
71+
```bash
72+
cargo tangle blueprint create -n my-avs --eigenlayer bls
73+
```
74+
75+
2. **Build Your AVS**
76+
77+
```bash
78+
cargo build --release
79+
```
80+
81+
3. **Deploy Contracts**
82+
83+
```bash
84+
# Deploy to local devnet
85+
cargo tangle blueprint deploy eigenlayer \
86+
--devnet \
87+
--ordered-deployment
88+
89+
# Or deploy to testnet
90+
cargo tangle blueprint deploy eigenlayer \
91+
--network testnet \
92+
--rpc-url <YOUR_RPC_URL> \
93+
--ordered-deployment
94+
```
95+
96+
4. **Run Your Service**
97+
```bash
98+
cargo tangle blueprint run \
99+
-p eigenlayer \
100+
-u <YOUR_RPC_URL>
101+
```
102+
103+
## Troubleshooting
104+
105+
Common issues and solutions:
106+
107+
1. **Deployment Failures**
108+
109+
- Verify RPC endpoint is accessible
110+
- Ensure correct network is specified (local, testnet, mainnet)
111+
- Check contract constructor arguments
112+
- Verify sufficient funds for deployment
113+
114+
2. **Service Issues**
115+
- Check settings.env file contains all required contract addresses
116+
- Verify contract addresses are correct for the chosen network
117+
- Ensure binary is built with correct features
118+
- Check network connectivity and RPC endpoint accessibility

pages/developers/eigenlayer-avs/_meta.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"overview": "Overview",
33
"incredible-squaring-avs": "Incredible Squaring AVS",
44
"bls-template": "Eigenlayer BLS Template",
5-
"ecdsa-template": "Eigenlayer ECDSA Template"
5+
"ecdsa-template": "Eigenlayer ECDSA Template",
6+
"bls-example": "Deploying an Eigenlayer AVS"
67
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Deploying and running an Eigenlayer AVS from the BLS Template
2+
3+
The following is a step-by-step guide for deploying and running an AVS using the cargo-tangle CLI.
4+
5+
## Generating the AVS from the Template
6+
7+
Run the following command, answering each prompt for project information. For anything you aren't certain about, the default selection is a safe choice. This command creates a BLS AVS called `my-avs`.
8+
9+
```bash
10+
cargo tangle blueprint create --name my-avs --eigenlayer bls
11+
```
12+
13+
Now that you have generated your AVS project, move to the newly created directory.
14+
15+
```bash
16+
cd my-avs
17+
```
18+
19+
## Deploying the AVS to a local testnet
20+
21+
The AVS is fully ready to be deployed, perfect for testing locally. The following command will start a local testnet in the background and deploy the AVS's necessary contracts.
22+
23+
```bash
24+
cargo tangle blueprint deploy eigenlayer \
25+
--devnet \
26+
--ordered-deployment
27+
```
28+
29+
In this case, you want to deploy the contracts in an ordered manner. Specifically, you need to deploy the TangleTaskManager before the TangleServiceManager, since the Service Manager takes the Task Manager's address as a constructor argument.
30+
31+
When you deploy the TangleTaskManager, you are also given the option to initialize it. You want to make sure you do this, supplying the initialization arguments when prompted.
32+
33+
You will be prompted for each contract's constructor arguments (if it has any). You can find the addresses of the contracts you need in your project's settings.env file. Below is a complete list of addresses you will need. Some are zero addresses because they aren't actually used.
34+
35+
### Addresses for deployment
36+
37+
| Address | Value |
38+
| -------------------- | -------------------------------------------- |
39+
| Registry Coordinator | c3e53f4d16ae77db1c982e75a937b9f60fe63690 |
40+
| Pauser Registry | Obtained from beginning of Deployment output |
41+
| Initial Owner | 70997970C51812dc3A010C7d01b50e0d17dc79C8 |
42+
| Aggregator | a0Ee7A142d267C1f36714E4a8F75612F20a79720 |
43+
| Generator | 15d34AAf54267DB7D7c367839AAf71A00a2C6A65 |
44+
| AVS Directory | 0000000000000000000000000000000000000000 |
45+
| Rewards Coordinator | 0000000000000000000000000000000000000000 |
46+
| Stake Registry | 5fc8d32690cc91d4c39d9d3abcbd16989f875707 |
47+
| Tangle Task Manager | Obtained in Deployment output |
48+
49+
Once all contracts have been deployed, you will notice that it continues running to keep the testnet alive.
50+
51+
## Running the AVS
52+
53+
In a new terminal, run the following command in the project's directory (make sure to replace the task manager address and the RPC URL with the values obtained from your deployment output):
54+
55+
```bash
56+
TASK_MANAGER_ADDRESS=<ADDRESS_FROM_OUTPUT> cargo tangle blueprint run \
57+
-p eigenlayer \
58+
-u <URL_FROM_DEPLOYMENT_OUTPUT> \
59+
--keystore-path ./test-keystore
60+
```
61+
62+
Running this once, will register the example operator (it uses Anvil's account 0 by default) and then exit the process. Once the registration is complete, you simply need to run the same command again.
63+
Upon running the command for a second time, you should see "Successfully ran job function!" printed to the terminal, signifying that the job function was successfully executed!

0 commit comments

Comments
 (0)