How to Get an Optimism RPC Endpoint

Optimism (OP Mainnet) is a leading Ethereum L2 and the foundation of the Superchain ecosystem. With sub-dollar transaction costs and full EVM compatibility, it hosts major protocols like Velodrome, Synthetix, and Aave. Here's how to get a reliable OP Mainnet RPC endpoint.

Features

  • Archive data access (all plans)
  • Trace & Debug methods (Starter+)
  • WebSocket support
  • Multi-region (Frankfurt, New York, Singapore)
  • Dedicated Nodes available

Step-by-Step: Get Your Optimism RPC Endpoint

  1. Create a GetBlock Account

    Go to GetBlock Dashboard and sign up. You can register with email or via Google/GitHub OAuth.

  2. Create an Optimism Endpoint

    Once logged in:

    1. Click "Shared Nodes" in the left sidebar
    2. Click "Create New Endpoint" or the "+" button
    1. Select:

      • Protocol: Optimism
      • Network: Mainnet or Sepolia
      • API Interface: JSON-RPC or Websocket or GraphQL
      • Region: Frankfurt (EU)
    1. Click "Create": Your endpoint URL will be generated immediately.
  3. Copy Your Endpoint URL

    Your endpoint URL looks like this:

    bashhttps://shared.<region>.getblock.io/<ACCESS-TOKEN>/

    <region> is eu-central-1 (Frankfurt), us-east-1 (New York), or ap-southeast-1 (Singapore) — whichever you picked in step 2.

    The long string after the host is your access token — keep it private.

  4. Test the Connection

    bashcurl -X POST https://shared.eu-central-1.getblock.io/<YOUR-ACCESS-TOKEN>/ \
      -H "Content-Type: application/json" \
      -d '{
      "jsonrpc":"2.0",
      "method":"eth_chainId",
      "params":[],
      "id":1
      }'
    
    bash{
       "jsonrpc":"2.0",
        "id":1,
        "result": "0xa"
     }

Code Sample

javascriptimport { JsonRpcProvider } from "ethers";
const provider = new JsonRpcProvider("https://shared.eu-central-1.getblock.io/<YOUR-ACCESS-TOKEN>/");
console.log("Block:", await provider.getBlockNumber());
typescriptimport { createPublicClient, http } from "viem";
import { optimism } from "viem/chains";
const client = createPublicClient({
  chain: optimism,
  transport: http("https://shared.eu-central-1.getblock.io/<YOUR-ACCESS-TOKEN>/"),
});

What's Next?

Need Superchain infrastructure? Contact us.