# voteSubscribe

Subscribe to receive notification anytime a new vote is observed in gossip. These votes are pre-consensus therefore there is no guarantee these votes will enter the ledger.

{% hint style="danger" %}
This subscription is unstable and only available if the validator was started with the&#x20;

`--rpc-pubsub-enable-vote-subscription`&#x20;

flag. The format of this subscription may change in the future.
{% endhint %}

#### Parameters required for this RPC call

* No parameters required.

{% tabs %}
{% tab title="Websocket" %}

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

{% endtab %}

{% tab title="Response" %}

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

{% endtab %}
{% endtabs %}

**Notification Format:**

The notification will be an object with the following fields:

* `hash: <string>` - The vote hash
* `slots: <array>` - The slots covered by the vote, as an array of u64 integers
* `timestamp: <i64|null>` - The timestamp of the vote
* `signature: <string>` - The signature of the transaction that contained this vote
* `votePubkey: <string>` - The public key of the vote account, as base-58 encoded string

{% tabs %}
{% tab title="Example" %}

```json
{
  "jsonrpc": "2.0",
  "method": "voteNotification",
  "params": {
    "result": {
      "hash": "8Rshv2oMkPu5E4opXTRyuyBeZBqQ4S477VG26wUTFxUM",
      "slots": [1, 2],
      "timestamp": null
    },
    "subscription": 0
  }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.shyft.to/solana/rpc-calls/solana-websockets/votesubscribe.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
