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

# rootSubscribe

(Subscription Websocket) Subscribe to receive notification anytime a new root is set by the validator.

This method will use `20` [Compute Units](/nodeapi/about/billing).

***

## **Parameters**

None.

## Returns

`result` The result will be an RpcResponse JSON object with id equal to the subscription id (needed to unsubscribe).

`Notification Format:` The notification format is the same as seen in the getAccountInfo RPC HTTP method.

* `slot` The latest slot number.

```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
// Result
{ "jsonrpc": "2.0", "result": 0, "id": 1 }
```

<CodeGroup>
  ```bash title="mainnet" theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
  wscat -c wss://mainnet.solana.validationcloud.io/v1/<YOUR_API_KEY_HERE>
  # wait for connection
  {"id":1,"jsonrpc":"2.0","method": "rootSubscribe" }
      
  ```

  ```bash title="devnet" theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
  wscat -c wss://devnet.solana.validationcloud.io/v1/<YOUR_API_KEY_HERE>
  # wait for connection
  {"id":1,"jsonrpc":"2.0","method": "rootSubscribe" }
      
  ```
</CodeGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.