For the complete documentation index, see llms.txt. This page is also available as Markdown.

getshards - TON

Example code for the getshards JSON-RPC method. Сomplete guide on how to use getshards JSON-RPC in GetBlock.io Web3 documentation.

This method returns the list of shardchain blocks referenced by a given masterchain block. Use it to enumerate all shards active in a given moment in time.

Parameters

Parameter
Type
Required
Description

seqno

integer

Yes

Masterchain block seqno

Request Example

REST (GET):

curl --location --request GET 'https://go.getblock.io/<ACCESS-TOKEN>/getShards?seqno=45792554' \
--header 'Content-Type: application/json'

JSON-RPC (POST):

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "getShards",
    "params": {
        "seqno": 45792554
    },
    "id": "getblock.io"
}'

Response Example

Response Parameters

Field
Type
Description

result.shards

array

Array of shardchain block IDs referenced by the given masterchain block

result.shards[].workchain

integer

Workchain ID

result.shards[].shard

string

Shard ID

result.shards[].seqno

integer

Shard block sequence number

Use Cases

  • Enumerating active shards at a given masterchain height

  • Driving block-by-block indexing across all shards

  • Building TON explorers that walk the shard tree

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid <ACCESS-TOKEN>

422

Validation Error

Request parameters are missing or malformed

429

Too Many Requests

Rate limit exceeded for your plan

504

Lite Server Timeout

Upstream TON liteserver timed out

SDK Integration

Last updated

Was this helpful?