-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Add Run the worker from source
section to README
#137
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ This is a step by step guide to deploy your own worker. | |
If you prefer video content you can watch this [video tutorial](https://www.youtube.com/watch?v=zRY7AwrJo4w) | ||
|
||
--- | ||
|
||
### Pre-Requirements | ||
|
||
There are **3** different types of workers. Every type can generate a specific type of proof. | ||
|
@@ -25,28 +26,37 @@ You can choose your infrastrcture depending on the type of proof you would like | |
|
||
1. Install `Docker` by following this [guide](https://docs.docker.com/engine/install/) | ||
2. Clone this repo | ||
|
||
```sh | ||
git clone https://github.com/Lagrange-Labs/worker.git | ||
cd worker | ||
git clone https://github.com/Lagrange-Labs/lgn-coprocessor.git | ||
cd lgn-coprocessor | ||
``` | ||
|
||
3. Generate a Lagrange key | ||
|
||
```sh | ||
#Generate the key | ||
docker compose run --rm worker avs new-key | ||
``` | ||
|
||
You should see something like this | ||
|
||
```sh | ||
Input password for Lagrange key: | ||
new Lagrange keystore stored under config/lagr_keystore.json | ||
public_key = "66779122cb188d1e70889278ffb3ee8ee024d4a23742a59afbdaaa096fc5135c3a14d897de87d1c56adbe029619c231416e7dfb3f1de0a542dd8ac7f4748ce07" | ||
public_key = "66779122cb188d1e70889278ffb3ee8ee024d4a23742a59afbdaaa096fc5135c3a14d897de87d1c56adbe029619c231416e7dfb3f1de0a542dd8ac7f4748ce07" | ||
``` | ||
|
||
4. Add the Ethereum keystore under `config/priv_key.json`. * This is the operator keystore generated by [EigenLayer cli](https://docs.eigenlayer.xyz/eigenlayer/operator-guides/operator-installation#cli-installation) | ||
5. Register the Lagrange key on-chain by signing it with the AVS operator key | ||
|
||
```sh | ||
docker compose run --rm worker avs register | ||
``` | ||
|
||
6. You are now registered, you can go ahead and remove the keystore from `config/priv_key.json` | ||
7. Add the Lagrange password to the `.env` file so that the service can be restarted without any manual intervention. | ||
|
||
```sh | ||
# set the AVS__LAGR_PWD key with the password you have set | ||
vim .env | ||
|
@@ -55,14 +65,51 @@ vim .env | |
### Run the worker Steps | ||
|
||
1. Run the worker | ||
|
||
```sh | ||
docker compose up -d | ||
``` | ||
|
||
### Run the worker from source | ||
|
||
1. Clone this repo | ||
|
||
```sh | ||
git clone https://github.com/Lagrange-Labs/lgn-coprocessor.git | ||
cd lgn-coprocessor | ||
``` | ||
|
||
2. Check your Rust toolchain | ||
|
||
```sh | ||
rustup toolchain list | ||
nightly-2024-12-03... (It is recommended) | ||
``` | ||
|
||
2. Update the worker configuration | ||
|
||
```sh | ||
cat lgn-worker/src/config/default.toml | ||
``` | ||
|
||
3. Update the system maximum stack size to unlimited | ||
|
||
```sh | ||
ulimit -s unlimited | ||
``` | ||
|
||
4. Build and run the worker | ||
|
||
```sh | ||
RUST_BACKTRACE=1 RUST_LOG=debug cargo run --release --bin lgn-worker -- --config YOUR_CONFIG.toml | ||
``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe lets also add a default config, and a link to the public params that work with this version of the worker? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added the latest public parameters URL to I have a section of Update the worker configuration, I think maybe the gateway URL should be set at this step. Wdyt? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sounds good to me. @kaisbaccour , just double checking, is the URL |
||
|
||
### Observability | ||
|
||
#### Metrics | ||
|
||
The worker exposes the prometheus metrics by default on port 9000 | ||
#### Dashboard | ||
Starting from worker version `v0.2.1`, you can import this [grafana dashboard ](https://grafana.com/grafana/dashboards/21302-worker/) | ||
|
||
#### Dashboard | ||
|
||
Starting from worker version `v0.2.1`, you can import this [grafana dashboard](https://grafana.com/grafana/dashboards/21302-worker/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@delehef any blockers on this ? @silathdiir doesn't it impact performance ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's possible and may be unsafe. I just updated to a limited value
100000000
(and markunlimited
as not recomended) in commit a0282f5.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK, the only issue is that accidental infinite recursion would blow up the whole memory instead of early killing the faulty program, so I don't think that enabled unlimited stack in this context a big risk.