Solana CLI Usage Reference 2025
The Solana CLI is a powerful toolset for developers, validators, and power users to interact with the Solana blockchain. Beyond simple wallet and balance commands, it offers access to validator data, network health, block production, and configuration control.
โ๏ธ Environment & Configuration
View Active Configuration
Displays:
RPC Endpoint
WebSocket Endpoint
Keypair Path
Commitment Level
Set RPC Cluster
Common RPCs:
Devnet:
https://api.devnet.solana.com
Testnet:
https://api.testnet.solana.com
Mainnet:
https://api.mainnet-beta.solana.com
Set Wallet Keypair
Define which keypair the CLI should use to sign transactions.
Generate a New Wallet
๐ Always back up your keypair safely and use hardware wallets for production.
View Wallet Address
Prints the public key from the currently configured wallet.
๐ฐ Wallet & Airdrops
Airdrop SOL (Devnet/Testnet Only)
Send test tokens to a wallet. Omit <ADDRESS>
to airdrop to current wallet.
Check Wallet Balance
Returns the SOL balance for the configured wallet.
Transfer SOL
Add --fee-payer
to specify another wallet that pays for transaction fees.
๐ฐ๏ธ Blockchain Data Queries
View Account Data
Returns raw on-chain account information including:
Lamports
Owner Program
Data length
View Recent Blockhash
Shows the latest blockhash for manual signing workflows.
Get Transaction Details
Shows status, slot number, and confirmation level.
Fetch Recent Transactions (Historical RPC Support Required)
๐งญ Epoch, Slot, and Leader Info
Epoch Info
Displays current epoch, slot progress, and leader schedule.
Slot Info
Outputs the current slot on the network.
Leader Schedule
Lists current validator leader rotation schedule.
๐ฆ Stake & Validator Operations
List Validators
Shows validator identity, vote accounts, commission, and more.
Stake Account Details
Returns staking status, delegated validator, and activation state.
Create Stake Account
Delegate Stake
๐ Diagnostics & Debugging
Network Ping
Tests connectivity and latency to the cluster.
Show CLI Version
Compute Program Size & Fees
Useful to analyze deployed BPF bytecode.
๐ File System & Permissions
Recommended Wallet Location
Set strict file permissions:
๐ง Common Pitfalls & Solutions
RPC timeout or rate limit
Try switching to another public or private RPC
"Account not found" error
Create an associated token account or check funding
Wallet not recognized
Run solana config get
and verify keypair path
Airdrop fails
Confirm you're on devnet/testnet and wallet exists
๐งพ Reference Command Summary
View config
solana config get
Change RPC
solana config set --url <RPC>
Set wallet
solana config set --keypair <KEYPAIR_PATH>
Generate wallet
solana-keygen new
Airdrop SOL
solana airdrop 2 <ADDRESS>
Check balance
solana balance
Transfer SOL
solana transfer <TO> <AMOUNT>
Check epoch info
solana epoch-info
Query transaction
solana confirm <TX_SIGNATURE>
List validators
solana validators
Last updated