mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
refactor: extract init from node-core (#8373)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@ -54,6 +54,7 @@ reth-node-optimism = { workspace = true, optional = true, features = [
|
||||
"optimism",
|
||||
] }
|
||||
reth-node-core.workspace = true
|
||||
reth-db-common.workspace = true
|
||||
reth-node-builder.workspace = true
|
||||
reth-node-events.workspace = true
|
||||
reth-consensus.workspace = true
|
||||
|
||||
@ -17,6 +17,7 @@ use reth_cli_runner::CliContext;
|
||||
use reth_config::{config::EtlConfig, Config};
|
||||
use reth_consensus::Consensus;
|
||||
use reth_db::{database::Database, init_db, DatabaseEnv};
|
||||
use reth_db_common::init::init_genesis;
|
||||
use reth_downloaders::{
|
||||
bodies::bodies::BodiesDownloaderBuilder,
|
||||
headers::reverse_headers::ReverseHeadersDownloaderBuilder,
|
||||
@ -26,7 +27,6 @@ use reth_fs_util as fs;
|
||||
use reth_interfaces::p2p::{bodies::client::BodiesClient, headers::client::HeadersClient};
|
||||
use reth_network::{NetworkEvents, NetworkHandle};
|
||||
use reth_network_api::NetworkInfo;
|
||||
use reth_node_core::init::init_genesis;
|
||||
use reth_primitives::{
|
||||
stage::StageId, BlockHashOrNumber, BlockNumber, ChainSpec, PruneModes, B256,
|
||||
};
|
||||
@ -187,7 +187,7 @@ impl Command {
|
||||
match get_single_header(&client, BlockHashOrNumber::Number(block)).await {
|
||||
Ok(tip_header) => {
|
||||
info!(target: "reth::cli", ?block, "Successfully fetched block");
|
||||
return Ok(tip_header.hash())
|
||||
return Ok(tip_header.hash());
|
||||
}
|
||||
Err(error) => {
|
||||
error!(target: "reth::cli", ?block, %error, "Failed to fetch the block. Retrying...");
|
||||
@ -255,7 +255,7 @@ impl Command {
|
||||
provider.get_stage_checkpoint(StageId::Finish)?.map(|ch| ch.block_number);
|
||||
if latest_block_number.unwrap_or_default() >= self.to {
|
||||
info!(target: "reth::cli", latest = latest_block_number, "Nothing to run");
|
||||
return Ok(())
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let pipeline_events = pipeline.events();
|
||||
|
||||
@ -16,6 +16,7 @@ use reth_beacon_consensus::EthBeaconConsensus;
|
||||
use reth_config::{config::EtlConfig, Config};
|
||||
use reth_consensus::Consensus;
|
||||
use reth_db::{database::Database, init_db, tables, transaction::DbTx};
|
||||
use reth_db_common::init::init_genesis;
|
||||
use reth_downloaders::{
|
||||
bodies::bodies::BodiesDownloaderBuilder,
|
||||
file_client::{ChunkedFileReader, FileClient, DEFAULT_BYTE_LEN_CHUNK_CHAIN_FILE},
|
||||
@ -25,7 +26,6 @@ use reth_interfaces::p2p::{
|
||||
bodies::downloader::BodyDownloader,
|
||||
headers::downloader::{HeaderDownloader, SyncTarget},
|
||||
};
|
||||
use reth_node_core::init::init_genesis;
|
||||
use reth_node_events::node::NodeEvent;
|
||||
use reth_primitives::{stage::StageId, ChainSpec, PruneModes, B256};
|
||||
use reth_provider::{
|
||||
|
||||
@ -13,19 +13,15 @@ use crate::{
|
||||
use clap::Parser;
|
||||
use reth_beacon_consensus::EthBeaconConsensus;
|
||||
use reth_config::{config::EtlConfig, Config};
|
||||
|
||||
use reth_db::{init_db, tables, transaction::DbTx};
|
||||
use reth_db_common::init::init_genesis;
|
||||
use reth_downloaders::file_client::{
|
||||
ChunkedFileReader, FileClient, DEFAULT_BYTE_LEN_CHUNK_CHAIN_FILE,
|
||||
};
|
||||
|
||||
use reth_node_core::init::init_genesis;
|
||||
|
||||
use reth_primitives::{op_mainnet::is_dup_tx, stage::StageId, PruneModes};
|
||||
use reth_provider::{ProviderFactory, StageCheckpointReader, StaticFileProviderFactory};
|
||||
use reth_static_file::StaticFileProducer;
|
||||
use std::{path::PathBuf, sync::Arc};
|
||||
|
||||
use tracing::{debug, error, info};
|
||||
|
||||
/// Syncs RLP encoded blocks from a file.
|
||||
|
||||
@ -9,7 +9,7 @@ use crate::{
|
||||
};
|
||||
use clap::Parser;
|
||||
use reth_db::init_db;
|
||||
use reth_node_core::init::init_genesis;
|
||||
use reth_db_common::init::init_genesis;
|
||||
use reth_primitives::ChainSpec;
|
||||
use reth_provider::ProviderFactory;
|
||||
use std::sync::Arc;
|
||||
|
||||
@ -10,7 +10,7 @@ use crate::{
|
||||
use clap::Parser;
|
||||
use reth_config::config::EtlConfig;
|
||||
use reth_db::{database::Database, init_db};
|
||||
use reth_node_core::init::init_from_state_dump;
|
||||
use reth_db_common::init::init_from_state_dump;
|
||||
use reth_primitives::{ChainSpec, B256};
|
||||
use reth_provider::ProviderFactory;
|
||||
|
||||
|
||||
@ -9,7 +9,8 @@ use reth_db::{
|
||||
init_db, tables,
|
||||
transaction::DbTx,
|
||||
};
|
||||
use reth_node_core::{args::DatabaseArgs, init::init_genesis};
|
||||
use reth_db_common::init::init_genesis;
|
||||
use reth_node_core::args::DatabaseArgs;
|
||||
use reth_primitives::ChainSpec;
|
||||
use reth_provider::{BlockNumReader, HeaderProvider, ProviderError, ProviderFactory};
|
||||
use reth_trie::StateRoot;
|
||||
|
||||
@ -11,8 +11,8 @@ use crate::{
|
||||
use clap::Parser;
|
||||
use itertools::Itertools;
|
||||
use reth_db::{open_db, static_file::iter_static_files, tables, transaction::DbTxMut, DatabaseEnv};
|
||||
use reth_db_common::init::{insert_genesis_header, insert_genesis_history, insert_genesis_state};
|
||||
use reth_fs_util as fs;
|
||||
use reth_node_core::init::{insert_genesis_header, insert_genesis_history, insert_genesis_state};
|
||||
use reth_primitives::{
|
||||
stage::StageId, static_file::find_fixed_range, ChainSpec, StaticFileSegment,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user