(&self, seed_nodes: &[&Self])
| 465 | } |
| 466 | |
| 467 | pub async fn start(&self, seed_nodes: &[&Self]) -> anyhow::Result<()> { |
| 468 | let cometbft_seeds = collect_seeds(seed_nodes, |n| { |
| 469 | let host = &n.cometbft.hostname(); |
| 470 | let id = n.cometbft_node_id()?; |
| 471 | Ok(format!("{id}@{host}:{COMETBFT_P2P_PORT}")) |
| 472 | })?; |
| 473 | |
| 474 | let resolver_seeds = collect_seeds(seed_nodes, |n| { |
| 475 | let host = &n.fendermint.hostname(); |
| 476 | let id = n.fendermint_peer_id()?; |
| 477 | Ok(format!("/dns/{host}/tcp/{RESOLVER_P2P_PORT}/p2p/{id}")) |
| 478 | })?; |
| 479 | |
| 480 | let env = env_vars! [ |
| 481 | "CMT_P2P_SEEDS" => cometbft_seeds, |
| 482 | "FM_RESOLVER__DISCOVERY__STATIC_ADDRESSES" => resolver_seeds, |
| 483 | ]; |
| 484 | |
| 485 | export_env(self.path.join(DYNAMIC_ENV), &env)?; |
| 486 | |
| 487 | // Start all three containers. |
| 488 | self.fendermint.start().await?; |
| 489 | self.cometbft.start().await?; |
| 490 | if let Some(ref ethapi) = self.ethapi { |
| 491 | ethapi.start().await?; |
| 492 | } |
| 493 | |
| 494 | Ok(()) |
| 495 | } |
| 496 | |
| 497 | /// Allow time for things to consolidate and APIs to start. |
| 498 | pub async fn wait_for_started(&self, timeout: Duration) -> anyhow::Result<bool> { |
no test coverage detected