validators - TAC
Example code for the validators JSON-RPC method. Complete guide on how to use validators JSON-RPC in GetBlock Web3 documentation.
Returns the validator set at a given height, paginated. Omitting height returns the latest set.
Method
validatorsParameters
height
string
Block height (omit for latest)
page
string
Page number
per_page
string
Results per page (max 100)
Example
export TAC_TM=https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/
# JSON-RPC over HTTP (POST)
curl -X POST "${TAC_TM}" -H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": "getblock.io", "method": "validators", "params": {"height": "5123456", "page": "1", "per_page": "100"}}'
# URI over HTTP (GET)
curl "${TAC_TM}validators?height=5123456&page=1&per_page=100"Response
Response Fields
block_height
string
Height of the returned validator set
validators
array
Validators with address, voting power, and proposer priority
total
string
Total validator count
Use Cases
Validator set: Read the active set at a height
Voting power: Compute stake distribution for a block
Error Handling
-32600 / Invalid request
Invalid request
The JSON-RPC envelope was malformed
-32602 / Invalid params
Invalid params
A parameter was missing or of the wrong type
403 / RBAC: access denied
Access denied
The GetBlock access token is missing or incorrect
Was this helpful?