chore(sdk): add helper trait to node API to simplify type definition (#10616)

This commit is contained in:
Emilia Hane
2024-10-26 18:55:26 +08:00
committed by GitHub
parent ac329bfce1
commit 44e4c47803
18 changed files with 105 additions and 61 deletions

View File

@ -21,7 +21,6 @@ reth-transaction-pool.workspace = true
reth-payload-builder.workspace = true
reth-payload-primitives.workspace = true
reth-tasks.workspace = true
reth-rpc-eth-api.workspace = true
reth-network-api.workspace = true
reth-node-types.workspace = true
reth-primitives.workspace = true

View File

@ -25,5 +25,3 @@ pub use node::*;
// re-export for convenience
pub use reth_node_types::*;
pub use reth_provider::FullProvider;
pub use reth_rpc_eth_api::EthApiTypes;

View File

@ -23,15 +23,14 @@ use reth_consensus_debug_client::{DebugConsensusClient, EtherscanBlockProvider,
use reth_engine_util::EngineMessageStreamExt;
use reth_exex::ExExManagerHandle;
use reth_network::{BlockDownloaderProvider, NetworkEventListenerProvider};
use reth_node_api::{
AddOnsContext, FullNodeComponents, FullNodeTypes, NodeTypesWithDB, NodeTypesWithEngine,
};
use reth_node_api::{AddOnsContext, FullNodeTypes, NodeTypesWithDB, NodeTypesWithEngine};
use reth_node_core::{
dirs::{ChainPath, DataDirPath},
exit::NodeExitFuture,
};
use reth_node_events::{cl::ConsensusLayerHealthEvents, node};
use reth_provider::providers::BlockchainProvider;
use reth_rpc::eth::RpcNodeCore;
use reth_tasks::TaskExecutor;
use reth_tracing::tracing::{debug, info};
use reth_transaction_pool::TransactionPool;
@ -47,14 +46,14 @@ use crate::{
AddOns, NodeBuilderWithComponents, NodeHandle,
};
/// Alias for [`reth_rpc_eth_types::EthApiBuilderCtx`], adapter for [`FullNodeComponents`].
/// Alias for [`reth_rpc_eth_types::EthApiBuilderCtx`], adapter for [`RpcNodeCore`].
pub type EthApiBuilderCtx<N> = reth_rpc_eth_types::EthApiBuilderCtx<
<N as FullNodeTypes>::Provider,
<N as FullNodeComponents>::Pool,
<N as FullNodeComponents>::Evm,
<N as FullNodeComponents>::Network,
<N as RpcNodeCore>::Provider,
<N as RpcNodeCore>::Pool,
<N as RpcNodeCore>::Evm,
<N as RpcNodeCore>::Network,
TaskExecutor,
<N as FullNodeTypes>::Provider,
<N as RpcNodeCore>::Provider,
>;
/// A general purpose trait that launches a new node of any kind.

View File

@ -11,10 +11,10 @@ use reth_node_api::{EngineTypes, FullNodeComponents};
use reth_node_core::{
dirs::{ChainPath, DataDirPath},
node_config::NodeConfig,
rpc::api::EngineApiClient,
};
use reth_payload_builder::PayloadBuilderHandle;
use reth_provider::ChainSpecProvider;
use reth_rpc_api::EngineApiClient;
use reth_rpc_builder::{auth::AuthServerHandle, RpcServerHandle};
use reth_tasks::TaskExecutor;

View File

@ -14,12 +14,14 @@ use reth_node_api::{
};
use reth_node_core::{
node_config::NodeConfig,
rpc::eth::{EthApiTypes, FullEthApiServer},
version::{CARGO_PKG_VERSION, CLIENT_CODE, NAME_CLIENT, VERGEN_GIT_SHA},
};
use reth_payload_builder::PayloadBuilderHandle;
use reth_provider::providers::ProviderNodeTypes;
use reth_rpc::EthApi;
use reth_rpc::{
eth::{EthApiTypes, FullEthApiServer},
EthApi,
};
use reth_rpc_api::eth::helpers::AddDevSigners;
use reth_rpc_builder::{
auth::{AuthRpcModule, AuthServerHandle},

View File

@ -23,8 +23,6 @@ reth-network-p2p.workspace = true
reth-rpc-eth-types.workspace = true
reth-rpc-server-types.workspace = true
reth-rpc-types-compat.workspace = true
reth-rpc-api = { workspace = true, features = ["client"] }
reth-rpc-eth-api = { workspace = true, features = ["client"] }
reth-transaction-pool.workspace = true
reth-tracing.workspace = true
reth-config.workspace = true
@ -38,7 +36,7 @@ reth-stages-types.workspace = true
# ethereum
alloy-primitives.workspace = true
alloy-rpc-types-engine = { workspace = true, features = ["jwt"] }
alloy-rpc-types-engine = { workspace = true, features = ["std", "jwt"] }
alloy-consensus.workspace = true
alloy-eips.workspace = true

View File

@ -22,15 +22,6 @@ pub mod primitives {
/// Re-export of `reth_rpc_*` crates.
pub mod rpc {
/// Re-exported from `reth_rpc_api`.
pub mod api {
pub use reth_rpc_api::*;
}
/// Re-exported from `reth_rpc::eth`.
pub mod eth {
pub use reth_rpc_eth_api::*;
}
/// Re-exported from `reth_rpc::rpc`.
pub mod result {
pub use reth_rpc_server_types::result::*;