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

[Feature] list of nominators per validator address #1289

Open
Imod7 opened this issue May 31, 2023 · 0 comments
Open

[Feature] list of nominators per validator address #1289

Imod7 opened this issue May 31, 2023 · 0 comments
Labels
I8 - Enhancement Additional feature request

Comments

@Imod7
Copy link
Contributor

Imod7 commented May 31, 2023

Proposed Change or Idea
The idea is to have a separate endpoint that returns the list of nominators based on the given/requested validator address.

What is the motivation for this feature
This feature was "requested" (they asked if it existed in Sidecar) by an external team and also mentioned in different SE questions (as noted in this comment).

Current Alternative
Right now this information is available (it is possible to be retrieved) in the following way as described by @TarikGul :

So for this in sidecar you can use /pallets/Staking/storage/nominators?keys[]=nominator_address to receive all the validators that the account is backing. After that you can retrieve all the active validators via /pallets/staking/validators.
Now if you would like to see which nominator accounts are backing which validators in the current active set, you can query this storage call which will return all the nominators for a validator address:
/pallets/Staking/storage/ErasStakers?keys[]=current_active_era&keys[]=validator_address

Additional Resources/Examples
There is also this script by W3F that is returning all of the nominations per validator in the active set. Bill mentioned this script but said that it is out-of-date. Just adding it here in case it is helpful and so that we have all the related information/resources.

Possible Implementation Ideas

  1. Have an endpoint that would extend the /pallets/staking/validators endpoint so it would be of this form /pallets/staking/validators/<validator_address>
  2. Have a query param in /pallets/staking/validators endpoint that would take the validators' address and return its nominators.
@TarikGul TarikGul added the I8 - Enhancement Additional feature request label May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I8 - Enhancement Additional feature request
Projects
None yet
Development

No branches or pull requests

2 participants