Bloxroute Integration

Learn all about Blockdaemon and Bloxroute partnership to enable faster transaction broadcasting and mempool streaming.

Blockdaemon has partnered with Bloxroute to enable faster transaction broadcasting and mempool streaming for Ethereum. Our API Suite customers can now view the entire lifecycle of their transactions from creation to sending to mempool to confirmation.

Transactions are broadcast to Blockdaemons node network alongside Bloxroutes BDN, allowing for 400-1000ms faster broadcasting.

Mempool transactions can be streamed over WebSockets, giving you 50-400ms faster network visibility.

Follow these steps to integrate with Bloxroute easily:

  1. Choose an appropriate fee: Blockdaemon offers an API to make fee estimation easier. See: Gas Estimation Endpoint
    curl -L 'https://<url>/v1/ethereum/mainnet/tx/estimate_fee' \
    -H 'Authorization: Bearer <token>'
    >>>
    {
        "most_recent_block": 16924951,
        "estimated_fees": {
            "fast": {
                "max_priority_fee": 1500000000,
                "max_total_fee": 35752959005
            },
            "medium": {
                "max_priority_fee": 1200000000,
                "max_total_fee": 31647074672
            },
            "slow": {
                "max_priority_fee": 1000000000,
                "max_total_fee": 29217492196
            }
        }
    }
    
  2. Create an unsigned transaction.

📘

Info!

Our SDK’s make TX creation even easier: Visit here

  1. Sign the Transaction with your private key: Our API does not act as a custodian and does not store or receive private keys. This must be done offline by the user.
  2. Send the signed transaction: You can do this in two ways:
    1. Universal REST API - Leverage our universal API to simply send a transaction.
      curl -L 'https://<url>/v1/ethereum/mainnet/tx/send' \
      -H 'Authorization: Bearer <token>' \
      -H 'Content-Type: application/json' \
      -d '{
          "tx": "e81b850548a3303564948aff5ca996f77487a4f04f1ce905bf3d27455580860b392151080080808080"
      }'
      >>>
      {
      "id": "9c8ac345b443dd10a418ea0beaa320ef233dbae5590be2a11ac090e0e9839c1c"
      }
      
    2. Submit directly to nodes.
      curl -L 'https://<url>/ethereum/mainnet' \
      -H 'Authorization: Bearer <token>' \
      -H 'Content-Type: application/json' \
      -d '{
          "jsonrpc": "2.0",
          "method": "eth_sendRawTransaction",
          "params": ["0x1088ad64585a43690d898584471eaa096236399993a41612168e1bd86e69ae4e"],
          "id": 83
      }'
      

Both methods publish the transaction the Blockdaemons node Network and Bloxroutes BDN enabling faster TX visibility.

  1. Stream mempool transactions: To watch as your transaction enters mempool.
    wscat -c wss://<url>/v1/ethereum/mainnet/mempool/websocket -H 'Authorization: Bearer <token>'
    >>>
    {
        "id": 2,
        "method": "subscribe",
        "params": {
            "subscription": "e5801e72-8514-4522-b389-47747d7abd10",
            "result": {
                "txHash": "0x07143548492922962a32f57a89d7b99608d224acb3d02ada7f8c043a6961e433",
                "txContents": {
                    "from": "0x6099d579200f3565fce5e4686e7e26b02061b3e4",
                    "gas": "0x5208",
                    "gasPrice": "0x74f95fa00",
                    "hash": "0x07143548492922962a32f57a89d7b99608d224acb3d02ada7f8c043a6961e433",
                    "input": "0x",
                    "nonce": "0x0",
                    "r": "0x30e8ebe915c1c41d48c60b02cd4cd0a6a8f67037bc37ef0b3ffdf9553718ed7",
                    "s": "0x1ec0bd951cfa812cf69baeed356382a4cfb997db7e2c5c40aea6bb447cdac73b",
                    "to": "0x02614efe24fe5c2e1e2bc94b77ef5b38610c0672",
                    "type": "0x0",
                    "v": "0x26",
                    "value": "0x212907c058b3000"
                }
            }
        }
    }
    

🚧

Attention!

Due to the speed at which transactions enter mempool, if your connection is too slow to keep up with the message pace and a back buffer of 128 messages is created you will be disconnected.

  1. Stream confirmed transactions: via Blockdaemon's Universal API:
    wscat -c wss://<url>/v1/ethereum/mainnet/websocket -H 'Authorization: Bearer <token>'
    >>> (Subscribe Message)
    {
        "id": 1,
        "method": "ubiquity.subscribe",
        "params": {
            "channel": "ubiquity.txs"
        }
    }
    >>>
    {
        "method": "ubiquity.subscription",
        "params": {
            "items": [
                {
                    "subID": 1,
                    "channel": "ubiquity.txs",
                    "revert": false,
                    "content": {
                        "id": "0xc372662a07002b631ea2346116baacb3fc050339a9a0dee7f469caba0b1dc717",
                        "block_id": "0x6a496c8cc4bdecdb524d78dc28e32d46e3233b4b071d30fedfa709399bce908e",
                        "date": 1679998295,
                        "status": "completed",
                        "num_events": 3,
                        "meta": null,
                        "block_number": 16925160,
                        "confirmations": 1,
                        "events": [
                            {
                                "id": "0xc372662a07002b631ea2346116baacb3fc050339a9a0dee7f469caba0b1dc717-fee",
                                "transaction_id": "0xc372662a07002b631ea2346116baacb3fc050339a9a0dee7f469caba0b1dc717",
                                "type": "fee",
                                "denomination": "ETH",
                                "source": "0x76F36d497b51e48A288f03b4C1d7461e92247d5e",
                                "meta": {
                                    "base_fee": 21620590347,
                                    "fee_burned": 2265427077149007,
                                    "gas_limit": 110346,
                                    "gas_price": 21620590347,
                                    "gas_used": 104781
                                },
                                "date": 1679998295,
                                "amount": 2265427077149007,
                                "decimals": 18
                            },
                            {
                                "id": "0xc372662a07002b631ea2346116baacb3fc050339a9a0dee7f469caba0b1dc717-0",
                                "transaction_id": "0xc372662a07002b631ea2346116baacb3fc050339a9a0dee7f469caba0b1dc717",
                                "type": "transfer",
                                "denomination": "ethereum/contract/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2/erc-20",
                                "source": "0x4870525EAE23FceB31DF613d179ef6275e1B93a9",
                                "destination": "0x74C99F3f5331676f6AEc2756e1F39b4FC029a83E",
                                "meta": {
                                    "contract": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
                                    "type": "ERC-20"
                                },
                                "date": 1679998295,
                                "amount": 265647827737029678,
                                "decimals": 18
                            },
                            {
                                "id": "0xc372662a07002b631ea2346116baacb3fc050339a9a0dee7f469caba0b1dc717-1",
                                "transaction_id": "0xc372662a07002b631ea2346116baacb3fc050339a9a0dee7f469caba0b1dc717",
                                "type": "transfer",
                                "denomination": "ethereum/contract/0xdac17f958d2ee523a2206206994597c13d831ec7/erc-20",
                                "source": "0x74C99F3f5331676f6AEc2756e1F39b4FC029a83E",
                                "destination": "0x4870525EAE23FceB31DF613d179ef6275e1B93a9",
                                "meta": {
                                    "contract": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
                                    "type": "ERC-20"
                                },
                                "date": 1679998295,
                                "amount": 453434504,
                                "decimals": 6
                            }
                        ]
                    }
                }
                ....
            ]
        }
    }
    

👋 Need Help?

Contact us through email or our support page for any issues, bugs, or assistance you may need.