chore: move featureless commands from bin to reth-cli-commands (#9333)

This commit is contained in:
joshieDo
2024-07-06 12:34:45 +02:00
committed by GitHub
parent 0ce192921f
commit 569555516b
13 changed files with 49 additions and 32 deletions

8
Cargo.lock generated
View File

@ -6610,6 +6610,7 @@ version = "1.0.0"
dependencies = [ dependencies = [
"ahash", "ahash",
"arbitrary", "arbitrary",
"backon",
"clap", "clap",
"comfy-table", "comfy-table",
"confy", "confy",
@ -6622,6 +6623,8 @@ dependencies = [
"ratatui", "ratatui",
"reth-beacon-consensus", "reth-beacon-consensus",
"reth-chainspec", "reth-chainspec",
"reth-cli-runner",
"reth-cli-util",
"reth-config", "reth-config",
"reth-db", "reth-db",
"reth-db-api", "reth-db-api",
@ -6629,15 +6632,20 @@ dependencies = [
"reth-downloaders", "reth-downloaders",
"reth-evm", "reth-evm",
"reth-fs-util", "reth-fs-util",
"reth-network",
"reth-network-p2p",
"reth-node-core", "reth-node-core",
"reth-primitives", "reth-primitives",
"reth-provider", "reth-provider",
"reth-prune",
"reth-stages", "reth-stages",
"reth-static-file", "reth-static-file",
"reth-static-file-types", "reth-static-file-types",
"reth-trie",
"serde", "serde",
"serde_json", "serde_json",
"tokio", "tokio",
"toml",
"tracing", "tracing",
] ]

View File

@ -6,15 +6,15 @@ use crate::{
LogArgs, LogArgs,
}, },
commands::{ commands::{
config_cmd, debug_cmd, dump_genesis, import, init_cmd, init_state, debug_cmd, import,
node::{self, NoArgs}, node::{self, NoArgs},
p2p, prune, recover, stage, stage,
}, },
version::{LONG_VERSION, SHORT_VERSION}, version::{LONG_VERSION, SHORT_VERSION},
}; };
use clap::{value_parser, Parser, Subcommand}; use clap::{value_parser, Parser, Subcommand};
use reth_chainspec::ChainSpec; use reth_chainspec::ChainSpec;
use reth_cli_commands::db; use reth_cli_commands::{config_cmd, db, dump_genesis, init_cmd, init_state, p2p, prune, recover};
use reth_cli_runner::CliRunner; use reth_cli_runner::CliRunner;
use reth_db::DatabaseEnv; use reth_db::DatabaseEnv;
use reth_node_builder::{NodeBuilder, WithLaunchContext}; use reth_node_builder::{NodeBuilder, WithLaunchContext};

View File

@ -1,13 +1,6 @@
//! This contains all of the `reth` commands //! This contains all of the `reth` commands
pub mod config_cmd;
pub mod debug_cmd; pub mod debug_cmd;
pub mod dump_genesis;
pub mod import; pub mod import;
pub mod init_cmd;
pub mod init_state;
pub mod node; pub mod node;
pub mod p2p;
pub mod prune;
pub mod recover;
pub mod stage; pub mod stage;

View File

@ -10,23 +10,28 @@ repository.workspace = true
[lints] [lints]
[dependencies] [dependencies]
reth-db = { workspace = true, features = ["mdbx"] }
reth-db-api.workspace = true
reth-provider.workspace = true
reth-primitives.workspace = true
reth-node-core.workspace = true
reth-fs-util.workspace = true
reth-db-common.workspace = true
reth-static-file-types.workspace = true
reth-beacon-consensus.workspace = true reth-beacon-consensus.workspace = true
reth-chainspec.workspace = true reth-chainspec.workspace = true
reth-cli-runner.workspace = true
reth-cli-util.workspace = true
reth-config.workspace = true reth-config.workspace = true
reth-db = { workspace = true, features = ["mdbx"] }
reth-db-api.workspace = true
reth-db-common.workspace = true
reth-downloaders.workspace = true reth-downloaders.workspace = true
reth-evm.workspace = true reth-evm.workspace = true
reth-fs-util.workspace = true
reth-network = { workspace = true, features = ["serde"] }
reth-network-p2p.workspace = true
reth-node-core.workspace = true
reth-primitives.workspace = true
reth-provider.workspace = true
reth-prune.workspace = true
reth-stages.workspace = true reth-stages.workspace = true
reth-static-file-types.workspace = true
reth-static-file.workspace = true reth-static-file.workspace = true
reth-trie = { workspace = true, features = ["metrics"] }
confy.workspace = true
tokio.workspace = true tokio.workspace = true
itertools.workspace = true itertools.workspace = true
@ -38,6 +43,11 @@ clap = { workspace = true, features = ["derive", "env"] }
serde.workspace = true serde.workspace = true
serde_json.workspace = true serde_json.workspace = true
tracing.workspace = true tracing.workspace = true
backon.workspace = true
# io
confy.workspace = true
toml = { workspace = true, features = ["display"] }
# tui # tui
comfy-table = "7.0" comfy-table = "7.0"

View File

@ -1,7 +1,7 @@
//! Command that dumps genesis block JSON configuration to stdout //! Command that dumps genesis block JSON configuration to stdout
use crate::args::utils::{chain_help, chain_value_parser, SUPPORTED_CHAINS};
use clap::Parser; use clap::Parser;
use reth_chainspec::ChainSpec; use reth_chainspec::ChainSpec;
use reth_node_core::args::utils::{chain_help, chain_value_parser, SUPPORTED_CHAINS};
use std::sync::Arc; use std::sync::Arc;
/// Dumps genesis block JSON configuration to stdout /// Dumps genesis block JSON configuration to stdout

View File

@ -1,7 +1,7 @@
//! Command that initializes the node from a genesis file. //! Command that initializes the node from a genesis file.
use crate::common::{AccessRights, Environment, EnvironmentArgs};
use clap::Parser; use clap::Parser;
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
use reth_provider::BlockHashReader; use reth_provider::BlockHashReader;
use tracing::info; use tracing::info;

View File

@ -1,7 +1,7 @@
//! Command that initializes the node from a genesis file. //! Command that initializes the node from a genesis file.
use crate::common::{AccessRights, Environment, EnvironmentArgs};
use clap::Parser; use clap::Parser;
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
use reth_config::config::EtlConfig; use reth_config::config::EtlConfig;
use reth_db_api::database::Database; use reth_db_api::database::Database;
use reth_db_common::init::init_from_state_dump; use reth_db_common::init::init_from_state_dump;

View File

@ -9,6 +9,13 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
pub mod common; pub mod common;
pub mod config_cmd;
pub mod db; pub mod db;
pub mod dump_genesis;
pub mod init_cmd;
pub mod init_state;
pub mod p2p;
pub mod prune;
pub mod recover;
#[cfg(feature = "dev")] #[cfg(feature = "dev")]
pub mod test_vectors; pub mod test_vectors;

View File

@ -1,12 +1,5 @@
//! P2P Debugging tool //! P2P Debugging tool
use crate::{
args::{
utils::{chain_help, chain_value_parser, SUPPORTED_CHAINS},
DatabaseArgs, NetworkArgs,
},
utils::get_single_header,
};
use backon::{ConstantBuilder, Retryable}; use backon::{ConstantBuilder, Retryable};
use clap::{Parser, Subcommand}; use clap::{Parser, Subcommand};
use reth_chainspec::ChainSpec; use reth_chainspec::ChainSpec;
@ -14,7 +7,13 @@ use reth_cli_util::{get_secret_key, hash_or_num_value_parser};
use reth_config::Config; use reth_config::Config;
use reth_network::NetworkConfigBuilder; use reth_network::NetworkConfigBuilder;
use reth_network_p2p::bodies::client::BodiesClient; use reth_network_p2p::bodies::client::BodiesClient;
use reth_node_core::args::DatadirArgs; use reth_node_core::{
args::{
utils::{chain_help, chain_value_parser, SUPPORTED_CHAINS},
DatabaseArgs, DatadirArgs, NetworkArgs,
},
utils::get_single_header,
};
use reth_primitives::BlockHashOrNumber; use reth_primitives::BlockHashOrNumber;
use std::{path::PathBuf, sync::Arc}; use std::{path::PathBuf, sync::Arc};

View File

@ -1,6 +1,6 @@
//! Command that runs pruning without any limits. //! Command that runs pruning without any limits.
use crate::common::{AccessRights, Environment, EnvironmentArgs};
use clap::Parser; use clap::Parser;
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
use reth_prune::PrunerBuilder; use reth_prune::PrunerBuilder;
use reth_static_file::StaticFileProducer; use reth_static_file::StaticFileProducer;
use tracing::info; use tracing::info;

View File

@ -1,5 +1,5 @@
use crate::common::{AccessRights, Environment, EnvironmentArgs};
use clap::Parser; use clap::Parser;
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
use reth_cli_runner::CliContext; use reth_cli_runner::CliContext;
use reth_db::tables; use reth_db::tables;
use reth_db_api::{ use reth_db_api::{