getLeaderSchedule – Solana
The getLeaderSchedule JSON-RPC method retrieves the leader schedule for a specific epoch in the Solana blockchain.
The getLeaderSchedule RPC Solana method provides the leader schedule for an epoch, mapping validator identities to their assigned slots. If no epoch is specified, the Solana getLeaderSchedule API returns the schedule for the current epoch.
The getLeaderSchedule method retrieves the leader schedule for a given epoch, showing the order in which validators are assigned to produce blocks. It helps developers and validators analyze network consensus, optimize transaction processing strategies, and monitor validator performance in the Solana blockchain.
Supported Networks
Access this method via Solana API Endpoints:
Mainnet
Devnet
Parameters
Optional Parameters
epoch (u64, optional) – The epoch to retrieve the leader schedule for. If omitted, the current epoch is used.
commitment (string, optional) – Commitment level of the request.
identity (string, optional) – Validator identity (Base-58 encoded) to filter the response.
getLeaderSchedule Example
This example demonstrates how to retrieve the getLeaderSchedule RPC Solana for a specific validator.
Request Example
API Endpoints
cURL Example
Response
Successful Response Example
Error Handling
Common getLeaderSchedule error scenarios:
Invalid epoch number: If the epoch does not exist or is out of range.
Network connectivity issues: The request fails due to API unavailability.
Malformed request parameters: Incorrectly formatted request values.
Example Error Response
Use Cases
The Solana getLeaderSchedule method is essential for:
Validators: Predicting assigned slots for upcoming epochs.
Blockchain explorers: Displaying leader schedules in real-time.
Web3 applications: Ensuring efficient transaction scheduling.
Analytics platforms: Tracking validator slot performance.
Code getLeaderSchedule Example – Web3 Integration
Integration with Web3
Integrate the Web3 getLeaderSchedule API with Solana’s Core API to retrieve real-time leader schedules. By leveraging JSON-RPC parameters and endpoints, developers can optimize transaction execution and validator slot assignments, ensuring maximum efficiency in blockchain operations.
Last updated