> ## 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.

# getGenesisHash

> Kümenin genesis hash'ini döndürür

## Parametreler

Bu metod herhangi bir parametre almaz.

## Yanıt

<ResponseField name="result" type="string">
  Base-58 kodlu dize olarak genesis hash
</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": "getGenesisHash"
}'
```

### 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 genesis hash
const genesisHash = await connection.getGenesisHash();
console.log('Genesis hash:', genesisHash);

// Verify cluster
async function verifyCluster(expectedHash: string) {
  const actualHash = await connection.getGenesisHash();
  if (actualHash !== expectedHash) {
    throw new Error(`Connected to wrong cluster. Expected ${expectedHash}, got ${actualHash}`);
  }
  console.log('Connected to correct cluster');
}
```

## Notlar

1. Kümenin genesis hash'ini döndürür
2. Genesis hash her kümeye özgüdür
3. Hangi kümeye bağlı olduğunuzu doğrulamak için kullanılabilir
4. Hash base-58 kodludur
5. Mevcut durumdan okuduğu için yanıt anında gelir

## En İyi Uygulamalar

1. Küme bağlantısını doğrulamak için bu metodu kullanın
2. RPC yükünü azaltmak için sonucu önbelleğe alın
3. Farklı kümeler için bilinen genesis hash'leriyle karşılaştırın
4. Diğer küme doğrulama metodlarıyla birlikte kullanın
5. Ağ hatalarını uygun şekilde yönetin

## Yaygın Hatalar

| Kod    | Mesaj                    | Çözüm                                                |
| ------ | ------------------------ | ---------------------------------------------------- |
| -32601 | Method not found         | Bir Solana RPC düğümüne bağlı olduğunuzu doğrulayın  |
| -32007 | Genesis hash unavailable | Düğüm başlatılıyor veya senkronize ediliyor olabilir |

## Kullanım Senaryoları

1. **Küme Doğrulaması**
   ```typescript theme={null}
   const CLUSTER_HASHES = {
     mainnet: '5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d',
     testnet: '4uhcVJyU9pJkvQyS88uRDiswHXSCkY3zQawwpjk2NsNY',
     devnet: 'EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG'
   };

   async function verifyClusterConnection(expectedCluster: keyof typeof CLUSTER_HASHES) {
     const genesisHash = await connection.getGenesisHash();
     const expectedHash = CLUSTER_HASHES[expectedCluster];
     
     if (genesisHash !== expectedHash) {
       throw new Error(`Connected to wrong cluster. Expected ${expectedCluster} (${expectedHash}), got ${genesisHash}`);
     }
     
     return {
       cluster: expectedCluster,
       genesisHash,
       verified: true
     };
   }
   ```

2. **Küme Tespiti**
   ```typescript theme={null}
   async function detectCluster() {
     const genesisHash = await connection.getGenesisHash();
     
     for (const [cluster, hash] of Object.entries(CLUSTER_HASHES)) {
       if (hash === genesisHash) {
         return cluster;
       }
     }
     
     throw new Error('Unknown cluster');
   }
   ```

3. **Ağ Yapılandırması**
   ```typescript theme={null}
   interface NetworkConfig {
     cluster: string;
     genesisHash: string;
     rpcEndpoint: string;
     wsEndpoint: string;
   }

   async function configureNetwork(endpoint: string): Promise<NetworkConfig> {
     const connection = new Connection(endpoint);
     const genesisHash = await connection.getGenesisHash();
     const cluster = await detectCluster();
     
     return {
       cluster,
       genesisHash,
       rpcEndpoint: endpoint,
       wsEndpoint: endpoint.replace('http', 'ws')
     };
   }
   ```
