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

Method build

etc/systems/src/smoke.rs:223–343  ·  view source on GitHub ↗

Builds and starts the system test stack.

(self)

Source from the content-addressed store, hash-verified

221
222 /// Builds and starts the system test stack.
223 pub async fn build(self) -> Result<SystemTestStack> {
224 let l1_chain_id = self.l1_chain_id.unwrap_or(DEFAULT_L1_CHAIN_ID);
225 let l2_chain_id = self.l2_chain_id.unwrap_or(DEFAULT_L2_CHAIN_ID);
226 let slot_duration = self.slot_duration.unwrap_or(DEFAULT_SLOT_DURATION);
227
228 let temp_dir = TempDir::new().wrap_err("Failed to create temp directory")?;
229 let output_dir = self.output_dir.unwrap_or_else(|| temp_dir.path().to_path_buf());
230
231 let mut setup = SetupContainer::new(&output_dir)
232 .with_chain_id(l1_chain_id)
233 .with_l2_chain_id(l2_chain_id)
234 .with_slot_duration(slot_duration);
235
236 if let Some(block) = self.isthmus_activation_block {
237 setup = setup.with_isthmus_activation_block(block);
238 }
239
240 if let Some(block) = self.base_azul_activation_block {
241 setup = setup.with_base_azul_activation_block(block);
242 }
243
244 if let Some(block) = self.base_beryl_activation_block {
245 setup = setup.with_base_beryl_activation_block(block);
246 }
247
248 if let Some(block) = self.base_cobalt_activation_block {
249 setup = setup.with_base_cobalt_activation_block(block);
250 }
251
252 if let Some(ref config) = self.stable_config {
253 setup = setup.with_network_name(&config.network_name);
254 }
255
256 let l1_genesis = tokio::task::spawn_blocking({
257 let setup = setup.clone();
258 move || setup.generate_l1_genesis()
259 })
260 .await
261 .wrap_err("L1 genesis task panicked")?
262 .wrap_err("Failed to generate L1 genesis")?;
263
264 let el_genesis_json = l1_genesis.read_el_genesis()?;
265 let jwt_secret_hex = l1_genesis.read_jwt_secret()?;
266
267 let (l1_container_config, l2_container_config) =
268 self.stable_config.as_ref().map_or((None, None), |config| {
269 let l1_config = L1ContainerConfig {
270 use_stable_names: true,
271 network_name: Some(config.network_name.clone()),
272 http_port: Some(config.ports.l1_http),
273 engine_port: Some(config.ports.l1_auth),
274 beacon_http_port: Some(config.ports.l1_cl_http),
275 beacon_p2p_port: Some(config.ports.l1_cl_p2p),
276 };
277 let l2_config = L2ContainerConfig {
278 use_stable_names: true,
279 network_name: Some(config.network_name.clone()),
280 builder_http_port: Some(config.ports.l2_builder_http),

Callers 15

create_http_clientMethod · 0.45
startMethod · 0.45
startMethod · 0.45
startMethod · 0.45
connect_peerMethod · 0.45
start_sequencerMethod · 0.45
derive_accountFunction · 0.45
newMethod · 0.45

Calls 15

with_network_nameMethod · 0.80
generate_l1_genesisMethod · 0.80
read_el_genesisMethod · 0.80
read_jwt_secretMethod · 0.80
testnet_dirMethod · 0.80
internal_rpc_urlMethod · 0.80
deploy_l2_contractsMethod · 0.80
genesis_pathMethod · 0.80
rollup_config_pathMethod · 0.80
el_genesis_pathMethod · 0.80
beaconMethod · 0.80
pathMethod · 0.45