This guide explains how to deploy and test the smart contract on a local Solana testnet.
Ensure you have the following installed on your system:
- Rust and Cargo
- Anchor CLI
- Solana CLI
Open a terminal and start the Solana test validator: solana-test-validator
In a new terminal window, configure Solana to use the local testnet using the line solana config set --url http://127.0.0.1:8899
Build the smart contract using Anchor: anchor build
Deploy the smart contract to the local testnet: anchor deploy
Run the tests to ensure the smart contract works correctly: anchor test