MCPcopy Create free account
hub / github.com/ChainSafe/Delorean-Protocol / create_node

Method create_node

fendermint/testing/materializer/src/docker/mod.rs:729–757  ·  view source on GitHub ↗

Get or create all docker containers that constitute to a Node.

(
        &'s mut self,
        node_name: &NodeName,
        node_config: &NodeConfig<'a, DockerMaterials>,
    )

Source from the content-addressed store, hash-verified

727
728 /// Get or create all docker containers that constitute to a Node.
729 async fn create_node<'s, 'a>(
730 &'s mut self,
731 node_name: &NodeName,
732 node_config: &NodeConfig<'a, DockerMaterials>,
733 ) -> anyhow::Result<DockerNode>
734 where
735 's: 'a,
736 {
737 // Pick a port range on the host.
738 let port_range = self
739 .port_range(node_name)
740 .context("failed to pick port range")?;
741
742 // We could write a (shared) docker-compose.yaml file and .env file per node,
743 // however the `bollard` library doesn't support docker-compose, so different
744 // techniques would need to be used. Alternatively we can just use `Docker`
745 // and run three different containers.
746 DockerNode::get_or_create(
747 &self.dir,
748 self.docker.clone(),
749 self.drop_chute.clone(),
750 &self.drop_policy,
751 node_name,
752 node_config,
753 port_range,
754 )
755 .await
756 .context("failed to create node")
757 }
758
759 async fn start_node<'s, 'a>(
760 &'s mut self,

Callers

nothing calls this directly

Calls 2

contextMethod · 0.80
port_rangeMethod · 0.80

Tested by

no test coverage detected