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:
- 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
- L1 Beacon URL: Ethereum L1 Beacon chain endpoint
- 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#
| 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! 💪
