getBlockProduction

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

📘

Supported on Solana (mainnet) only.

Parameters

  • (optional) <object> - Configuration object containing the following optional fields:
    • (optional) commitment: <string> - Commitment
    • (optional) range: <object> - Slot range to return block production for. If parameter not provided, defaults to current epoch.
      • firstSlot: <u64> - first slot to return block production information for (inclusive)
      • (optional) lastSlot: <u64> - last slot to return block production information for (inclusive). If parameter not provided, defaults to the highest slot
    • (optional) identity: <string> - Only return results for this validator identity (base-58 encoded)

Returns

The result will be an RpcResponse JSON object with value equal to:

  • <object>
    • byIdentity: <object> - a dictionary of validator identities, as base-58 encoded strings. Value is a two element array 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)

API Endpoint

The format of an Solana API endpoint is
https://open-platform.nodereal.io/{{apiKey}}/solana/

Here is an example:
https://open-platform.nodereal.io/4c0a1c23661a4e26bcbcwed461e34ea9/solana/

Example

Request

curl https://open-platform.nodereal.io/{{apiKey}}/solana/ \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getBlockProduction",
    "params": [
      {
        "identity": "85iYT5RuzRTDgjyRa3cP8SYhM2j21fj7NhfJ3peu1DPr",
        "range": {
          "firstSlot": 40,
          "lastSlot": 50
        }
      }
    ]
  }'

Result

{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "slot": 10102
    },
    "value": {
      "byIdentity": {
        "85iYT5RuzRTDgjyRa3cP8SYhM2j21fj7NhfJ3peu1DPr": [11, 11]
      },
      "range": {
        "firstSlot": 50,
        "lastSlot": 40
      }
    }
  },
  "id": 1
}