pendingTxs - Local Node Validation

To achieve maximum performance when using the pendingTxs stream, bloXroute Gateways can leverage local Ethereum node validation. This enhancement applies only to the pendingTxs stream, not to newTxs.

How It Works

If your Gateway is connected to an Ethereum (or EVM-compatible) node that publishes WebSocket feeds, it can subscribe to:

  • newPendingTransactions

  • newHeads

This allows the Gateway to verify transactions locally and optimize performance.

If the node does not expose these feeds, the Gateway will still function and stream newBlocks and pendingTxs, but latency may increase.

How to Enable WebSocket Feeds

Step 1: Start your Ethereum node with WebSocket enabled

--ws \
--ws.addr <ETH_NODE_IP> \
--ws.port 8546 \
--ws.api eth

Replace <ETH_NODE_IP> with the actual IP of your Ethereum node.

If your Gateway and node are on the same machine, use:

--ws.addr 127.0.0.1

Step 2: Start the Gateway with WebSocket URI Add the following to your Gateway startup command:

Use the same IP and port as defined above. For local setups, use: --eth-ws-uri ws://127.0.0.1:8546

By enabling this setup, you ensure pendingTxs are verified directly via your node, improving stream quality and reducing false positives.

Last updated