Could we deploy a canister on a specified subnet?

Could we deploy a canister on a specified subnet?
If we can, when can we deploy a canister on a specified subnet?

1 Like

This is currently not possible but we recognise that this is a problem. We hope to be able to allow users to deploy canisters to specific subnets in the near future.

2 Likes

This would be the opposite of the serverless philosophy. Ideally, I’d want to just deploy to the IC and have it figure out the details. I imagine people want to deploy to specific subnets to subvert the issues plaguing pjljw or the like. While other seemingly empty subnets are available.

2 Likes

While not a perfect solution, you can use the dfx ledger create-canister command to create an empty canister (which will be created on a random subnet), check on ic.rocks or the ICA dashboard to see where the canister has been created, and if it was created on a desired subnet, deploy a cycles wallet to that canister using dfx identity --network ic deploy-wallet <canister id>. Once the cycles wallet is deployed, any canisters created from that cycles wallet will be on the same subnet. I’ve done this and it works! More info on the create-canister command here: dfx ledger :: Internet Computer

5 Likes

I consider this a bug (or missing feature): If I create a new canister through a wallet, and the subnet with that wallet is already full, or generally more busy than some other subnet, then I would expect the new canister to be transparently be installed on that subnet (echoing @saikatdas0790’s sentiments). At least “create that canister wherever possible” should be the default, and “create that canister on the same subnet as canister X” or “create this canister on a subnet other than canister X, Y, Z (for load balancing)” or “create this canister on a subnet with at least n nodes” or other subnet indications an optional setting. And I hope we aim for such declarative settings, and not just a blunt and inflexible “create on subnet X”.

1 Like

:wave: hey all! Just wanted to check the status of this.

Good question. Let me ping internally as well.

1 Like

We have a proposed feature to allow the caller to specify a subnetwork on which to install a newly created canister. The feature would also require to expose via the dashboard a variety of attributes of subnetworks (like replication factor, availability of threshold ECDSA on that subnetwork, subnetwork load etc), which should allow for a somewhat informed decision.

3 Likes

Wonderful, would I be able to use this feature on chain? For me this is critical.

Also, is there a timeline associated with this or is it just proposed?

3 Likes

Yes, canisters should be able to make such canister creation requests – however in the first iteration it is likely that a canister would not be able read up-to-date subnetwork info so that may need to be fed “manually”. In the long term, we should expose subnetwork info on chain (there’s more than one usecase for this).
There is no timeline unfortunately at the moment.

2 Likes

I want some extra information for this, im unable to check wallet_create_canister method in motoko , do you have some example for that, already tried to use it according to docs, getting some error…
if you could help with that :
Blog for error