How to pass arguments when creating canister programmatically like below?
May I wrongly formatting arguments
Or is there any other way to pass arguments when initialization canister programmatically?
let install_config = CanisterInstall {
mode:InstallMode::Install,
canister_id: canister_id.clone(),
wasm_module: wasm_module.clone(),
args: b"(arg1, arg2)".to_vec() // What is the argument's format?
}
api::call::call(Principal::management_canister(), "install_code", (install_config,)).await...
use ic_cdk::export::candid::{encode_args};
let canister_args_result = encode_args(("MyName", "MN", 18 as u64, 0 as u64));
let canister args = match canister_args_result {
Ok(res) => res,
_ => Vec::new()
};