To make the most of our first lecture, please set up your development environment in advance.
Tip
Checkout Manual Setup section for step by step guide.
| Setup | Version | Installation | Note |
|---|---|---|---|
| WSL | 2.0 | Guide | Highly recomended |
| Rust | 1.86.0 | Guide | |
| Solana | 2.2.12 | Guide | |
| Anchor | 0.31.1 | Guide | |
| VS Code | Guide | Or any other favorite IDE | |
| Rust Analyzer | Guide | Highly recommended | |
| Docker | Guide | To use pre-configured docker image |
This is the main learning material for the first lecture. It is our introductory material to blockchain and Solana. Getting comfortable with it will help you pass the first task!
-
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
-
[!NOTE] Airdrop only works on devnet, testnet and localhost.
solana airdrop 5
[!TIP] You can also optionally specify the destination address of the airdrop.
solana airdrop 5 <YOUR_PUBKEY>
[!TIP] You can also use the Solana Faucet to get some SOL.
-
solana-keygen pubkey ~/my-solana-wallet/my-keypair.json -
[!NOTE] In most cases 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 a separate terminal tab, call:
solana-test-validator
Within the anchor project directory:
- Build the project
anchor build
- Run tests without starting the local validator (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 on Discord.