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:
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:
# 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:
- Network type:
testnetormainnet(default: mainnet) - Sync mode:
genesisorsnapshot(default: snapshot)- Snapshot: Fast sync using pre-built snapshots (recommended)
- Genesis: Sync from genesis block
- L1 RPC URL: Ethereum L1 RPC endpoint (optional)
- L1 Beacon URL: Ethereum L1 Beacon chain endpoint (optional)
- 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)
- Flashblocks: Enable/disable MEV flashblocks service (default: disabled)
- If enabled, provide a Flashblocks WebSocket URL (default:
wss://xlayerws.okx.com/flashblocks)
- If enabled, provide a Flashblocks WebSocket URL (default:
Sync Mode Availability#
Not all sync modes are available for every client-network combination:
| Client | Network | Genesis | Snapshot |
|---|---|---|---|
| reth | mainnet | ✅ | ✅ |
| geth | mainnet | ✅ | ✅ |
| reth | testnet | ❌ | ✅ |
| geth | testnet | ❌ | ✅ |
📊 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#
| Service | Default Port | Protocol | Purpose |
|---|---|---|---|
| RPC API | 8545 | HTTP | JSON-RPC API |
| WebSocket | 8546 | WebSocket | WebSocket API |
| Engine API | 8552 | HTTP | Engine API |
| Op-Node RPC | 9545 | HTTP | Consensus layer API |
| Execution P2P | 30303 | TCP/UDP | P2P network |
| Op-Node P2P | 9223 | TCP/UDP | P2P 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! 💪