Skip to content

vict0rcarvalh0/anchor-vault

Repository files navigation

Anchor Vault

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.


Getting Started

Follow these steps to set up, build, and test the program on your local machine.

Prerequisites

  1. Install Rust
  2. Install Solana CLI
  3. Install Anchor Framework

Clone the Repository

git clone https://github.com/<your-username>/<repository-name>.git
cd <repository-name>

Build and run tests

cd <repository-name>
anchor build
anchor test

Deploy the program

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:

Deploy to Devnet

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

Deploy to Local Validator

If you want to test the program in a local environment, you can run a local Solana validator and deploy the program there.

  1. Run the Local Validator: In one terminal, start a local Solana validator:
solana-test-validator
  1. Set the Cluster to Localhost: In another terminal, configure Solana CLI to use the local validator:
solana config set --url http://localhost:8899
  1. Deploy the Program to Local Validator: Skip starting a local validator again by using:
anchor deploy --skip-local-validator

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published