genesis - Cosmos

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

Returns the genesis document for the chain.

Cosmos Hub's genesis file is too large for this method — it returns an error. Use genesis_chunked instead for any large chain.

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": "genesis",
    "params": [],
    "id": "getblock.io"
}'

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

Response Example

Response Parameters

Field
Type
Description

result.genesis.genesis_time

string

ISO 8601 timestamp at genesis

result.genesis.chain_id

string

Chain ID at genesis

result.genesis.initial_height

string

Initial block height (used after a chain upgrade like cosmoshub-1 → cosmoshub-4)

result.genesis.app_state

object

Initial application state — typically very large on production chains

Use Cases

  • Genesis inspection on small / test chains

  • Initial state verification for new chain launches

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

-32603

Genesis file too large

Cosmos Hub's genesis is >100MB — use genesis_chunked instead

SDK Integration

Last updated

Was this helpful?