Learn getBlockProduction use cases, code examples, request parameters, response structure, and tips.
getBlockProduction
RPC method provides information about block production in the current epoch or a specified slot range. It can be used to retrieve data for all validators or for a specific validator identity. This is valuable for monitoring validator performance and understanding block production patterns on the network.
getBlockProduction
method accepts an optional configuration object with the following parameters:
commitment
(string, optional): Specifies the commitment level to use for the query. If omitted, the default commitment of the node is used.range
(object, optional): Defines a slot range to query.
firstSlot
(u64): The first slot to fetch block production information for (inclusive).lastSlot
(u64, optional): The last slot to fetch block production information for (inclusive). If omitted, the current epoch’s block production up to the current slot will be returned.identity
(string, optional): A base58-encoded public key of a validator identity. If provided, the response will only include block production information for this specific validator. If omitted, information for all validators in the specified range (or current epoch) is returned.identity
or range.firstSlot
must be provided. If identity
is not provided, the range
parameter is required.
result
field of the JSON-RPC response will be an object containing:
context
(object):
slot
(u64): The slot at which the information was retrieved.value
(object):
byIdentity
(object): An object where keys are validator identity strings (base58-encoded public keys), and values are objects containing:
leaderSlots
(u64): The number of leader slots assigned to this validator in the queried range/epoch.blocksProduced
(u64): The number of blocks produced by this validator in the queried range/epoch.range
(object):
firstSlot
(u64): The first slot of the queried range.lastSlot
(u64): The last slot of the queried range.identity
without a range
, the data returned is for the current epoch up to the latest processed slot by the node. If you need data for a full past epoch for a specific validator, you’ll need to determine the firstSlot
and lastSlot
for that epoch.getBlockProduction
is key for building dashboards or alerts related to validator uptime and block production success rates.getLeaderSchedule
: For deeper analysis, you can correlate getBlockProduction
data with the output of getLeaderSchedule
to see which specific leader slots were made or missed.identity
can return a large amount of data, especially if no range
or a wide range
is specified. Be mindful of response sizes and processing requirements.getBlockProduction
RPC method to analyze block production on Solana.