genesis_chunked - Cosmos

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

Returns a chunk of the genesis document. Chunks are 0-indexed; call repeatedly with increasing chunk values until you've fetched all chunks (the response includes a total chunk count).

Parameters

Parameter
Type
Required
Description

chunk

integer

Yes

Chunk index (0-based)

Request Example

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

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

Response Example

Response Parameters

Field
Type
Description

result.chunk

integer

Index of this chunk (echoed)

result.total

integer

Total number of chunks composing the full genesis file

result.data

string

Base64-encoded chunk of the genesis JSON

Use Cases

  • Downloading the Cosmos Hub genesis file in pieces

  • Reconstructing initial state for archival nodes

  • Light client initialization from a trusted genesis

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?