Add a lighthouse node implementation

This commit is contained in:
Omar Abdulla
2025-09-24 17:13:52 +03:00
parent c2ba2cfed6
commit 5c30e8a5bf
8 changed files with 1385 additions and 6 deletions
+1
View File
@@ -6,6 +6,7 @@ use revive_dt_node_interaction::EthereumNode;
pub mod common;
pub mod constants;
pub mod geth;
pub mod lighthouse_geth;
pub mod process;
pub mod substrate;
File diff suppressed because it is too large Load Diff
+15 -1
View File
@@ -93,10 +93,22 @@ impl Process {
let mut stdout_lines = BufReader::new(stdout_logs_file).lines();
let mut stderr_lines = BufReader::new(stderr_logs_file).lines();
let mut stdout = String::new();
let mut stderr = String::new();
loop {
let stdout_line = stdout_lines.next().and_then(Result::ok);
let stderr_line = stderr_lines.next().and_then(Result::ok);
if let Some(stdout_line) = stdout_line.as_ref() {
stdout.push_str(stdout_line);
stdout.push('\n');
}
if let Some(stderr_line) = stderr_line.as_ref() {
stderr.push_str(stderr_line);
stdout.push('\n');
}
let check_result =
check_function(stdout_line.as_deref(), stderr_line.as_deref())
.context("Failed to wait for the process to be ready")?;
@@ -106,7 +118,9 @@ impl Process {
}
if Instant::now().duration_since(spawn_time) > max_wait_duration {
bail!("Waited for the process to start but it failed to start in time")
bail!(
"Waited for the process to start but it failed to start in time. stderr {stderr} - stdout {stdout}"
)
}
}
}