Motiv
Build on X Layer

One-click Setup#

📋 Overview#

Quickly deploy an X Layer self-hosted RPC node with support for both geth and reth 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#

Download and Run Setup#

mkdir -p /data/xlayer-rpc && cd /data/xlayer-rpc
curl -fsSL https://raw.githubusercontent.com/okx/xlayer-toolkit/main/rpc-setup/one-click-setup.sh -o one-click-setup.sh
chmod +x one-click-setup.sh

Choose RPC Client Type#

You can specify the execution client type:

# Use geth (default)
./one-click-setup.sh

# Use reth
./one-click-setup.sh --rpc_type=reth

Interactive Setup#

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
  1. L1 RPC URL: Ethereum L1 RPC endpoint
  2. L1 Beacon URL: Ethereum L1 Beacon chain endpoint
  3. 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)

🚀 Running Multiple Instances#

You can run multiple RPC nodes on the same machine with different ports:

# First instance (mainnet-geth)
cd /data/xlayer-testnet-geth
./one-click-setup.sh --rpc_type=geth
# Configure: mainnet, ports 8545, 8546, etc.

# Second instance (mainnet-reth) - use different ports
cd /data/xlayer-testnet-reth
./one-click-setup.sh --rpc_type=reth
# Configure: mainnet, ports 8547, 8548, etc.

Each instance uses isolated container names and networks, so they won't conflict.

📊 Service Management#

# 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! 💪