Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'keys' of undefined when calling api.query.authorityDiscovery.keys() #424

Open
ltfschoen opened this issue Mar 27, 2023 · 1 comment
Labels

Comments

@ltfschoen
Copy link

If you follow the API docs here https://polkadot.js.org/docs/substrate/storage#authoritydiscovery and call api.query.authorityDiscovery.keys() after connecting to WS provider wss://rpc.polkadot.io, it returns TypeError: Cannot read property 'keys' of undefined. This was reported here https://substrate.stackexchange.com/questions/7761/how-to-query-api-query-authoritydiscovery-keys/7789#7789

Is it the case that it has been replaced with https://polkadot.js.org/docs/substrate/runtime#authoritydiscoveryapi ?

@jacogr
Copy link
Member

jacogr commented Mar 27, 2023

The docs are generated from the substrate runtime, it will be different between versions and actual runtimes you connect to. (All docs, including the newly-added Kusama/Polkadot sections) are based on the master branches and updated weekly. What is actually on-chain could be lagging.

In all cases however - the docs are not done manually, they are extracted from the chain metadata and would reflect what is in that (master branch version) runtime.

If you compare Polkadot & Substrate - the kitchensink substrate runtime contains authorityDiscovery, Polkadot does not. Substrate basically exposes all available pallets (mostly), Polkadot/Kusama/others would have a selection based on the chain requirements.

TL;DR Entirely expected that runtimes would differ - the Substrate section lists all Substrate pallets, it is not chain-specific.

@jacogr jacogr added the support label Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants