nimbus-eth2
nimbus-eth2 copied to clipboard
List validator indices
Is your feature request related to a problem? Please describe.
We don't seem to have a simple way for users to list all their validators / validator indices. This is useful for things like ncli_db validatorPerf
. Specifically, it makes it easier for users to compare their validators to the global average.
Describe the solution you'd like A command that outputs a list of one's validator indices
@tersec has suggested to me that the simplest solution may be to just feed ncli_db
the relevant public keys. Since the database has a list of validator public keys, more or less ordered by index.
https://ethereum.github.io/eth2.0-APIs/#/Beacon/getStateValidators
@arnetheduck i'm probably missing something obvious, but when i run the command as is from the nimbus guide
curl -d '{"jsonrpc":"2.0","method":"get_v1_beacon_states_stateId_validators","params":["finalized"],"id":1}' -H 'Content-Type: application/json' localhost:9190 -s | jq
I get a long list of validators, even though i only have one validator attached.
I don't see how would do anything but list all validators matching a certain set of status flags (whether active or inactive, etc; not whether attached to any particular node): https://github.com/status-im/nimbus-eth2/blob/8ebd496fbeef03b4fd6837b7211fd1bd8d2cf2b3/beacon_chain/rpc/beacon_api.nim#L208-L279
there's certainly validatorids in there which is the pubkeys, if you know those you can get specific validators, and the response includes the index
The Keymanager API can be used to list the locally imported validator keystores.
Several approaches have been provided.