Skip to content

Commit

Permalink
Update book
Browse files Browse the repository at this point in the history
  • Loading branch information
chong-he committed Sep 20, 2024
1 parent e81dfa3 commit 4c6ae73
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
9 changes: 6 additions & 3 deletions book/src/validator-manager-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

The `lighthouse validator-manager` supports 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`.

## Delete
The `delete` command deletes one or more validators from the validator client. It will also modify the `validator_definitions.yml` file automatically so there is no manual action required from the user after the delete. To `delete`:

```bash
Expand All @@ -14,18 +15,20 @@ Example:
lighthouse vm remove --vc-token ~/.lighthouse/mainnet/validators/api-token.txt --validators 0x8885c29b8f88ee9b9a37b480fd4384fed74bda33d85bc8171a904847e65688b6c9bb4362d6597fd30109fb2def6c3ae4, 0xa262dae3dcd2b2e280af534effa16bedb27c06f2959e114d53bd2a248ca324a018dc73179899a066149471a94a1bc92f
```

The `import-standard` command imports validator keystores generated by the staking-deposit-cli. To import validator keystore:
## Import
The `import` command imports validator keystores generated by the staking-deposit-cli. To import validator keystore:

```bash
lighthouse vm import-standard --vc-token <API-TOKEN-PATH> --validators-file /path/to/json --password keystore_password
lighthouse vm import --standard-format --vc-token <API-TOKEN-PATH> --validators-file /path/to/json --password keystore_password
```

Example:

```
lighthouse vm import-standard --vc-token ~/.lighthouse/mainnet/validators/api-token.txt --validator-file keystore.json --password keystore_password
lighthouse vm import --standard-format --vc-token ~/.lighthouse/mainnet/validators/api-token.txt --validator-file keystore.json --password keystore_password
```

## List
To list the validators running on the validator client:

```bash
Expand Down
2 changes: 2 additions & 0 deletions book/src/validator-manager-create.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ lighthouse \
> Be sure to remove `./validators.json` after the import is successful since it
> contains unencrypted validator keystores.
> Note: To import validators with validator-manager using keystore files created using the staking deposit cli, refer to [Managing Validators](./validator-manager-api.md#import).
## Detailed Guide

This guide will create two validators and import them to a VC. For simplicity,
Expand Down
1 change: 1 addition & 0 deletions validator_manager/src/import_validators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ pub mod tests {
let validator_standard = &validators[0];
let validator_json = validator_standard.voting_keystore.0.clone();

// Let the created file to have a file name so that it will not overwrite the file created before
let keystore_file_path = validators_file_path.with_file_name("keystore.json");
let keystore_file = File::create(&keystore_file_path).unwrap();
validator_json.to_json_writer(keystore_file).unwrap();
Expand Down

0 comments on commit 4c6ae73

Please sign in to comment.