Solana RPC WebSocket Methods

Open an individual method page for request parameters, examples, notification payloads, and unsubscription behavior. For shared response objects reused across WebSocket methods, see Solana RPC JSON Structures Reference.

Request Format

Solana RPC WebSocket methods use JSON-RPC 2.0 over a persistent WebSocket connection. Connect to the PubSub endpoint at ws://<ADDRESS>/ or wss://<ADDRESS>/.

FieldTypeDescription
jsonrpcstringJSON-RPC version. Set this to "2.0".
idstring | number | nullClient-supplied request identifier. The server echoes it in the subscribe response.
methodstringPubSub method name, such as accountSubscribe or slotSubscribe.
paramsarrayOrdered method parameters. Use an empty array when the method takes no parameters.

Many subscription methods take the optional commitment parameter. If unspecified, subscriptions that accept commitment default to finalized.

Notification Format

After a subscribe request succeeds, the server returns a numeric subscription id in the JSON-RPC response. Later notifications are pushed as JSON-RPC messages with a method-specific notification name and the active subscription id.

FieldTypeDescription
jsonrpcstringJSON-RPC version.
methodstringNotification name, such as accountNotification or slotNotification.
params.resultanyMethod-specific notification payload. Many methods include a context object and a method-specific value.
params.subscriptionnumberSubscription id returned by the corresponding *Subscribe method.

For notifications that include context and value, PubSub includes context.slot and omits context.apiVersion.

Method Reference

Accounts

MethodDescription
accountSubscribeSubscribe to notifications when one account's lamports or data change.
accountUnsubscribeCancel an accountSubscribe subscription.
programSubscribeSubscribe to notifications for accounts owned by a program.
programUnsubscribeCancel a programSubscribe subscription.

Transactions

MethodDescription
logsSubscribeSubscribe to transaction log messages that match a log filter.
logsUnsubscribeCancel a logsSubscribe subscription.
signatureSubscribeSubscribe to status notifications for one transaction signature.
signatureUnsubscribeCancel a signatureSubscribe subscription.

Blocks

MethodDescription
blockSubscribeSubscribe to block notifications as blocks reach confirmed or finalized commitment.
blockUnsubscribeCancel a blockSubscribe subscription.

Cluster

MethodDescription
rootSubscribeSubscribe to notifications when the validator sets a new root slot.
rootUnsubscribeCancel a rootSubscribe subscription.
slotSubscribeSubscribe to notifications when the validator processes a new slot.
slotUnsubscribeCancel a slotSubscribe subscription.
slotsUpdatesSubscribeSubscribe to tagged slot lifecycle updates emitted by the validator.
slotsUpdatesUnsubscribeCancel a slotsUpdatesSubscribe subscription.
voteSubscribeSubscribe to gossip vote notifications.
voteUnsubscribeCancel a voteSubscribe subscription.

Is this page helpful?

Table of Contents

Edit Page

Managed by

© 2026 Solana Foundation.
All rights reserved.
Get connected