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
  • Get authorization header
  • Installation
  • Startup
  • Verify the Gateway and OFR is running correctly
  • Sample program to receive shreds through OFR
  • Firedancer Compatibility
  1. SOLANA
  2. Optimized Feed Relay (OFR)

Gateway and OFR Setup

Solana Gateway and OFR Setup

PreviousGateway and OFR RequirementsNextGateway Startup Arguments

Last updated 6 days ago

Get authorization header

In order to receive shreds through the Optimized Feed Relay (OFR) and connect to bloXroute's OFR Relay, you must use a OFR Gateway. To do this, you need to Create An Account and get Authorization.

Installation

docker pull bloxroute/solana-gateway:latest

Startup

docker run --name bxgateway-solana -d \
  --network=host bloxroute/solana-gateway:latest \
  -auth-header=[AuthHeader] \
  -network-interface=eno1 \
  -tvu-port=8001 \
  -ofr-host=ny.solana-v2.blxrbdn.com \
  -port=18888

The values used for network-interface argument and tvu-port argument could vary based on the hosting machine. Please follow the section to determine the proper values.

Verify the Gateway and OFR is running correctly

To verify that your Gateway is running correctly and shreds are being received through OFR, monitor the stdout or logfile logs. Every minute it should report the amount of shreds it sends and receives.

The output should be similar to the following:

time="2025-01-06T10:56:00.000160" level="info" msg="stats: total shreds by source: [(10.142.0.47:0, 449771), (185.26.9.3:8381, 434018)] unseen shreds by source: [(185.26.9.3:8381, 385382), (10.142.0.47:0, 70913)]. Seen 84.46% of shreds first from BDN"

Note: The Gateway does not need to be restarted if your Solana node restarts.

Sample program to receive shreds through OFR

Traders with Enterprise Elite plan or above can start a ofr gateway to run without a local Solana node, with gateway startup arguments like -no-validator -broadcast-addresses 127.0.0.1:1820. Custom programs can then be deployed to listen at the addresses to receive and consume shreds from the OFR Relay.

For example, running a custom UDP server with code below to receive shreds from gateway:

package main

import (
	"fmt"
	"net"
)

func main() {
	conn, err := net.ListenUDP("udp", &net.UDPAddr{
		IP:   net.ParseIP("0.0.0.0"),
		Port: 1820,
	})
	if err != nil {
		fmt.Printf("Error starting UDP server: %v\n", err)
		return
	}
	defer conn.Close()

	fmt.Printf("UDP server listening\n")

	buffer := make([]byte, 1228) // 1228 - udp shred size

	// Continuously read data
	for {
		n, addr, err := conn.ReadFromUDP(buffer)
		if err != nil {
			fmt.Printf("Error reading from UDP connection: %v\n", err)
			continue
		}
		
		// or process it generally
		fmt.Printf("Received message from %s: %s\n", addr.String(), string(buffer[:n]))
	}
}

Firedancer Compatibility

OFR provides partial compatibility with Firedancer specifically due to its XDP-based networking architecture. Currently, integrating with Firedancer requires an Enterprise Elite subscription tier or higher. The following outlines the configuration process for deploying an OFR Gateway with Firedancer:

docker run --name bxgateway-solana -d \
  --network=host bloxroute/solana-gateway:latest \
  -auth-header=[AuthHeader] \
  -network-interface=eno1 \
  -tvu-port=8001 \
  -ofr-host=ny.solana-v2.blxrbdn.com \
  -port=18888 \
  -no-validator \ # disable validator
  -broadcast-addresses 127.0.0.1:8001 # broadcast shreds to tvu-port on lo
  
# This configuration enables direct transmission of shreds to the loopback (`lo`) 
# interface, where they are subsequently processed by the XDP subsystem and 
# dedicated shred tiles.
gateway arguments