Skip to content

[docs-agent] Add Solana blockSubscribe reference page - #1566

Open
alchemy-bot wants to merge 4 commits into
mainfrom
docs/solana-block-subscribe
Open

[docs-agent] Add Solana blockSubscribe reference page#1566
alchemy-bot wants to merge 4 commits into
mainfrom
docs/solana-block-subscribe

Conversation

@alchemy-bot

Copy link
Copy Markdown
Contributor

Summary

Adds a blockSubscribe reference page to the Solana Subscription API Endpoints section, modeled after the existing accountSubscribe / programSubscribe pages.

blockSubscribe is only exposed on Alchemy's Solana streaming endpoint (wss://solana-mainnet.streaming.alchemy.com), not on the standard wss://solana-mainnet.g.alchemy.com WebSocket endpoint. The page opens with a Warning callout making this explicit, plus a second callout carrying over Solana's upstream "unstable method" warning. Method behavior was live-verified against docs-demo on the streaming endpoint before writing:

  • Subscribe returned a real numeric subscription id.
  • Real blockNotification payloads captured with commitment: confirmed, encoding: base64, transactionDetails: signatures, showRewards: false, maxSupportedTransactionVersion: 0 — used as the example values in the page.
  • Confirmed that omitting maxSupportedTransactionVersion returns block: null with err: { UnsupportedTransactionVersion: 0 } — surfaced as an Info callout after the Result section.
  • Confirmed that the standard g.alchemy.com WebSocket endpoint returns -32601 Method 'blockSubscribe' not found for the same request.

Changes

  • content/api-reference/websockets/solana-subscription-api-endpoints/block-subscribe.mdx — new page.
  • content/api-reference/websockets/solana-subscription-api-endpoints/solana-subscription-api-endpoints.mdx — added a row to the Cluster table with an inline note that the method requires the streaming endpoint.
  • content/docs.yml — added the nav entry under Solana Subscription API Endpoints, immediately after slotSubscribe.

Notes

  • @solana/web3.js does not wrap blockSubscribe, so the JS example uses a raw ws WebSocket instead of a Connection.on* helper.
  • CU cost row on the pricing page was intentionally not touched — that requires topconfig.yml from OMGWINNING/chain-config, which docs-agent cannot read.
  • Live-verified blockSubscribe also works on wss://solana-devnet.streaming.alchemy.com/v2/<key>. The current callout only mentions the mainnet streaming endpoint per the requester's explicit ask; happy to add a devnet line if reviewers want it.

Linear

DOCS-205 — https://linear.app/alchemyapi/issue/DOCS-205/add-solana-blocksubscribe-page-streaming-endpoint

Requested by

@clinder777 (via Slack thread)

Adds `blockSubscribe` under Solana Subscription API Endpoints. Method is only exposed on Alchemy's Solana streaming endpoint (`wss://solana-mainnet.streaming.alchemy.com`), not on the regular `solana-mainnet.g.alchemy.com` WebSocket endpoint — flagged with a warning callout at the top of the page. Live-verified against `docs-demo`.

Refs DOCS-205

Requested-by: @clinder777
@alchemy-bot
alchemy-bot requested a review from a team as a code owner August 25, 2026 19:52
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

🔗 Preview Mode

Name Status Preview Updated (UTC)
Alchemy Docs ✅ Ready 🔗 Visit Preview Aug 26, 2026, 5:59 PM

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a5f5834583

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

* `config` (optional): `object` - Configuration object containing:

* `commitment`: `string` - The commitment level. One of `confirmed`, `finalized`. Defaults to `finalized`. `processed` is not supported for this subscription.
* `encoding`: `string` - Encoding for account and instruction data. One of `base58`, `base64`, `base64+zstd`, `jsonParsed`. Defaults to `base64`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge List only encodings accepted by blockSubscribe

When a reader selects the documented base64+zstd value, the subscription request is rejected because blockSubscribe uses transaction encodings, which do not support the account-data-only base64+zstd format. The accepted list should include json instead, alongside base58, base64, and jsonParsed.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Live-verified against wss://solana-mainnet.streaming.alchemy.com/v2/docs-demo: sending encoding: base64+zstd returns -32602 unknown variant \base64+zstd`, expected one of `binary`, `base64`, `base58`, `json`, `jsonParsed``.

Fixed in 114970f8 — updated the encoding list to json, jsonParsed, base58, base64 (matching the server's accepted set for transaction encodings), changed the default to json, and added a short note that base64+zstd is not supported by blockSubscribe (it's an account-data encoding only). Not adding binary since it's the deprecated alias for base58.

alchemy-bot and others added 3 commits August 25, 2026 20:08
`base64+zstd` is not a valid encoding for `blockSubscribe` — it's an account-data encoding only. Live-verified against `wss://solana-mainnet.streaming.alchemy.com/v2/docs-demo`: sending `encoding: base64+zstd` returns `-32602 unknown variant \`base64+zstd\`, expected one of \`binary\`, \`base64\`, \`base58\`, \`json\`, \`jsonParsed\``.

Updated the encoding list on `block-subscribe.mdx` to `json`, `jsonParsed`, `base58`, `base64` (Solana's default for transaction encoding is `json`), and added a short note that `base64+zstd` is not supported here.

Addresses codex review comment on PR #1566.

Refs DOCS-205

Requested-by: @clinder777
Per requester feedback, remove the Solana upstream 'unstable method' warning callout from the top of the page. The streaming-endpoint callout stays.

Refs DOCS-205

Requested-by: @clinder777
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants