Solana
Solana
Solana
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
logsSubscribe opens a Solana PubSub subscription that pushes the log lines emitted by transactions as they are processed on the network. Each notification carries the transaction signature, any error, and the array of program log messages — the same Program log: output a program writes while it runs on this SOL-fee-paid chain. You can take every transaction's logs or narrow to those that mention one account or program. The matching JSON-RPC endpoint is https://solana.therpc.io/YOUR_API_KEY, and you stop the stream by passing the returned subscription id to logsUnsubscribe.
{ mentions: [pubkey] } — for instance a Raydium AMM or a token mint.Program log: lines that programs emit, surfacing swaps, mints, or stake events as they happen.| # | Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
| 1 | filter | object | Ja | "all" | "allWithVotes" | { mentions: [pubkey] } (exactly one pubkey). |
| 2 | config | object | Nein | Options: commitment. |
| Typ | Beschreibung |
|---|---|
| integer | A numeric subscription id. logsNotification pushes { signature, err, logs: [...] }. |
| Code | Meldung | Ursache |
|---|---|---|
-32602 | Invalid params | A param is missing, of the wrong type, or malformed (e.g. a non-base58 pubkey or a bad config field). |
-32603 | Internal error | The node hit an internal error serving the request — retry, and reduce the requested range/encoding if it persists. |
mentions filter takes exactly one pubkey inside the array — Solana rejects a list of several addresses, so open one subscription per address you want to follow."all" filter is extremely high volume on a chain producing slots every ~400ms — prefer a mentions filter to keep the stream manageable, and call logsUnsubscribe with the subscription id when you are finished.