getLeaderSchedule – Solana

The getLeaderSchedule JSON-RPC method retrieves the leader schedule for a specific epoch in the Solana blockchain.

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

Parameters

Optional Parameters

  • epoch (u64, optional) – The epoch to retrieve the leader schedule for. If omitted, the current epoch is used.

  • object (optional):

    • commitment (string, optional) – Commitment level of the request.

    • identity (string, optional) – Validator identity (Base-58 encoded) to filter the response.

Result

  • null : the requested epoch is not found.

  • object: A dictionary (key-value pairs) where each key is a validator identity (Base-58 encoded string) and each value is an array of slot indices (relative to the first slot in the requested epoch).

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

Was this helpful?