mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix(cli): block node command from exiting (#1540)
This commit is contained in:
3
.github/workflows/integration.yml
vendored
3
.github/workflows/integration.yml
vendored
@ -91,4 +91,5 @@ jobs:
|
|||||||
cargo run --profile ${{ matrix.profile }} \
|
cargo run --profile ${{ matrix.profile }} \
|
||||||
--bin reth -- node \
|
--bin reth -- node \
|
||||||
--debug.tip 0x91c90676cab257a59cd956d7cb0bceb9b1a71d79755c23c7277a0697ccfaf8c4 \
|
--debug.tip 0x91c90676cab257a59cd956d7cb0bceb9b1a71d79755c23c7277a0697ccfaf8c4 \
|
||||||
--debug.max-block 100000
|
--debug.max-block 100000 \
|
||||||
|
--debug.terminate
|
||||||
|
|||||||
@ -111,6 +111,10 @@ pub struct Command {
|
|||||||
#[arg(long = "debug.max-block", help_heading = "Debug")]
|
#[arg(long = "debug.max-block", help_heading = "Debug")]
|
||||||
max_block: Option<u64>,
|
max_block: Option<u64>,
|
||||||
|
|
||||||
|
/// Flag indicating whether the node should be terminated after the pipeline sync.
|
||||||
|
#[arg(long = "debug.terminate", help_heading = "Debug")]
|
||||||
|
terminate: bool,
|
||||||
|
|
||||||
#[clap(flatten)]
|
#[clap(flatten)]
|
||||||
rpc: RpcServerArgs,
|
rpc: RpcServerArgs,
|
||||||
}
|
}
|
||||||
@ -196,8 +200,15 @@ impl Command {
|
|||||||
|
|
||||||
tx.await??;
|
tx.await??;
|
||||||
|
|
||||||
info!(target: "reth::cli", "Finishing up");
|
info!(target: "reth::cli", "Pipeline has finished.");
|
||||||
Ok(())
|
|
||||||
|
if self.terminate {
|
||||||
|
Ok(())
|
||||||
|
} else {
|
||||||
|
// The pipeline has finished downloading blocks up to `--debug.tip` or
|
||||||
|
// `--debug.max-block`. Keep other node components alive for further usage.
|
||||||
|
futures::future::pending().await
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn build_networked_pipeline(
|
async fn build_networked_pipeline(
|
||||||
|
|||||||
Reference in New Issue
Block a user