Prerequisites
Before you begin, ensure you have the following installed on your system:- Rust (stable) - Required for building the Solana program
- Solana CLI (v1.18+) - Command-line tools for Solana development
- Anchor CLI (v0.31.1) - Framework for Solana program development
- Node.js (v18+) - JavaScript runtime for the frontend
- Phantom Wallet browser extension - For transaction signing (set to devnet)
Make sure your Phantom wallet is configured to use devnet before testing the application.
Installation
Install root dependencies
Install the root-level dependencies for the Anchor workspace:This installs Anchor testing utilities and TypeScript dependencies.
Install frontend dependencies
Navigate to the frontend directory and install React dependencies:This installs React 19, Vite 7.3, Tailwind CSS v4, Solana wallet adapters, and all frontend dependencies.
Generate a keypair (if needed)
If you don’t have a Solana keypair for devnet development, generate one:
Building the Program
Build the Anchor program to compile the Rust code:- Compiles the Solana program in
programs/nullgraph/src/lib.rs - Generates the IDL (Interface Definition Language) file in
target/idl/nullgraph.json - Generates TypeScript types in
target/types/nullgraph.ts - Creates the compiled program binary in
target/deploy/
The program ID is declared in
Anchor.toml under [programs.devnet]: 2u3DXQq9A6UgMryeVSWCNdYLy3Fjh391R5hcfWYkCgZKRunning the Frontend
Start the development server
Connect your wallet
Open http://localhost:5173 in your browser and click the wallet button in the navigation bar to connect your Phantom wallet.
Environment Variables
The frontend accepts optional environment variables for configuration:| Variable | Default | Description |
|---|---|---|
VITE_RPC_URL | https://api.devnet.solana.com | Solana JSON-RPC endpoint |
.env file in the app/ directory:
Both variables are optional. The defaults point to the devnet deployment.
Rebuilding IDL After Program Changes
Whenever you modify the Anchor program (programs/nullgraph/src/lib.rs), you must rebuild and update the frontend IDL:
Project Structure
Next Steps
Now that your local environment is set up:- Learn how to run the test suite
- Deploy your program to devnet
- Explore the program architecture