Solana
Solana
Solana
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
getEpochInfo is a Solana JSON-RPC method that returns details about the epoch the cluster is currently in. Solana groups its ~400ms slots into epochs, and this call hands back the epoch number, the slotIndex (offset within the epoch) and slotsInEpoch that bound it, the global absoluteSlot, the blockHeight, and the running transactionCount for the chain that settles SOL transfers. Send it as a JSON-RPC 2.0 POST to https://solana.therpc.io/YOUR_API_KEY, optionally passing a config object with commitment or minContextSlot.
slotIndex / slotsInEpoch — useful for staking UIs like Marinade where rewards land on epoch boundaries.slotsInEpoch - slotIndex) by Solana's ~400ms slot time.absoluteSlot and blockHeight in a single round trip instead of calling getSlot and getBlockHeight separately.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | config | object | 否 | Options: commitment, minContextSlot. |
| 类型 | 描述 |
|---|---|
| object | { absoluteSlot, blockHeight, epoch, slotIndex, slotsInEpoch, transactionCount }. |
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32602 | Invalid params | A param is missing, of the wrong type, or malformed (e.g. a non-base58 pubkey or a bad config field). |
-32603 | Internal error | The node hit an internal error serving the request — retry, and reduce the requested range/encoding if it persists. |
slotIndex is the offset inside the current epoch, not a global position — use absoluteSlot whenever you need the chain-wide slot number.commitment: processed advances fastest but can be rolled back, while finalized is settled. Pick the level that matches how confirmed you need the numbers to be.