getEpochInfo
Last updated:
`getEpochInfo` returns a snapshot of the cluster's current epoch: which epoch is active, how far through it the cluster is, and the related slot and block heights. Use it to display network progress, estimate time until the next epoch boundary, or as a lightweight liveness probe that also reports the node's current `absoluteSlot` and `blockHeight`.
`slotIndex` is the cluster's position **within** the current epoch, while `slotsInEpoch` is that epoch's total length — so `slotsInEpoch - slotIndex` slots remain before the epoch rolls over. `absoluteSlot` is the slot count since genesis (it keeps climbing across epochs), and `blockHeight` is the number of confirmed blocks beneath the current one.
The reading is taken relative to a slot governed by the optional `commitment` config. Pass `minContextSlot` to require that the serving node has already reached at least a given slot before it answers.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| config | CommitmentConfig | No |
Returns
| Field | Type |
|---|---|
| result | object |
Examples
curl https://<your-endpoint>/ \
-X POST -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"getEpochInfo","params":[]}'const res = await fetch("https://<your-endpoint>/", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"id": 1,
"method": "getEpochInfo",
"params": [],
"jsonrpc": "2.0"
}),
});
const data = await res.json();import requests
resp = requests.post("https://<your-endpoint>/", json={"id":1,"method":"getEpochInfo","params":[],"jsonrpc":"2.0"})
print(resp.json()){
"id": 1,
"result": {
"epoch": 990,
"slotIndex": 19314,
"blockHeight": 405776345,
"absoluteSlot": 427699314,
"slotsInEpoch": 432000,
"transactionCount": 522254340964
},
"jsonrpc": "2.0"
}Usage
- Transport: HTTP (JSON-RPC).
- Networks: mainnet, devnet, testnet.
- Credit cost: 1 per call.
FAQ
- What does getEpochInfo do?
- Returns information about the current epoch on the Solana cluster.
- How many credits does getEpochInfo cost?
- getEpochInfo costs 1 credit(s) per call on Triport by default.
- Is getEpochInfo available over WebSocket?
- getEpochInfo is an HTTP JSON-RPC method.