I am studying management_canister.
let foobar = install_code(install_code_arg).await.unwrap();
I get an error with install_code. I am running locally, not on mainnet. I would like to get rid of the error.
Reject text: Canister rno2w-sqaaa-aaaaa-aaacq-cai trapped explicitly: Panicked at ‘called
Result::unwrap()
on anErr
value: (CanisterError, “Canister installation failed withCanister q3fc5-haaaa-aaaaa-aaahq-cai is out of cycles: requested 80000590000 cycles but the available balance is 0 cycles and the freezing threshold 11827 cycles
”)’, src/management_canister_study_backend/src/lib.rs:24:55
use ic_cdk::*;
use ic_cdk::api::management_canister::main::*;
#[ic_cdk_macros::update]
async fn create_canister_example() {
let create_canister_arg = CreateCanisterArgument {
settings: Some(CanisterSettings {
controllers: Some(vec![ic_cdk::id()]),
compute_allocation: Some(0.into()),
memory_allocation: Some(10000.into()),
freezing_threshold: Some(10000.into()),
}),
};
let canister_id_records = create_canister(create_canister_arg).await.unwrap();
let canister_id_record = canister_id_records.0;
let canister_id = canister_id_record.canister_id;
let install_code_arg = InstallCodeArgument {
mode: CanisterInstallMode::Install,
canister_id,
wasm_module: b"\x00asm\x01\x00\x00\x00".to_vec(),
arg: vec![],
};
let foobar = install_code(install_code_arg).await.unwrap();
}