consensus_params - Cosmos

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

Returns the consensus parameters at a specific height — block size limits, evidence rules, and allowed validator public key types.

Parameters

Parameter
Type
Required
Description

height

integer

No

Block height (defaults to latest)

Request Example

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

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

Response Example

Response Parameters

Field
Type
Description

result.block_height

string

Block height at which params were sampled

result.consensus_params.block.max_bytes

string

Maximum block size in bytes

result.consensus_params.block.max_gas

string

Maximum gas per block (-1 means unlimited)

result.consensus_params.evidence.max_age_num_blocks

string

Maximum block age for accepting evidence

result.consensus_params.validator.pub_key_types

array of string

Allowed validator key types

Use Cases

  • Detecting consensus parameter upgrades

  • Sizing transaction batches to fit within block limits

  • Compliance tooling that audits chain parameters over time

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?