getMasterchainInfo | TON v2

The getMasterchainInfo method retrieves information about the current state of the TON masterchain. This method provides crucial details about the latest masterchain block and the initial state of the masterchain.

πŸ‘

Get you own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.

You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

This method doesn't require any parameters.

JSON-RPC example

curl -X POST \
  'https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v2/jsonRPC' \
  -H 'Content-Type: application/json' \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getMasterchainInfo",
    "params": {}
  }'

Response

  • last (object) β€” Information about the last masterchain block:
    • seqno (integer) β€” The sequence number of the last masterchain block.
    • shard (string) β€” The shard identifier of the last masterchain block.
    • workchain (integer) β€” The workchain identifier of the last masterchain block.
    • fileHash (string) β€” The file hash of the last masterchain block.
    • rootHash (string) β€” The root hash of the last masterchain block.
  • init (object) β€” Information about the initial masterchain block:
    • fileHash (string) β€” The file hash of the initial masterchain block.
    • rootHash (string) β€” The root hash of the initial masterchain block.
  • stateRootHash (string) β€” The state root hash of the masterchain.
  • version (integer) β€” The version of the masterchain.

Use case

A possible use case for the getMasterchainInfo method in TON is for applications that need to monitor or sync with the current state of the TON blockchain. This method can be used to:

  1. Track the latest block in the masterchain for synchronization purposes.
  2. Verify the current state of the blockchain against a known state.
  3. Monitor the progress of the masterchain in terms of block sequence numbers.
  4. Obtain necessary information for validating and processing transactions.

Try the getMasterchainInfo RPC method yourself

Language
Click Try It! to start a request and see the response here!