Day 21 of RareSkills Solana Course.
- Configure Solana to run on localhost:
solana config set --url localhost
- Run the test validator node on another terminal:
solana-test-validator --reset
- Run Solana logs on another terminal:
solana logs
- Build Anchor program:
anchor build
- Sync program_id with Anchor key:
anchor keys sync
- Run tests:
anchor test --skip-local-validator
- Anchor checks the account being read by default to see if the program owns the account.
UncheckedAccount
bypasses the safety check with reading accounts owned by the program./// CHECK: ...
doc comment is required by Anchor when bypassing safety checks like usingUncheckedAccount
.- Not all
SOL
in an account is spendable, a portion of the balance must be maintained to berent exempt
.