cmc_create_canister_install_code

Function cmc_create_canister_install_code 

Source
pub async fn cmc_create_canister_install_code(
    create_settings_arg: &CreateCanisterInitSettingsArg,
    wasm_arg: &WasmArg,
    cycles: u128,
    subnet_id: &SubnetId,
) -> Result<Principal, String>
Expand description

Asynchronously creates a new canister and installs the provided Wasm code with additional cycles.

§Arguments

  • create_settings_arg: The custom settings to apply to spinup the canister.
  • wasm_arg: Wasm binary and arguments to install in the new canister (WasmArg struct).
  • cycles: Additional cycles to deposit during canister creation on top of CREATE_CANISTER_CYCLES.
  • subnet_id: The SubnetId where the canister should be created.

§Returns

  • Ok(Principal): On success, returns the Principal ID of the newly created canister.
  • Err(String): On failure, returns an error message.