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://triport.io/sol \
-X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-d '{"id":1,"method":"getEpochInfo","params":[],"jsonrpc":"2.0"}'const res = await fetch("https://triport.io/sol", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
body: JSON.stringify({
"id": 1,
"method": "getEpochInfo",
"params": [],
"jsonrpc": "2.0"
}),
});
const data = await res.json();import requests
resp = requests.post(
"https://triport.io/sol",
headers={"Authorization": "Bearer <api-key>"},
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.