Solana Quick Start Guide
Welcome to the Solana Quick Start Guide! This hands-on guide will introduce you to the core concepts for building on Solana, regardless of your prior experience.
What You'll Learn
In this tutorial, you'll learn about:
- Solana Accounts: Learn how data is stored on the Solana network.
- Sending Transactions: Learn to interact with the Solana network by sending transactions.
- Building and Deploying Programs: Create your first Solana program and deploy it to the network.
- Program Derived Addresses (PDAs): Learn how to use PDAs to create deterministic addresses for accounts.
- Cross-Program Invocations (CPIs): Learn how to call other programs from within your program, enabling complex interactions and composability between multiple programs on Solana.
The best part? You don't need to install anything! We'll be using Solana Playground, a browser-based development environment. This means you can follow along, copy and paste code, and see results immediately, all from your web browser. Basic programming knowledge is helpful but not required.
Let's dive in and start building on Solana!
Solana Playground
Solana Playground (Solpg) is a browser-based development environment that allows you to quickly develop, deploy, and test Solana programs!
Open a new tab in your web browser and navigate to https://beta.solpg.io/.
Create Playground Wallet
If you're new to Solana Playground, the first step is to create your Playground Wallet. This wallet will allow you to interact with the Solana network right from your browser.
Step 1. Connect to Playground
Click the "Not connected" button at the bottom left of the screen.
Not Connected
Step 2. Create Your Wallet
You'll be prompted to save your wallet's keypair. Once you are ready, click "Continue" to proceed.
Create Playground Wallet
You should now see your wallet's address, SOL balance, and connected cluster (devnet by default) at the bottom of the window.
Connected
Your Playground Wallet will be saved in your browser's local storage. Clearing your browser cache will remove your saved wallet. Your Playground Wallet should only be used for testing and development. Do not send real assets (from mainnet) to this address.
Some definitions you may find helpful:
- wallet address: a 32-byte public key from a Ed25519 keypair, generally
displayed as a base-58 encoded string (eg.
7MNj7pL1y7XpPnN7ZeuaE4ctwg3WeufbX5o85sA91J1
). The corresponding private key is used to sign transactions from this address. On Solana, an address is the unique idenifier for a user's wallet, a program (smart contract), or any other account on the network. - connected cluster: the Solana network you're currently interacting with.
Common clusters include:
devnet
: A development network for developer experimentationtestnet
: A network reserved for validator testing (do not use as app developer)mainnet-beta
: The main Solana network for live transactions
Get Devnet SOL
Before we start building, we need to obtain some devnet SOL.
As a developer, SOL is required for two main use cases:
- Creating new accounts to store data or deploy programs on the network
- Paying transaction fees when interacting with the Solana network
Below are two methods to fund your wallet with devnet SOL:
Option 1: Using the Playground Terminal
To fund your Playground wallet with devnet SOL. In the Playground terminal, run:
Option 2: Using the Devnet Faucet
If the airdrop command doesn't work (due to rate limits or errors), you can use the Web Faucet.
- Enter your wallet address (found at the bottom of the Playground screen) and select an amount
- Click "Confirm Airdrop" to receive your devnet SOL
Faucet Airdrop
Last updated on