> For the complete documentation index, see [llms.txt](https://docs.triton.one/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.triton.one/solana/rpc-methods/real-time-streaming/whirligig-websocket/blocksubscribe.md).

# blockSubscribe

Subscribe to each new block over WebSocket, filtered by all or mentionsAccountOrProgram, at confirmed or finalized commitment.

## Request

{% tabs %}
{% tab title="WebSocket message" %}

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "blockSubscribe",
  "params": [
    "all",
    {
      "commitment": "finalized",
      "encoding": "base64",
      "transactionDetails": "full",
      "showRewards": true,
      "maxSupportedTransactionVersion": 1
    }
  ]
}
```

{% endtab %}
{% endtabs %}

Connect to `wss://<your-endpoint>.mainnet.rpcpool.com/<your-token>`.

In Rust, [`PubsubClient::block_subscribe`](https://docs.rs/solana-pubsub-client/latest/solana_pubsub_client/nonblocking/pubsub_client/struct.PubsubClient.html#method.block_subscribe) in the `solana-pubsub-client` crate sends this request.

## Parameters

**`filter`** · required

One of:

* `"all"` · every block.
* `{ "mentionsAccountOrProgram": <pubkey> }` · only blocks containing a transaction that mentions the given base-58 address.

**`config`** · optional

Solana's [`RpcBlockSubscribeConfig`](https://docs.rs/solana-client/latest/solana_client/rpc_config/struct.RpcBlockSubscribeConfig.html), the same config [transactionSubscribe](/solana/rpc-methods/real-time-streaming/whirligig-websocket/transactionsubscribe.md) uses:

| Field                            | Default     | Description                                                                                                                                                                                                                                                                                                                                                                                         |
| -------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `commitment`                     | `finalized` | `confirmed` or `finalized`. `processed` is not supported.                                                                                                                                                                                                                                                                                                                                           |
| `encoding`                       | `base64`    | Transaction encoding: `base58`, `base64`, `json`, or `jsonParsed`. `base58` is rejected when `maxSupportedTransactionVersion` is 1 or higher.                                                                                                                                                                                                                                                       |
| `transactionDetails`             | `full`      | `full`, `accounts`, `signatures`, or `none`.                                                                                                                                                                                                                                                                                                                                                        |
| `showRewards`                    | `false`     | Include the block `rewards` array. Entries can have `rewardType` `VATDebit` (validator admission ticket burn, negative `lamports`).                                                                                                                                                                                                                                                                 |
| `maxSupportedTransactionVersion` | —           | Highest transaction version to return. Set `1` to receive legacy, v0 and v1 transactions; v1 transactions are enabled on mainnet since slot 447,120,000. If you omit it (or set it below the newest version in a block) and `transactionDetails` is `full` or `accounts`, any block that holds a newer transaction arrives with `block` set to `null` and an `UnsupportedTransactionVersion` error. |

## Response

```json
{
  "jsonrpc": "2.0",
  "result": 0,
  "id": 1
}
```

## Result

Subscription id. Pass this to [blockUnsubscribe](/solana/rpc-methods/real-time-streaming/whirligig-websocket/blockunsubscribe.md).

## Notification

Updates arrive as `blockNotification` messages, each with a `context` (`slot`) and a `value`:

| Field   | Type           | Description                                                                                                                                                                                                               |
| ------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `slot`  | u64            | Slot of the block.                                                                                                                                                                                                        |
| `block` | object \| null | Block data, the same structure as [getBlock](/solana/rpc-methods/historical-data/getblock.md).                                                                                                                            |
| `err`   | null \| object | `{"UnsupportedTransactionVersion": <version>}` when `transactionDetails` is `full` or `accounts` and the block holds a transaction newer than `maxSupportedTransactionVersion`; `block` is then `null`. Otherwise `null`. |

***

*Adapted from the* [*Solana `blockSubscribe` reference*](https://solana.com/docs/rpc/websocket/blocksubscribe)*, maintained by the Solana Foundation.*

***

<i class="fa-life-ring">:life-ring:</i> Contact support by clicking the chat icon in your [customer dashboard](https://customers.triton.one)\ <i class="fa-briefcase">:briefcase:</i> Sales questions? [Contact us](https://triton.one/contact)\ <i class="fa-sparkles">:sparkles:</i> AI agent? Read [llms.txt](https://docs.triton.one/llms.txt)\ <i class="fa-rss">:rss:</i> Follow updates: [Blog](https://blog.triton.one) · [X](https://x.com/triton_one) · [YouTube](https://www.youtube.com/@triton_one_ltd) · [Telegram](https://t.me/tritonone) · [GitHub](https://github.com/rpcpool)
