Skip to content

Commit

Permalink
Add Run the worker from source to README.
Browse files Browse the repository at this point in the history
  • Loading branch information
silathdiir committed Jan 15, 2025
1 parent 9681283 commit e3ace0a
Showing 1 changed file with 45 additions and 5 deletions.
50 changes: 45 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -55,14 +65,44 @@ 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. 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
```

### 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/)

0 comments on commit e3ace0a

Please sign in to comment.