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

Method create_node

fendermint/testing/materializer/src/docker/mod.rs:737–765  ·  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

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

Callers

nothing calls this directly

Calls 2

contextMethod · 0.80
port_rangeMethod · 0.80

Tested by

no test coverage detected