---
title: getGenesisHash
description: >-
  Returns the genesis hash for the connected cluster.
url: /docs/rpc/http/getgenesishash
type: reference
hideTableOfContents: true
---

Returns the genesis hash for the connected cluster.

<Callout type="info" title="Source">
  [`get_genesis_hash`](https://github.com/anza-xyz/agave/blob/v3.1.8/rpc/src/rpc.rs#L2801)
</Callout>

<APIMethod>

```jsonc !!request curl
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getGenesisHash"
}
```

```ts !!request title="Kit"
import { createSolanaRpc } from "@solana/kit";

const rpc_url = "https://api.devnet.solana.com";
const rpc = createSolanaRpc(rpc_url);

let genesisHash = await rpc.getGenesisHash().send();

console.log(genesisHash);
```

```ts !!request title="web3.js"
import { Connection, clusterApiUrl } from "@solana/web3.js";

const connection = new Connection(clusterApiUrl("devnet"), "confirmed");

let genesisHash = await connection.getGenesisHash();

console.log(genesisHash);
```

```rs !!request title="Rust"
use anyhow::Result;
use solana_client::nonblocking::rpc_client::RpcClient;
use solana_commitment_config::CommitmentConfig;

#[tokio::main]
async fn main() -> Result<()> {
    let client = RpcClient::new_with_commitment(
        String::from("https://api.devnet.solana.com"),
        CommitmentConfig::confirmed(),
    );

    let genesis_hash = client.get_genesis_hash().await?;

    println!("{:#?}", genesis_hash);

    Ok(())
}
```

### !params

### !!result

```jsonc !response
{
  "jsonrpc": "2.0",
  // !hover result
  "result": "GH7ome3EiwEr7tu9JuTh2dpYWBJK3z69Xm1ZE3MEE6JC",
  "id": 1
}
```

!type string

Genesis hash, as a base-58 encoded string.

</APIMethod>
