Source
get_epoch_scheduleParameters
NoneResult
result
The result field will be an object with the following fields:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
RPC methods
CLI reference
Network constants
curl https://api.devnet.solana.com -s -X POST \
-H "Content-Type: application/json" \
-d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getEpochSchedule"
}
'
import { createSolanaRpc } from "@solana/kit";
const rpc_url = "https://api.devnet.solana.com";
const rpc = createSolanaRpc(rpc_url);
let epochSchedule = await rpc.getEpochSchedule().send();
console.log(epochSchedule);
import { Connection, clusterApiUrl } from "@solana/web3.js";
const connection = new Connection(clusterApiUrl("devnet"), "confirmed");
let epochSchedule = await connection.getEpochSchedule();
console.log(epochSchedule);
use anyhow::Result;
use solana_client::nonblocking::rpc_client::RpcClient;
use solana_commitment_config::CommitmentConfig;
#[tokio::main]
async fn main() -> Result<()> {
let client = RpcClient::new_with_commitment(
String::from("https://api.devnet.solana.com"),
CommitmentConfig::confirmed(),
);
let epoch_schedule = client.get_epoch_schedule().await?;
println!("{:#?}", epoch_schedule);
Ok(())
}
{
"jsonrpc": "2.0",
"result": {
"firstNormalEpoch": 8,
"firstNormalSlot": 8160,
"leaderScheduleSlotOffset": 8192,
"slotsPerEpoch": 8192,
"warmup": true
},
"id": 1
}
Returns the cluster’s epoch schedule parameters.
curl https://api.devnet.solana.com -s -X POST \
-H "Content-Type: application/json" \
-d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getEpochSchedule"
}
'
import { createSolanaRpc } from "@solana/kit";
const rpc_url = "https://api.devnet.solana.com";
const rpc = createSolanaRpc(rpc_url);
let epochSchedule = await rpc.getEpochSchedule().send();
console.log(epochSchedule);
import { Connection, clusterApiUrl } from "@solana/web3.js";
const connection = new Connection(clusterApiUrl("devnet"), "confirmed");
let epochSchedule = await connection.getEpochSchedule();
console.log(epochSchedule);
use anyhow::Result;
use solana_client::nonblocking::rpc_client::RpcClient;
use solana_commitment_config::CommitmentConfig;
#[tokio::main]
async fn main() -> Result<()> {
let client = RpcClient::new_with_commitment(
String::from("https://api.devnet.solana.com"),
CommitmentConfig::confirmed(),
);
let epoch_schedule = client.get_epoch_schedule().await?;
println!("{:#?}", epoch_schedule);
Ok(())
}
{
"jsonrpc": "2.0",
"result": {
"firstNormalEpoch": 8,
"firstNormalSlot": 8160,
"leaderScheduleSlotOffset": 8192,
"slotsPerEpoch": 8192,
"warmup": true
},
"id": 1
}
get_epoch_scheduleShow propertiesHide properties
EpochSchedule
definition in solana-sdk for the exact derivation.EpochSchedule
definition in solana-sdk for the exact derivation.