How to Subscribe to Stream
Learn how to direct real-time access to transaction and block streams sourced from the BDN, bypassing RPC node-level execution and processing entirely.
Code Sample
wss://go.getblock.asia/<ACCESS_TOKEN>//npm install ws dotenv
import WebSocket from "ws";
import "dotenv/config";
const ws = new WebSocket(
`wss://go.getblock.io/${process.env.ACCESS_TOKEN}`,
);
ws.on("open", () => {
console.log("Connected to BSC streams");
});
ws.on("error", (err) => {
console.error("WebSocket error:", err.message);
});> [email protected] start
> node index.js
Connected to BSC streamsHow to Subscribe to Streams
Stream
Description
Use Case
1. Block Streams (bdnBlocks)
Field
Description
2. Transaction Streams (newTxs / pendingTxs)
Field
Description
Filter
Type
Description
3. Transaction Receipts (txReceipts)
Field
Description
Unsubscribing
Best Practices
Rate Limits
Tier
Concurrent Subscriptions
Message Rate
Troubleshooting
Problem
Solution
Next Step
Last updated
Was this helpful?