Day 19 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
Note: to retest the programs and avoid
failed to send transaction: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x0
error, comment out theinitialize
function call.
// await program.methods.initialize().accounts(...).rpc();
seeds=[]
ininit macro
behave askeys
that can be used for mappings.keys
that are used byinit macro
need to be in aninstruction macro
.
seeds=[]
can have as many keys as the compute limit can support.to_le_bytes()
means tolittle endian
bytes.to_be_bytes()
means tobig endian
bytes.