Learn getEpochInfo use cases, code examples, request parameters, response structure, and tips.
getEpochInfo
RPC method returns information about the current epoch. This can be useful for understanding the current state of the network, how far into the current epoch the network has progressed, and when the next epoch might begin. To better understand how epochs, slots, and blocks work together on Solana, refer to our detailed article.
getEpochInfo
method can optionally take a configuration object with the following parameters:
commitment
(string, optional): Specifies the commitment level to use when querying the ledger.
finalized
: The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout.confirmed
: The node will query the most recent block that has been voted on by a supermajority of the cluster.processed
: The node will query its most recent block. Note that the block may not be complete.finalized
.minContextSlot
(number, optional): The minimum slot at which the request can be evaluated. This can be used to ensure the response is from a recent enough state.result
field of the JSON-RPC response will be an object containing the following fields:
absoluteSlot
(u64): The current absolute slot number.blockHeight
(u64): The current block height.epoch
(u64): The current epoch number.slotIndex
(u64): The current slot relative to the start of the current epoch.slotsInEpoch
(u64): The total number of slots in the current epoch.transactionCount
(u64 | null): The total number of transactions processed in the current epoch. Can be null
if the data is not available.confirmed
commitment.
commitment
can affect the timeliness and finality of the data. processed
is the fastest but least safe, while finalized
is the safest but may lag slightly. Learn more about commitment levels for detailed information.transactionCount
Availability: The transactionCount
field might be null
if the node doesn’t have this information readily available or if it’s not tracked for the specific commitment level.slotsInEpoch
can vary. You can use getEpochSchedule
to get more details about the epoch schedule.getEpochInfo
RPC method for retrieving details about the current epoch on the Solana network.