Skip to content

Commit

Permalink
docs: add guide to run operator using systemd (#1078)
Browse files Browse the repository at this point in the history
  • Loading branch information
JuArce authored Sep 30, 2024
1 parent d6c2e34 commit cf84ee8
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 9 deletions.
84 changes: 77 additions & 7 deletions docs/operator_guides/0_running_an_operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,27 @@ Update the following placeholders in `./config-files/config-operator.yaml`:
`"<ecdsa_key_store_location_path>"` and `"<bls_key_store_location_path>"` are the paths to your keys generated with the EigenLayer CLI, `"<operator_address>"` and `"<earnings_receiver_address>"` can be found in the `operator.yaml` file created in the EigenLayer registration process.
The keys are stored by default in the `~/.eigenlayer/operator_keys/` directory, so for example `<ecdsa_key_store_location_path>` could be `/path/to/home/.eigenlayer/operator_keys/some_key.ecdsa.key.json` and for `<bls_key_store_location_path>` it could be `/path/to/home/.eigenlayer/operator_keys/some_key.bls.key.json`.

The default configuration uses the public nodes RPC, but we suggest you use your own nodes for better performance and reliability.
Also, from v0.5.2 there is a fallback mechanism to have two RPCs, so you can add a second RPC for redundancy.
Two RPCs are used, one as the main one, and the other one as a fallback in case one node is working unreliably.

Default configurations is set up to use the same public node in both scenarios.

{% hint style="danger" %}

PUBLIC NODES SHOULDN'T BE USED AS THE MAIN RPC. We recommend not using public nodes at all.

FALLBACK AND MAIN RPCs SHOULD BE DIFFERENT.

{% endhint %}

Most of the actions will pass through the main RPC unless there is a problem with it. Events are fetched from both nodes.

```yaml
eth_rpc_url: "https://ethereum-holesky-rpc.publicnode.com"
eth_rpc_url_fallback: "https://ethereum-holesky-rpc.publicnode.com"
eth_ws_url: "wss://ethereum-holesky-rpc.publicnode.com"
eth_ws_url_fallback: "wss://ethereum-holesky-rpc.publicnode.com"
eth_rpc_url: "https://<RPC_1>"
eth_rpc_url_fallback: "https://<RPC_2>"
eth_ws_url: "wss://<RPC_1>"
eth_ws_url_fallback: "wss://<RPC_2>"
```
## Step 4 - Deposit Strategy Tokens
We are using [WETH](https://holesky.eigenlayer.xyz/restake/WETH) as the strategy token.
Expand Down Expand Up @@ -152,6 +162,66 @@ If you don't have Holesky ETH, these are some useful faucets:
./operator/build/aligned-operator start --config ./config-files/config-operator.yaml
```

### Run Operator using Systemd

To manage the Operator process on Linux systems, we recommend use systemd with the following configuration:

You should create a user and a group in order to run the Operator and set the service unit to use that. In the provided service unit, we assume you have already created a user called `aligned`

```toml
# aligned-operator.service
[Unit]
Description=Aligned Operator
After=network.target
[Service]
Type=simple
User=aligned
ExecStart=<path_to_aligned_layer_repository>/operator/build/aligned-operator start --config <path_to_operator_config>
Restart=always
RestartSec=1
StartLimitBurst=100
[Install]
WantedBy=multi-user.target
```

{% hint style="info" %}
`aligned-operator.service` is just an arbitrary name. You can name your service as you wish, following the format `<service-name>.service`.
{% endhint %}

Once you have configured the `aligned-operator.service` file, you need to run the following commands:

```shell
sudo cp aligned-operator.service /etc/systemd/system/aligned-operator.service
sudo systemctl enable --now aligned-operator.service
```

{% hint style="warning" %}
All paths must be absolute.
{% endhint %}

Those commands will link the service to systemd directory and then, will start the Operator service.

Also, if the server running the operator goes down, systemd will start automatically the Operator on server startup.

#### Restart operator

If you want to restart the operator, you can use the following command:

```shell
sudo systemctl restart aligned-operator.service
```

#### Get Operators logs

Once you are running your operator using systemd, you can get its logs using journalctl as follows:

```shell
journalctl -xfeu aligned-operator.service
```

## Unregistering the operator

To unregister the Aligned operator, run:
Expand Down
14 changes: 12 additions & 2 deletions docs/operator_guides/1_operator_FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,19 @@ We also recommend the following RPC providers:
- [Infura](https://infura.io/)
- [Blast](https://blastapi.io/)

The default configuration uses the public nodes RPC.
Two RPCs are used, one as the main one, and the other one as a fallback in case one node is working unreliably.

Since `v0.5.2`, there is a fallback mechanism to have two RPCs, so you need to add a second RPC for redundancy.
Default configurations is set up to use the same public node in both scenarios.

{% hint style="danger" %}

PUBLIC NODES SHOULDN'T BE USED AS THE MAIN RPC. We recommend not using public nodes at all.

FALLBACK AND MAIN RPCs SHOULD BE DIFFERENT.

{% endhint %}

Most of the actions will pass through the main RPC unless there is a problem with it. Events are fetched from both nodes.

### How can I check if the version I'm using is the latest one?

Expand Down

0 comments on commit cf84ee8

Please sign in to comment.