In order not to waste time on our first lecture, please prepare/install some stuff in advance. 👇
Tip
For step by step guide check Manual Setup
Setup | Description | Version | How to Install |
---|---|---|---|
Windows subsystem for Linux(WSL) | optional but highly recommended | 2.0 | Instructions |
Rust | - | 1.79.0 | Instructions |
Solana tool suite | 1.18.18 | Instructions | |
Anchor framework | - | 0.30.1 | Instructions |
VSCode | chose your own preferred IDE | - | Instructions |
RustAnalyzer | optional extension for VSCode | - | Instructions |
Docker | Install Docker | - | Instructions |
- Introduction to Solana by Ackee Blockchain Solana Handbook
-
solana config get
-
solana config set --url localhost # useful for local development solana config set -u l # shorter option, l stands for localhost
solana config set --url devnet # useful for devnet testing solana config set -u d # shorter option, d stands for devnet
-
solana-keygen new -o test.json
-
As you may guess, Airdrop will only work on Devnet, Testnet or Localhost. No you cannot airdrop SOL on Mainnet!!
solana airdrop 5
You can also optionally specify the destination address of the airdrop
solana airdrop 5 <YOUR_PUBKEY>
You can also use the Solana Faucet to get some SOL.
-
solana-keygen pubkey ~/my-solana-wallet/my-keypair.json
-
In most cases (99%) you DO NOT NEED TO start the local validator by yourself. Down below you can find the Anchor commands which will handle everything for you.
solana-test-validator
-
solana logs
-
anchor init <your_project_name>
-
anchor build
-
anchor test
-
In separate window, call:
Within the anchor project directory
solana-test-validator
- Build the project
anchor build
- Run Tests without starting the local validator (as you started it manually in the step above)
anchor test --skip-local-validator
- Build the project
If you have any questions feel free to reach out to us at Discord.