refactor: move ValidationApi setup to EthereumAddOns (#14342)

This commit is contained in:
Arsenii Kulikov
2025-02-09 18:14:53 +04:00
committed by GitHub
parent b48426efdd
commit 104bd6e039
12 changed files with 139 additions and 143 deletions

View File

@ -34,9 +34,7 @@ use reth::rpc::builder::{
// Configuring the network parts, ideally also wouldn't need to think about this.
use myrpc_ext::{MyRpcExt, MyRpcExtApiServer};
use reth::tasks::TokioTaskExecutor;
use reth_node_ethereum::{
node::EthereumEngineValidator, EthEvmConfig, EthExecutorProvider, EthereumNode,
};
use reth_node_ethereum::{EthEvmConfig, EthExecutorProvider, EthereumNode};
use reth_provider::ChainSpecProvider;
// Custom rpc extension
@ -75,11 +73,7 @@ async fn main() -> eyre::Result<()> {
// Pick which namespaces to expose.
let config = TransportRpcModuleConfig::default().with_http([RethRpcModule::Eth]);
let mut server = rpc_builder.build(
config,
Box::new(EthApi::with_spawner),
Arc::new(EthereumEngineValidator::new(spec)),
);
let mut server = rpc_builder.build(config, Box::new(EthApi::with_spawner));
// Add a custom rpc namespace
let custom_rpc = MyRpcExt { provider };