We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
/pallets/staking/validators
Should return a list of all the validators. This requires retrieving all the entries and mapping out the AccountId keys from storage.
AccountId
const validators = await api.query.staking.validators.entries(); const keys = validators.forEach(([key]) => { console.log('key arguments:', key.args.map((k) => k.toHuman())); });
Example JSON response from the endpoint:
{ validators: [ `162DmeD1MHpWQhv8NPz7zbUEfCyTfG4Tuqz7P7852KiY2wXz`, `13pYWKctR5s8vQuyZt3pxQXue4SRH9coyAS9S9z5HtogAnhs `, ... ] }
The text was updated successfully, but these errors were encountered:
Another related endpoint to the one mentioned in this issue and maybe interesting to have is one that shows "The list of nominators per validator"
For example under an endpoint like : /pallets/staking/validators/validatorAddress
/pallets/staking/validators/validatorAddress
This idea comes from seeing related questions in the Substrate Stack Exchange like the ones mentioned below :
Sorry, something went wrong.
Imod7
No branches or pull requests
/pallets/staking/validators
Description
Should return a list of all the validators. This requires retrieving all the entries and mapping out the
AccountId
keys from storage.Example JSON response from the endpoint:
The text was updated successfully, but these errors were encountered: