Steem WebSocket API Bridge – Real-Time Blockchain Data for DeveloperssteemCreated with Sketch.

in Steem Dev19 hours ago

image.png

Hi there, a few weeks ago, while updating the UI and enhancements of Steemblocks, I faced an issue with API calls. Previously, I used HTTP API calls for the steemblocks, but due to live data, Steemblocks was uing thousands call in every minute which was really harmful for the system.

As I don't provide RPC node, so I came up with a simple solution, which is Steem WebSocket API Bridge for our Steemblocks.

Therefore, here are the details to introduce the Steem WebSocket API Bridge, a high-performance, real-time WebSocket server that connects developers directly to the Steem blockchain. Designed for speed, reliability, and scalability, it brings instant access to block data, operations, transactions, witnesses, etc for your apps. You can customise the API methods according to your needs.


🔹 What It Does

The Steem WebSocket API Bridge acts as a live data hub between your applications and the Steem blockchain. Instead of repeatedly querying nodes (which can be slow and unreliable), this bridge:

  • Connects to multiple Steem nodes for failover and redundancy.
  • Maintains real-time WebSocket subscriptions for block updates, block headers, operations, witnesses, and global blockchain properties. (I used these methods for SteemBlocks)
  • Implements a smart caching system to reduce API calls and ensure fast responses.
  • Handles high-frequency requests with request queues and rate-limiting.
  • Monitors node health continuously and automatically switches to the most responsive node in case of failures.
  • Broadcasts updates only to subscribed clients, improving efficiency for large apps.

In short, it saves API calls, reduces latency, and provides reliable, real-time blockchain data to developers and apps.


🔹 Benefits

  1. Real-Time Data: Instantly receive updates for blocks, operations, transactions, and witness changes.
  2. High Availability: Automatic node failover ensures your app stays connected even if a node goes down.
  3. Efficient Performance: Multi-layer caching and request queueing prevent unnecessary load on the network.
  4. Developer-Friendly: Simple subscription methods let developers choose exactly the data they need.
  5. Rate-Limited but Flexible: Supports up to 2,000 messages per minute per client, suitable for high-frequency trading, dashboards, and analytics.
  6. Health Monitoring: Endpoints like /health and /status let you easily monitor server performance and uptime.

🔹 Supported API Methods

Data Queries (Request/Response)

  • get_dynamic_global_properties – Get the latest blockchain statistics.
  • get_block_header – Fetch a specific block header by number.
  • get_block – Fetch a full block and its transactions.
  • get_ops_in_block – Retrieve all operations in a given block.
  • get_active_witnesses – List currently active witnesses.
  • get_transaction – Get details for a specific transaction by ID.

Subscriptions (Real-Time Updates)

  • subscribe_global_properties / unsubscribe_global_properties – Receive live blockchain stats.
  • subscribe_blocks / unsubscribe_blocks – Get full block data as they are produced.
  • subscribe_block_headers / unsubscribe_block_headers – Receive new block headers.
  • subscribe_operations / unsubscribe_operations – Track all operations in real time.
  • subscribe_witnesses / unsubscribe_witnesses – Monitor changes in active witnesses.

🔹 How It Works

  1. The server connects to multiple Steem nodes for redundancy.
  2. Clients connect via WebSocket (or HTTP for health/status).
  3. Requests are queued and processed efficiently.
  4. Data is cached intelligently to reduce repeated API calls.
  5. Subscribers receive instant updates whenever relevant blockchain events occur.
  6. Node health is monitored, and slow or failed nodes are automatically replaced with healthier alternatives.

🔹 Endpoints

  • WebSocket: wss://dhakawitness.com (production) or ws://localhost:8080 (local testing)
  • Health Check: /health
  • Status Endpoint: /status

🔹 Why It’s Useful

Whether you’re building a block explorer, analytics dashboard, or community app, this WebSocket bridge:

  • Reduces latency and improves user experience.
  • Saves server resources by caching and batching requests.
  • Keeps your app resilient with automatic node failover.
  • Enables high-frequency apps to scale without overloading the blockchain network.

The Steem WebSocket API Bridge is now live at dhakawitness.com, providing developers with the fastest and most reliable access to Steem blockchain data.

Thanks for supporting us.
@dhaka.witness

Seed Nodes:
seed.dhakawitness.com
seed2.dhakawitness.com
witness node: @dhaka.witness (Rank 24)
WebSocket: https://dhakawitness.com/

SteemStats: A powerful multifunctional Discord bot
https://discord.com/oauth2/authorize?client_id=1276922336842612777

Steem Burn Pool: (https://burn.steemblocks.com/) is Currently Under Construction & will be released soon.

Also, various tools and open-source work:

Steem Websocket Bridge
Witness Missed Block Alert tool and some more small tools you might find in our GitHub