getEpochInfo — Solana RPC Method
getEpochInfo returns information about the current epoch, including the epoch number, how far into the epoch the cluster is, and the total number of transaction count. This is the go-to method for understanding where the network is in its epoch cycle.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
commitment | string | No | processed, confirmed, or finalized. Default: finalized. |
minContextSlot | number | No | Minimum slot at which the request can be evaluated. |
Request
curl -X POST https://api.mainnet-beta.solana.com \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getEpochInfo",
"params": []
}'
TypeScript (@solana/kit)
import { createSolanaRpc } from "@solana/kit";
const rpc = createSolanaRpc("https://api.mainnet-beta.solana.com");
const epochInfo = await rpc.getEpochInfo().send();
const progress = (Number(epochInfo.slotIndex) / Number(epochInfo.slotsInEpoch)) * 100;
console.log(`Epoch ${epochInfo.epoch}: ${progress.toFixed(1)}% complete`);
Response
{
"jsonrpc": "2.0",
"result": {
"absoluteSlot": 341200000,
"blockHeight": 289443000,
"epoch": 790,
"slotIndex": 160000,
"slotsInEpoch": 432000,
"transactionCount": 412800000000
},
"id": 1
}
| Field | Type | Description |
|---|---|---|
absoluteSlot | u64 | The current slot. |
blockHeight | u64 | The current block height (blocks produced since genesis). |
epoch | u64 | The current epoch number. |
slotIndex | u64 | The current slot relative to the start of the current epoch (0-based). |
slotsInEpoch | u64 | The number of slots in this epoch (typically 432,000). |
transactionCount | u64 or null | Total number of transactions processed since genesis. May be null on some nodes. |
Common errors
- Node behind — if
minContextSlotis higher than the node’s current slot, the request fails. Remove the parameter or wait.
Performance
getEpochInfo is a lightweight call that reads in-memory state. Safe to poll frequently for dashboards or monitoring. The response is always a fixed-size small JSON object.
FAQ
How long is a Solana epoch? An epoch is 432,000 slots on mainnet. At approximately 400ms per slot, that is roughly 2 days. The exact duration varies based on the actual slot time, which fluctuates slightly.
How do I calculate epoch progress?
Divide slotIndex by slotsInEpoch: (slotIndex / slotsInEpoch) * 100 gives the percentage.
How do I estimate when the current epoch ends?
Calculate the remaining slots: slotsInEpoch - slotIndex. Multiply by the average slot time (approximately 0.4 seconds) to get the estimated seconds remaining.
What happens at the epoch boundary? At the start of a new epoch, staking rewards are distributed, the leader schedule is computed for the next epoch, and the validator set may change based on delegated stake.
Why might transactionCount be null?
Some RPC node configurations do not track the total transaction count. This is an optional feature that requires additional storage. If the value is null, the node does not have this data.
Parameters
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
commitment | string | No | Commitment level: processed, confirmed, or finalized. | finalized |
minContextSlot | number | No | Minimum slot at which the request can be evaluated. | — |
Updated: