Test Validator
Thelight test-validator command starts a complete local development environment for ZK Compression, including:
- Solana test validator with Light Protocol programs
- Photon indexer for querying compressed accounts
- Light prover server for generating zero-knowledge proofs
- Forester service (optional) for automatic tree management
Basic Usage
Core Flags
Skip Services
Run the validator without specific components:Skip starting the Photon indexer. Use when you have an external indexer or don’t need compressed account queries.
Skip starting the prover service. Use when you have an external prover or want to test without proof generation.
Skip initializing Light system accounts. Advanced usage only.
Example
Forester Service
Start the forester service for automatic compression of compressible accounts.
Port for the forester API server.
Light PDA programs to track. Format:
program_id:discriminator_base58. Can be specified multiple times for tracking multiple programs.Example
Network Configuration
Port Configuration
JSON RPC port. The RPC websocket will use the next port (default: 8900).
Photon indexer port. Cannot be used with
--skip-indexer.Light prover server port. Cannot be used with
--skip-prover.Gossip DNS name or IP address for the validator to advertise.
Example
Validator Configuration
Maximum number of shreds to keep in root slots. Higher values use more disk space.
Path to Geyser plugin configuration file. Cannot be used with
--validator-args.Additional arguments to pass directly to
solana-test-validator. For advanced users only. Cannot be used with --geyser-config.Example
Geyser Plugin
Direct Validator Args
Program Management
Loading Custom Programs
Add a SBF program to genesis with upgrades disabled. Takes two arguments:
<address> <path/program.so>. Can be specified multiple times.If the ledger exists, this parameter is silently ignored.Add an upgradeable SBF program to genesis. Required for programs needing compressible config initialization. Takes three arguments:
<address> <path/program.so> <upgrade_authority>. Can be specified multiple times.If the ledger exists, this parameter is silently ignored.SBF Program
Upgradeable Program
Loading Accounts
Additional directory containing account JSON files to preload. Can be specified multiple times for multiple directories.
Example
Network Cloning
Clone Light Protocol programs and accounts from Devnet instead of loading local binaries. Cannot be used with
--mainnet.Clone Light Protocol programs and accounts from Mainnet instead of loading local binaries. Cannot be used with
--devnet.Devnet Clone
Mainnet Clone
Indexer Configuration
Custom indexer database URL for storing indexing data. By default, an in-memory SQLite database is used. Cannot be used with
--skip-indexer.Disable indexer version check. Use only if you know what you’re doing. Cannot be used with
--skip-indexer.Custom Database
Validator Management
Validator Runtime
Use Surfpool instead of
solana-test-validator. Pass --no-use-surfpool to use the standard Solana test validator.Skip resetting the ledger. Continues from previous state.
Use Standard Validator
Continue Previous Session
Stopping the Validator
Stop the test validator and dependent processes. Combine with
--skip-indexer or --skip-prover to keep specific services running.Stop All
Stop Validator, Keep Prover
Logging
Enable verbose logging for debugging.
Common Workflows
Standard Development Setup
Testing Without Indexer
Custom Ports for Multiple Instances
Production-Like Setup
Testing Custom Programs
Troubleshooting
Port already in use
Port already in use
If you see port conflicts, either:
- Stop existing services with
light test-validator --stop - Use custom ports with
--rpc-port,--indexer-port,--prover-port
Validator won't start
Validator won't start
Try these steps:
- Stop all processes:
light test-validator --stop - Check for zombie processes:
ps aux | grep solana - Start with verbose logging:
light test-validator -v - Reset the ledger: Start normally (resets by default)
Indexer version mismatch
Indexer version mismatch
If you need to bypass version checks temporarily:Note: This is not recommended for production use.
Custom program not loading
Custom program not loading
Ensure:
- Program file exists at the specified path
- Address doesn’t conflict with system programs
- Filename doesn’t match system program names
- You’re using the correct flag (—sbf-program vs —upgradeable-program)
Examples
Next Steps
All Commands
Explore the complete command reference
Compressed Tokens
Learn to work with compressed tokens