getBlockProduction
Returns recent block production information from the current or previous epoch.

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.
    • range: (optional) <object> - Slot range for block production response. Defaults to to the current epoch.
      • firstSlot: <u64> - first slot to return block production information for (inclusive)
      • lastSlot: (optional) <u64> - last slot to return block production information for (inclusive). Defaults to the highest slot
      • identity: (optional) < base-58 encoded string> - Specifies return results for a particular validator identity

Returns

  • <object>
    • byIdentity: <object> - a dictionary of validator identities Key-> base-58 encoded strings. Value -> two element arrays containing the number of leader slots and the number of blocks produced.
    • range: <object> - block production slot range
      • firstSlot: <u64> - first slot of the block production information (inclusive)
      • lastSlot: <u64> - last slot of block production information (inclusive)

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":"getBlockProduction"}'
Copied!

Response

1
{
2
"jsonrpc": "2.0",
3
"result": {
4
"context": {
5
"slot": 134454845
6
},
7
"value": {
8
"byIdentity": {
9
"12CUDzb3oe8RBQ4tYGqsuPsCbsVE4KWfktXRihXf8Ggq": [
10
32,
11
27
12
],
13
"12ashmTiFStQ8RGUpi1BTCinJakVyDKWjRL6SWhnbxbT": [
14
52,
15
42
16
],
17
"12oRmi8YDbqpkn326MdjwFeZ1bh3t7zVw8Nra2QK2SnR": [
18
16,
19
15
20
],
21
.............
22
},
23
"range": {
24
"firstSlot": 134352000,
25
"lastSlot": 134454845
26
}
27
}
28
},
29
"id": 1
30
Copied!