# voteSubscribe

> Streams validator vote transactions as the node's gossip/replay pipeline observes them (unstable upstream).

Source: https://docs.constant-k.com/rpc/websocket/votesubscribe/

`voteSubscribe` emits a notification each time the node observes a new vote from any validator: the `votePubkey` that cast it, the `slots` it votes for, the resulting bank `hash`, a `timestamp`, and the vote transaction's own `signature`. This is raw, pre-consensus gossip; a vote appearing here is not a guarantee it will ever land in a rooted block.

Agave ships this subscription behind `--rpc-pubsub-enable-vote-subscription` and documents it as unstable. constant-k enables the flag on Operator and above, so the subscription works normally here even though most public RPC providers leave it off; its contents are a best-effort signal about network voting activity, not settlement truth.

- Transport: WebSocket, JSON-RPC 2.0 over `wss://ws-newyork.constant-k.com:1337/ws?api-key=YOUR_API_KEY`
- Category: Subscriptions
- Availability: Operator and above

## Parameters

None.

## Result

- `result` (integer, optional): The subscription id, returned once in the initial RPC response. Passed to `voteUnsubscribe`, it cancels the stream.

## Notifications

Updates arrive as `voteNotification` messages. One notification per observed vote: the voting validator's identity, the slots it covers, the bank hash it voted for, a timestamp, and the vote transaction's signature.

- `params.result` (object, optional)
  - `votePubkey` (string, optional): Base58 vote account address that cast this vote.
  - `slots` (integer[], optional): Slots covered by this vote, oldest first.
  - `hash` (string, optional): Base58 bank hash being voted for.
  - `timestamp` (integer | null, optional): Unix timestamp the vote carried, if any.
  - `signature` (string, optional): Base58 signature of the vote transaction itself.

## Unsubscribe

`voteUnsubscribe`, called with the subscription id, returns `true` once the subscription is removed.

## Example: Subscribe to vote updates

Request (send after connecting):

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "voteSubscribe"
}
```

Response:

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

Notification:

```json
{
  "jsonrpc": "2.0",
  "method": "voteNotification",
  "params": {
    "result": {
      "votePubkey": "7VDcWQwZQiiJfR6JQqvXpvQFT9CDLNqhLBpZKmZQxDVN",
      "slots": [
        337812488,
        337812489,
        337812490
      ],
      "hash": "9mK2wR7hF3gJ6nQ1sT4vX8zB5cD2eG9jL3mP6qS1uW4y",
      "timestamp": 1789696120,
      "signature": "31nUfXa3iVxBJRPQPbV9nPiDLBbDky4gsv3Fmg5E4cfzyrhoY4ivDSFvN2hC7cBt5SBcGzNJeXgwgYgwgbyhJjXW"
    },
    "subscription": 9042
  },
  "truncated": true
}
```

## Notes

- WebSocket access is included on the Operator plan and above; it is not available on Free.
- Concurrent connections are capped per API key: 10 on Operator, 50 on Blade Runner, 100 on Nexus.
- Subscribe and unsubscribe calls draw from the same global per-plan request-rate limit as HTTP calls: 50 req/s on Operator, 200 req/s on Blade Runner, 500 req/s on Nexus.
- Only subscription methods (the `*Subscribe` / `*Unsubscribe` family) are accepted on the WebSocket endpoint; standard request/response RPC methods must go over HTTPS instead.
- A `getHealth` request sent over the open socket on a regular interval serves as a keepalive; connections that go quiet can be dropped by intermediate load balancers.
- Each region has its own WebSocket hostname, for example `wss://ws-newyork.constant-k.com:1337/ws?api-key=YOUR_API_KEY`; every region is listed on the Endpoints page.
- Hand-built rather than captured live, since `voteSubscribe` is usually disabled on public endpoints; `slots` normally runs long enough to warrant trimming.
- Votes are pre-consensus; "no guarantee they will enter the ledger" is how upstream documentation puts the caveat, and it applies here too.

