consensus_state - Cosmos

Example code for the consensus_state JSON-RPC method. Complete guide on how to use consensus_state JSON-RPC in GetBlock Web3 documentation.

Returns the current consensus state — the round, step, and votes the node has observed. Useful for diagnosing consensus stalls or observing the consensus process in real time.

Parameters

  • None

Request Example

# JSON-RPC over HTTP POST (canonical)
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "consensus_state",
    "params": [],
    "id": "getblock.io"
}'

# URI over HTTP GET (alternate, for simple methods)
curl --location --request GET 'https://go.getblock.io/<ACCESS-TOKEN>/consensus_state'

Response Example

Response Parameters

Field
Type
Description

result.round_state['height/round/step']

string

Current height, round, and step in the consensus state machine

result.round_state.start_time

string

ISO 8601 timestamp when the current round began

result.round_state.proposal_block_hash

string

Hash of the currently proposed block (may be empty if no proposal yet)

result.round_state.height_vote_set

array

Per-round vote sets

Use Cases

  • Diagnosing consensus halts

  • Validator operations monitoring

  • Research into consensus liveness

Error Handling

Status Code
Error Message
Cause

404

Not Found

Missing or invalid <ACCESS-TOKEN>

-32602

Invalid params

Request parameters are missing or malformed

-32603

Internal error

Server-side error while processing the request

429

Too Many Requests

Rate limit exceeded for your plan

SDK Integration

Last updated

Was this helpful?