MCPcopy Create free account
hub / github.com/base/base / launch_add_ons

Method launch_add_ons

crates/execution/node/src/node.rs:585–637  ·  view source on GitHub ↗
(
        self,
        ctx: reth_node_api::AddOnsContext<'_, N>,
    )

Source from the content-addressed store, hash-verified

583 type Handle = RpcHandle<N, EthB::EthApi>;
584
585 async fn launch_add_ons(
586 self,
587 ctx: reth_node_api::AddOnsContext<'_, N>,
588 ) -> eyre::Result<Self::Handle> {
589 let Self { rpc_add_ons, da_config, gas_limit_config, .. } = self;
590 let eth_config =
591 BaseEthConfigHandler::new(ctx.node.provider().clone(), ctx.node.evm_config().clone());
592
593 let builder = base_execution_payload_builder::BasePayloadBuilder::new(
594 ctx.node.pool().clone(),
595 ctx.node.provider().clone(),
596 ctx.node.evm_config().clone(),
597 );
598 // Install additional rollup-specific RPC methods.
599 let debug_ext = BaseDebugWitnessApi::<_, _, _, Attrs>::new(
600 ctx.node.provider().clone(),
601 ctx.node.task_executor().clone(),
602 builder,
603 );
604 let miner_ext = BaseMinerExtApi::new(da_config, gas_limit_config);
605
606 rpc_add_ons
607 .launch_add_ons_with(ctx, move |container| {
608 let reth_node_builder::rpc::RpcModuleContainer { modules, auth_module, registry } =
609 container;
610
611 modules.merge_if_module_configured(RethRpcModule::Eth, eth_config.into_rpc())?;
612
613 debug!(target: "reth::cli", "Installing debug payload witness rpc endpoint");
614 modules.merge_if_module_configured(RethRpcModule::Debug, debug_ext.into_rpc())?;
615
616 // extend the miner namespace if configured in the regular http server
617 modules.add_or_replace_if_module_configured(
618 RethRpcModule::Miner,
619 miner_ext.clone().into_rpc(),
620 )?;
621
622 // install the miner extension in the authenticated if configured
623 if modules.module_config().contains_any(&RethRpcModule::Miner) {
624 debug!(target: "reth::cli", "Installing miner DA rpc endpoint");
625 auth_module.merge_auth_methods(miner_ext.into_rpc())?;
626 }
627
628 // install the debug namespace in the authenticated if configured
629 if modules.module_config().contains_any(&RethRpcModule::Debug) {
630 debug!(target: "reth::cli", "Installing debug rpc endpoint");
631 auth_module.merge_auth_methods(registry.debug_api().into_rpc())?;
632 }
633
634 Ok(())
635 })
636 .await
637 }
638}
639
640impl<N, EthB, PVB, EB, EVB, Attrs, RpcMiddleware> RethRpcAddOns<N>

Callers

nothing calls this directly

Calls 4

evm_configMethod · 0.80
cloneMethod · 0.45
providerMethod · 0.45
poolMethod · 0.45

Tested by

no test coverage detected