Solana Cookbook

The Solana Cookbook is a developer resource that provides examples and references for building applications on Solana. Each example and reference will focus on specific aspects of Solana development while providing additional details and usage examples.

Development Guides

Development guides help developers set up and interact with the Solana ecosystem using various tools and clients.

GuideClientDescription
How to Start a Local ValidatorSolana CLISet up and run a local Solana validator
Connecting to a Solana EnvironmentJavaScriptConnect to different Solana networks
Getting Test SOLJavaScriptObtain SOL tokens for testing
Subscribing to EventsJavaScriptListen to Solana program events
Using Mainnet Accounts and ProgramsSolana CLIWork with production accounts and programs

Wallet Management

Learn how to create, restore, and manage Solana wallets using various tools and libraries.

GuideClientDescription
How to Create a KeypairJavaScriptGenerate new Solana keypairs
How to Restore a KeypairJavaScriptRecover existing keypairs
How to Verify a KeypairJavaScriptValidate keypair authenticity
How to Validate a Public KeyJavaScriptCheck public key validity
How to Generate Mnemonics for Keypairsbip39Create seed phrases
How to Restore a Keypair from a MnemonicJavaScript, bip39Recover keypairs using seed phrases
How to Generate a Vanity AddressSolana CLICreate custom addresses
How to Sign and Verify a MessageJavaScriptMessage signing and verification
How to Connect a Wallet with ReactReact, JavaScriptIntegrate wallets in React apps

Transaction Operations

Explore various transaction-related operations on the Solana blockchain.

GuideClientDescription
How to Send SOLJavaScriptTransfer SOL between accounts
How to Send TokensJavaScriptTransfer SPL tokens
How to Calculate Transaction CostJavaScriptEstimate transaction fees
How to Add a Memo to a TransactionJavaScriptInclude memos in transactions
How to Add Priority Fees to a TransactionJavaScriptSet transaction priorities
How to Optimize Compute RequestedJavaScriptImprove transaction efficiency
Offline TransactionsJavaScriptHandle offline operations

Account Management

Learn how to manage Solana accounts effectively.

GuideClientDescription
How to Create an AccountJavaScriptCreate new Solana accounts
How to Calculate Account Creation CostJavaScriptEstimate account costs
How to Create a PDA's AccountJavaScript, RustWork with PDAs
How to Sign with a PDA's AccountRustPDA signing operations
How to Close an AccountRustRemove accounts
How to Get Account BalanceJavaScriptCheck account balances

Program Development

Develop Solana programs with these comprehensive guides.

GuideClientDescription
How to Transfer SOL in a Solana ProgramRustProgram-based SOL transfers
How to Get Clock in a ProgramRustAccess program clock
How to Change Account SizeRustModify account sizes
How to Do Cross Program InvocationRustCPI operations
How to Create a Program Derived AddressRustGenerate PDAs
How to Read Accounts in a ProgramRustAccount data access
Reading Multiple InstructionsRustHandle multiple instructions
How to Verify Accounts in a Solana ProgramRustAccount verification

Token Operations

Comprehensive guides for working with tokens on Solana.

GuideClientDescription
How to Create a TokenJavaScriptCreate new tokens
How to Get a Token MintJavaScriptAccess token mints
How to Create a Token AccountJavaScriptSet up token accounts
How to Get a Token AccountJavaScriptRetrieve token accounts
How to Get a Token Account's BalanceJavaScript, RustCheck token balances
How to Mint TokensJavaScriptCreate new tokens
How to Transfer TokensJavaScriptMove tokens between accounts
How to Burn TokensJavaScriptRemove tokens from circulation
How to Close Token AccountsJavaScriptClean up token accounts
How to Set Authority on Token Accounts or MintsJavaScriptManage token permissions
How to Delegate Token AccountsJavaScriptSet up token delegation
How to Revoke a Token DelegateJavaScriptRemove delegates
How to Use Wrapped SOLJavaScriptWork with wrapped SOL
How to Get All Token Accounts by AuthorityJavaScriptList token accounts
How to Create an NFTJavaScriptMint NFTs
How to Fetch the NFT MetadataJavaScriptFetch NFT metadata
How to Get the Owner of an NFTJavaScriptFind NFT ownership
How to Get All NFTs from a WalletJavaScriptList wallet NFTs