Skip to main content

Parameters

object
Configuration object containing the following optional fields:

Response

number
Current block height

Code Examples

Basic Request

Request with Commitment

Using web3.js

Notes

  1. Block height increases monotonically with each new block
  2. Block height may be different from slot number due to skipped slots
  3. Different nodes may return slightly different heights based on their view of the network
  4. The response is immediate as it reads from the current state

Best Practices

  1. Use appropriate commitment level based on your needs:
    • processed for latest possible height
    • confirmed for high probability finality
    • finalized for guaranteed finality
  2. Consider using getSlot if you need slot numbers instead of block height
  3. For historical queries, use getBlock with specific slots

Common Errors