> ## Documentation Index
> Fetch the complete documentation index at: https://chainstack-docs-polygon-erigon-trace-deprecation.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# getMasterchainInfo | TON v2

> The getMasterchainInfo method retrieves information about the current state of the TON masterchain. Use it on TON v2 via Chainstack.

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.

<Note>
  **TON billing: full (1 RU)**

  This method is always billed as full. See [Request units — TON method scope](/docs/request-units#ton-method-scope).
</Note>

## Parameters

This method doesn't require any parameters.

## JSON-RPC example

```shell Shell theme={null}
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.


## OpenAPI

````yaml openapi/ton_node_api/v2/getMasterchainInfo.json GET /getMasterchainInfo
openapi: 3.0.0
info:
  title: getMasterchainInfo example
  version: 1.0.0
  description: >-
    This is an API example for getMasterchainInfo, a method to retrieve
    information about the current state of the TON masterchain.
servers:
  - url: >-
      https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v2
security: []
paths:
  /getMasterchainInfo:
    get:
      tags:
        - TON Operations
      summary: getMasterchainInfo
      operationId: getMasterchainInfo
      responses:
        '200':
          description: Information about the current state of the TON masterchain
          content:
            application/json:
              schema:
                type: object
                properties:
                  last:
                    type: object
                    properties:
                      seqno:
                        type: integer
                        description: The sequence number of the last masterchain block
                      shard:
                        type: string
                        description: The shard identifier of the last masterchain block
                      workchain:
                        type: integer
                        description: The workchain identifier of the last masterchain block
                      fileHash:
                        type: string
                        description: The file hash of the last masterchain block
                      rootHash:
                        type: string
                        description: The root hash of the last masterchain block
                  init:
                    type: object
                    properties:
                      fileHash:
                        type: string
                        description: The file hash of the initial masterchain block
                      rootHash:
                        type: string
                        description: The root hash of the initial masterchain block
                  stateRootHash:
                    type: string
                    description: The state root hash of the masterchain
                  version:
                    type: integer
                    description: The version of the masterchain

````