feat: reth-config crate (#2825)

This commit is contained in:
byyou
2023-05-26 13:56:28 +00:00
committed by GitHub
parent 1176754d6e
commit 0caf051869
15 changed files with 80 additions and 35 deletions

View File

@@ -9,6 +9,7 @@ build = "build.rs"
[dependencies]
# reth
reth-config = { path = "../../crates/config" }
reth-primitives = { path = "../../crates/primitives", features = ["arbitrary"] }
reth-db = { path = "../../crates/storage/db", features = ["mdbx", "test-utils"] }
# TODO: Temporary use of the test-utils feature
@@ -92,4 +93,4 @@ jemalloc = ["dep:jemallocator"]
only-info-logs = ["tracing/release_max_level_info"]
[build-dependencies]
vergen = { version = "8.0.0", features = ["build", "cargo", "git", "gitcl"] }
vergen = { version = "8.0.0", features = ["build", "cargo", "git", "gitcl"] }

View File

@@ -2,10 +2,10 @@
use crate::version::P2P_CLIENT_VERSION;
use clap::Args;
use reth_config::Config;
use reth_net_nat::NatResolver;
use reth_network::{HelloMessage, NetworkConfigBuilder};
use reth_primitives::{mainnet_nodes, ChainSpec, NodeRecord};
use reth_staged_sync::Config;
use secp256k1::SecretKey;
use std::{path::PathBuf, sync::Arc};

View File

@@ -8,6 +8,7 @@ use eyre::Context;
use futures::{Stream, StreamExt};
use reth_beacon_consensus::BeaconConsensus;
use reth_config::Config;
use reth_db::database::Database;
use reth_downloaders::{
bodies::bodies::BodiesDownloaderBuilder,
@@ -15,12 +16,9 @@ use reth_downloaders::{
};
use reth_interfaces::consensus::Consensus;
use reth_primitives::{ChainSpec, H256};
use reth_staged_sync::{
utils::{
chainspec::genesis_value_parser,
init::{init_db, init_genesis},
},
Config,
use reth_staged_sync::utils::{
chainspec::genesis_value_parser,
init::{init_db, init_genesis},
};
use reth_stages::{
prelude::*,

View File

@@ -3,7 +3,7 @@ use std::path::PathBuf;
use clap::Parser;
use eyre::{bail, WrapErr};
use reth_staged_sync::Config;
use reth_config::Config;
/// `reth config` command
#[derive(Debug, Parser)]

View File

@@ -9,6 +9,7 @@ use crate::{
use clap::Parser;
use futures::{stream::select as stream_select, StreamExt};
use reth_beacon_consensus::BeaconConsensus;
use reth_config::Config;
use reth_db::{
database::Database,
mdbx::{Env, WriteMap},
@@ -26,12 +27,9 @@ use reth_network::NetworkHandle;
use reth_network_api::NetworkInfo;
use reth_primitives::{BlockHashOrNumber, BlockNumber, ChainSpec, H256};
use reth_provider::{ShareableDatabase, Transaction};
use reth_staged_sync::{
utils::{
chainspec::genesis_value_parser,
init::{init_db, init_genesis},
},
Config,
use reth_staged_sync::utils::{
chainspec::genesis_value_parser,
init::{init_db, init_genesis},
};
use reth_stages::{
sets::DefaultStages,

View File

@@ -19,6 +19,7 @@ use reth_beacon_consensus::{BeaconConsensus, BeaconConsensusEngine};
use reth_blockchain_tree::{
config::BlockchainTreeConfig, externals::TreeExternals, BlockchainTree, ShareableBlockchainTree,
};
use reth_config::Config;
use reth_db::{
database::Database,
mdbx::{Env, WriteMap},
@@ -45,13 +46,10 @@ use reth_provider::{BlockProvider, CanonStateSubscriptions, HeaderProvider, Shar
use reth_revm::Factory;
use reth_revm_inspectors::stack::Hook;
use reth_rpc_engine_api::EngineApi;
use reth_staged_sync::{
utils::{
chainspec::genesis_value_parser,
init::{init_db, init_genesis},
parse_socket_address,
},
Config,
use reth_staged_sync::utils::{
chainspec::genesis_value_parser,
init::{init_db, init_genesis},
parse_socket_address,
};
use reth_stages::{
prelude::*,

View File

@@ -6,15 +6,13 @@ use crate::{
};
use backon::{ConstantBuilder, Retryable};
use clap::{Parser, Subcommand};
use reth_config::Config;
use reth_db::mdbx::{Env, EnvKind, WriteMap};
use reth_discv4::NatResolver;
use reth_interfaces::p2p::bodies::client::BodiesClient;
use reth_primitives::{BlockHashOrNumber, ChainSpec, NodeRecord};
use reth_provider::ShareableDatabase;
use reth_staged_sync::{
utils::{chainspec::chain_spec_value_parser, hash_or_num_value_parser},
Config,
};
use reth_staged_sync::utils::{chainspec::chain_spec_value_parser, hash_or_num_value_parser};
use std::{path::PathBuf, sync::Arc};
/// `reth p2p` command

View File

@@ -9,13 +9,11 @@ use crate::{
};
use clap::Parser;
use reth_beacon_consensus::BeaconConsensus;
use reth_config::Config;
use reth_downloaders::bodies::bodies::BodiesDownloaderBuilder;
use reth_primitives::{ChainSpec, StageCheckpoint};
use reth_provider::{ShareableDatabase, Transaction};
use reth_staged_sync::{
utils::{chainspec::chain_spec_value_parser, init::init_db},
Config,
};
use reth_staged_sync::utils::{chainspec::chain_spec_value_parser, init::init_db};
use reth_stages::{
stages::{
BodyStage, ExecutionStage, ExecutionStageThresholds, MerkleStage, SenderRecoveryStage,