Before beginning, you'll need to install the following core dependencies for a complete runtime environment:
-
rustc
-
solana
-
anchor
(preferably withavm
)
Please follow these instructions to set up your environment: https://solana.com/docs/intro/installation
This is deep rust mode for unit testing.
You'll need a local validator running for this. In a separate terminal, simply issue the command
solana-test-validator
cargo build-bpf
cargo test-sbf
This is integration mode for interface testing in TypeScript.
You don't need to run a local validator for this. Anchor does that under the hood.
yarn install
anchor build
You may need to change the
version = 4
toversion = 3
inCargo.lock
manually for this to work
anchor test