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

Method launch_node

crates/execution/runner/src/runner.rs:140–172  ·  view source on GitHub ↗
(
        rollup_args: RollupArgs,
        extensions: Vec<Box<dyn BaseNodeExtension>>,
        service_builder: SB,
        da_config: Option<BaseDAConfig>,
        gas_limit_config: Option<GasLimitC

Source from the content-addressed store, hash-verified

138 }
139
140 async fn launch_node(
141 rollup_args: RollupArgs,
142 extensions: Vec<Box<dyn BaseNodeExtension>>,
143 service_builder: SB,
144 da_config: Option<BaseDAConfig>,
145 gas_limit_config: Option<GasLimitConfig>,
146 started_callbacks: Vec<StartedCallback>,
147 builder: BaseNodeBuilder,
148 ) -> Result<NodeHandleFor<BaseNode>> {
149 info!(target: "base-runner", "starting custom Base node");
150
151 let mut base_node = BaseNode::new(rollup_args);
152 if let Some(da_config) = da_config {
153 base_node = base_node.with_da_config(da_config);
154 }
155 if let Some(gas_limit_config) = gas_limit_config {
156 base_node = base_node.with_gas_limit_config(gas_limit_config);
157 }
158 let components = service_builder.build_components(&base_node);
159
160 let builder = builder
161 .with_types_and_provider::<BaseNode, BlockchainProvider<_>>()
162 .with_components(components)
163 .with_add_ons(base_node.add_ons())
164 .on_component_initialized(move |_ctx| Ok(()));
165
166 let hooks = extensions.into_iter().fold(NodeHooks::new(), |hooks, ext| ext.apply(hooks));
167 let hooks = started_callbacks
168 .into_iter()
169 .fold(hooks, |hooks, callback| hooks.add_node_started_hook(move |_| callback()));
170
171 hooks.apply_to(builder).launch().await
172 }
173}
174
175#[cfg(test)]

Callers

nothing calls this directly

Calls 9

into_iterMethod · 0.80
add_node_started_hookMethod · 0.80
apply_toMethod · 0.80
with_da_configMethod · 0.45
with_gas_limit_configMethod · 0.45
build_componentsMethod · 0.45
add_onsMethod · 0.45
applyMethod · 0.45
launchMethod · 0.45

Tested by

no test coverage detected