• Fetch the current block height of the node.

    Parameters

    • t: HttpTransport

      HTTP transport instance

    • commitment: Commitment = 'confirmed'

      Desired commitment level (default: "confirmed")

    • opts: CallOptions & {
          minContextSlot?: number;
      } = {}

      Additional call options

    Returns Promise<number>

    The current block height

    const height = await getBlockHeight(transport);
    console.log(`Current block height: ${height}`);

    1.0.0