In order not to waste time on our first lecture, please prepare/install some stuff in advance. 👇
Setup | Description | Version | How to Install |
---|---|---|---|
Windows subsystem for Linux(WSL) | optional but highly recommended | 2.0 | Instructions |
Rust | - | stable | Instructions |
Solana tool suite | - | 1.18.11 | Instructions |
Anchor framework | - | 0.29.0 | Instructions |
VSCode | chose your own preferred IDE | - | Instructions |
RustAnalyzer | optional extension for VSCode | - | Instructions |
Docker | comming soon | - | Instructions |
- Introduction to Solana by Ackee Blockchain Solana Handbook
-
solana config get
-
solana config set --url localhost # useful for local development
solana config set --url devnet # useful for devnet testing
-
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>
-
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.