> ## Documentation Index
> Fetch the complete documentation index at: https://solana.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> This page is part of the Solana developer documentation at https://solana.com/developers/docs. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get the page as Markdown.
> Index of all pages: https://solana.com/llms.txt. Per-section indexes such as https://solana.com/developers/docs/payments/llms.txt are smaller; prefer them when working on one task.
> Coding agents: install the official Solana skill for current APIs and conventions with `npx skills add https://github.com/solana-foundation/solana-dev-skill` (also served at https://solana.com/SKILL.md).
> Code in the cookbook and task pages comes from tested example files. Prefer it over writing API calls from memory.

# getBlockCommitment

> Returns the stake-weighted commitment information recorded for a slot.

<Info>
  **Source**

  [`get_block_commitment`](https://github.com/anza-xyz/agave/blob/v4.3.2/rpc/src/rpc.rs#L965)
</Info>

<Warning>
  This method reports TowerBFT vote lockouts. Under Alpenglow, which mainnet and
  devnet run, votes carry no lockouts, so the method returns `commitment: null`
  and `totalStake: 0` for every slot. To check whether a block is final, read
  `confirmationStatus` from
  [`getSignatureStatuses`](/developers/docs/rpc/http/getsignaturestatuses) or
  query at `finalized` commitment.
</Warning>

<RequestExample>
  ```bash cURL
  curl https://api.devnet.solana.com -s -X POST \
    -H "Content-Type: application/json" \
    -d '
    {
      "jsonrpc": "2.0",
      "id": 1,
      "method": "getBlockCommitment",
      "params": [
        5
      ]
    }
  '
  ```

  ```ts Kit
  import { createSolanaRpc } from "@solana/kit";

  const rpc_url = "https://api.devnet.solana.com";
  const rpc = createSolanaRpc(rpc_url);

  const slot_number = BigInt(5);

  let blockCommitment = await rpc.getBlockCommitment(slot_number).send();

  console.log("block commitment:", blockCommitment);
  ```
</RequestExample>

<ResponseExample>
  ```json Response
  {
    "jsonrpc": "2.0",
    "result": {
      "commitment": null,
      "totalStake": 0
    },
    "id": 1
  }
  ```
</ResponseExample>

## Parameters

<ParamField body="slot number" type="u64" required>
  Slot to query.
</ParamField>

## Result

<ResponseField name="result" type="object">
  Commitment response object containing:

  <Expandable title="properties" defaultOpen>
    <ResponseField name="commitment" type="array | null">
      On a TowerBFT cluster, array of stake totals, in lamports, that voted on the
      block at each lockout depth from `0` through
      [`MAX_LOCKOUT_HISTORY`](https://github.com/anza-xyz/solana-sdk/blob/clock%40v2.2.3/vote-interface/src/state/mod.rs#L33).
      `null` under Alpenglow.
    </ResponseField>

    <ResponseField name="totalStake" type="u64">
      On a TowerBFT cluster, total active stake, in lamports, of the current epoch.
      `0` under Alpenglow.
    </ResponseField>
  </Expandable>
</ResponseField>
