All commands check for installation of rust, solana CLI, and anchor CLI.
# One-time setup (installs Rust, Solana CLI, Anchor, and creates a keypair)
source ./run.sh setup
# Build all programs (gateway-minter and gateway-wallet)
anchor build
# Clean build artifacts
anchor clean
# Run all tests
anchor test
# Format code (checks both Rust and TypeScript/JavaScript)
yarn format
# Auto-fix formatting issues (fixes both Rust and TypeScript/JavaScript)
yarn format:fix
# Lint code (checks both Rust and TypeScript/JavaScript)
yarn lintThe script will automatically use the correct versions of tools as specified in:
Anchor.tomlfor Solana CLI and Anchor versionsrust-toolchain.tomlfor Rust version
To ensure with certainty that packages are not changed unexpectedly as well as to enable reproducible, verifiable builds, all Cargo dependencies are vendored locally in the vendor directory and enabled via the .cargo/config.toml file.
To add a new dependency:
# remove to allow pulling dependencies from crates-io
rm .cargo/config.toml
# Add your dependency
cargo add <dependency> --package <package>
cargo vendor --locked
# restore to the original
git restore .cargo/config.toml