-
Start the local Solana validator with the Metaplex Token Metadata program:
solana-test-validator -r \ --bpf-program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s dumps/metadata.so
This command starts a local Solana validator, resets it (-r flag), and loads the Metaplex Token Metadata program.
-
Airdrop some SOL to your wallet:
solana airdrop 5 H6B8Qo82EW2jK7HDgEj5EUwv5gq8TSMbGLkXfFmQhmJg
Replace
H6B8Qo82EW2jK7HDgEj5EUwv5gq8TSMbGLkXfFmQhmJgwith your wallet address if different. -
Run Anchor tests:
anchor test --skip-local-validatorThis command runs your Anchor tests without starting a new local validator (since we've already started one in step 1).
- Ensure that your
Anchor.tomlfile and program ID in your Rust code (lib.rs) match the deployed program ID. - If you encounter any "Program ID mismatch" errors, double-check that your program is correctly deployed to the local validator.
- The
dumps/metadata.sofile should contain the compiled Metaplex Token Metadata program. Ensure this file exists in the specified path.