Which method should I use to create a canister in a specified subnet: CMC.create_canister
vs CMC.notify_create_canister
vs CyclesLedger.create_canister
?
Why there are methods of two different canisters? What are their relative (dis)advantages?
Which method should I use to create a canister in a specified subnet: CMC.create_canister
vs CMC.notify_create_canister
vs CyclesLedger.create_canister
?
Why there are methods of two different canisters? What are their relative (dis)advantages?
To be specific, I am creating a package manager that installs packages (for a user) consisting of several canisters.
Read this thread, this should be helpful. In brief, notify method is used to notify CMC canister about ICP transfer index and do the op of creating canister.
Understood. but there is not only CMC.notify_create_canister
but also simply CMC.create_canister
(Creates a canister using the cycles attached to the function call).
This last option seems easier to use and faster (one method call instead of several).
Is my opinion, that CMC.create_canister
may be the best option, valid?
And then the next question: What is better: CMC.create_canister
or CyclesLedger.create_canister
?
There are different use cases for all these methods.
Like notify create canister get used when someone want to facilitate Create Canister feature from frontend/client side and I am not sure whats the difference between CMC and CycleLedger in your reference above, but when you use cmc to create canister, cycles get deducted from your account and in other case, cycles get deducted from the source canister (where you add cycles to parent method).
Overall you cant claim which method is best, since there are different use cases.
Exactly as @h1teshtr1path1 said.
CMC.notify_create_canister
CMC.create_canister
, send cycles with your requset