mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat(rpc): relax VaidationApi and EngineApi (#13241)
This commit is contained in:
@ -34,7 +34,9 @@ use reth::rpc::builder::{
|
||||
// Configuring the network parts, ideally also wouldn't need to think about this.
|
||||
use myrpc_ext::{MyRpcExt, MyRpcExtApiServer};
|
||||
use reth::{blockchain_tree::noop::NoopBlockchainTree, tasks::TokioTaskExecutor};
|
||||
use reth_node_ethereum::{EthEvmConfig, EthExecutorProvider, EthereumNode};
|
||||
use reth_node_ethereum::{
|
||||
node::EthereumEngineValidator, EthEvmConfig, EthExecutorProvider, EthereumNode,
|
||||
};
|
||||
use reth_provider::{test_utils::TestCanonStateSubscriptions, ChainSpecProvider};
|
||||
|
||||
// Custom rpc extension
|
||||
@ -70,11 +72,15 @@ async fn main() -> eyre::Result<()> {
|
||||
.with_evm_config(EthEvmConfig::new(spec.clone()))
|
||||
.with_events(TestCanonStateSubscriptions::default())
|
||||
.with_block_executor(EthExecutorProvider::ethereum(provider.chain_spec()))
|
||||
.with_consensus(EthBeaconConsensus::new(spec));
|
||||
.with_consensus(EthBeaconConsensus::new(spec.clone()));
|
||||
|
||||
// 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));
|
||||
let mut server = rpc_builder.build(
|
||||
config,
|
||||
Box::new(EthApi::with_spawner),
|
||||
Arc::new(EthereumEngineValidator::new(spec)),
|
||||
);
|
||||
|
||||
// Add a custom rpc namespace
|
||||
let custom_rpc = MyRpcExt { provider };
|
||||
|
||||
Reference in New Issue
Block a user