getSlot RPC Method

Returns the slot that has reached the given or default commitment level

Parameters#

objectoptional

Configuration object containing the following fields:

commitmentstringoptional

The commitment describes how finalized a block is at that point in time.

minContextSlotnumberoptional

The minimum slot that the request can be evaluated at.

Result#

<u64> - Current slot

Code sample#

curl https://api.devnet.solana.com -s -X POST -H "Content-Type: application/json" -d '
  {"jsonrpc":"2.0","id":1, "method":"getSlot"}
'

Response#

{ "jsonrpc": "2.0", "result": 1234, "id": 1 }
Try It