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

Method launch_add_ons

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

evm_configMethod · 0.80
newFunction · 0.50
cloneMethod · 0.45
providerMethod · 0.45
poolMethod · 0.45

Tested by

no test coverage detected