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.
Source
Unstable Method
Agave documents this as an unstable RPC PubSub voteSubscribe
subscription.
It is only available if the validator was started with
--rpc-pubsub-enable-vote-subscription.
$ curl https://api.devnet.solana.com -s -X \> POST -H "Content-Type: application/json" -d '> {> "jsonrpc": "2.0",> "id": 1,> "method": "voteSubscribe"> }> '
params
Noneresult
Response
{"jsonrpc": "2.0","result": 0,"id": 1}
integer
Subscription id. Pass this to voteUnsubscribe.
Notification format
Notifications are delivered as voteNotification.
{"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}}
jsonrpc
string
Always "2.0".
method
string
Always "voteNotification".
params
object
Notification wrapper with the vote payload and the subscription id.
Is this page helpful?