# getAgGenesisCert

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://solana-mainnet.g.alchemy.com/v2/{apiKey}

Returns the [Alpenglow](https://solana.com/upgrades/alpenglow) genesis certificate: the certificate over the first block produced under Alpenglow consensus. Returns `null` while the cluster is still running TowerBFT, which makes this the way to detect whether Alpenglow is active on a cluster. Available from Agave v4.3; earlier nodes respond with a `Method not found` (-32601) error.

Reference: https://www.alchemy.com/docs/chains/solana/solana-api-endpoints/get-ag-genesis-cert

## Result

**Alpenglow genesis certificate** (null or object): The Alpenglow genesis certificate, or `null` if the cluster has not migrated to Alpenglow consensus.

## Example

### Response

```json
{
  "jsonrpc": "2.0",
  "result": null,
  "id": 1
}
```

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://solana-mainnet.g.alchemy.com/v2/docs-demo \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getAgGenesisCert"
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({jsonrpc: '2.0', id: 1, method: 'getAgGenesisCert'})
};

fetch('https://solana-mainnet.g.alchemy.com/v2/docs-demo', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://solana-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getAgGenesisCert"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://solana-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"getAgGenesisCert\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://solana-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"getAgGenesisCert\"\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://solana-mainnet.g.alchemy.com/v2/docs-demo");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"getAgGenesisCert\"\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);

```


## OpenRPC Method Specification

```yaml
name: getAgGenesisCert
description: 'Returns the [Alpenglow](https://solana.com/upgrades/alpenglow) genesis certificate: the certificate over the first block produced under Alpenglow consensus. Returns `null` while the cluster is still running TowerBFT, which makes this the way to detect whether Alpenglow is active on a cluster. Available from Agave v4.3; earlier nodes respond with a `Method not found` (-32601) error.'
x-compute-units: 10
params: []
result:
  name: Alpenglow genesis certificate
  description: The Alpenglow genesis certificate, or `null` if the cluster has not migrated to Alpenglow consensus.
  schema:
    title: Alpenglow Genesis Certificate
    description: The certificate over the first block produced under Alpenglow consensus, or `null` while the cluster is still running TowerBFT.
    oneOf:
      - type: 'null'
      - type: object
        properties:
          block:
            title: Alpenglow Genesis Block
            type: object
            description: The first block produced under Alpenglow consensus.
            properties:
              slot:
                type: integer
                description: Slot of the Alpenglow genesis block.
              blockId:
                type: array
                description: Block ID of the Alpenglow genesis block, as a 32-byte array.
                minItems: 32
                maxItems: 32
                items:
                  type: integer
                  minimum: 0
                  maximum: 255
          signature:
            title: Alpenglow Genesis Signature
            type: object
            description: Aggregate BLS signature over the Alpenglow genesis block.
            properties:
              signature:
                type: array
                description: 192-byte aggregate BLS signature.
                minItems: 192
                maxItems: 192
                items:
                  type: integer
                  minimum: 0
                  maximum: 255
              bitmap:
                type: array
                description: Bitmap of the ranks of the validators whose votes are covered by the aggregate signature.
                items:
                  type: integer
                  minimum: 0
                  maximum: 255
examples:
  - name: getAgGenesisCert example
    params: []
    result:
      name: Alpenglow genesis certificate
      value: null
```
