I want to install a frontend canister to a specified subnet from another frontend canister.
In other words, I want to create a frontend canister B (and possibly its backend) that on clicking a button will install asset canister A + all its assets to a specified subnet.
How? Is this even possible?
I also want to install an asset canister A + all necessary assets from a shared method of canister B.
Possible?
How to store assets for installation on-chain?
First you probably want to use the CMC’s notify_create_canister
to create the canister on a different subnet. Then you will want to install_code
on the new canister with the WASM that I showed you in the other post.
To upload the assets you probably can use @dfinity/assets
. I don’t know how up-to-date it is, but the interface has not changed in ages.
To get the assets that you want to install you can either upload them on the site itself or have an asset canister host them for you so you can fetch them before using the files