During early stage development, it is often convenient to target a cluster with
fewer restrictions and more configuration options than the public offerings
provide. This is easily achieved with the
solana-test-validator binary, which
starts a full-featured, single-node cluster on the developer's workstation.
- No RPC rate-limits
- No airdrop limits
- Direct on-chain program deployment
- Clone accounts from a public cluster, including programs (
- Load accounts from files
- Configurable transaction history retention (
- Configurable epoch length (
- Jump to an arbitrary slot (
solana-test-validator binary ships with the Solana CLI Tool Suite.
Install before continuing.
First take a look at the configuration options
Next start the test validator
By default, basic status information is printed while the process is running. See Appendix I for details
solana-test-validator running in its own terminal. When it is no longer
needed, it can be stopped with ctrl-c.
Open a new terminal to interact with a running
instance using other binaries from the Solana CLI Tool Suite or your own client
- NOTE: The result should match the
Genesis Hash:field in the
Error: No such file or directory (os error 2)means that the default wallet does not yet exist. Create it with
- NOTE: If the wallet has a zero SOL balance, airdrop some localnet SOL with
solana airdrop 10
msg!() output from on-chain programs#
- NOTE: This command needs to be running when the target transaction is executed. Run it in its own terminal
- File path of the ledger storage directory. This directory can get large. Store
less transaction history with
--limit-ledger-size ...or relocate it with
- File path of the validator text log file. The log can also be streamed by
--log. Status output is suppressed in this case.
- The validator's identity in the gossip network
- The software version
- Session running time, current slot of the the three block commitment levels, slot height of the last snapshot, transaction count, voting authority balance
By default, the test validator runs with all runtime features activated.
You can verify this using the Solana command-line tools:
Since this may not always be desired, especially when testing programs meant for deployment to mainnet, the CLI provides an option to deactivate specific features: