Parameters

This method does not require any parameters.

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": "getEpochSchedule"
}'

Using web3.js

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

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

Using Python

from solana.rpc.api import Client

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

Notes

  1. Returns epoch schedule information from the cluster’s genesis configuration
  2. The returned data is static and does not change for a given network/cluster
  3. Useful for calculating epoch boundaries and leader schedule timing
  4. The warmup parameter indicates if epochs start short and grow to their full size

Best Practices

  1. Cache this information locally as it does not change
  2. Use the returned values to calculate epoch transitions
  3. Use firstNormalEpoch and firstNormalSlot for epoch timing calculations
  4. Handle network errors and retry when appropriate