Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jul 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions bin/reth/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ use crate::{
LogArgs,
},
commands::{
config_cmd, debug_cmd, dump_genesis, import, init_cmd, init_state,
debug_cmd, import,
node::{self, NoArgs},
p2p, prune, recover, stage,
stage,
},
version::{LONG_VERSION, SHORT_VERSION},
};
use clap::{value_parser, Parser, Subcommand};
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_db::DatabaseEnv;
use reth_node_builder::{NodeBuilder, WithLaunchContext};
Expand Down
7 changes: 0 additions & 7 deletions bin/reth/src/commands/mod.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
//! This contains all of the `reth` commands

pub mod config_cmd;
pub mod debug_cmd;
pub mod dump_genesis;
pub mod import;
pub mod init_cmd;
pub mod init_state;
pub mod node;
pub mod p2p;
pub mod prune;
pub mod recover;
pub mod stage;
28 changes: 19 additions & 9 deletions crates/cli/commands/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,28 @@ repository.workspace = true
[lints]

[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-chainspec.workspace = true
reth-cli-runner.workspace = true
reth-cli-util.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-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-static-file-types.workspace = true
reth-static-file.workspace = true
reth-trie = { workspace = true, features = ["metrics"] }

confy.workspace = true
tokio.workspace = true
itertools.workspace = true

Expand All @@ -38,6 +43,11 @@ clap = { workspace = true, features = ["derive", "env"] }
serde.workspace = true
serde_json.workspace = true
tracing.workspace = true
backon.workspace = true

# io
confy.workspace = true
toml = { workspace = true, features = ["display"] }

# tui
comfy-table = "7.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Command that dumps genesis block JSON configuration to stdout
use crate::args::utils::{chain_help, chain_value_parser, SUPPORTED_CHAINS};
use clap::Parser;
use reth_chainspec::ChainSpec;
use reth_node_core::args::utils::{chain_help, chain_value_parser, SUPPORTED_CHAINS};
use std::sync::Arc;

/// Dumps genesis block JSON configuration to stdout
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Command that initializes the node from a genesis file.

use crate::common::{AccessRights, Environment, EnvironmentArgs};
use clap::Parser;
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
use reth_provider::BlockHashReader;
use tracing::info;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Command that initializes the node from a genesis file.

use crate::common::{AccessRights, Environment, EnvironmentArgs};
use clap::Parser;
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
use reth_config::config::EtlConfig;
use reth_db_api::database::Database;
use reth_db_common::init::init_from_state_dump;
Expand Down
7 changes: 7 additions & 0 deletions crates/cli/commands/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

pub mod common;
pub mod config_cmd;
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")]
pub mod test_vectors;
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
//! 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 clap::{Parser, Subcommand};
use reth_chainspec::ChainSpec;
use reth_cli_util::{get_secret_key, hash_or_num_value_parser};
use reth_config::Config;
use reth_network::NetworkConfigBuilder;
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 std::{path::PathBuf, sync::Arc};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Command that runs pruning without any limits.
use crate::common::{AccessRights, Environment, EnvironmentArgs};
use clap::Parser;
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
use reth_prune::PrunerBuilder;
use reth_static_file::StaticFileProducer;
use tracing::info;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::common::{AccessRights, Environment, EnvironmentArgs};
use clap::Parser;
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
use reth_cli_runner::CliContext;
use reth_db::tables;
use reth_db_api::{
Expand Down
Loading