getBlockHeight
Returns the current block height of the node

Parameters

  • <object> - (optional) Config object:
    • commitment: (optional) Configures the commitment level of the blocks queried Accepts one of the following strings: ["finalized", "confirmed", "processed"] For more info, refer to this doc.

Returns

  • <u64> - a slot integer denoting the target block number

Example

Request

cURL
1
curl --location --request POST 'https://solana-mainnet.g.alchemy.com/v2/demo' \
2
--header 'Content-Type: application/json' \
3
--data-raw '{"jsonrpc":"2.0","id":1, "method":"getBlockHeight"}'
Copied!

Response

1
{
2
"jsonrpc": "2.0",
3
"result": 121845738,
4
"id": 1
5
}
Copied!