---
title: Solana Cookbook
seoTitle: Solana Cookbook - Code examples for Solana development
description:
  "The Solana Cookbook is a collection of code snippets, useful examples, and
  references for building on Solana."
---

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.

| Guide                                                                                      | Client             | Description                                |
| ------------------------------------------------------------------------------------------ | ------------------ | ------------------------------------------ |
| [How to Start a Local Validator](/docs/intro/installation/surfpool-cli-basics)             | Solana CLI         | Set up and run a local Solana validator    |
| [Connecting to a Solana Environment](/developers/cookbook/development/connect-environment) | JavaScript, Python | Connect to different Solana networks       |
| [Getting Test SOL](/developers/cookbook/development/test-sol)                              | JavaScript, Python | Obtain SOL tokens for testing              |
| [Subscribing to Events](/developers/cookbook/development/subscribing-events)               | JavaScript, Python | Listen to Solana program events            |
| [Using Mainnet Accounts and Programs](/docs/tools/surfpool)                                | Solana CLI         | Work with production accounts and programs |

## Wallet Management

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

| Guide                                                                                          | Client             | Description                         |
| ---------------------------------------------------------------------------------------------- | ------------------ | ----------------------------------- |
| [How to Create a Keypair](/developers/cookbook/wallets/create-keypair)                         | JavaScript, Python | Generate new Solana keypairs        |
| [How to Restore a Keypair](/developers/cookbook/wallets/restore-keypair)                       | JavaScript, Python | Recover existing keypairs           |
| [How to Verify a Keypair](/developers/cookbook/wallets/verify-keypair)                         | JavaScript, Python | Validate keypair authenticity       |
| [How to Validate a Public Key](/developers/cookbook/wallets/check-publickey)                   | JavaScript, Python | Check public key validity           |
| [How to Generate Mnemonics for Keypairs](/developers/cookbook/wallets/generate-mnemonic)       | bip39              | Create seed phrases                 |
| [How to Restore a Keypair from a Mnemonic](/developers/cookbook/wallets/restore-from-mnemonic) | JavaScript, bip39  | Recover keypairs using seed phrases |
| [How to Generate a Vanity Address](/developers/cookbook/wallets/generate-vanity-address)       | Solana CLI         | Create custom addresses             |
| [How to Sign and Verify a Message](/developers/cookbook/wallets/sign-message)                  | JavaScript, Python | Message signing and verification    |
| [How to Connect a Wallet with React](/developers/cookbook/wallets/connect-wallet-react)        | React, JavaScript  | Integrate wallets in React apps     |

## Transaction Operations

Explore various transaction-related operations on the Solana blockchain.

| Guide                                                                                            | Client             | Description                    |
| ------------------------------------------------------------------------------------------------ | ------------------ | ------------------------------ |
| [How to Send SOL](/developers/cookbook/transactions/send-sol)                                    | JavaScript, Python | Transfer SOL between accounts  |
| [How to Send Tokens](/docs/tokens/basics/transfer-tokens)                                        | JavaScript, Python | Transfer SPL tokens            |
| [How to Calculate Transaction Cost](/developers/cookbook/transactions/calculate-cost)            | JavaScript, Python | Estimate transaction fees      |
| [How to Add a Memo to a Transaction](/developers/cookbook/transactions/add-memo)                 | JavaScript, Python | Include memos in transactions  |
| [How to Add Priority Fees to a Transaction](/developers/cookbook/transactions/add-priority-fees) | JavaScript, Python | Set transaction priorities     |
| [How to Optimize Compute Requested](/developers/cookbook/transactions/optimize-compute)          | JavaScript, Python | Improve transaction efficiency |
| [Offline Transactions](/developers/cookbook/transactions/offline-transactions)                   | JavaScript, Python | Handle offline operations      |

## Account Management

Learn how to manage Solana accounts effectively.

| Guide                                                                                  | Client             | Description                |
| -------------------------------------------------------------------------------------- | ------------------ | -------------------------- |
| [How to Create an Account](/developers/cookbook/accounts/create-account)               | JavaScript, Python | Create new Solana accounts |
| [How to Calculate Account Creation Cost](/developers/cookbook/accounts/calculate-rent) | JavaScript, Python | Estimate account costs     |
| [How to Create a PDA's Account](/docs/core/pda)                                        | JavaScript, Rust   | Work with PDAs             |
| [How to Sign with a PDA's Account](/docs/core/cpi)                                     | Rust               | PDA signing operations     |
| [How to Close an Account](/docs/core/accounts)                                         | Rust               | Remove accounts            |
| [How to Get Account Balance](/developers/cookbook/accounts/get-account-balance)        | JavaScript, Python | Check account balances     |

## Token Program Instructions

Refer to the [Token Program](/docs/tokens/basics) section for code examples.
