Parameters
NoneResult
result
When the node has a snapshot, this returns a JSON object with the following
fields:
result
If the node has no snapshot, a JSON RPC error response is returned.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
RPC methods
CLI reference
Network constants
curl https://api.devnet.solana.com -s -X POST \
-H "Content-Type: application/json" \
-d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getHighestSnapshotSlot"
}
'
import { createSolanaRpc } from "@solana/kit";
const rpc_url = "https://api.devnet.solana.com";
const rpc = createSolanaRpc(rpc_url);
let hightestSnapshotSlot = await rpc.getHighestSnapshotSlot().send();
console.log(hightestSnapshotSlot);
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 highest_snapshot_slot = client.get_highest_snapshot_slot().await?;
println!("{:#?}", highest_snapshot_slot);
Ok(())
}
{
"jsonrpc": "2.0",
"result": {
"full": 100,
"incremental": 110
},
"id": 1
}
{
"jsonrpc": "2.0",
"error": {
"code": -32008,
"message": "No snapshot"
},
"id": 1
}
Returns the highest full snapshot slot and, if available, the highest incremental snapshot slot built on it.
curl https://api.devnet.solana.com -s -X POST \
-H "Content-Type: application/json" \
-d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getHighestSnapshotSlot"
}
'
import { createSolanaRpc } from "@solana/kit";
const rpc_url = "https://api.devnet.solana.com";
const rpc = createSolanaRpc(rpc_url);
let hightestSnapshotSlot = await rpc.getHighestSnapshotSlot().send();
console.log(hightestSnapshotSlot);
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 highest_snapshot_slot = client.get_highest_snapshot_slot().await?;
println!("{:#?}", highest_snapshot_slot);
Ok(())
}
{
"jsonrpc": "2.0",
"result": {
"full": 100,
"incremental": 110
},
"id": 1
}
{
"jsonrpc": "2.0",
"error": {
"code": -32008,
"message": "No snapshot"
},
"id": 1
}