> ## 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.

# voteSubscribe

> Subscribe to gossip vote notifications.

Subscribe to notifications when a new vote is observed in gossip. These votes
are pre-consensus, so there is no guarantee they will enter the ledger.

<Info>
  **Source**

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

<Warning>
  **Unstable Method**

  Agave documents this as an [unstable RPC PubSub `voteSubscribe`
  subscription](https://github.com/anza-xyz/agave/blob/v4.3.2/validator/src/commands/run/args/pub_sub_config.rs#L77-L80).
  It is only available if the validator was started with
  `--rpc-pubsub-enable-vote-subscription`.
</Warning>

<Warning>
  This subscription reports TowerBFT votes from gossip. Under Alpenglow, which
  mainnet and devnet run, validators send votes directly to each other instead,
  so the subscription receives no notifications.
</Warning>

<RequestExample>
  ```json WebSocket
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "voteSubscribe"
  }
  ```

  ```rs Rust
  use anyhow::Result;
  use futures::StreamExt;
  use solana_client::nonblocking::pubsub_client::PubsubClient;

  #[tokio::main]
  async fn main() -> Result<()> {
      let pubsub_client = PubsubClient::new("wss://api.devnet.solana.com/").await?;

      let (mut notifications, unsubscribe) = pubsub_client.vote_subscribe().await?;

      while let Some(notification) = notifications.next().await {
          println!("{:?}", notification);
      }

      unsubscribe().await;

      Ok(())
  }
  ```
</RequestExample>

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

## Parameters

**None**

## Result

<ResponseField name="result" type="integer">
  Subscription id. Pass this to
  [voteUnsubscribe](/developers/docs/rpc/websocket/voteunsubscribe).
</ResponseField>

## Notification format

Notifications are delivered as `voteNotification`.

```json
{
  "jsonrpc": "2.0",
  "method": "voteNotification",
  "params": {
    "result": {
      "votePubkey": "Dsw9gS3HhFZKtdRETYxZEDfxnhvybP65seF9BJTFnLTZ",
      "slots": [
        326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339,
        340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353,
        354, 355, 356
      ],
      "hash": "AdU6NQBUhCpLGzsbV9Kn2vBG8pmedvnnSkxuctFQC9Du",
      "timestamp": 1774643712,
      "signature": "5Scozdcb2WM3tsEJtQYYYtKR2DbE7nNKsNVo2qQJm1XQ5K97pJnbgkGSiGh5YKWxMzQzDBUmw7A57gwsnqLceR2Q"
    },
    "subscription": 1
  }
}
```

<ResponseField name="jsonrpc" type="string">
  Always `"2.0"`.
</ResponseField>

<ResponseField name="method" type="string">
  Always `"voteNotification"`.
</ResponseField>

<ResponseField name="params" type="object">
  Notification wrapper with the vote payload and the subscription id.

  <Expandable title="properties" defaultOpen>
    <ResponseField name="result" type="object">
      Vote payload observed in gossip. This notification is serialized directly and
      does not include `context` and `value`.

      <Expandable title="properties">
        <ResponseField name="votePubkey" type="string">
          Vote account that produced the vote, as a base-58 encoded string.
        </ResponseField>

        <ResponseField name="slots" type="array[u64]">
          Slots covered by the vote.
        </ResponseField>

        <ResponseField name="hash" type="string">
          Vote hash for the observed vote transaction.
        </ResponseField>

        <ResponseField name="timestamp" type="i64 | null">
          Vote timestamp, if one was present in the vote.
        </ResponseField>

        <ResponseField name="signature" type="string">
          Transaction signature that carried the vote.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="subscription" type="integer">
      Subscription id that produced this notification.
    </ResponseField>
  </Expandable>
</ResponseField>
