Welcome to the Solana developer docs!
This page has everything you need to know to get started with Solanadevelopment, including basic requirements, how Solana development works, and thetools you'll need to get started.
High Level Developer Overview #
Development on Solana can be broken down into two main parts:
- Onchain Program Development: This is where you create and deploy customprograms directly to the blockchain. Once deployed, anyone who knows how tocommunicate with them can use them. You can write these programs in Rust, C,or C++. Rust has the most support for onchain program development today.
- Client Development: This is where you write software (calleddecentralized applications, or dApps) that communicates with onchainprograms. Your apps can submit transactions to perform actions onchain.Client development can be written in any programming language.
The "glue" between the client side and the onchain side is theSolana JSON RPC API. The client-side sends RPCrequests to the Solana network to interact with onchain programs. This is verysimilar to normal development between a frontend and backend. The majordifference with working on Solana is that the backend is a global permissionlessblockchain. This means that anyone can interact with your onchain programwithout the need of issuing API keys or any other form of permission.
How clients work with the Solana blockchain
Solana development is a bit different from other blockchains because of itshighly composable onchain programs. This means you can build on top of anyprogram already deployed, and often you can do so without needing to do anycustom onchain program development. For example, if you wanted to work withtokens, you could use the Token Program that is alreadydeployed on the network. All development on your application would beclient-side in your language of choice.
Developers looking to build on Solana will find that the development stack isvery similar to any other development stack. The main difference is that you'llbe working with a blockchain and have to think about how users potentiallyinteract with your application onchain instead of just on the frontend.Developing on Solana still has CI/CD pipelines, testing, debugging tools, afrontend and backend, and anything you'd find in a normal development flow.
What You'll Need Get Started #
To get started with Solana development, you'll need different tools based onwhether you are developing for client-side, onchain programs, or both.
Client-side Development #
If you're developing onchain apps, you should know Rust.
If you're developing on the client-side, you can work with any programminglanguage you're comfortable with. Solana has community-contributed SDKs to helpdevelopers interact with the Solana network in most popular languages :
Language | SDK |
---|---|
RUST | solana_sdk |
Typescript | @solana/web3.js |
Python | solders |
Java | solanaj |
C++ | solcpp |
Go | solana-go |
Kotlin | solanaKT |
Dart | solana |
You'll also need a connection with an RPC to interact with the network. You caneither work with a RPC infrastructure provider orrun your own RPC node.
To quickly get started with a front-end for your application, you can generate acustomizable Solana scaffold by typing the following into your CLI:
npx create-solana-dapp <project-name>
This will create a new project with all the necessary files and basicconfiguration to get started building on Solana. The scaffold will include bothan example frontend and an onchain program template (if you selected one). Youcan read thecreate-solana-dapp
docsto learn more.
Onchain Program Development #
Onchain program development consists of either writing programs in Rust, C, orC++. First you'll need to make sure you have Rust installed on your machine. Youcan do this with the following command:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
You'll then need to have the Solana CLI installedto compile and deploy your programs. You can install the Solana CLI by runningthe following command:
sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)"
Using the Solana CLI, it is recommended to run a local validator for testingyour program. To run a local validator after installing the Solana CLI, run thefollowing command:
solana-test-validator
This will start a local validator on your machine that you can use to test yourprograms. You canread more about local development in this guide.
When building onchain programs, you have a choice to either build with nativeRust (ie, without a framework) or use the Anchor framework. Anchor is aframework that makes it easier to build on Solana by providing a higher-levelAPI for developers. Think of Anchor like building with React for your websitesinstead of raw Javascript and HTML. While Javascript and HTML give you morecontrol over your website, React accelerates your development and makesdeveloping easy. You can read more about Anchoron their website.
You'll need a way to test your program. There are a few different ways to testyour program based on your language preference:
- solana-program-test -Testing framework built in Rust
- solana-bankrun - Testingframework built for writing Typescript tests
- bankrun -Testing framework built for writing Python tests
If you do not want to develop your programs locally, there's also theonline IDE Solana Playground. Solana Playground allowsyou to write, test, and deploy programs on Solana. You can get started withSolana Playground byfollowing our guide.
Developer Environments #
Choosing the right environment based on your work is very important. On Solana,there are a few different network environments (called clusters) to facilitatemature testing and CI/CD practices:
- Mainnet Beta: The production network where all the action happens.Transactions cost real money here.
- Devnet: The quality assurance network where you deploy your programs totest before deploying to production. Think "staging environment".
- Local: The local network that you run on your machine using
solana-test-validator
to test your programs. This should be your firstchoice when developing programs.
Build by Example #
While you get started building on Solana, there's a few more resources availableto help accelerate your journey:
- Solana Cookbook: A collection ofreferences and code snippets to help you build on Solana.
- Solana Program Examples:A repository of example programs providing building blocks for differentactions on your programs.
- Guides: Tutorials and guides to walkyou through building on Solana.
Getting Support #
The best support you can find is onSolana StackExchange. Search for yourquestion there first - there's a good chance there will already be a questionasked by someone else, with an answer. If it's not there, add a new question!Remember to include as much detail as you can in your question, and please usetext (not screenshots) to show error messages, so other people with the sameproblem can find your question!
Next steps #
You're now ready to get started building on Solana!
- Deploy your first Solana program in the browser
- Get started building programs locally with Rust
- Overview of writing Solana programs