This the multi-page printable view of this section. Click here to print.
1 - Development Tools
Anchor is the Solidity of Solana
The Solana program SDK provides low-level interfaces for writing smart contracts. It doesn’t help you define methods for you contract or how data is stored, you can decide for yourself what tools you want to use.
The Anchor framework makes Solana program development much simpler. Developing a contract with Anchor will a little closer to the experience of building with Solidity. It allows programs to define human readable method names and provides helpers for serializing contract state in many different programming languages.
solana-test-validator is the Ganache of Solana
Solana provides a tool called
solana-test-validator which starts up
a local node on your machine for development purposes. It is installed as
part of the Solana Tool Suite.
solana-test-validator to setup a new node with a local blockhain
ledger. Restarting from the same directory will reuse the same ledger state.
--reset flag to start fresh.
Add your own locally built programs (smart contracts) to your local blockchain’s
genesis block by using the
--bpf-program option for as many programs as you
need. This is useful for speeding up development iterations and setting up other
programs that your program will call.
Copy the account state from another cluster by using the
--clone option. This must
be used along with the
--url option to specify which cluster to fetch accounts from.
solana-program-test is the Truffle of Solana
Solana provides Rust package called
solana-program-test which includes a test framework
which can be used to test programs in a local Solana VM instance. Check out the
Solana Program Library to learn how to use it.
2 - Program Languages
Solana has first class support for the Rust programming language.
New to Rust?
It may be difficult to learn at first, but once you master it, there’s a good chance you’ll never look back. Rust has consistently ranked as the moved loved programming language in Stack Overflow’s developer surveys from many years.
Most Rust developers have learned through the Rust “book”. The Rust book explains Rust’s unique and tricky features in an easy to understand way. Give it a try!
The easiest way to write Rust programs for Solana is by using the Anchor framework.
Solidity is not yet supported on Solana. Solidity was built to work really well for the Ethereum Virtual Machine (EVM). However, Solana’s smart contract VM was designed with fundamental differences from the EVM and so it currently does not support Solidity. There are two ongoing efforts to support Solidity on Solana:
Porting the EVM to run on Solana
Support Solidity for writing Solana programs
Solana has support for C as well but the vast majority of resources are written for Rust. C developers are recommended to use Rust for a better development experience.
Solana has previously experimented with adding support for the Move language but has set that project aside to prioritize other projects.
3 - Client Languages
Solana provides a Rust SDK for creating bots and tools.
solana-sdkis used to create Transactions
solana-clientis used to interact with a Solana cluster
solana-cli-configis used to create CLI tools
@solana/web3.jsis used to create transactions and connect to a Solana cluster
@project-serum/anchoris used to interact with Solana programs built with Anchor
Community created Go SDK: https://github.com/portto/solana-go-sdk
Community created Swift SDK: https://github.com/crewshin/solana-swift
Community created Python SDK: https://michaelhly.github.io/solana-py/