Introduction
The Solana test validator (solana-test-validator
) is an essential tool for developers building decentralized applications (dApps) on the Solana blockchain. This local single-node cluster provides a flexible testing environment with fewer restrictions than public networks.
Key Benefits
- No RPC rate limits: Test extensively without throttling
- Unlimited airdrops: Quickly fund test accounts
- Direct program deployment: Upload BPF programs via
--bpf-program
flag - Account cloning: Mirror production accounts using
--clone
Customizable parameters:
- Transaction history retention (
--limit-ledger-size
) - Epoch duration (
--slots-per-epoch
) - Slot advancement (
--warp-slot
)
- Transaction history retention (
Getting Started
Installation
The test validator comes bundled with Solana CLI tools. Install via:
sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
Verify installation with:
solana --version
Running the Test Validator
Review available options:
solana-test-validator --help
Start the validator:
solana-test-validator
Typical output:
JSON RPC URL: http://127.0.0.1:8899 Processed Slot: 5142 | Finalized Slot: 5110
Interacting With Your Local Cluster
CLI Configuration
Set your CLI to target the local validator:
solana config set --url http://127.0.0.1:8899
Common Operations
Command | Description |
---|---|
solana balance | Check wallet balance |
solana airdrop 10 | Fund test account |
solana transfer <address> 1 | Send test transaction |
Monitoring Program Logs
To view program debug output:
solana logs
Advanced Features
Account Management
- Load accounts from file:
--account <FILE>
- Clone production accounts:
--clone <ADDRESS>
Performance Optimization
solana-test-validator --limit-ledger-size 5000
Runtime Configuration
By default, all features are activated. For mainnet-equivalent testing:
solana-test-validator --deactivate-feature <FEATURE_PUBKEY>
FAQ Section
How do I reset my test validator?
Delete the ledger directory (default: test-ledger
) or specify a new location with --ledger
.
Why can't I see my program logs?
Ensure you're running the log monitor in a separate terminal before executing transactions.
How many slots per epoch should I use?
For rapid testing: --slots-per-epoch 100
. For mainnet realism: --slots-per-epoch 432000
.
👉 Want to test real SOL transfers? Try our developer-friendly exchange.
Can I speed up block production?
Yes! Use --warp-slot <TARGET_SLOT>
to jump forward in time.
What's the difference between processed and confirmed slots?
Processed slots have been received, while confirmed slots have achieved 1 block confirmation.
👉 Need more advanced testing tools? Check out our developer resources.