Supoose I am having 1000 canisters created using IC management canister with some actor class…
But Later on I need to redeploy those 1000 canisters code with some extra update function, In that case Im supposed to use IC.install_code method for all 1000 canister Ids …
Lets just say I looped over them and will be using install_code method for each canister Id…
Trouble Im having here is from where to get arg and wasm_module for new Code which i need to deploy… Suppose in some way I can create a .wasm file for new code , then how Im going to change it to
[Blob] or [Nat8] , to get it supported with install_code method…
I found a forum over this, but i didnt get the approach.
Please help with the above method, or you can let me know some more good method if there is one!!!
At the moment there is no good way to achieve this from Motoko, I’m afraid.
We have the forthcoming to_candid/from_candid primitives coming soon that will make argument construction easier, but the only install method we have at the moment is a fresh install via the class constructor.
There is a GH PR and issue below that discusses some ways forward but none are that satisfactory.
The solution I currently have in mind is an additional constructor with more install options, coupled with an opt-out dynamic check for interface compatibility during upgrade. Opt-out to allow for deliberate breaking change, when desired.
One more doubt, while using didc encode ‘(“text”)’
Instead of text , I wanted to pass variable which contains that text, can i do that ? If Yes, Can you please tell me syntax for that , I tried every way, but i am not able to figure out a way !!
didc encode {some variable which contains text value}
Also, can you please provide me some link, how to deal with WASM, Array.data(wasm) is not working I guess. So please if you can elaborate how to deal with wasm. I tried to convert it to text , but not working.