chore(cli): move utils to reth-cli-utils crate (#9297)

This commit is contained in:
Luca Provini
2024-07-04 14:34:55 +02:00
committed by GitHub
parent 610110bb67
commit f759ca6036
20 changed files with 234 additions and 180 deletions

View File

@@ -31,6 +31,7 @@ reth-transaction-pool.workspace = true
reth-beacon-consensus.workspace = true
reth-cli-runner.workspace = true
reth-cli-commands.workspace = true
reth-cli-util.workspace = true
reth-consensus-common.workspace = true
reth-blockchain-tree.workspace = true
reth-rpc-builder.workspace = true

View File

@@ -1,15 +1,12 @@
//! Command for debugging execution.
use crate::{
args::{get_secret_key, NetworkArgs},
macros::block_executor,
utils::get_single_header,
};
use crate::{args::NetworkArgs, macros::block_executor, utils::get_single_header};
use clap::Parser;
use futures::{stream::select as stream_select, StreamExt};
use reth_beacon_consensus::EthBeaconConsensus;
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
use reth_cli_runner::CliContext;
use reth_cli_util::get_secret_key;
use reth_config::Config;
use reth_consensus::Consensus;
use reth_db::DatabaseEnv;

View File

@@ -1,7 +1,7 @@
//! Command for debugging in-memory merkle trie calculation.
use crate::{
args::{get_secret_key, NetworkArgs},
args::NetworkArgs,
macros::block_executor,
utils::{get_single_body, get_single_header},
};
@@ -9,6 +9,7 @@ use backon::{ConstantBuilder, Retryable};
use clap::Parser;
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
use reth_cli_runner::CliContext;
use reth_cli_util::get_secret_key;
use reth_config::Config;
use reth_db::DatabaseEnv;
use reth_errors::BlockValidationError;

View File

@@ -1,14 +1,11 @@
//! Command for debugging merkle trie calculation.
use crate::{
args::{get_secret_key, NetworkArgs},
macros::block_executor,
utils::get_single_header,
};
use crate::{args::NetworkArgs, macros::block_executor, utils::get_single_header};
use backon::{ConstantBuilder, Retryable};
use clap::Parser;
use reth_beacon_consensus::EthBeaconConsensus;
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
use reth_cli_runner::CliContext;
use reth_cli_util::get_secret_key;
use reth_config::Config;
use reth_consensus::Consensus;
use reth_db::{tables, DatabaseEnv};

View File

@@ -1,7 +1,4 @@
use crate::{
args::{get_secret_key, NetworkArgs},
macros::block_executor,
};
use crate::{args::NetworkArgs, macros::block_executor};
use clap::Parser;
use eyre::Context;
use reth_basic_payload_builder::{BasicPayloadJobGenerator, BasicPayloadJobGeneratorConfig};
@@ -11,6 +8,7 @@ use reth_blockchain_tree::{
};
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
use reth_cli_runner::CliContext;
use reth_cli_util::get_secret_key;
use reth_config::Config;
use reth_consensus::Consensus;
use reth_db::DatabaseEnv;

View File

@@ -1,13 +1,14 @@
//! Main node command for launching a node
use crate::args::{
utils::{chain_help, chain_value_parser, parse_socket_address, SUPPORTED_CHAINS},
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};

View File

@@ -2,8 +2,7 @@
use crate::{
args::{
get_secret_key,
utils::{chain_help, chain_value_parser, hash_or_num_value_parser, SUPPORTED_CHAINS},
utils::{chain_help, chain_value_parser, SUPPORTED_CHAINS},
DatabaseArgs, NetworkArgs,
},
utils::get_single_header,
@@ -11,6 +10,7 @@ use crate::{
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;

View File

@@ -2,7 +2,7 @@
//!
//! Stage debugging tool
use crate::{
args::{get_secret_key, NetworkArgs, StageEnum},
args::{NetworkArgs, StageEnum},
macros::block_executor,
prometheus_exporter,
};
@@ -10,6 +10,7 @@ use clap::Parser;
use reth_beacon_consensus::EthBeaconConsensus;
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
use reth_cli_runner::CliContext;
use reth_cli_util::get_secret_key;
use reth_config::config::{HashingConfig, SenderRecoveryConfig, TransactionLookupConfig};
use reth_downloaders::bodies::bodies::BodiesDownloaderBuilder;
use reth_exex::ExExManagerHandle;