# getHighestSnapshotSlot

The `getHighestSnapshotSlot` RPC method provides details about the **most recent ledger snapshots** stored by a Solana RPC node. It includes both the highest **full snapshot** and the latest **incremental snapshot** (if available), which are critical for fast node startup and ledger synchronization.

> **Version Note:** Available in `solana-core v1.9+`. For versions ≤ v1.8, use the deprecated `getSnapshotSlot` method.

***

#### ✅ Common Use Cases

* **Monitor Snapshot Generation**\
  Check how up-to-date a node is in generating snapshots used for bootstrapping and syncing.
* **Analyze Node Health**\
  Use snapshot information to understand whether the node is keeping pace with the cluster or falling behind.
* **Debug Syncing Issues**\
  Compare full and incremental snapshot slots to troubleshoot delayed snapshot generation or restoration problems.

***

#### 🛠 Request Parameters

This method **does not accept any parameters**.

***

#### 📦 Response Structure

The `result` field returns an object:

```json
{
  "full": 185000000,
  "incremental": 185050000
}
```

| Field         | Type          | Description                                                                                                                                                      |
| ------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `full`        | *u64*         | The highest slot at which a **full snapshot** is available.                                                                                                      |
| `incremental` | *u64 \| null* | The highest slot at which an **incremental snapshot** exists (based on the full snapshot). Can be `null` if incremental snapshotting is disabled or unavailable. |

If the node has no snapshots at all, the behavior may vary by provider (e.g., returning `null`, an empty object, or an error).

***

💡 **Example: Fetch Highest Snapshot Slot**

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getHighestSnapshotSlot"
}
```

**Code Examples**

{% tabs %}
{% tab title="Nodejs" %}

```javascript
const fetch = require('node-fetch');

async function getHighestSnapshotSlot(rpcUrl) {
  try {
    const response = await fetch(rpcUrl, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        jsonrpc: '2.0',
        id: 1,
        method: 'getHighestSnapshotSlot'
      }),
    });

    const data = await response.json();
    
    // Print the exact full response
    console.log('Full RPC Response:');
    console.log(JSON.stringify(data, null, 2));
    
    return data;
  } catch (error) {
    console.error('Error getting health:', error.message);
    return null;
  }
}

// Example usage
const RPC_URL = 'https://rpc.coinvera.io/?x-api-key=your-coinvera-x-api-key';

getHighestSnapshotSlot(RPC_URL);
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

def get_highest_snapshot_slot(rpc_url):
    try:
        response = requests.post(
            rpc_url,
            headers={
                'Content-Type': 'application/json',
            },
            json={
                'jsonrpc': '2.0',
                'id': 1,
                'method': 'getHighestSnapshotSlot'
            }
        )
        
        data = response.json()
        
        # Print the exact full response
        print('Full RPC Response:')
        print(json.dumps(data, indent=2))
        
        return data
        
    except Exception as error:
        print(f'Error getting health: {error}')
        return None

# Example usage
RPC_URL = 'https://rpc.coinvera.io/?x-api-key=your-coinvera-x-api-key'
get_highest_snapshot_slot(RPC_URL)
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "jsonrpc": "2.0",
  "result": {
    "full": 353404518,
    "incremental": 353413622
  },
  "id": 1
}
```

***

#### 🧠 Developer Tips

* **Snapshot Data Is Node-Specific**\
  Snapshot availability depends on each node’s configuration. Archival or high-availability nodes may generate snapshots more frequently than lightweight ones.
* **Snapshot Progression**\
  Expect `full` and `incremental` snapshot slots to increase as the node progresses through epochs. If these values remain static, the node may not be generating new snapshots correctly.
* **Full vs. Incremental Snapshots**
  * **Full Snapshot**: Contains the complete state of the ledger at a given slot.
  * **Incremental Snapshot**: Captures state changes since the most recent full snapshot. Smaller and faster to create, but dependent on the base full snapshot.
* **Use in Automation and Alerting**\
  Monitor these values in scripts or infrastructure dashboards to ensure snapshot generation is healthy and up to date.
* **Version Compatibility**\
  Ensure your node or RPC provider supports Solana v1.9+ to use this method. Older nodes will not respond to this RPC call.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.coinvera.io/integration/solana/rpc/gethighestsnapshotslot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
