How to Connect to the Base Network's Sequencer: Configuration Guide

To connect to the Base network's sequencer, configure the OP_SEQUENCER_HTTP environment variable in your .env.mainnet or .env.sepolia file before starting the Docker compose stack, which configures the OP‑Node container to route all sequencer RPC calls to the authoritative endpoint.

The Base L2 node (base/node) connects to the sequencer through HTTP endpoints defined in environment configuration files. When you launch the Docker compose stack, the op-node-entrypoint script reads these variables to establish the connection required for block proposals, transaction posting, and chain state synchronization.

Default Sequencer Endpoints and Configuration

The Base repository provides network-specific environment files that define the default sequencer URLs. These files are located in the repository root and are selected via the NETWORK_ENV variable when starting the stack.

Mainnet Configuration

For Base mainnet, the default sequencer endpoint is https://mainnet-sequencer.base.org. This value is defined in the .env.mainnet file at lines 12-14, which sets the OP_SEQUENCER_HTTP variable. The README.md documents this configuration at line 1007, confirming that this URL connects to the authoritative sequencer nodes responsible for ordering transactions.

Sepolia Testnet Configuration

For Base Sepolia (testnet), the endpoint is https://sepolia-sequencer.base.org, defined in .env.sepolia. This allows developers to connect to the testnet sequencer for staging and development purposes without interacting with mainnet infrastructure.

Architectural Flow for Sequencer Connection

The connection process follows a specific initialization sequence orchestrated by Docker compose:

  1. Docker compose reads the NETWORK_ENV variable to select either .env.mainnet or .env.sepolia.
  2. The environment file supplies OP_SEQUENCER_HTTP and client‑specific variants such as RETH_SEQUENCER_HTTP and OP_GETH_SEQUENCER_HTTP.
  3. The op‑node‑entrypoint script consumes these variables to configure the Optimism OP‑Stack components inside the container.
  4. All RPC calls to the sequencer are routed to the specified HTTP endpoint, which forwards them to the authoritative Base sequencer nodes.

Querying the Sequencer RPC

Once your node is configured, you can interact directly with the sequencer endpoint using standard HTTP requests.

Health Check via cURL

Verify sequencer availability using the health endpoint:


# Mainnet health check

curl -s https://mainnet-sequencer.base.org/health | jq .

# Sepolia health check  

curl -s https://sepolia-sequencer.base.org/health | jq .

JavaScript RPC Client Example

Fetch the latest block from the sequencer using Node.js:

const fetch = require('node-fetch');

async function getLatestBlock() {
  const sequencer = process.env.OP_SEQUENCER_HTTP || 'https://mainnet-sequencer.base.org';
  const response = await fetch(sequencer, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      jsonrpc: '2.0',
      method: 'eth_getBlockByNumber',
      params: ['latest', false],
      id: 1,
    }),
  });
  const data = await response.json();
  console.log('Latest block:', data.result);
}

getLatestBlock().catch(console.error);

Set OP_SEQUENCER_HTTP in your shell or .env file to target a specific network.

Runtime Override Options

You can override the sequencer URL without modifying configuration files by passing the environment variable directly to Docker compose:


# Use a custom sequencer endpoint for a one-off run

OP_SEQUENCER_HTTP=https://custom-sequencer.mydomain.org \
NETWORK_ENV=.env.mainnet CLIENT=reth docker compose up --build

Key Configuration Files

Understanding these source files helps troubleshoot connection issues:

  • .env.mainnet – Defines mainnet variables including OP_SEQUENCER_HTTP (lines 12-14)
  • .env.sepolia – Defines Sepolia testnet variables and its sequencer URL
  • docker-compose.yml – Orchestrates containers and injects the chosen .env file
  • op-node-entrypoint – Startup script that reads environment variables and launches the OP‑Node
  • README.md – Documents the default sequencer endpoint and startup procedures (line 1007)

Summary

  • Set OP_SEQUENCER_HTTP in .env.mainnet (https://mainnet-sequencer.base.org) or .env.sepolia (https://sepolia-sequencer.base.org) to define your target sequencer.
  • The op-node-entrypoint script processes these variables during container startup according to the configuration in docker-compose.yml.
  • Override defaults at runtime by exporting OP_SEQUENCER_HTTP before executing docker compose up.
  • Client‑specific variants like RETH_SEQUENCER_HTTP and OP_GETH_SEQUENCER_HTTP allow fine‑grained control per execution client.

Frequently Asked Questions

What is the default Base sequencer URL?

The default Base mainnet sequencer URL is https://mainnet-sequencer.base.org, defined in .env.mainnet. For the Sepolia testnet, the URL is https://sepolia-sequencer.base.org as specified in .env.sepolia. These endpoints are hardcoded in the environment files and loaded by the op-node-entrypoint script during startup.

Can I use a custom sequencer endpoint?

Yes, override the default by setting OP_SEQUENCER_HTTP to your custom URL either in the .env file or as an environment variable passed to Docker compose. The Base node will route all sequencer RPC calls to your specified endpoint instead of the default mainnet-sequencer.base.org or sepolia-sequencer.base.org addresses.

How do I verify my node is connected to the sequencer?

Query the sequencer's health endpoint using curl https://mainnet-sequencer.base.org/health or check your node's logs for successful RPC connections to the configured OP_SEQUENCER_HTTP URL. The op-node-entrypoint logs will display the configured endpoint during initialization, confirming which sequencer the container is targeting.

What is the difference between OP_SEQUENCER_HTTP and client-specific variables?

OP_SEQUENCER_HTTP is the primary variable used by the OP‑Node container, while client‑specific variants like RETH_SEQUENCER_HTTP and OP_GETH_SEQUENCER_HTTP allow different execution clients to use distinct sequencer endpoints. If the client‑specific variable is set, it typically takes precedence for that particular component, enabling multi-client deployments with different routing requirements.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →