chore: move node command to reth-cli-commands (#9395)

This commit is contained in:
joshieDo
2024-07-09 17:13:58 +02:00
committed by GitHub
parent d599393771
commit e97e379e43
6 changed files with 20 additions and 13 deletions

2
Cargo.lock generated
View File

@ -6633,12 +6633,14 @@ dependencies = [
"reth-db",
"reth-db-api",
"reth-db-common",
"reth-discv4",
"reth-downloaders",
"reth-evm",
"reth-exex",
"reth-fs-util",
"reth-network",
"reth-network-p2p",
"reth-node-builder",
"reth-node-core",
"reth-primitives",
"reth-provider",

View File

@ -5,17 +5,16 @@ use crate::{
utils::{chain_help, chain_value_parser, SUPPORTED_CHAINS},
LogArgs,
},
commands::{
debug_cmd, import,
node::{self, NoArgs},
},
commands::{debug_cmd, import},
macros::block_executor,
version::{LONG_VERSION, SHORT_VERSION},
};
use clap::{value_parser, Parser, Subcommand};
use reth_chainspec::ChainSpec;
use reth_cli_commands::{
config_cmd, db, dump_genesis, init_cmd, init_state, p2p, prune, recover, stage,
config_cmd, db, dump_genesis, init_cmd, init_state,
node::{self, NoArgs},
p2p, prune, recover, stage,
};
use reth_cli_runner::CliRunner;
use reth_db::DatabaseEnv;

View File

@ -2,4 +2,3 @@
pub mod debug_cmd;
pub mod import;
pub mod node;

View File

@ -25,6 +25,7 @@ reth-exex.workspace = true
reth-fs-util.workspace = true
reth-network = { workspace = true, features = ["serde"] }
reth-network-p2p.workspace = true
reth-node-builder.workspace = true
reth-node-core.workspace = true
reth-primitives.workspace = true
reth-provider.workspace = true
@ -67,6 +68,9 @@ proptest = { workspace = true, optional = true }
arbitrary = { workspace = true, optional = true }
proptest-arbitrary-interop = { workspace = true, optional = true }
[dev-dependencies]
reth-discv4.workspace = true
[features]
default = []
dev = [

View File

@ -14,6 +14,7 @@ pub mod db;
pub mod dump_genesis;
pub mod init_cmd;
pub mod init_state;
pub mod node;
pub mod p2p;
pub mod prune;
pub mod recover;

View File

@ -1,17 +1,20 @@
//! Main node command for launching a node
use crate::args::{
utils::{chain_help, chain_value_parser, SUPPORTED_CHAINS},
DatabaseArgs, DatadirArgs, DebugArgs, DevArgs, NetworkArgs, PayloadBuilderArgs, PruningArgs,
RpcServerArgs, TxPoolArgs,
};
use clap::{value_parser, Args, Parser};
use reth_chainspec::ChainSpec;
use reth_cli_runner::CliContext;
use reth_cli_util::parse_socket_address;
use reth_db::{init_db, DatabaseEnv};
use reth_node_builder::{NodeBuilder, WithLaunchContext};
use reth_node_core::{node_config::NodeConfig, version};
use reth_node_core::{
args::{
utils::{chain_help, chain_value_parser, SUPPORTED_CHAINS},
DatabaseArgs, DatadirArgs, DebugArgs, DevArgs, NetworkArgs, PayloadBuilderArgs,
PruningArgs, RpcServerArgs, TxPoolArgs,
},
node_config::NodeConfig,
version,
};
use std::{ffi::OsString, fmt, future::Future, net::SocketAddr, path::PathBuf, sync::Arc};
/// Start the node
@ -303,7 +306,6 @@ mod tests {
}
#[test]
#[cfg(not(feature = "optimism"))] // dev mode not yet supported in op-reth
fn parse_dev() {
let cmd = NodeCommand::<NoArgs>::parse_from(["reth", "--dev"]);
let chain = reth_chainspec::DEV.clone();