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
  • Quickstart
  • gRPC Endpoint
  • Authentication
  • Example: Test with grpcurl
  • GO Example: Listen for New Blocks on Base
  • Troubleshooting
  1. Base Network
  2. Streams

GetBdnBlockStream

PreviousStreamsNextTON Trader API

Last updated 1 month ago

The GetBdnBlockStream stream provides low-latency access to new blocks as they’re produced on the Base network. Note that there is a low chance that this stream may include blocks that will not be accepted on chain.

This is a real-time gRPC stream delivering full block headers and bodies (including transactions), intended for searchers, indexers, and other latency-sensitive applications.

This stream is available to Enterprise Elite and Ultra tier users.

Quickstart

Prerequisites

  • Go 1.24.1+

  • op-geth installed (pay attention to use it instread of go-ethereum)

  • gRPC installed (google.golang.org/grpc)

  • .proto file:

gRPC Endpoint

base.blxrbdn.com:443
  • No TLS required

  • Authorization required via authorization header

Authentication

Set your authorization header via environment variable:

export AUTH_HEADER="<your-auth-header>"

In gRPC, this will be passed as:

metadata.New(map[string]string{
  "authorization": os.Getenv("AUTH_HEADER"),
})

Example: Test with grpcurl

grpcurl -H "authorization: <AUTH_HEADER>" \
  -H "Content-Type: application/grpc" \
  -d '{}' \
  base.blxrbdn.com:443 \
  streamerapi.Api/GetBdnBlockStream

This will return raw stream data — you can pretty-print it with jq.

GO Example: Listen for New Blocks on Base

package main

import (
	"context"
	"fmt"
	"time"

	"github.com/bloXroute-Labs/base-streamer-client-go/provider"
	streamerapi "github.com/bloXroute-Labs/base-streamer-proto/streamer_api"
	"github.com/ethereum/go-ethereum/core/types"
	"github.com/ethereum/go-ethereum/rlp"
	"github.com/joho/godotenv"
)

func main() {
	_ = godotenv.Load()

	err := ListenForBdnBlocks(10)
	if err != nil {
		panic(err)
	}
}

func ListenForBdnBlocks(numberOfBlocks uint64) error {
	grpcClient, err := provider.NewGRPCClient()
	if err != nil {
		return err
	}
	blocksChan := make(chan *streamerapi.GetBdnBlockStreamResponse)
	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()

	stream, err := grpcClient.GetBdnBlockStream(ctx)
	if err != nil {
		return fmt.Errorf("failed to get stream with: %v", err)
	}
	stream.Into(blocksChan)

	fmt.Println("waiting on blocks channel")
	for range numberOfBlocks {
		bdnBlock, ok := <-blocksChan
		if !ok {
			// channel closed
			return fmt.Errorf("bdn blocks channel closed")
		}
		updateTime := time.Now()

		blockHeader := &types.Header{}
		err := rlp.DecodeBytes(bdnBlock.BlockHeader, blockHeader)
		if err != nil {
			return fmt.Errorf("failed to RLP decode block header with: %v", err)
		}

		blockBody := &types.Body{}
		err = rlp.DecodeBytes(bdnBlock.BlockBody, blockBody)
		if err != nil {
			return fmt.Errorf("failed to RLP decode block body with: %v", err)
		}

		fmt.Printf("bdn block: %v, %v txns at %v\n", blockHeader.Number.Uint64(), len(blockBody.Transactions), updateTime.UTC())
	}
	return nil
}

Sample output:

waiting on blocks channel  
new block: 12345678, 120 txns at 2025-03-25 12:45:01.234 UTC  
new block: 12345679, 98 txns at 2025-03-25 12:45:13.147 UTC  
...

Troubleshooting

Issue
Possible Cause

Stream closes unexpectedly

Expired token, gRPC connection limits, network/firewall issues

Unmarshal errors

Mismatched Go or op-geth dependency

No output

Ensure proper env variables and endpoint configuration

🔗 You can get the .proto file

🔗 You can access the Base streamer client

streamer_api.proto
here
here