Skip to content

Commit cf84ee8

Browse files
authored
docs: add guide to run operator using systemd (#1078)
1 parent d6c2e34 commit cf84ee8

File tree

2 files changed

+89
-9
lines changed

2 files changed

+89
-9
lines changed

docs/operator_guides/0_running_an_operator.md

Lines changed: 77 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,27 @@ Update the following placeholders in `./config-files/config-operator.yaml`:
9292
`"<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.
9393
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`.
9494

95-
The default configuration uses the public nodes RPC, but we suggest you use your own nodes for better performance and reliability.
96-
Also, from v0.5.2 there is a fallback mechanism to have two RPCs, so you can add a second RPC for redundancy.
95+
Two RPCs are used, one as the main one, and the other one as a fallback in case one node is working unreliably.
96+
97+
Default configurations is set up to use the same public node in both scenarios.
98+
99+
{% hint style="danger" %}
100+
101+
PUBLIC NODES SHOULDN'T BE USED AS THE MAIN RPC. We recommend not using public nodes at all.
102+
103+
FALLBACK AND MAIN RPCs SHOULD BE DIFFERENT.
104+
105+
{% endhint %}
106+
107+
Most of the actions will pass through the main RPC unless there is a problem with it. Events are fetched from both nodes.
97108

98109
```yaml
99-
eth_rpc_url: "https://ethereum-holesky-rpc.publicnode.com"
100-
eth_rpc_url_fallback: "https://ethereum-holesky-rpc.publicnode.com"
101-
eth_ws_url: "wss://ethereum-holesky-rpc.publicnode.com"
102-
eth_ws_url_fallback: "wss://ethereum-holesky-rpc.publicnode.com"
110+
eth_rpc_url: "https://<RPC_1>"
111+
eth_rpc_url_fallback: "https://<RPC_2>"
112+
eth_ws_url: "wss://<RPC_1>"
113+
eth_ws_url_fallback: "wss://<RPC_2>"
103114
```
104115
105-
106116
## Step 4 - Deposit Strategy Tokens
107117
108118
We are using [WETH](https://holesky.eigenlayer.xyz/restake/WETH) as the strategy token.
@@ -152,6 +162,66 @@ If you don't have Holesky ETH, these are some useful faucets:
152162
./operator/build/aligned-operator start --config ./config-files/config-operator.yaml
153163
```
154164

165+
### Run Operator using Systemd
166+
167+
To manage the Operator process on Linux systems, we recommend use systemd with the following configuration:
168+
169+
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`
170+
171+
```toml
172+
# aligned-operator.service
173+
174+
[Unit]
175+
Description=Aligned Operator
176+
After=network.target
177+
178+
[Service]
179+
Type=simple
180+
User=aligned
181+
ExecStart=<path_to_aligned_layer_repository>/operator/build/aligned-operator start --config <path_to_operator_config>
182+
Restart=always
183+
RestartSec=1
184+
StartLimitBurst=100
185+
186+
[Install]
187+
WantedBy=multi-user.target
188+
```
189+
190+
{% hint style="info" %}
191+
`aligned-operator.service` is just an arbitrary name. You can name your service as you wish, following the format `<service-name>.service`.
192+
{% endhint %}
193+
194+
Once you have configured the `aligned-operator.service` file, you need to run the following commands:
195+
196+
```shell
197+
sudo cp aligned-operator.service /etc/systemd/system/aligned-operator.service
198+
sudo systemctl enable --now aligned-operator.service
199+
```
200+
201+
{% hint style="warning" %}
202+
All paths must be absolute.
203+
{% endhint %}
204+
205+
Those commands will link the service to systemd directory and then, will start the Operator service.
206+
207+
Also, if the server running the operator goes down, systemd will start automatically the Operator on server startup.
208+
209+
#### Restart operator
210+
211+
If you want to restart the operator, you can use the following command:
212+
213+
```shell
214+
sudo systemctl restart aligned-operator.service
215+
```
216+
217+
#### Get Operators logs
218+
219+
Once you are running your operator using systemd, you can get its logs using journalctl as follows:
220+
221+
```shell
222+
journalctl -xfeu aligned-operator.service
223+
```
224+
155225
## Unregistering the operator
156226

157227
To unregister the Aligned operator, run:

docs/operator_guides/1_operator_FAQ.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,19 @@ We also recommend the following RPC providers:
1717
- [Infura](https://infura.io/)
1818
- [Blast](https://blastapi.io/)
1919

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

22-
Since `v0.5.2`, there is a fallback mechanism to have two RPCs, so you need to add a second RPC for redundancy.
22+
Default configurations is set up to use the same public node in both scenarios.
23+
24+
{% hint style="danger" %}
25+
26+
PUBLIC NODES SHOULDN'T BE USED AS THE MAIN RPC. We recommend not using public nodes at all.
27+
28+
FALLBACK AND MAIN RPCs SHOULD BE DIFFERENT.
29+
30+
{% endhint %}
31+
32+
Most of the actions will pass through the main RPC unless there is a problem with it. Events are fetched from both nodes.
2333

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

0 commit comments

Comments
 (0)