Create an instance of an `ipc-cli` command runner.
(
&self,
testnet_name: &TestnetName,
network_name: Option<&NetworkName>,
)
| 436 | |
| 437 | /// Create an instance of an `ipc-cli` command runner. |
| 438 | fn ipc_cli_runner( |
| 439 | &self, |
| 440 | testnet_name: &TestnetName, |
| 441 | network_name: Option<&NetworkName>, |
| 442 | ) -> anyhow::Result<DockerRunner<CliName>> { |
| 443 | // Create a directory to hold the wallet. |
| 444 | let ipc_dir = self.ipc_dir(testnet_name); |
| 445 | let accounts_dir = self.accounts_dir(testnet_name); |
| 446 | // Create a `~/.ipc` directory, as expected by default by the `ipc-cli`. |
| 447 | fs::create_dir_all(&ipc_dir).context("failed to create .ipc dir")?; |
| 448 | // Use the owner of the directory for the container, so we don't get permission issues. |
| 449 | let user = user_id(&ipc_dir)?; |
| 450 | // Mount the `~/.ipc` directory and all the keys to be imported. |
| 451 | let volumes = vec![ |
| 452 | (ipc_dir, "/fendermint/.ipc"), |
| 453 | (accounts_dir, "/fendermint/accounts"), |
| 454 | ]; |
| 455 | |
| 456 | let cli_name = testnet_name.root().cli("ipc"); |
| 457 | |
| 458 | let runner = DockerRunner::new( |
| 459 | self.docker.clone(), |
| 460 | self.drop_chute.clone(), |
| 461 | self.drop_policy.clone(), |
| 462 | cli_name, |
| 463 | user, |
| 464 | FENDERMINT_IMAGE, |
| 465 | volumes, |
| 466 | network_name.cloned(), |
| 467 | ); |
| 468 | |
| 469 | Ok(runner) |
| 470 | } |
| 471 | |
| 472 | /// Import the private key of an account into the `ipc-cli` wallet. |
| 473 | async fn ipc_cli_wallet_import( |
no test coverage detected