Day 30 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
close
is the opposite ofinit
.close
does the following:- reduces the lamport balance to
zero
- sends the lamports to a
target addresses
- changes the owner of the account to the
system program
- reduces the lamport balance to
close = signer
specifies that the signer will receive therent lamports
after closing the account.- You can specify any address to receive the
rent lamports
from closing the account. - Closed accounts can be initialized again.
- To close a Solana program, use
solana program close <address> --bypass-warning
- A closed program cannot be redeployed again.