Skip to content

Commit 5a4f928

Browse files
committed
save exit message to a file
1 parent 47419b3 commit 5a4f928

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

validator_manager/src/exit_validators.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,13 @@ async fn run<E: EthSpec>(config: ExitConfig) -> Result<(), String> {
175175
if signature {
176176
let exit_message_json = serde_json::to_string(&exit_message.data);
177177
match exit_message_json {
178-
Ok(json) => println!("Validator {}: {}", validator_to_exit, json),
178+
Ok(json) => {
179+
// Save the exit message to a JSON file
180+
let file_path = format!("validator_{}.json", validator_to_exit);
181+
std::fs::write(&file_path, json)
182+
.map_err(|e| format!("Failed to write exit message to file: {}", e))?;
183+
println!("Exit message saved to {}", file_path);
184+
}
179185
Err(e) => eprintln!("Failed to serialize voluntary exit message: {}", e),
180186
}
181187
}

0 commit comments

Comments
 (0)