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
- Block height increases monotonically with each new block
- Block height may be different from slot number due to skipped slots
- Different nodes may return slightly different heights based on their view of the network
- The response is immediate as it reads from the current state
Best Practices
- Use appropriate commitment level based on your needs:
processedfor latest possible heightconfirmedfor high probability finalityfinalizedfor guaranteed finality
- Consider using
getSlotif you need slot numbers instead of block height - For historical queries, use
getBlockwith specific slots