RPC
WebSocket RPC Methods
Real-time WebSocket subscriptions for monitoring blockchain state changes
Real-time WebSocket subscriptions for monitoring blockchain state changes. Connect to ws://localhost:8900 when running Surfnet.
accountSubscribe
Account subscribe endpoint specification
Parameters
| Name | Type | Description |
|---|---|---|
pubkey* | string | Account public key to monitor (base-58 encoded) |
config | RpcAccountSubscribeConfig | Optional subscription configuration |
Example
{ "jsonrpc": "2.0", "id": 1, "method": "accountSubscribe", "params": [ { "commitment": "Processed", "encoding": "Base58" }, "string" ]}blockSubscribe
blockSubscribe - Subscribe to block updates
Example
{ "jsonrpc": "2.0", "id": 1, "method": "blockSubscribe", "params": []}logsSubscribe
logsSubscribe - Subscribe to transaction logs
Example
{ "jsonrpc": "2.0", "id": 1, "method": "logsSubscribe", "params": []}programSubscribe
programSubscribe - Subscribe to program account changes
Example
{ "jsonrpc": "2.0", "id": 1, "method": "programSubscribe", "params": []}signatureSubscribe
Signature subscribe endpoint specification
Parameters
| Name | Type | Description |
|---|---|---|
signature* | string | Transaction signature to monitor (base-58 encoded) |
config | RpcSignatureSubscribeConfig | Optional subscription configuration |
Example
{ "jsonrpc": "2.0", "id": 1, "method": "signatureSubscribe", "params": [ { "commitment": "Processed", "enableReceivedNotification": true }, "string" ]}slotSubscribe
Slot subscribe endpoint specification
Example
{ "jsonrpc": "2.0", "id": 1, "method": "slotSubscribe", "params": []}slotUpdatesSubscribe
slotUpdatesSubscribe - Subscribe to slot updates
Example
{ "jsonrpc": "2.0", "id": 1, "method": "slotUpdatesSubscribe", "params": []}