TriportRPC

getBlockCommitment

Last updated:

`getBlockCommitment` reports how much of the cluster's stake has voted on the block produced at a given **slot**. It returns a `commitment` array describing the stake-weighted vote depth for that block, plus the `totalStake` active in the current epoch. Together these let you judge how finalized a block is: the more stake concentrated at the highest lockout depth, the less likely the block is to be rolled back.

Pass the target `slot` as the single positional parameter. If the node has no commitment information for the requested slot — for example a slot it never saw, or one already purged from its ledger — the `commitment` field is returned as `null` while `totalStake` still reflects the epoch's active stake.

This is a low-level inspection method. For everyday "is this transaction final?" checks, prefer querying with a `commitment` config of `finalized` on the relevant read method; reach for `getBlockCommitment` when you need the raw stake-weighted vote distribution for a specific block.

Parameters

getBlockCommitment parameters
NameTypeRequiredDescription
slotSlotYes

Returns

getBlockCommitment return value
FieldType
resultobject

Examples

curl https://<your-endpoint>/ \
  -X POST -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"getBlockCommitment","params":["<slot>"]}'
const res = await fetch("https://<your-endpoint>/", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
  "id": 1,
  "method": "getBlockCommitment",
  "params": [
    "<slot>"
  ],
  "jsonrpc": "2.0"
}),
});
const data = await res.json();
import requests
resp = requests.post("https://<your-endpoint>/", json={"id":1,"method":"getBlockCommitment","params":["<slot>"],"jsonrpc":"2.0"})
print(resp.json())

Usage

  1. Transport: HTTP (JSON-RPC).
  2. Networks: mainnet, devnet, testnet.
  3. Credit cost: 1 per call.

FAQ

What does getBlockCommitment do?
Returns the amount of cluster stake, in lamports, that has voted on a particular Solana block (slot).
How many credits does getBlockCommitment cost?
getBlockCommitment costs 1 credit(s) per call on Triport by default.
Is getBlockCommitment available over WebSocket?
getBlockCommitment is an HTTP JSON-RPC method.