MCPcopy Create free account
hub / github.com/consensus-shipyard/ipc / start_node

Method start_node

fendermint/testing/materializer/src/testnet.rs:365–388  ·  view source on GitHub ↗

Start a node. Fails if the node hasn't been created yet.

(
        &mut self,
        m: &mut R,
        subnet_name: &SubnetName,
        node_id: &NodeId,
        node: &Node,
    )

Source from the content-addressed store, hash-verified

363 ///
364 /// Fails if the node hasn't been created yet.
365 async fn start_node(
366 &mut self,
367 m: &mut R,
368 subnet_name: &SubnetName,
369 node_id: &NodeId,
370 node: &Node,
371 ) -> anyhow::Result<()> {
372 let node_name = subnet_name.node(node_id);
373
374 let seeds = node
375 .seed_nodes
376 .iter()
377 .map(|s| self.node(&subnet_name.node(s)))
378 .collect::<Result<Vec<_>, _>>()
379 .with_context(|| format!("failed to collect seeds for {node_name:?}"))?;
380
381 let node = self.node(&node_name)?;
382
383 m.start_node(node, &seeds)
384 .await
385 .with_context(|| format!("failed to start {node_name:?}"))?;
386
387 Ok(())
388 }
389
390 async fn create_and_start_rootnet(
391 &mut self,

Callers 1

Calls 3

with_contextMethod · 0.80
nodeMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected