Skip to main content

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

1

Clone the repository

Clone the NullGraph repository to your local machine:
2

Install root dependencies

Install the root-level dependencies for the Anchor workspace:
This installs Anchor testing utilities and TypeScript dependencies.
3

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.
4

Configure Solana CLI

Set your Solana CLI to point to devnet:
Verify your configuration:
5

Generate a keypair (if needed)

If you don’t have a Solana keypair for devnet development, generate one:
Keep your keypair secure. Never commit keypair files to version control.
6

Airdrop devnet SOL

Request devnet SOL for deployment and testing:
Check your balance:

Building the Program

Build the Anchor program to compile the Rust code:
This command:
  • 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]: 2u3DXQq9A6UgMryeVSWCNdYLy3Fjh391R5hcfWYkCgZK

Running the Frontend

1

Navigate to the app directory

2

Start the development server

The frontend will be available at http://localhost:5173
3

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: To customize, create a .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:
This ensures the frontend’s Anchor client stays in sync with the on-chain program interface.

Project Structure

Next Steps

Now that your local environment is set up:
  1. Learn how to run the test suite
  2. Deploy your program to devnet
  3. Explore the program architecture