This repository contains a Vault program built using the Anchor Framework on the Solana blockchain. The vault is a secure on-chain storage solution for managing tokens or assets under programmatic control.
Follow these steps to set up, build, and test the program on your local machine.
git clone https://github.com/<your-username>/<repository-name>.git
cd <repository-name>
cd <repository-name>
anchor build
anchor test
Before deploying the program, decide whether to deploy to the Devnet (public testing network) or a local validator (local development environment). Follow the steps below:
Set the Cluster to Devnet: Configure Solana CLI to use the Devnet cluster:
solana config set --url https://api.devnet.solana.com
Deploy the Program: Use Anchor's deployment command to deploy to Devnet:
anchor deploy --provider.cluster devnet
If you want to test the program in a local environment, you can run a local Solana validator and deploy the program there.
- Run the Local Validator: In one terminal, start a local Solana validator:
solana-test-validator
- Set the Cluster to Localhost: In another terminal, configure Solana CLI to use the local validator:
solana config set --url http://localhost:8899
- Deploy the Program to Local Validator: Skip starting a local validator again by using:
anchor deploy --skip-local-validator