nimbus-eth2 icon indicating copy to clipboard operation
nimbus-eth2 copied to clipboard

List validator indices

Open unixpi opened this issue 3 years ago • 5 comments

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.

unixpi avatar Jun 07 '21 14:06 unixpi

https://ethereum.github.io/eth2.0-APIs/#/Beacon/getStateValidators

arnetheduck avatar Jun 07 '21 14:06 arnetheduck

@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.

unixpi avatar Jun 07 '21 15:06 unixpi

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

tersec avatar Jun 07 '21 16:06 tersec

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

arnetheduck avatar Jun 08 '21 17:06 arnetheduck

The Keymanager API can be used to list the locally imported validator keystores.

zah avatar Jun 09 '22 10:06 zah

Several approaches have been provided.

tersec avatar Apr 23 '23 18:04 tersec