Source
get_slotParameters
config
Configuration object containing the following fields:
Result
result
Highest slot the node used to answer this request.
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": "getSlot",
"params": [
{
"commitment": "finalized"
}
]
}
'
import { createSolanaRpc } from "@solana/kit";
const rpc_url = "https://api.devnet.solana.com";
const rpc = createSolanaRpc(rpc_url);
let slot = await rpc.getSlot().send();
console.log(slot);
import { Connection, clusterApiUrl, type GetSlotConfig } from "@solana/web3.js";
const connection = new Connection(clusterApiUrl("devnet"), "confirmed");
let config: GetSlotConfig = {
commitment: "finalized"
};
let slot = await connection.getSlot(config);
console.log(slot);
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 slot = client.get_slot().await?;
println!("{}", slot);
Ok(())
}
{
"jsonrpc": "2.0",
"result": 1234,
"id": 1
}
Returns the highest slot reached at the requested commitment.
curl https://api.devnet.solana.com -s -X POST \
-H "Content-Type: application/json" \
-d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getSlot",
"params": [
{
"commitment": "finalized"
}
]
}
'
import { createSolanaRpc } from "@solana/kit";
const rpc_url = "https://api.devnet.solana.com";
const rpc = createSolanaRpc(rpc_url);
let slot = await rpc.getSlot().send();
console.log(slot);
import { Connection, clusterApiUrl, type GetSlotConfig } from "@solana/web3.js";
const connection = new Connection(clusterApiUrl("devnet"), "confirmed");
let config: GetSlotConfig = {
commitment: "finalized"
};
let slot = await connection.getSlot(config);
console.log(slot);
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 slot = client.get_slot().await?;
println!("{}", slot);
Ok(())
}
{
"jsonrpc": "2.0",
"result": 1234,
"id": 1
}
get_slotShow propertiesHide properties
processed, confirmed, finalizedSolana RPC uses the following commitment levels:| Value | Description |
|---|---|
processed | Return data from the highest slot this node has processed. This is the newest view, but the block can still be skipped. |
confirmed | Return data from the same slot as finalized. Kept for compatibility and planned for removal in a later release. |
finalized | Return data from the highest slot with a finalization certificate, from votes by 80% of stake in one round or 60% of stake in each of two rounds. This is the strongest commitment level. |
{ "minContextSlot": 341197000 }