getblockcount

How to use it

// yarn add @tatumio/tatum

import { TatumSDK, ZCash, Network } from '@tatumio/tatum'

const tatum = await TatumSDK.init<ZCash>({network: Network.ZCASH})

const result = await tatum.rpc.getBlockCount()

await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs

Overview

getblockcount is a method that returns the number of blocks in the local best blockchain. This method is useful for obtaining the current height of the blockchain, which can be used for various purposes, such as monitoring the blockchain, determining the number of confirmations for a transaction, or assessing the progress of the blockchain's growth.

Parameters

This method does not have any parameters.

Return Object

The returned object is an integer representing the number of blocks in the local best blockchain.

JSON Examples

Request example:

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "getblockcount"
}

Response example:

{
    "result": 787067,
    "error": null,
    "id": 1
}

\

Last updated

ยฉ Tatum Technology, LLC