githubEdit

validators - NEAR Protocol

Example code for the validators json-rpc method. Сomplete guide on how to use validators json-rpc in GetBlock.io Web3 documentation.

This method provides detailed information about current, upcoming, and previous validators on the NEAR blockchain.

Supported Networks

  • Mainnet

Parameters

  • None

Request Example

Base URL

https://go.getblock.io/<ACCESS_TOKEN>

Example(cURL)

curl -X POST https://go.getblock.io/<ACCESS_TOKEN> \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0",
"method": "validators",
"params": [null],
"id": "getblock.io"}'

Response Example

Response Parameters Definition

Field

Type

Description

current_proposals

array

Information about validator proposals for the next epoch.

current_proposals.account_id

string

Identifier of the validator account proposing to join.

current_proposals.public_key

string

Public key of the validator.

current_proposals.stake

string

Amount of tokens staked (in yoctoNEAR).

current_proposals.validator_stake_struct_version

string

Version of the validator stake struct.

current_validators

array

Information about validators currently participating in the epoch.

current_validators.account_id

string

Identifier of the current validator.

current_validators.public_key

string

Public key of the validator.

current_validators.is_slashed

boolean

Indicates if the validator has been slashed.

current_validators.num_expected_chunks_per_shard

array

Number of expected chunks per shard.

current_validators.num_produced_chunks_per_shard

array

Number of chunks produced per shard.

current_validators.num_produced_endorsements

integer

Total endorsements the validator produced.

current_validators.num_produced_endorsements_per_shard

array

Endorsements produced per shard.

current_validators.shards_endorsed

array

List of shards endorsed by this validator.

current_validators.num_expected_endorsements

integer

Number of endorsements expected.

current_validators.stake

string

Total tokens staked by the validator.

current_validators.shards

array

Shard IDs the validator operates on.

current_validators.num_expected_blocks

integer

Expected blocks the validator should produce.

current_validators.num_expected_chunks

integer

Expected chunks the validator should produce.

current_validators.num_produced_blocks

integer

Blocks actually produced by the validator.

current_validators.num_produced_chunks

integer

Chunks actually produced by the validator.

next_validators

array

List of validators scheduled for the next epoch.

next_validators.account_id

string

Identifier for the upcoming validator.

next_validators.public_key

string

Public key of the validator.

next_validators.stake

string

Stake amount for the next validator.

next_validators.shards

array

Shard assignments for the next validator.

current_fishermen

array

Information about active fishermen (participants monitoring network behavior).

current_fishermen.account_id

string

Account ID of the current fisherman.

current_fishermen.public_key

string

Public key of the fisherman.

current_fishermen.stake

string

Amount of tokens staked by the fisherman.

next_fishermen

array

Information about fishermen in the next epoch.

next_fishermen.account_id

string

Account ID of the next fisherman.

next_fishermen.public_key

string

Public key of the fisherman.

next_fishermen.stake

string

Amount staked by the fisherman.

prev_epoch_kickout

array

List of validators removed in the previous epoch and their reasons.

prev_epoch_kickout.account_id

string

Identifier of the validator kicked out.

prev_epoch_kickout.reason

object

Reason for removal.

prev_epoch_kickout.reason.NotEnoughChunks.expected

integer

Expected number of chunks.

prev_epoch_kickout.reason.NotEnoughChunks.produced

integer

Produced number of chunks.

epoch_start_height

integer

The block height at which the epoch started.

epoch_height

integer

The height (number) of the current epoch.

Use Cases

  • Monitor current validator activity and block production performance.

  • Track upcoming validators joining the next epoch.

  • Support staking dashboards and validator ranking systems.

Code Example

Node(Axios)

Python(Requests)

Error Handling

HTTP Code

Error Message

Description

500 Internal Server Error

Failed to fetch validator data

Internal node error while retrieving validator information.

403 Forbidden

RBAC: access denied

The Getblock access token is missing or incorrect

Integration with Web3

By integrating /validators with dApp, developers can:

  • Create staking analytics dashboards.

  • Display real-time validator metrics to delegators.

  • Maintain transparent governance by tracking validator proposals.

Last updated

Was this helpful?