Skip to content

Commit b51ac93

Browse files
author
Test User
committed
feat: Enhance Solana validator/RPC deployment based on Validator Jumpstart guidelines
- Add disk management with 3-disk configuration support - Implement system optimizations (kernel, network, CPU governor) - Add hot-swap capability for high availability - Implement monitoring and metrics integration - Add support for different client types (standard, Jito, Agave) - Update CLI with dedicated Solana validator/RPC commands - Add comprehensive documentation
1 parent 4a232f8 commit b51ac93

File tree

11 files changed

+1733
-11
lines changed

11 files changed

+1733
-11
lines changed

solana-validator-enhancements.md

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
# Solana Validator/RPC Enhancements
2+
3+
This document outlines the enhancements made to the OSVM-CLI for Solana validator and RPC node deployment based on the [Validator Jumpstart](https://github.com/ice-staking/validator-jumpstart) repository.
4+
5+
## Overview of Enhancements
6+
7+
The following enhancements have been implemented:
8+
9+
1. **Hardware Optimization & Disk Configuration**
10+
- Support for 3-disk setup (OS, Ledger, Accounts/Snapshots)
11+
- Disk validation and mounting
12+
- Directory structure creation
13+
14+
2. **System Performance Optimization**
15+
- Kernel and network parameter tuning
16+
- CPU governor settings
17+
- File descriptor limits
18+
- Memory management
19+
20+
3. **Enhanced Installation Options**
21+
- Version selection (standard, Jito, Agave)
22+
- Client type configuration
23+
- Installation verification
24+
25+
4. **Hot-Swap Capability**
26+
- Staked/unstaked keypair management
27+
- Identity transition scripts
28+
- Automatic failover monitoring
29+
30+
5. **Monitoring & Management**
31+
- Log rotation configuration
32+
- System monitoring scripts
33+
- Metrics dashboard integration
34+
- Alert system for critical issues
35+
36+
6. **Security Enhancements**
37+
- Firewall configuration
38+
- Port management
39+
- Enhanced service configuration
40+
41+
## Command Line Usage
42+
43+
### Deploy a Solana Validator
44+
45+
```bash
46+
# Basic validator deployment
47+
osvm solana validator user@host --network mainnet
48+
49+
# Enhanced validator with disk configuration
50+
osvm solana validator user@host --network mainnet \
51+
--ledger-disk /dev/nvme0n1 --accounts-disk /dev/nvme1n1
52+
53+
# Validator with Jito client
54+
osvm solana validator user@host --network mainnet \
55+
--client-type jito --version v1.18.23-jito
56+
57+
# Validator with hot-swap capability
58+
osvm solana validator user@host --network mainnet \
59+
--ledger-disk /dev/nvme0n1 --accounts-disk /dev/nvme1n1 \
60+
--hot-swap
61+
62+
# Full configuration with metrics
63+
osvm solana validator user@host --network mainnet \
64+
--ledger-disk /dev/nvme0n1 --accounts-disk /dev/nvme1n1 \
65+
--client-type jito --version v1.18.23-jito \
66+
--hot-swap \
67+
--metrics-config "host=https://metrics.solana.com:8086,db=mainnet-beta,u=mainnet-beta_write,p=password"
68+
```
69+
70+
### Deploy a Solana RPC Node
71+
72+
```bash
73+
# Basic RPC node deployment
74+
osvm solana rpc user@host --network mainnet
75+
76+
# Enhanced RPC with disk configuration
77+
osvm solana rpc user@host --network mainnet \
78+
--ledger-disk /dev/nvme0n1 --accounts-disk /dev/nvme1n1
79+
80+
# RPC with transaction history enabled
81+
osvm solana rpc user@host --network mainnet \
82+
--ledger-disk /dev/nvme0n1 --accounts-disk /dev/nvme1n1 \
83+
--enable-history
84+
```
85+
86+
## Disk Configuration
87+
88+
The enhanced deployment supports the recommended 3-disk configuration:
89+
90+
1. **OS Disk** - Typically ~500GB SSD for the operating system
91+
2. **Ledger Disk** - High-performance NVMe (≥2TB) mounted at `/mnt/ledger`
92+
3. **Accounts Disk** - High-performance NVMe (≥2TB) mounted at `/mnt/extras` with subdirectories:
93+
- `/mnt/extras/accounts` - For accounts database
94+
- `/mnt/extras/snapshot` - For snapshots
95+
96+
When using the `--ledger-disk` and `--accounts-disk` options, the system will:
97+
- Validate disk existence and size requirements
98+
- Format disks if not already formatted
99+
- Mount disks to the appropriate locations
100+
- Create necessary subdirectories
101+
- Set proper permissions
102+
103+
## System Optimizations
104+
105+
The deployment applies the following system optimizations:
106+
107+
1. **Network Parameters**
108+
- TCP buffer sizes and congestion control
109+
- TCP optimization settings
110+
- Solana-specific network parameters
111+
112+
2. **Kernel Optimizations**
113+
- Timer migration settings
114+
- Process limits
115+
- Task timeout configuration
116+
117+
3. **Virtual Memory Tuning**
118+
- Swappiness and memory mapping
119+
- Dirty ratio and background ratio
120+
- Write-back settings
121+
122+
## Hot-Swap Capability
123+
124+
The hot-swap capability implements the Identity Transition methodology from Pumpkin's Pool:
125+
126+
1. **Keypair Management**
127+
- Staked keypair for normal operation
128+
- Unstaked keypair as fallback
129+
130+
2. **Automatic Failover**
131+
- Monitoring script checks validator health
132+
- Automatic transition to unstaked identity when falling behind
133+
- Automatic transition back to staked identity when caught up
134+
135+
3. **Service Coordination**
136+
- Log rotation with USR1 signal
137+
- Service management scripts
138+
139+
## Monitoring Setup
140+
141+
The deployment includes:
142+
143+
1. **Basic Monitoring**
144+
- Regular service health checks
145+
- Performance metrics collection
146+
- Disk usage monitoring
147+
148+
2. **Alert System**
149+
- Critical error detection
150+
- Disk space warnings
151+
- Catching-up state monitoring
152+
153+
3. **Optional Grafana + InfluxDB Stack**
154+
- Docker-based monitoring stack
155+
- Pre-configured for Solana metrics
156+
- Dashboard templates
157+
158+
## Limitations and Notes
159+
160+
- Disk configuration requires direct device paths (e.g., `/dev/nvme0n1`)
161+
- Hot-swap capability is optimized for single-machine operation
162+
- Metrics configuration requires a valid InfluxDB instance
163+
- Some optimizations may require system restarts to take full effect

src/clparse.rs

Lines changed: 148 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,153 @@ pub fn parse_command_line() -> ArgMatches<'static> {
352352
.help("Network to deploy on")
353353
)
354354
)
355+
.subcommand(
356+
SubCommand::with_name("solana")
357+
.about("Deploy a Solana RPC node")
358+
.arg(
359+
Arg::with_name("connection")
360+
.help("SSH connection string (format: user@host[:port])")
361+
.required(true)
362+
.index(1)
363+
)
364+
.arg(
365+
Arg::with_name("network")
366+
.long("network")
367+
.value_name("NETWORK")
368+
.takes_value(true)
369+
.possible_values(&["mainnet", "testnet", "devnet"])
370+
.default_value("mainnet")
371+
.help("Network to deploy on")
372+
)
373+
)
355374
)
375+
.subcommand(
376+
SubCommand::with_name("solana")
377+
.about("Deploy and manage Solana validators")
378+
.setting(AppSettings::SubcommandRequiredElseHelp)
379+
.subcommand(
380+
SubCommand::with_name("validator")
381+
.about("Deploy a Solana validator node with enhanced features")
382+
.arg(
383+
Arg::with_name("connection")
384+
.help("SSH connection string (format: user@host[:port])")
385+
.required(true)
386+
.index(1)
387+
)
388+
.arg(
389+
Arg::with_name("network")
390+
.long("network")
391+
.value_name("NETWORK")
392+
.takes_value(true)
393+
.possible_values(&["mainnet", "testnet", "devnet"])
394+
.default_value("mainnet")
395+
.help("Network to deploy on")
396+
)
397+
.arg(
398+
Arg::with_name("version")
399+
.long("version")
400+
.value_name("VERSION")
401+
.takes_value(true)
402+
.help("Solana client version (e.g., v1.16.0, v1.18.23-jito)")
403+
)
404+
.arg(
405+
Arg::with_name("client-type")
406+
.long("client-type")
407+
.value_name("TYPE")
408+
.takes_value(true)
409+
.possible_values(&["standard", "jito", "agave"])
410+
.default_value("standard")
411+
.help("Solana client type (standard, jito, agave)")
412+
)
413+
.arg(
414+
Arg::with_name("hot-swap")
415+
.long("hot-swap")
416+
.takes_value(false)
417+
.help("Enable hot-swap capability for high availability")
418+
)
419+
.arg(
420+
Arg::with_name("ledger-disk")
421+
.long("ledger-disk")
422+
.value_name("DEVICE")
423+
.takes_value(true)
424+
.help("Ledger disk device path (e.g., /dev/nvme0n1)")
425+
)
426+
.arg(
427+
Arg::with_name("accounts-disk")
428+
.long("accounts-disk")
429+
.value_name("DEVICE")
430+
.takes_value(true)
431+
.help("Accounts disk device path (e.g., /dev/nvme1n1)")
432+
)
433+
.arg(
434+
Arg::with_name("metrics-config")
435+
.long("metrics-config")
436+
.value_name("CONFIG")
437+
.takes_value(true)
438+
.help("Metrics configuration string (e.g., host=https://metrics.solana.com:8086,db=mainnet-beta,u=mainnet-beta_write,p=password)")
439+
)
440+
)
441+
.subcommand(
442+
SubCommand::with_name("rpc")
443+
.about("Deploy a Solana RPC node with enhanced features")
444+
.arg(
445+
Arg::with_name("connection")
446+
.help("SSH connection string (format: user@host[:port])")
447+
.required(true)
448+
.index(1)
449+
)
450+
.arg(
451+
Arg::with_name("network")
452+
.long("network")
453+
.value_name("NETWORK")
454+
.takes_value(true)
455+
.possible_values(&["mainnet", "testnet", "devnet"])
456+
.default_value("mainnet")
457+
.help("Network to deploy on")
458+
)
459+
.arg(
460+
Arg::with_name("version")
461+
.long("version")
462+
.value_name("VERSION")
463+
.takes_value(true)
464+
.help("Solana client version (e.g., v1.16.0)")
465+
)
466+
.arg(
467+
Arg::with_name("client-type")
468+
.long("client-type")
469+
.value_name("TYPE")
470+
.takes_value(true)
471+
.possible_values(&["standard", "jito", "agave"])
472+
.default_value("standard")
473+
.help("Solana client type (standard, jito, agave)")
474+
)
475+
.arg(
476+
Arg::with_name("ledger-disk")
477+
.long("ledger-disk")
478+
.value_name("DEVICE")
479+
.takes_value(true)
480+
.help("Ledger disk device path (e.g., /dev/nvme0n1)")
481+
)
482+
.arg(
483+
Arg::with_name("accounts-disk")
484+
.long("accounts-disk")
485+
.value_name("DEVICE")
486+
.takes_value(true)
487+
.help("Accounts disk device path (e.g., /dev/nvme1n1)")
488+
)
489+
.arg(
490+
Arg::with_name("metrics-config")
491+
.long("metrics-config")
492+
.value_name("CONFIG")
493+
.takes_value(true)
494+
.help("Metrics configuration string")
495+
)
496+
.arg(
497+
Arg::with_name("enable-history")
498+
.long("enable-history")
499+
.takes_value(false)
500+
.help("Enable transaction history (increases storage requirements)")
501+
)
502+
)
356503
.get_matches()
357-
}
504+
}

0 commit comments

Comments
 (0)