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

# getLeaderSchedule

> Bir dönem için lider çizelgesini döndürür

## Parametreler

<ResponseField name="slot" type="number" optional>
  Bu slotu içeren dönem için lider çizelgesini getir
</ResponseField>

<ResponseField name="config" type="object" optional>
  <Expandable title="config fields">
    <ResponseField name="commitment" type="string" optional>
      Onay seviyesi (processed, confirmed, finalized)
    </ResponseField>

    <ResponseField name="identity" type="string" optional>
      Yalnızca bu doğrulayıcı kimliği için sonuçları döndür (base-58 kodlu)
    </ResponseField>
  </Expandable>
</ResponseField>

## Yanıt

<ResponseField name="result" type="object">
  <Expandable title="result fields">
    <ResponseField name="context" type="object">
      <ResponseField name="slot" type="number">
        İsteğin işlendiği slot
      </ResponseField>
    </ResponseField>

    <ResponseField name="value" type="object">
      Doğrulayıcı kimliklerini atanan lider slotlarına eşleyen sözlük
    </ResponseField>
  </Expandable>
</ResponseField>

## Kod Örnekleri

### Temel İstek

```bash theme={null}
curl https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getLeaderSchedule"
}'
```

### Belirli Doğrulayıcı İçin İstek

```bash theme={null}
curl https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getLeaderSchedule",
  "params": [{
    "identity": "VALIDATOR_IDENTITY"
  }]
}'
```

### web3.js Kullanımı

```typescript theme={null}
import { Connection } from '@solana/web3.js';

const connection = new Connection('https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY');

// Get leader schedule
const leaderSchedule = await connection.getLeaderSchedule();
console.log('Leader schedule:', leaderSchedule.value);

// Get validator's leader slots
async function getValidatorLeaderSlots(validatorIdentity: string) {
  const schedule = await connection.getLeaderSchedule({
    identity: validatorIdentity
  });
  
  if (!schedule.value) {
    return {
      hasSlots: false,
      slots: []
    };
  }
  
  const slots = schedule.value[validatorIdentity] || [];
  
  return {
    hasSlots: slots.length > 0,
    slots,
    totalSlots: slots.length,
    context: schedule.context
  };
}
```

## Notlar

1. Mevcut veya belirtilen dönem için lider çizelgesini döndürür
2. Yalnızca belirli bir doğrulayıcının slotlarını göstermek için filtrelenebilir
3. Lider slotları, stake ağırlığına göre doğrulayıcılara atanır
4. Çizelge bir dönem boyunca sabittir
5. Yanıt, isteğin işlendiği slotu içerir

## En İyi Uygulamalar

1. İhtiyacınıza göre uygun onay seviyesini kullanın
2. Yalnızca belirli doğrulayıcılarla ilgileniyorsanız doğrulayıcı kimliğine göre filtreleyin
3. RPC yükünü azaltmak için uygun durumlarda sonuçları önbelleğe alın
4. Lider çizelgesindeki değişiklikleri izleyin
5. Diğer doğrulayıcıyla ilgili metodlarla birlikte kullanın

## Yaygın Hatalar

| Kod    | Mesaj                            | Çözüm                                                |
| ------ | -------------------------------- | ---------------------------------------------------- |
| -32601 | Method not found                 | Bir Solana RPC düğümüne bağlı olduğunuzu doğrulayın  |
| -32602 | Invalid params                   | Slot ve kimlik parametrelerini kontrol edin          |
| -32007 | Schedule information unavailable | Düğüm başlatılıyor veya senkronize ediliyor olabilir |
