getEpochInfo – Solana
The getEpochInfo JSON-RPC method retrieves information about the current epoch in the Solana blockchain.
The getEpochInfo RPC Solana method returns details about the current epoch, including slot index, total slots in the epoch, block height, and transaction count.
The getEpochInfo method retrieves information about the current epoch in the Solana network. It provides details such as the epoch number, slot progress, remaining slots until the next epoch, and the estimated time for epoch completion. This method is essential for tracking network progression, staking schedules, and protocol timing.
Supported Networks
This method is accessible through Solana API endpoints:
Mainnet
Devnet
Parameters
Optional Parameters
commitment (string): Defines the finality level of the response.
minContextSlot (number): The minimum slot at which the request should be evaluated.
Request Example
API Endpoints
cURL Example
Response
A successful getEpochInfo example response returns details about the current epoch, including the slot index and transaction count.
Example Response
Error Handling
Common getEpochInfo error scenarios:
Network issues: The request fails due to Solana API unavailability.
Invalid parameters: Incorrect or missing configuration values.
Outdated slot reference: The specified minContextSlot is too low.
Example Error Response
Use Cases
The Solana getEpochInfo method is essential for:
Blockchain explorers: Displaying real-time epoch status.
Web3 applications: Tracking epoch changes for staking and governance.
Validator nodes: Monitoring slot progression and transaction activity.
Analytics platforms: Analyzing blockchain performance and transaction trends.
Code Example – Web3 getEpochInfo Integration
Integration with Web3
Integrate the getEpochInfo API with Solana’s Core API to retrieve up-to-date epoch details dynamically. By leveraging JSON-RPC parameters and endpoints, developers can ensure accurate tracking of block progression, transaction volume, and epoch-based calculations for staking and governance applications.
Last updated