I would like to ask if there is a way to do a multiple canister upgrade using another canister assuming each of my users owns a canister? I know there is an install_code with mode = #upgrade but I’m not sure what to add with arg and wasm_module. Thank you!
The manager canister would need to be the controller of the user canisters. This would allow the manager canister to upgrade the user canisters.
You would use the install_code method, with the mode set to #upgrade.
In this scenario, the arg argument is the initialization data for the canister you are upgrading. The exact format of this argument will depend on the specific canister’s implementation, but it is generally used to set the initial state of the canister.
The wasm_module argument is the actual compiled WebAssembly binary that the canister will execute. You’d need to upload this binary to the manager canister (or retrieve it in some other way), so that the manager canister can provide it as an argument to the install_code method.
This is if you want to upload from you local machine. I think you want to update from another canister. You would need to upload the wasm to another canister and allow that canister to be a controller of the canister u are trying to upgrade.
Yeah this was code to convert it to unit8 array within javascript script. It basically get the buffer from the wasm from the path to the wasm file in your dfx/local dir: