Тема
Build on X Layer

One-click Setup#

📋 Overview#

Quickly deploy an X Layer self-hosted RPC node with support for both reth and geth execution clients.

💻 System Requirements#

  • OS: Linux (Ubuntu 20.04+ recommended)
  • Memory: 8GB minimum, 16GB+ recommended
  • Storage: 200GB SSD minimum, 500GB+ recommended
  • Docker: Docker 20.10+ and Docker Compose 2.0+

⚡ Quick Start#

Fully Automatic Setup (Recommended)#

Run the following command — a mainnet reth node with snapshot and default ports will be deployed automatically after a 5-second countdown, no input required:

Bash
curl -sSf https://raw.githubusercontent.com/okx/xlayer-toolkit/main/rpc-setup/one-click-setup.sh | bash

This is equivalent to: mainnet + reth + snapshot + all default ports.

Custom Setup#

Press n during the 5-second countdown to enter interactive mode, where you can customize network, client, ports, and more.

You can also specify the execution client type:

Bash
# Use geth
curl -sSf https://raw.githubusercontent.com/okx/xlayer-toolkit/main/rpc-setup/one-click-setup.sh | bash -s -- --rpc_type=geth

Interactive Prompts#

In custom mode, the script will prompt you for:

  1. Network type: testnet or mainnet (default: mainnet)
  2. Sync mode: genesis or snapshot (default: snapshot)
    • Snapshot: Fast sync using pre-built snapshots (recommended)
    • Genesis: Sync from genesis block
  3. L1 RPC URL: Ethereum L1 RPC endpoint (optional)
  4. L1 Beacon URL: Ethereum L1 Beacon chain endpoint (optional)
  5. Ports (optional, with defaults):
    • RPC port (default: 8545)
    • WebSocket port (default: 8546)
    • Engine API port (default: 8552)
    • Node RPC port (default: 9545)
    • P2P ports (default: 30303, 9223)
  6. Flashblocks: Enable/disable MEV flashblocks service (default: disabled)
    • If enabled, provide a Flashblocks WebSocket URL (default: wss://xlayerws.okx.com/flashblocks)

Sync Mode Availability#

Not all sync modes are available for every client-network combination:

ClientNetworkGenesisSnapshot
rethmainnet
gethmainnet
rethtestnet
gethtestnet

📊 Service Management#

Bash
# Check service status
make status

# Stop services (preserves data)
make stop

# Stop specific instance
make stop TARGET=mainnet-geth
make stop TARGET=mainnet-reth

# Restart services
make run

# View logs
docker compose logs -f

📡 Service Ports#

ServiceDefault PortProtocolPurpose
RPC API8545HTTPJSON-RPC API
WebSocket8546WebSocketWebSocket API
Engine API8552HTTPEngine API
Op-Node RPC9545HTTPConsensus layer API
Execution P2P30303TCP/UDPP2P network
Op-Node P2P9223TCP/UDPP2P network

All ports are configurable during setup.

🔗 Access Your RPC Node#

After setup, your RPC node will be available at:

  • HTTP RPC: http://localhost:<RPC_PORT>
  • WebSocket: ws://localhost:<WS_PORT>
  • Op-Node API: http://localhost:<NODE_RPC_PORT>

Run make status to see your configured ports.

Thank you for building with X Layer! 💪