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

# rootSubscribe | Solana

> Subscribe to Solana ledger root changes with rootSubscribe. Receive real-time WebSocket notifications whenever the validator confirms a new root slot.

## Parameters

* `<commitment>` - (optional) The level of commitment desired when querying state. Default is "finalized".

## Response

* `result` - An integer subscription id (needed to unsubscribe)

* `subscription` - An object containing root information:

  * `root` - The slot number that has been rooted
  * `timestamp` - The estimated production time of the rooted slot, as Unix timestamp (seconds since the Unix epoch)

## `rootSubscribe` code examples

This example subscribes to root updates.

<Info>
  Note that subscriptions require a WebSocket connection and [WebSocket cat](https://www.npmjs.com/package/wscat) for you to use this method in the console.

  Install WebSocket cat with:

  `npm install -g wscat`
</Info>

<CodeGroup>
  ```shell wscat theme={"system"}
  $ wscat -c YOUR_CHAINSTACK_WEBSOCKET_ENDPOINT
  # Wait for the connection to be established

  Connected (press CTRL+C to quit)

  > { "jsonrpc": "2.0", "id": 1, "method": "rootSubscribe" }
  ```
</CodeGroup>

## Use case

The `rootSubscribe` method is particularly useful for applications that need to monitor the finality of the Solana blockchain. Common use cases include:

* Finality tracking: Monitor when slots become rooted (finalized) in the blockchain
* Chain reorganization detection: Track changes in the root to detect potential chain reorganizations
* Historical data processing: Know when slots are safe to process for historical data analysis
* Consensus monitoring: Track the progress and health of consensus by monitoring root advancement

By subscribing to root updates, applications can maintain accurate information about the finalized state of the blockchain and make decisions based on confirmed data.
