Reputation: 4582
Is it possible to list all the parachains in a given network? The documentation for test-network for parachains states that we can select the desired parachain from the dropdown. I want to do the same thing from the backend using Rust but I am not sure what the cli command is (if I am running the Polkadot node) or a rust function that exists in the source code of Polkadot that lists all the parachains.
Upvotes: 0
Views: 386
Reputation: 461
You can explore here how polkadot js app lists the registered parathreads https://github.com/polkadot-js/apps/tree/master/packages/page-parachains/src/Parathreads
The side menu and some other elements are built by teams adding PR with their info here https://github.com/polkadot-js/apps/tree/master/packages/apps-config
And here in the paras module living in Polkadot is where all onboarded parachains are kept track https://github.com/paritytech/polkadot/blob/264b81abe854646b4f98f34b711deb0cf96f1ea3/runtime/parachains/src/paras/mod.rs#L563.
Upvotes: 1