OSVM CLI 🚀
A powerful command-line interface for managing Solana Virtual Machines (SVMs) across various networks. Monitor, deploy, and manage your SVM infrastructure with a single tool.
📚 Documentation
For comprehensive documentation, please visit the docs directory:
- 📖 Complete Documentation Index - Start here for all documentation
- 🚀 Quick Start Guide - Installation and setup
- 💡 Examples & Patterns - Usage examples and workflows
- ⚙️ Configuration Guide - Configuration management
Core Features Documentation
- 🖥️ SVM Management - Manage Solana Virtual Machines
- 🏗️ Node Management - Deploy and monitor nodes
- 🌐 SSH Deployment - Remote deployment capabilities
- 🔗 RPC Manager - RPC node management
- 📊 Dashboard - Interactive monitoring interfaces
Advanced Features Documentation
- 🔧 Self-Repair System - Automated maintenance
- 📋 Log Monitoring - Real-time log analysis
- ⚡ Validator Enhancements - Performance optimization
- 📦 eBPF Deployment - Smart contract deployment
graph TB
User((User))
subgraph "OSVM CLI System"
subgraph "CLI Interface"
MainCLI["Main CLI<br>Rust/Clap"]
CommandParser["Command Parser<br>Clap"]
subgraph "Core Commands"
SVMCommands["SVM Commands<br>Rust"]
NodeCommands["Node Commands<br>Rust"]
SolanaCommands["Solana Commands<br>Rust"]
RPCCommands["RPC Commands<br>Rust"]
end
end
subgraph "Node Management"
NodeManager["Node Manager<br>Rust"]
subgraph "Node Components"
NodeDB["Node Database<br>JSON"]
NodeMonitor["Node Monitor<br>Rust"]
NodeDashboard["Node Dashboard<br>Ratatui"]
NodeMetrics["Node Metrics<br>Rust"]
NodeLogs["Log Manager<br>Rust"]
end
end
subgraph "SSH Deployment"
SSHManager["SSH Manager<br>SSH2"]
subgraph "Deployment Components"
DeployConfig["Deployment Config<br>Rust"]
DiskManager["Disk Manager<br>Rust"]
ServiceManager["Service Manager<br>Rust"]
HotSwap["Hot Swap Manager<br>Rust"]
Dependencies["Dependency Manager<br>Rust"]
end
end
subgraph "Utilities"
Logger["Logger<br>env_logger"]
Config["Config Manager<br>YAML"]
Dashboard["Dashboard Generator<br>HTML/CSS"]
Examples["Examples Manager<br>Rust"]
end
end
subgraph "External Systems"
SolanaNode["Solana Node<br>Rust"]
RPCNode["RPC Node<br>JSON-RPC"]
RemoteServer["Remote Server<br>Linux"]
end
User -->|Uses| MainCLI
MainCLI -->|Parses| CommandParser
CommandParser -->|Executes| SVMCommands
CommandParser -->|Executes| NodeCommands
CommandParser -->|Executes| SolanaCommands
CommandParser -->|Executes| RPCCommands
NodeCommands -->|Manages| NodeManager
NodeManager -->|Stores| NodeDB
NodeManager -->|Monitors| NodeMonitor
NodeMonitor -->|Displays| NodeDashboard
NodeMonitor -->|Collects| NodeMetrics
NodeManager -->|Manages| NodeLogs
SolanaCommands -->|Deploys| SSHManager
RPCCommands -->|Deploys| SSHManager
SSHManager -->|Uses| DeployConfig
SSHManager -->|Manages| DiskManager
SSHManager -->|Controls| ServiceManager
SSHManager -->|Handles| HotSwap
SSHManager -->|Installs| Dependencies
MainCLI -->|Uses| Logger
MainCLI -->|Reads| Config
NodeDashboard -->|Generates| Dashboard
MainCLI -->|Shows| Examples
SSHManager -->|Connects to| RemoteServer
NodeMonitor -->|Monitors| SolanaNode
NodeMonitor -->|Monitors| RPCNode
⚡ One-Line Installation
Linux/macOS
|
Windows
Docker
Run OSVM CLI in a Docker container without installing it locally:
# Pull the latest image
# Run with version check
# Run with interactive mode (mount current directory)
# Use as an alias
🌟 Key Features
- SVM Management: List and inspect Solana Virtual Machines
- Node Deployment: Deploy validator or dedicated RPC nodes with a single command
- Interactive Dashboard: Real-time monitoring with a terminal-based UI
- Network Configuration: Configure nodes for mainnet, testnet, or devnet
- Performance Metrics: Track TPS, latency, and system requirements
- Colorized Output: Enhanced readability with consistent color-coding for status, commands, and data
- Command Examples: Built-in examples for common workflows and operations
- SSH Deployment: Remote deployment and management capabilities
🚀 GitHub Actions Integration
OSVM CLI now includes a dedicated GitHub Action for seamless CI/CD integration! Deploy SVM nodes directly from your workflows with minimal configuration.
Quick Start
- name: Deploy SVM Node
uses: ./.github/actions/svm-deploy
with:
svm-name: 'my-svm'
host: 'user@example.com'
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
network: 'devnet'
node-type: 'validator'
Features
- 🔒 Secure: Uses GitHub Secrets for sensitive data
- 🎯 Configurable: Support for different networks and node types
- 📊 Detailed Logging: Comprehensive deployment logs
- 🔄 Reusable: Includes reusable workflows for common patterns
📖 View Complete Documentation | 🔧 See Examples
📋 Command Reference
SVM Management
# List all SVMs installed in the chain
# Get detailed information about a specific SVM
# Launch interactive dashboard
Command Examples and Help
# Show examples for all command categories
# Show examples for a specific category
# Available categories: basic, svm, node, monitoring, workflow
# List all available example categories
Node Deployment
# Deploy a validator node to a remote server (mainnet)
# Deploy an RPC node to a remote server (testnet)
# Deploy a Sonic RPC node to a remote server
# Deploy multiple SVMs to a single server
# Deploy an eBPF binary to all available SVM networks
RPC Node Deployment
# Deploy a Sonic RPC node to a remote server (mainnet)
# Deploy a Sonic RPC node to a remote server (testnet)
# Deploy a Sonic RPC node to a remote server (devnet)
# Monitor devnet RPC node logs (automatically finds the most recent log file)
# Show specific number of recent log lines
# Follow logs in real-time (similar to tail -f)
# Start a local test validator for development (guaranteed to work)
# Check test validator status
# Stop test validator
The rpc-manager
command provides comprehensive RPC node management:
- Test Validator: Local development validator with guaranteed RPC functionality
- Instant startup with no external dependencies
- Built-in faucet for SOL airdrops
- Perfect for local development and testing
- Full Solana RPC API support
- Devnet RPC: Real devnet validator that syncs with live blockchain
- Auto-repair system with real-time log monitoring
- System parameter tuning (network limits, file descriptors, etc.)
- External reachability fixes using ngrok tunnels
- Port conflict resolution and memory optimization
- Sonic RPC: Deploys Sonic RPC nodes using Docker containers
- Network Selection: Choose between mainnet, testnet, or devnet environments
- Automatic Configuration: Handles all dependencies and configuration automatically
- Comprehensive Logging: Structured JSON logging to
osvm.log
for debugging
eBPF Program Deployment
# Deploy an eBPF binary to all available SVM networks
# Deploy with custom Anchor IDL file
# Deploy to a specific network only
The deploy
command provides a streamlined way to deploy eBPF programs:
- Multi-network Deployment: Deploy to all SVM networks with one command
- Network Selection: Choose between mainnet, testnet, devnet, or all networks
- IDL Publishing: Option to publish the IDL along with the program
- Auto-generated basic IDL (default)
- Custom Anchor IDL JSON file support via
--idl-file
option
- Required Files:
- eBPF binary (.so file)
- Program ID file:
- For new deployments: Must be a keypair JSON file (contains private key)
- For upgrades: Can be either a keypair file or pubkey-only JSON file
- Program owner keypair: JSON file containing private key (required for all deployments)
- Fee payer keypair: JSON file containing private key (pays for deployment transaction)
File Format Requirements
Keypair files (generated with solana-keygen new
):
// Array of 64 bytes containing private key
Pubkey-only files (for upgrades only):
or plain string:
HN4tEEGheziD9dqcWg4xZd29htcerjXKGoGiQXM5hxiS
🔧 Detailed Installation
Prerequisites
- Rust 1.80.0 or later
- Solana CLI tools 1.14.29 or later
From Source
# Clone the repository
# Build the project
# Install the binary
📊 Dashboard Features
The interactive dashboard provides real-time monitoring of your SVM infrastructure, including:
- Overview of all installed SVMs with status indicators
- Network details for each SVM (mainnet, testnet, devnet)
- Performance metrics with real-time visualization
- Node status monitoring with resource usage
- Aggregated logs from all nodes
Launch the dashboard with:
Keyboard Controls
Tab
,Right Arrow
,Left Arrow
: Switch between tabsUp Arrow
,Down Arrow
: Navigate through itemsn
: Select next SVMv
: Toggle verbosity level (affects displayed information detail)p
: Select previous SVMh
: Toggle help overlayq
orCtrl+C
: Quit the dashboard
📚 Documentation
- 📖 GitHub Actions Integration - Complete guide for CI/CD integration
- 🔧 GitHub Actions Examples - Ready-to-use workflow examples
- 📋 Command Reference - All available commands and options
- 🎯 Usage Examples - Common use cases and scenarios
- 🔧 Installation Guide - Step-by-step setup instructions
- 📊 Dashboard Features - Interactive monitoring capabilities
For complete documentation, visit our official documentation.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Development Setup
To ensure code quality and consistency, this project uses pre-commit hooks that enforce code formatting and linting.
Installing Pre-commit Hooks
Run the following command from the project root to install the pre-commit hooks:
This will install a git hook that automatically runs:
cargo fmt --all -- --check
- Ensures code is properly formattedcargo clippy
- Runs linting checks
Manual Code Quality Checks
You can also run these checks manually:
# Format your code
# Check formatting without modifying files
# Run clippy linting
Skipping Pre-commit Hooks
If you need to skip the pre-commit hook for a specific commit (not recommended), use:
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.