chore: extract cli runner from node-core (#7719)

This commit is contained in:
Matthias Seitz
2024-04-18 21:50:41 +02:00
committed by GitHub
parent 1a61d29afd
commit a1059bed99
17 changed files with 63 additions and 11 deletions

View File

@ -24,6 +24,7 @@ reth-interfaces = { workspace = true, features = ["clap"] }
reth-transaction-pool.workspace = true
reth-beacon-consensus.workspace = true
reth-auto-seal-consensus.workspace = true
reth-cli-runner.workspace = true
reth-consensus-common.workspace = true
reth-blockchain-tree.workspace = true
reth-rpc-engine-api.workspace = true

View File

@ -9,10 +9,10 @@ use crate::{
config_cmd, db, debug_cmd, dump_genesis, import, init_cmd, node, node::NoArgs, p2p,
recover, stage, test_vectors,
},
core::cli::runner::CliRunner,
version::{LONG_VERSION, SHORT_VERSION},
};
use clap::{value_parser, Parser, Subcommand};
use reth_cli_runner::CliRunner;
use reth_db::DatabaseEnv;
use reth_node_builder::{InitState, WithLaunchContext};
use reth_primitives::ChainSpec;

View File

@ -5,7 +5,6 @@ use crate::{
utils::{chain_help, genesis_value_parser, SUPPORTED_CHAINS},
DatabaseArgs,
},
core::cli::runner::CliContext,
dirs::{DataDirPath, MaybePlatformPath},
};
use alloy_rlp::Decodable;
@ -18,6 +17,7 @@ use reth_beacon_consensus::BeaconConsensus;
use reth_blockchain_tree::{
BlockchainTree, BlockchainTreeConfig, ShareableBlockchainTree, TreeExternals,
};
use reth_cli_runner::CliContext;
use reth_db::{init_db, DatabaseEnv};
use reth_interfaces::{consensus::Consensus, RethResult};
use reth_node_api::PayloadBuilderAttributes;

View File

@ -6,13 +6,13 @@ use crate::{
utils::{chain_help, genesis_value_parser, SUPPORTED_CHAINS},
DatabaseArgs, NetworkArgs,
},
core::cli::runner::CliContext,
dirs::{DataDirPath, MaybePlatformPath},
utils::get_single_header,
};
use clap::Parser;
use futures::{stream::select as stream_select, StreamExt};
use reth_beacon_consensus::BeaconConsensus;
use reth_cli_runner::CliContext;
use reth_config::{config::EtlConfig, Config};
use reth_db::{database::Database, init_db, DatabaseEnv};
use reth_downloaders::{

View File

@ -6,12 +6,12 @@ use crate::{
utils::{chain_help, genesis_value_parser, SUPPORTED_CHAINS},
DatabaseArgs, NetworkArgs,
},
core::cli::runner::CliContext,
dirs::{DataDirPath, MaybePlatformPath},
utils::{get_single_body, get_single_header},
};
use backon::{ConstantBuilder, Retryable};
use clap::Parser;
use reth_cli_runner::CliContext;
use reth_config::Config;
use reth_db::{init_db, DatabaseEnv};
use reth_interfaces::executor::BlockValidationError;

View File

@ -6,13 +6,13 @@ use crate::{
utils::{chain_help, genesis_value_parser, SUPPORTED_CHAINS},
DatabaseArgs, NetworkArgs,
},
core::cli::runner::CliContext,
dirs::{DataDirPath, MaybePlatformPath},
utils::get_single_header,
};
use backon::{ConstantBuilder, Retryable};
use clap::Parser;
use reth_beacon_consensus::BeaconConsensus;
use reth_cli_runner::CliContext;
use reth_config::Config;
use reth_db::{cursor::DbCursorRO, init_db, tables, transaction::DbTx, DatabaseEnv};
use reth_interfaces::{consensus::Consensus, p2p::full_block::FullBlockClient};

View File

@ -1,7 +1,8 @@
//! `reth debug` command. Collection of various debugging routines.
use crate::core::cli::runner::CliContext;
use clap::{Parser, Subcommand};
use reth_cli_runner::CliContext;
mod build_block;
mod execution;
mod in_memory_merkle;

View File

@ -4,7 +4,6 @@ use crate::{
utils::{chain_help, genesis_value_parser, SUPPORTED_CHAINS},
DatabaseArgs, NetworkArgs,
},
core::cli::runner::CliContext,
dirs::{DataDirPath, MaybePlatformPath},
};
use clap::Parser;
@ -14,6 +13,7 @@ use reth_beacon_consensus::{hooks::EngineHooks, BeaconConsensus, BeaconConsensus
use reth_blockchain_tree::{
BlockchainTree, BlockchainTreeConfig, ShareableBlockchainTree, TreeExternals,
};
use reth_cli_runner::CliContext;
use reth_config::Config;
use reth_db::{init_db, DatabaseEnv};
use reth_interfaces::consensus::Consensus;

View File

@ -6,10 +6,10 @@ use crate::{
DatabaseArgs, DebugArgs, DevArgs, NetworkArgs, PayloadBuilderArgs, PruningArgs,
RpcServerArgs, TxPoolArgs,
},
core::cli::runner::CliContext,
dirs::{DataDirPath, MaybePlatformPath},
};
use clap::{value_parser, Args, Parser};
use reth_cli_runner::CliContext;
use reth_db::{init_db, DatabaseEnv};
use reth_node_builder::{InitState, NodeBuilder, WithLaunchContext};
use reth_node_core::{node_config::NodeConfig, version};

View File

@ -1,7 +1,7 @@
//! `reth recover` command.
use crate::core::cli::runner::CliContext;
use clap::{Parser, Subcommand};
use reth_cli_runner::CliContext;
mod storage_tries;

View File

@ -1,9 +1,9 @@
use crate::{
args::utils::{chain_help, genesis_value_parser, SUPPORTED_CHAINS},
core::cli::runner::CliContext,
dirs::{DataDirPath, MaybePlatformPath},
};
use clap::Parser;
use reth_cli_runner::CliContext;
use reth_db::{
cursor::{DbCursorRO, DbDupCursorRW},
init_db, tables,

View File

@ -158,6 +158,10 @@ pub mod rpc {
}
}
// re-export for convenience
#[doc(inline)]
pub use reth_cli_runner::{tokio_runtime, CliContext, CliRunner};
#[cfg(all(unix, any(target_env = "gnu", target_os = "macos")))]
pub mod sigsegv_handler;