Parameters

commitment
string

The commitment describes how finalized a block is at that point in time.

minContextSlot
number

The minimum slot that the request can be evaluated at.

Response

result
object

Code Examples

Basic Request

curl http://rpc.orbitflare.com -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getEpochInfo"
}'

Using web3.js

import { Connection } from '@solana/web3.js';

const connection = new Connection('http://rpc.orbitflare.com');
const epochInfo = await connection.getEpochInfo();
console.log(epochInfo);

Using Python

from solana.rpc.api import Client

client = Client("http://rpc.orbitflare.com")
response = client.get_epoch_info()
print(response)

Notes

  1. Returns detailed information about the current epoch
  2. Includes absolute slot, block height, epoch number, and slots in epoch
  3. Transaction count may be null if not available
  4. Different commitment levels can be specified
  5. The response is immediate as it reads from the current state

Best Practices

  1. Use this method to track epoch transitions
  2. Monitor transaction count for network activity
  3. Check slot index to determine progress within the current epoch
  4. Handle network errors and retry when appropriate
  5. Use appropriate commitment level based on your needs