bloXroute Documentation
WebsiteBlogTwitterDiscord
  • Welcome to bloXroute
  • Introduction
    • Why Use bloXroute?
    • Products
    • Create An Account
    • Technical Support
  • SOLANA
    • Trader API
      • Introduction
        • Regions
        • Authorization
        • Rate Limits
        • Tip and Tipping Addresses
      • Quick Start
        • Transaction Submission
        • Front-Running Protection & Transaction Bundle
        • Go SDK
        • Python SDK
        • Typescript SDK
        • Rust SDK
      • API Endpoints
        • Core Endpoints
          • submit
          • submit-paladin
          • submit-batch
          • balance
          • rate-limit
          • transaction
          • priority-fee
          • GetPriorityFeeStream
          • GetBundleTipStream
          • submit-snipe
        • Pump.fun
          • quotes
          • swap
          • swap-sol
          • GetPumpFunNewTokensStream
          • GetPumpFunSwapsStream
          • GetPumpFunAMMSwapsStream
        • Raydium
          • quotes
          • pools
          • pool-reserves
          • swap
          • cpmm-swap
          • clmm-swap
          • route-swap
          • GetPoolReservesStream
          • GetSwapsStream
          • GetNewRaydiumPoolsStream
          • GetNewRaydiumPoolsByTransactionStream
        • Jupiter
          • quotes
          • swap
          • swap-instructions
          • route-swap
        • Openbook
          • markets
          • orderbooks/{market}
          • depth/{market}
          • tickers/{market}
          • open-orders/{market}
          • unsettled/{market}
          • place
          • replace
          • cancel
          • settle
          • GetOrderbooksStream
          • GetTickersStream
      • Best Performance for Landing Transactions
      • Support
        • API Health
        • Contact us
        • Suggestions
        • Wiki
          • Terms & Concepts
          • Resources
    • Optimized Feed Relay (OFR)
      • Transaction Streamer
      • Gateway and OFR Requirements
      • Gateway and OFR Setup
      • Gateway Startup Arguments
      • OFR performance
      • Logging
      • Submitting Transaction
      • Upgrading Gateway
      • Troubleshooting
  • BSC & ETH
    • EVM Blockchain Distribution Network (BDN)
      • How to Connect
      • The bloXroute Gateway
        • Local Gateway
          • Installation and Startup
            • Authentication & Certificates
            • Requirements
            • Supported Clients
            • GitHub repository option
            • Docker container option
            • Startup Script
            • Startup Arguments
          • General Connectivity Troubleshooting
          • Logging
          • Upgrading your Gateway
        • Add Your Gateway as a Trusted Peer to Your Execution Layer Client
        • Connecting Your Gateway with the Consensus Layer
      • IPs & Relays
        • Relays IPs
        • Private Relays
        • Cloud-API IPs
          • ⏩Reducing Latencies using the BDN
    • APIs
      • Authorization
      • Check Transaction Quota
      • Submit a Transaction
        • Raw Transaction Construction
        • Tx-Validation
        • Batch Transaction
      • Private Transactions
        • ETH Private Transactions
        • BSC Private Transactions
      • Transaction Bundles
        • Bundle Simulation
        • Bundle Validation
        • Bundle Submission
          • BSC Bundle Submission
            • List of BSC Validators
          • ETH Bundle Submission
          • Bundle Submission with Gateway
        • Bundle Tracking
          • BSC Bundle-Trace
          • ETH Bundle-Trace
          • ETH Bundle Inclusion Status
        • Bundle Refunds
          • Priority Fee Refund
          • Bundle Refund
          • Latest Bundle Refunds
      • Backrun Arbitrage
        • BackRunMe: Bundle Submission
          • BSC submit arbOnly
          • ETH submit arbOnly
            • blxr_info
            • ETH arbOnly Simulation
      • Token Launch Sniping
      • Other Utilities
        • List of bloXroute Builders
        • List of External Builders
        • Tx-Trace
        • Ping
    • Streams
      • Requirements
      • Subscription limits
      • Working With Streams
        • Creating a Subscription
          • Websocket
          • gRPC
        • Handling the Notification
          • Websocket
          • gRPC
        • Cancelling a Subscription
          • Websocket
          • gRPC
        • Local Node Validation
      • newTxs and pendingTxs
        • Filters
        • Raw TX Reconstruction
      • BackRunMe: arbOnlyMEV
        • ETH arbOnlyMEV
        • BSC arbOnlyMEV
      • transactionStatus
      • txReceipts
      • newBlocks
      • bdnBlocks
      • ethOnBlock
      • MEVBlockValue
      • MEVNextProposerInfo
    • Block Builders and Validators
      • Validator Gateway
      • MEV Relay (For Validators)
      • Block Submission
      • Proposer MEV-Protect
      • Compliance Lists
      • Preconfirmations
    • Protect RPCs
      • ETH Protect RPC
      • ETH Gas Protect RPC
      • BSC Protect RPC
      • SOL Protect RPC
  • Base Network
    • Submit Transactions
    • Streams
      • GetBdnBlockStream
  • TON NETWORK
    • TON Trader API
      • Quick Start
      • Fee Schedule
      • Connection
      • Submit Signed Transaction
  • Resources
    • BDN Explorer
    • Block Explorer
    • Guides
      • Algorithmic Trading
      • Setting Up a Local Gateway
      • Gateway as Web3 Bridge
    • Architecture
      • BDN Architecture
        • Network Components
        • Performance Techniques
          • Block Compression
          • Cut-through Routing
          • Optimized Topology
      • bloXroute Protocol
        • Versioning
        • Message Structure
        • Message Types
    • Contact Us
Powered by GitBook
On this page
  1. Resources
  2. Guides

Setting Up a Local Gateway

PreviousAlgorithmic TradingNextGateway as Web3 Bridge

Below are instructions for setting up the required bloXroute local gateway.

Requirements:

  1. The instructions below assume you already have a server, are running a node and that you are using Docker. In addition to using the docker start up command, you can set up a local gateway using the startup script provided .

  2. Please make sure you have downloaded the certificates available in the bloXroute account portal. Save the certificate and secret hash to a folder. For example, /usr/local/bloxroute-certificate

  3. You should generate a private and public key pair. (For detailed instructions on how to create a public and private key pair, go.)

Installation

To pull the latest gateway version, run the following command:

docker pull bloxroute/bloxroute-gateway-go:latest

Running your gateway

To run your gateway, copy the command below and modify it as needed. See the table below for additional information about various parameters and how you might need to change them. You will need the enode value and IP address of your blockchain node. The --eth-ws-uri argument is optional, however we do recommend using it.

docker run --name bxgateway-go -d \
-v /home/ubuntu/gateway_log:/app/bloxroute/logs \
-v /home/ubuntu/ssl:/app/bloxroute/ssl \
-p 1801:1801 -p 28333:28333 bloxroute/bloxroute-gateway-go:v2.123.1 \
--blockchain-network <Mainnet> \
--ws --port 1801 \
--enodes enode://<BLOCKCHAIN_NODE_PUBLIC_KEY>@<NODE_IP>:<NODE_PORT> \
--enr enr:<enr> \
--private-key <YOUR_PRIVATE_KEY> \
--eth-ws-uri ws://<ETH node IP address>:8546
docker run --name bxgateway-go -d \
-v <LOG_FILE_PATH>:/app/bloxroute/logs \
-v <SSL_CERT_PATH>:/app/bloxroute/ssl \
-p 1801:1801 -p 28333:28333 bloxroute/bloxroute-gateway-go \
--blockchain-network <BSC-Mainnet> \
--ws --port 1801 \
--enodes enode://<BLOCKCHAIN_NODE_PUBLIC_KEY>@<NODE_IP>:<NODE_PORT> \
--enr enr:<enr> \
--private-key <YOUR_PRIVATE_KEY> \
--eth-ws-uri ws://<ETH node IP address>:8546

Setting your gateway as a trusted peer

The bloXroute Gateway connects to the blockchain node as a peer. If the blockchain node runs out of peer slots, it will reject the Gateway connection with a "too many peers" error. To overcome this, add the Gateway as a “trusted peer.”

The below instructions are for adding a gateway as a trusted peer in Geth. Over 70% of the nodes in the Ethereum Mainnet use Geth. If your node runs a different client and you do not know how to change the commands below accordingly, please contact support.

  1. You will need to obtain the gateway enode. You can look up the enode from the Gateway log during the startup process by grep-ing for the word “enode”.

  2. Open the node’s console and add the Gateway as a trusted peer using command admin.addTrustedPeer(<gateway_enode>). Note that the IP address and port do not need to be included.

admin.addTrustedPeer("enode://GATEWAY_PUBLIC_KEY")
  1. Edit the geth config file and add the Gateway to TrustedNodes in the [Node.P2P] section. You can generate a config file that matches your current configuration by running geth dumpconfig. This step is required as admin.addTrustedPeer is not retained after a node restarts. If you do not change this configuration, you will need to add the gateway as a trusted peer every time you restart your node.

[Node.P2P]
...
TrustedNodes=["YOUR_ENODE"]

here
here