> ## Documentation Index
> Fetch the complete documentation index at: https://goldrush.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# getLeaderSchedule on Solana

> Call getLeaderSchedule on Solana via GoldRush JSON-RPC. Returns the leader schedule for an epoch. Endpoint, parameters, return values, and code examples.

<Card title="0.05 credits per call" icon="coins" />

`getLeaderSchedule` on **Solana**: Returns the leader schedule for an epoch.

## Endpoint

```
https://rpc.goldrushdata.com/v1/solana-mainnet
```

Authenticate with `Authorization: Bearer <GOLDRUSH_API_KEY>`. See [authentication](/goldrush-json-rpc/authentication).

## Parameters

| Name     | Type     | Required | Description                                                           | Example                                                       |
| -------- | -------- | -------- | --------------------------------------------------------------------- | ------------------------------------------------------------- |
| `slot`   | `u64`    | no       | Slot whose epoch's schedule to fetch; defaults to the current epoch.  | `372877175`                                                   |
| `config` | `object` | no       | `{commitment?, identity?}`. `identity` filters to a single validator. | `{"identity":"ENvAW7JScgYq6o4zKZwewtkzzJgDzuJAFxYasvmEQdpS"}` |

## Returns

`object | null`: Map of leader pubkey → array of slot indices, or `null` if the epoch has no schedule.

```json theme={null}
{"ENvAW7JScgYq6o4zKZwewtkzzJgDzuJAFxYasvmEQdpS":[0,1,2,3,4,5,6,7]}
```

## Examples

<CodeGroup>
  ```bash curl theme={null}
  curl https://rpc.goldrushdata.com/v1/solana-mainnet \
    -H "Authorization: Bearer $GOLDRUSH_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "getLeaderSchedule",
      "params": [372877175, {"identity":"ENvAW7JScgYq6o4zKZwewtkzzJgDzuJAFxYasvmEQdpS"}]
    }'
  ```

  ```typescript @solana/kit theme={null}
  import {
    createDefaultRpcTransport,
    createSolanaRpcFromTransport,
  } from "@solana/kit";

  const transport = createDefaultRpcTransport({
    url: "https://rpc.goldrushdata.com/v1/solana-mainnet",
    headers: { Authorization: `Bearer ${process.env.GOLDRUSH_API_KEY}` },
  });
  const rpc = createSolanaRpcFromTransport(transport);

  const result = await rpc.getLeaderSchedule(372877175, {"identity":"ENvAW7JScgYq6o4zKZwewtkzzJgDzuJAFxYasvmEQdpS"}).send();
  console.log(result);
  ```

  ```python python theme={null}
  import os
  import requests

  resp = requests.post(
      "https://rpc.goldrushdata.com/v1/solana-mainnet",
      headers={
          "Authorization": f"Bearer {os.environ['GOLDRUSH_API_KEY']}",
          "Content-Type": "application/json",
      },
      json={"jsonrpc": "2.0", "id": 1, "method": "getLeaderSchedule", "params": [372877175, {"identity":"ENvAW7JScgYq6o4zKZwewtkzzJgDzuJAFxYasvmEQdpS"}]},
  )
  print(resp.json()["result"])
  ```
</CodeGroup>

## Errors

Standard JSON-RPC errors: `-32600` invalid request, `-32601` method not found, `-32602` invalid params.

## Related Slot info methods on Solana

* [`getSlot` on Solana](/api-reference/json-rpc/solana/getslot)
* [`getSlotLeader` on Solana](/api-reference/json-rpc/solana/getslotleader)
* [`getSlotLeaders` on Solana](/api-reference/json-rpc/solana/getslotleaders)
* [`getMaxRetransmitSlot` on Solana](/api-reference/json-rpc/solana/getmaxretransmitslot)
* [`getMaxShredInsertSlot` on Solana](/api-reference/json-rpc/solana/getmaxshredinsertslot)
