How do I programmatically find the list of subnets?
here is how ic-admin gets it from the registry canister:
Thanks @yvonneanne. Those donāt seem to be functions exposed in public crates, so Iām not sure if everything would need to be copied. ![]()
PS: Not an urgent question, it can definitely wait until working hours.
what do you need the list for?
the CMC has a public query method to get default subnets (Iām not sure what default subnets are⦠maybe the ones new canisters would be on at random if no additional conditions apply?)
https://dashboard.internetcomputer.org/canister/rkp4c-7iaaa-aaaaa-aaaca-cai
Ah, thatās nice! I also noticed it, but like you, I was confused about what ādefaultā means. If thatās the public list, that should work. Thanks!
Yes, thatās exactly what it is. You can see that the output matches what has been defined in the latest proposal.
Iām still a bit unsure about what ādefaultā means. I wanted to add it to DFINITYās ic-js, but Iām not sure how I should document it. The Rust code is also undocumented. What could be an accurate description for it?
Maybe this explanation by Severin helps: NNS Updates Dec 1, 2023 - #8 by Severin
Thanks, now I understand how ādefaultā is used. But is it safe to say that ādefaultā equals the āpublicā subnets (as in the proposal shared above)?
Or are the ādefaultā subnets a subset of the āpublicā subnets?
In code and proposal public == default is valid. IMO it would be more correct to also include the ones publicly accessible by specifying a subnet type, but oh wellā¦
Iām not entirely I get everything but, it answered my questions. Gonna work with the default. Thanks for the explanation!