๐Ÿ‘‘
Solana Development Bible
  • Install the Solana Tool Suite CLI
  • Solana CLI Usage Refrence
  • What Are SPL Tokens?
  • Creating an SPL Token on Solana
  • Creating a Token-2022 on Solana
  • Find NFT Candy Machine ID
  • How to pull a hashlist and clean up data.
  • Solana CLI Usage Reference 2025
Powered by GitBook
On this page
  • โš™๏ธ Environment & Configuration
  • ๐Ÿ’ฐ Wallet & Airdrops
  • ๐Ÿ›ฐ๏ธ Blockchain Data Queries
  • ๐Ÿงญ Epoch, Slot, and Leader Info
  • ๐Ÿ“ฆ Stake & Validator Operations
  • ๐Ÿ”Ž Diagnostics & Debugging
  • ๐Ÿ“ File System & Permissions
  • ๐Ÿง  Common Pitfalls & Solutions
  • ๐Ÿงพ Reference Command Summary

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

solana config get

Displays:

  • RPC Endpoint

  • WebSocket Endpoint

  • Keypair Path

  • Commitment Level

Set RPC Cluster

solana config set --url https://api.devnet.solana.com

Common RPCs:

  • Devnet: https://api.devnet.solana.com

  • Testnet: https://api.testnet.solana.com

  • Mainnet: https://api.mainnet-beta.solana.com

Set Wallet Keypair

solana config set --keypair ~/.config/solana/id.json

Define which keypair the CLI should use to sign transactions.

Generate a New Wallet

solana-keygen new --outfile ~/.config/solana/new-wallet.json

๐Ÿ” Always back up your keypair safely and use hardware wallets for production.

View Wallet Address

solana-keygen pubkey

Prints the public key from the currently configured wallet.


๐Ÿ’ฐ Wallet & Airdrops

Airdrop SOL (Devnet/Testnet Only)

solana airdrop 2 <ADDRESS>

Send test tokens to a wallet. Omit <ADDRESS> to airdrop to current wallet.

Check Wallet Balance

solana balance

Returns the SOL balance for the configured wallet.

Transfer SOL

solana transfer <RECIPIENT_ADDRESS> <AMOUNT> --allow-unfunded-recipient --url https://api.devnet.solana.com

Add --fee-payer to specify another wallet that pays for transaction fees.


๐Ÿ›ฐ๏ธ Blockchain Data Queries

View Account Data

solana account <ADDRESS>

Returns raw on-chain account information including:

  • Lamports

  • Owner Program

  • Data length

View Recent Blockhash

solana block

Shows the latest blockhash for manual signing workflows.

Get Transaction Details

solana confirm <TRANSACTION_SIGNATURE>

Shows status, slot number, and confirmation level.

Fetch Recent Transactions (Historical RPC Support Required)

solana transaction-history <ADDRESS>

๐Ÿงญ Epoch, Slot, and Leader Info

Epoch Info

solana epoch-info

Displays current epoch, slot progress, and leader schedule.

Slot Info

solana slot

Outputs the current slot on the network.

Leader Schedule

solana leader-schedule

Lists current validator leader rotation schedule.


๐Ÿ“ฆ Stake & Validator Operations

List Validators

solana validators

Shows validator identity, vote accounts, commission, and more.

Stake Account Details

solana stake-account <STAKE_ACCOUNT_ADDRESS>

Returns staking status, delegated validator, and activation state.

Create Stake Account

solana-keygen new --outfile stake-keypair.json
solana create-stake-account stake-keypair.json <AMOUNT>

Delegate Stake

solana delegate-stake stake-keypair.json <VALIDATOR_VOTE_ADDRESS>

๐Ÿ”Ž Diagnostics & Debugging

Network Ping

solana ping <ADDRESS>

Tests connectivity and latency to the cluster.

Show CLI Version

solana --version

Compute Program Size & Fees

solana program dump <PROGRAM_ID> ./dump.so

Useful to analyze deployed BPF bytecode.


๐Ÿ“ File System & Permissions

Recommended Wallet Location

~/.config/solana/id.json

Set strict file permissions:

chmod 600 ~/.config/solana/id.json

๐Ÿง  Common Pitfalls & Solutions

Problem
Fix

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

Action
Command

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


PreviousHow to pull a hashlist and clean up data.

Last updated 2 days ago

For complete CLI docs and updates, visit the official Solana reference:

https://docs.solana.com/cli