This repository contains a basic Solana Anchor project — a boilerplate for developing, testing, and deploying smart contracts (programs) on the Solana blockchain.
├── Anchor.toml # Anchor workspace config
├── Cargo.toml # Rust package config
├── programs/
│ └── test-hello-world/ # Main Solana program source code
├── tests/ # Integration tests
└── migrations/ # Optional migration scripts
Make sure you have the following installed:
- Rust → https://rustup.rs
- Solana CLI →
sh -c "$(curl -sSfL https://release.solana.com/stable/install)" - Anchor CLI →
cargo install --git https://github.com/coral-xyz/anchor anchor-cli
solana --version
anchor --version
rustc --versionBuild and test your program.
anchor build
anchor testsolana-test-validatorThen deploy:
anchor deploy --provider.cluster localnet Anchor provides Mocha-style tests using TypeScript. To run them:
anchor testOr run individual tests:
npx ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.tsMIT — feel free to modify and use for your own Solana projects.