Skip to content

Commit f8f94b9

Browse files
committed
Add doc
1 parent a5f4d2d commit f8f94b9

File tree

3 files changed

+79
-2
lines changed

3 files changed

+79
-2
lines changed

book/src/validator-manager-api.md

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,75 @@
11
# Managing Validators
22

3-
The `lighthouse validator-manager` uses the [Keymanager API](https://ethereum.github.io/keymanager-APIs/#/) to list, import and delete keystores via the HTTP API. This requires the validator client running with the flag `--http`.
3+
The `lighthouse validator-manager` uses the [Keymanager API](https://ethereum.github.io/keymanager-APIs/#/) to exit, list, import and delete keystores via the HTTP API. This requires the validator client running with the flag `--http`.
4+
5+
## Exit
6+
7+
The `exit` command exits one or more validators from the validator client. To `exit`:
8+
9+
> **Important note: Once the --beacon-node flag is used, it will publish the voluntary exit to the network. This action is irreversible.**
10+
11+
```bash
12+
lighthouse vm exit --vc-token <API-TOKEN-PATH> --validators pubkey1,pubkey2 --beacon-node http://beacon-node-url:5052
13+
```
14+
15+
Example:
16+
17+
```bash
18+
lighthouse vm exit --vc-token ~/.lighthouse/mainnet/validators/api-token.txt --validators 0x8885c29b8f88ee9b9a37b480fd4384fed74bda33d85bc8171a904847e65688b6c9bb4362d6597fd30109fb2def6c3ae4,0xa262dae3dcd2b2e280af534effa16bedb27c06f2959e114d53bd2a248ca324a018dc73179899a066149471a94a1bc92f --beacon-node http://localhost:5052
19+
```
20+
21+
If successful, the following message will be returned:
22+
23+
```text
24+
Successfully validated and published voluntary exit for validator 0x8885c29b8f88ee9b9a37b480fd4384fed74bda33d85bc8171a904847e65688b6c9bb4362d6597fd30109fb2def6c3ae4
25+
Successfully validated and published voluntary exit for validator
26+
0xa262dae3dcd2b2e280af534effa16bedb27c06f2959e114d53bd2a248ca324a018dc73179899a066149471a94a1bc92f
27+
```
28+
29+
To exit all validators on the validator client, use the keyword `all`:
30+
31+
```bash
32+
lighthouse vm exit --vc-token ~/.lighthouse/mainnet/validators/api-token.txt --validators all --beacon-node http://localhost:5052
33+
```
34+
35+
To check the voluntary exit status, use both `--status` and `--beacon-node` flags:
36+
37+
```bash
38+
lighthouse vm exit --vc-token ~/.lighthouse/mainnet/validators/api-token.txt --validators 0x8de7ec501d574152f52a962bf588573df2fc3563fd0c6077651208ed20f24f3d8572425706b343117b48bdca56808416 --beacon-node http://localhost:5052 --status
39+
```
40+
41+
If the validator voluntary exit has been accepted by the chain, the following message will be returned:
42+
43+
```text
44+
Voluntary exit for validator 0x8de7ec501d574152f52a962bf588573df2fc3563fd0c6077651208ed20f24f3d8572425706b343117b48bdca56808416 has been accepted into the beacon chain, but not yet finalized. Finalization may take several minutes or longer. Before finalization there is a low probability that the exit may be reverted.
45+
Current epoch: 2, Exit epoch: 7, Withdrawable epoch: 263
46+
Please keep your validator running till exit epoch
47+
Exit epoch in approximately 480 secs
48+
```
49+
50+
When the exit epoch is reached, querying the status will return:
51+
52+
```text
53+
Validator 0x8de7ec501d574152f52a962bf588573df2fc3563fd0c6077651208ed20f24f3d8572425706b343117b48bdca56808416 has exited at epoch: 7
54+
```
55+
56+
You can safely shut down the validator client at this point.
57+
58+
The following exit command will only generate the exit message and will not publish the message to the network, i.e., there will be no voluntary exit.
59+
60+
To only generate the exit message without publishing it to the network, use the flag `--signature`:
61+
62+
```bash
63+
lighthouse vm exit --vc-token ~/.lighthouse/mainnet/validators/api-token.txt --validators all --signature
64+
```
65+
66+
To generate the exit message for a particular (future) epoch, use the flag `--exit-epoch`:
67+
68+
```bash
69+
lighthouse vm exit --vc-token ~/.lighthouse/mainnet/validators/api-token.txt --validators all --signature --exit-epoch 1234567
70+
```
71+
72+
The generated exit message will only be valid at or after the specified exit-epoch, in this case, epoch 1234567.
473

574
## Delete
675

@@ -16,6 +85,12 @@ Example:
1685
lighthouse vm delete --vc-token ~/.lighthouse/mainnet/validators/api-token.txt --validators 0x8885c29b8f88ee9b9a37b480fd4384fed74bda33d85bc8171a904847e65688b6c9bb4362d6597fd30109fb2def6c3ae4,0xa262dae3dcd2b2e280af534effa16bedb27c06f2959e114d53bd2a248ca324a018dc73179899a066149471a94a1bc92f
1786
```
1887

88+
To delete all validators on the validator client, use the keyword `all`:
89+
90+
```bash
91+
lighthouse vm delete --vc-token ~/.lighthouse/mainnet/validators/api-token.txt --validators all
92+
```
93+
1994
## Import
2095

2196
The `import` command imports validator keystores generated by the staking-deposit-cli/ethstaker-deposit-cli. To import a validator keystore:

book/src/validator-manager.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ The `validator-manager` boasts the following features:
3232

3333
- [Creating and importing validators using the `create` and `import` commands.](./validator-manager-create.md)
3434
- [Moving validators between two VCs using the `move` command.](./validator-manager-move.md)
35-
- [Managing validators such as delete, import and list validators.](./validator-manager-api.md)
35+
- [Managing validators such as exit, delete, import and list validators.](./validator-manager-api.md)

book/src/voluntary-exit.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ A validator can initiate a voluntary exit provided that the validator is current
1010
It takes at a minimum 5 epochs (32 minutes) for a validator to exit after initiating a voluntary exit.
1111
This number can be much higher depending on how many other validators are queued to exit.
1212

13+
You can also perform voluntary exit for one or more validators using the validator manager, see [Managing Validators](./validator-manager-api.md#exit) for more details.
14+
1315
## Initiating a voluntary exit
1416

1517
In order to initiate an exit, users can use the `lighthouse account validator exit` command.

0 commit comments

Comments
 (0)