mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: Pseudo peer and staged sync
For simplicity, we use with_pow() + pseudo peer that connects to reth itself, so that it can support 1. StateFetcher via NetworkState 2. Block announcement (which requires with_pow()). For block announcement, another way was using ImportService like before, or calling engine_api. But for simplicitiy, for now we just publish from pseudo peer like pre-PoS, hence with_pow().
This commit is contained in:
13
src/main.rs
13
src/main.rs
@ -1,8 +1,8 @@
|
||||
use clap::{Args, Parser};
|
||||
use clap::Parser;
|
||||
use reth::builder::NodeHandle;
|
||||
use reth_hl::{
|
||||
chainspec::parser::HlChainSpecParser,
|
||||
node::{cli::Cli, storage::tables::Tables, HlNode},
|
||||
node::{cli::{Cli, HlNodeArgs}, storage::tables::Tables, HlNode},
|
||||
};
|
||||
|
||||
// We use jemalloc for performance reasons
|
||||
@ -10,11 +10,6 @@ use reth_hl::{
|
||||
#[global_allocator]
|
||||
static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
|
||||
|
||||
/// No Additional arguments
|
||||
#[derive(Debug, Clone, Copy, Default, Args)]
|
||||
#[non_exhaustive]
|
||||
struct NoArgs;
|
||||
|
||||
fn main() -> eyre::Result<()> {
|
||||
reth_cli_util::sigsegv_handler::install();
|
||||
|
||||
@ -23,9 +18,9 @@ fn main() -> eyre::Result<()> {
|
||||
std::env::set_var("RUST_BACKTRACE", "1");
|
||||
}
|
||||
|
||||
Cli::<HlChainSpecParser, NoArgs>::parse().run(|builder, _| async move {
|
||||
Cli::<HlChainSpecParser, HlNodeArgs>::parse().run(|builder, ext| async move {
|
||||
builder.builder.database.create_tables_for::<Tables>()?;
|
||||
let (node, engine_handle_tx) = HlNode::new();
|
||||
let (node, engine_handle_tx) = HlNode::new(ext.block_source_args.parse().await?);
|
||||
let NodeHandle { node, node_exit_future: exit_future } =
|
||||
builder.node(node).launch().await?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user