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

Method ipc_cli_runner

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

Create an instance of an `ipc-cli` command runner.

(
        &self,
        testnet_name: &TestnetName,
        network_name: Option<&NetworkName>,
    )

Source from the content-addressed store, hash-verified

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(

Callers 2

ipc_cli_run_cmdMethod · 0.80
create_relayerMethod · 0.80

Calls 7

create_dir_allFunction · 0.85
user_idFunction · 0.85
ipc_dirMethod · 0.80
accounts_dirMethod · 0.80
contextMethod · 0.80
cliMethod · 0.80
rootMethod · 0.45

Tested by

no test coverage detected