Skip to content

Commit

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

You can safely shut down the validator client at this point.

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.
The following command will only generate the voluntary exit message and save it to a file named `{validator_pubkey}.json`. It will not publish the message to the network, i.e., there will be no voluntary exit.

To only generate the exit message without publishing it to the network, use the flag `--signature`:
To generate the exit message and save it to a file, use the flag `--signature`:

```bash
lighthouse vm exit --vc-token ~/.lighthouse/mainnet/validators/api-token.txt --validators all --signature
Expand Down
5 changes: 3 additions & 2 deletions validator_manager/src/exit_validators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use eth2::{BeaconNodeHttpClient, SensitiveUrl, Timeouts};
use serde::{Deserialize, Serialize};
use serde_json;
use slot_clock::{SlotClock, SystemTimeSlotClock};
use std::fs::write;
use std::path::PathBuf;
use std::time::Duration;
use types::{ChainSpec, EthSpec, PublicKeyBytes};
Expand Down Expand Up @@ -209,7 +210,7 @@ async fn run<E: EthSpec>(config: ExitConfig) -> Result<(), String> {
exit_message_all.push(json.clone());
} else {
let file_path = format!("{}.json", validator_to_exit);
std::fs::write(&file_path, json).map_err(|e| {
write(&file_path, json).map_err(|e| {
format!("Failed to write voluntary exit message to file: {}", e)
})?;
println!("Voluntary exit message saved to {}", file_path);
Expand Down Expand Up @@ -361,7 +362,7 @@ async fn run<E: EthSpec>(config: ExitConfig) -> Result<(), String> {
if merge {
let all_json = serde_json::to_string(&exit_message_all)
.map_err(|e| format!("Failed to serialize voluntary exit message: {}", e))?;
std::fs::write("all_validators.json", all_json)
write("all_validators.json", all_json)
.map_err(|e| format!("Failed to write all voluntary exit messages to file: {}", e))?;
println!("All voluntary exit messages save to all_validators.json.")
}
Expand Down

0 comments on commit 6a70f4e

Please sign in to comment.