Parameters

slot
number
required

Block number, identified by Slot

Response

result
object

Code Examples

Basic Request

curl http://rpc.orbitflare.com -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getBlockCommitment",
  "params": [5]
}'

Using web3.js

import { Connection } from '@solana/web3.js';

const connection = new Connection('http://rpc.orbitflare.com');
const commitment = await connection.getBlockCommitment(5);
console.log(commitment);

Using Python

from solana.rpc.api import Client

client = Client("http://rpc.orbitflare.com")
response = client.get_block_commitment(5)
print(response)

Notes

  1. Returns commitment information for a specific block
  2. The commitment array indicates stake weight distribution
  3. The totalStake value represents the total active stake in the current epoch
  4. The response is immediate as it reads from the current state

Best Practices

  1. Use this method to verify block confirmation status
  2. Compare commitment values to understand consensus levels
  3. Handle network errors and retry when appropriate