commit - Cosmos

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

Returns the commit (validator signatures) for a block at a given height. The commit proves the validator set agreed on the block; light clients use this to verify chain progression.

Parameters

Parameter
Type
Required
Description

height

integer

No

Block height (decimal). Defaults to the latest committed block

Request Example

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

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

Response Example

Response Parameters

Field
Type
Description

result.signed_header.header

object

Block header

result.signed_header.commit

object

Commit data with validator signatures

result.signed_header.commit.signatures

array

Per-validator signatures on this block

result.canonical

boolean

Whether this commit is canonical (final)

Use Cases

  • Light client verification

  • Cross-chain proofs (IBC relayers verify peer chain commits)

  • Auditing validator participation in consensus

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?