logs Subscribe
Streams program log output for transactions matching a filter, as each one lands.
wss://ws-newyork.constant-k.com:1337/ws?api-key=YOUR_API_KEYlogsSubscribe is a lighter-weight alternative to blockSubscribe or programSubscribe for reacting to transaction outcomes and their log lines. filter selects which transactions are included: "all" for every non-vote transaction, "allWithVotes" to also include vote transactions (very high volume), or {"mentions": ["<pubkey>"]} for only transactions whose account list includes that one address — the mentions list must contain exactly one address; the node rejects more than one.
commitment trades notification speed against the chance a transaction's outcome still changes: a processed log line can belong to a transaction that later fails to reach confirmed.
Parameters
params is a JSON array, with values in this order: filter, config.
Which transactions to receive logs for.
Show one ofOne of
allallWithVotesShow propertiesProperties
Exactly one base58 pubkey; a list with more than one entry is rejected.
Optional subscription settings.
Show propertiesProperties
How settled the account/transaction state must be before the node acts on it. processed is fastest and can roll back; finalized is slowest and never rolls back.
processedconfirmedfinalizedResult
The subscription id, returned once in the initial RPC response. Passed to logsUnsubscribe, it cancels the stream.
Notifications
Updates arrive as logsNotification messages on the same socket. result.value.signature identifies the transaction, result.value.err is null on success or the transaction error object on failure, and result.value.logs is the ordered array of program log lines (Program X invoke, Program log: ..., Program X success, and so on).
Notification payload.
Show propertiesProperties
Response context, including the slot the data was read at.
Show propertiesProperties
Slot number this applies to.
The requested data; see the fields below.
Show propertiesProperties
Base58 transaction signature.
Null on success, or an error object/string describing the failure.
Ordered program log lines emitted while the transaction executed.
Unsubscribe
logsUnsubscribe, called with the subscription id, stops the notifications and returns true once the subscription is removed.
{
"jsonrpc": "2.0",
"id": 2,
"method": "logsUnsubscribe",
"params": [26917947]
}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/*Unsubscribefamily) are accepted on the WebSocket endpoint; standard request/response RPC methods must go over HTTPS instead. - A
getHealthrequest 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. - Captured live from
wss://api.mainnet-beta.solana.com; the real notification'slogsarray ran to about 90 lines from a multi-hop swap transaction and has been trimmed to 3 for this reference.