TriportRPC

getBlock

TON / https://triport.io/rpc/ton

Minimum tier: Pro

TON method guide

Last updated:

getBlock fetches a serialized block body from a liteserver. The required workchain, shard, and seqno identify the block position; optional root and file hashes can supply the cryptographic identity already obtained from a lookup or masterchain response.

The result contains the resolved block ID and base64-encoded serialized block data. Use getBlockHeader when metadata and proof material are sufficient and the block body is unnecessary. Use lookupBlock first when the full block ID must be resolved from a sequence number, logical time, or Unix time.

Historical availability is a per-liteserver property. Archive routing is best-effort and does not turn the pool into a continuous full-history service.

Parameters

getBlock parameters
NameTypeRequiredDescription
workchainintegerYes
shardShardYes
seqnoSeqnoYes
root_hashHashNo
file_hashHashNo

Returns

getBlock return value
FieldType
resultBlockData

Examples

curl https://triport.io/rpc/ton \
  -X POST -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <api-key>' \
  -d '{"jsonrpc":"2.0","id":1,"method":"getBlock","params":["<workchain>","<shard>","<seqno>","<root_hash>","<file_hash>"]}'
const res = await fetch("https://triport.io/rpc/ton", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
  body: JSON.stringify({
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getBlock",
  "params": [
    "<workchain>",
    "<shard>",
    "<seqno>",
    "<root_hash>",
    "<file_hash>"
  ]
}),
});
const data = await res.json();
import requests
resp = requests.post(
    "https://triport.io/rpc/ton",
    headers={"Authorization": "Bearer <api-key>"},
    json={"jsonrpc":"2.0","id":1,"method":"getBlock","params":["<workchain>","<shard>","<seqno>","<root_hash>","<file_hash>"]},
)
print(resp.json())

Usage

  1. Transport: HTTP (JSON-RPC).
  2. Chain: TON.
  3. Clusters: mainnet.
  4. Credit cost: 5 per call.

FAQ

What does getBlock do?
Returns the serialized body of a TON block identified by its full block ID.
How many credits does getBlock cost?
getBlock costs 5 credit(s) per call on Triport by default.
Is getBlock available over WebSocket?
getBlock is an HTTP JSON-RPC method.