Prerequisites
Before installing Sol RPC Router, ensure you have the following dependencies installed:Rust (Required)
Sol RPC Router requires Rust 2021 edition or later.Redis (Required)
Redis is required for API key storage and atomic rate limiting.- Docker
- Ubuntu / Debian
- macOS
- From Source
The easiest way to run Redis:To persist data across restarts:
Production Redis Setup: For production deployments, configure Redis with persistence, authentication, and resource limits. See the Redis production checklist for details.
Building from Source
Build the Project
Build the release version (optimized for production):This will compile:For development (faster compilation, no optimizations):
sol-rpc-router- The main proxy serverrpc-admin- The API key management CLI
Build Time: The first build may take 5-10 minutes as Cargo downloads and compiles all dependencies. Subsequent builds will be much faster.
Dependencies
Sol RPC Router uses the following key dependencies (automatically managed by Cargo):Core Runtime
| Dependency | Version | Purpose |
|---|---|---|
tokio | 1.x | Async runtime with full features |
axum | 0.7 | Web framework with WebSocket support |
hyper | 1.x | HTTP client and server |
hyper-tls | 0.6 | TLS support for HTTPS backends |
Data & Serialization
| Dependency | Version | Purpose |
|---|---|---|
serde | 1.x | Serialization framework |
serde_json | 1.x | JSON parsing and generation |
toml | 0.8 | Configuration file parsing |
Redis & Caching
| Dependency | Version | Purpose |
|---|---|---|
redis | 0.27 | Redis client with async support |
moka | 0.12 | Local API key cache (60s TTL) |
WebSocket
| Dependency | Version | Purpose |
|---|---|---|
tokio-tungstenite | 0.24 | WebSocket client and server |
futures-util | 0.3 | Stream utilities for WebSocket |
Monitoring
| Dependency | Version | Purpose |
|---|---|---|
metrics | 0.24 | Metrics collection framework |
metrics-exporter-prometheus | 0.16 | Prometheus metrics exporter |
Utilities
| Dependency | Version | Purpose |
|---|---|---|
clap | 4.x | Command-line argument parsing |
tracing | 0.1 | Structured logging |
rand | 0.8 | Random API key generation |
arc-swap | 1.8 | Lock-free config reloading |
All dependencies are specified in
Cargo.toml and are automatically downloaded and compiled by cargo build.Configuration Files
Create your configuration file based on the example:Running Tests
Sol RPC Router includes 35+ unit and integration tests. All tests use mocks only—no Redis or real HTTP backends required.System Requirements
Minimum Requirements
- CPU: 1 core (2+ recommended)
- RAM: 512 MB (1 GB+ recommended for production)
- Disk: 100 MB for binaries + space for logs
- OS: Linux, macOS, or Windows with WSL2
Recommended Production Setup
- CPU: 4+ cores
- RAM: 4 GB+ (depends on API key cache size and request volume)
- Disk: SSD for Redis persistence
- Network: Low-latency connection to Solana RPC backends
- OS: Linux (Ubuntu 22.04 LTS or similar)
Port Requirements
Sol RPC Router uses three ports:| Port | Service | Configurable Via | Default |
|---|---|---|---|
| HTTP | JSON-RPC endpoint | port in config.toml | 28899 |
| WebSocket | Dedicated WS endpoint | port + 1 (automatic) | 28900 |
| Metrics | Prometheus metrics | metrics_port in config.toml | 28901 |
Environment Variables
Therpc-admin CLI supports environment variables:
config.toml and does not use environment variables.
Troubleshooting Build Issues
Linker errors on Linux
Linker errors on Linux
Error:
linking with cc failed or cannot find -lsslSolution: Install development libraries:Compilation errors with older Rust
Compilation errors with older Rust
Error:
error[E0658]: use of unstable library featureSolution: Update Rust to the latest stable version:Out of memory during compilation
Out of memory during compilation
Error: Or increase system swap space.
LLVM ERROR: out of memory or system hangsSolution: Reduce parallel compilation jobs:Redis connection issues
Redis connection issues
Error:
Failed to initialize Redis KeyStoreSolutions:- Verify Redis is running:
redis-cli ping - Check Redis is listening:
netstat -tlnp | grep 6379 - Test connection:
redis-cli -u redis://127.0.0.1:6379/0 ping - Check firewall rules
- Verify
redis_urlin config.toml is correct
Permission denied on port binding
Permission denied on port binding
Error:
Permission denied (os error 13) when starting routerSolution: Ports below 1024 require root privileges. Either:- Use ports above 1024 (recommended):
port = 8899 - Run with sudo (not recommended for production)
- Use systemd socket activation
- Configure port forwarding with iptables
Next Steps
Quick Start
Get your router running in 5 minutes
Configuration
Learn about all configuration options
Deployment
Deploy to production
Monitoring
Set up Prometheus and Grafana