Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Ge0frey/nullgraph/llms.txt
Use this file to discover all available pages before exploring further.
This guide walks you through building, deploying, and running NullGraph locally.
Installation
Clone the NullGraph repository and navigate to the project directory:
git clone <repository-url>
cd nullgraph
Install Root Dependencies
Install the root-level dependencies for Anchor testing and scripts:
@coral-xyz/anchor (v0.31.1) - Anchor framework for Solana
@solana/spl-token (v0.4.14) - SPL Token utilities
Testing dependencies (Mocha, Chai, TypeScript)
Install Frontend Dependencies
Navigate to the frontend directory and install dependencies:
React 19.2 with TypeScript 5.9
Vite 7.3 for build tooling
Tailwind CSS 4.2 for styling
Solana wallet adapter libraries
React Router 7.13 for routing
Set your Solana CLI to point to devnet:
solana config set --url devnet
Verify the configuration:
RPC URL: https://api.devnet.solana.com
Build and Deploy
Compile the Solana program:
This compiles the Rust program in programs/nullgraph/src/lib.rs and generates:
Program binary in target/deploy/nullgraph.so
IDL in target/idl/nullgraph.json
TypeScript types in target/types/nullgraph.ts
The build process may take several minutes on the first run as it downloads and compiles dependencies.
Deploy the compiled program to Solana devnet:
anchor deploy --provider.cluster devnet
This uploads the program to devnet and returns a program ID. The default program ID is:
2u3DXQq9A6UgMryeVSWCNdYLy3Fjh391R5hcfWYkCgZK
Deployment requires SOL for transaction fees and rent. Ensure your wallet has at least 2 SOL. Use solana airdrop 2 --url devnet to get devnet SOL.
Run the one-time initialization script to create the protocol state account:
npx ts-node scripts/init-protocol.ts
Derives the ProtocolState PDA from seed ["protocol_state"]
Calls initialize_protocol with fee set to 250 basis points (2.5%)
Sets your wallet as the protocol authority and treasury
Initializes NKA and bounty counters to zero
Authority: <your-public-key>
Protocol State PDA: <protocol-state-address>
Treasury (same as authority): <your-public-key>
Initializing protocol with fee_basis_points = 250 (2.5%)...
Transaction signature: <signature>
Protocol initialized successfully!
If the protocol is already initialized, the script will detect the existing account and skip initialization.
Run the Frontend
Start the Development Server
Navigate to the app directory and start Vite:
The development server starts at:
Open http://localhost:5173 in your browser
Click “Connect Wallet” in the navigation bar
Select Phantom from the wallet list
Approve the connection in the Phantom popup
Ensure Phantom is set to Devnet
If you see wallet connection errors, verify that:
- Phantom is installed and unlocked
- Phantom is set to Devnet network
- You’re using a supported browser (Chrome, Firefox, Brave, Edge)
Configuration
Environment Variables
The frontend accepts optional environment variables. Create app/.env if you need custom configuration:
# Optional: Custom RPC endpoint
VITE_RPC_URL=https://api.devnet.solana.com
# Optional: Custom program ID (if you deployed your own)
VITE_PROGRAM_ID=2u3DXQq9A6UgMryeVSWCNdYLy3Fjh391R5hcfWYkCgZK
Update IDL After Program Changes
If you modify the Anchor program, rebuild and sync the IDL to the frontend:
# Rebuild the program
anchor build
# Copy IDL and types to frontend
cp target/idl/nullgraph.json app/src/lib/nullgraph.json
cp target/types/nullgraph.ts app/src/lib/nullgraph_types.ts
Testing
Run Anchor Tests
Test the program using the Anchor test suite:
# Run against local validator (auto-starts/stops)
anchor test
# Run against existing devnet deployment
anchor test --skip-local-validator --provider.cluster devnet
The test suite (tests/nullgraph.ts) covers:
- Protocol initialization
- NKA submission and counter increment
- Bounty creation with BIO escrow
- Bounty submissions and approvals
- Fee calculation and distribution
- Error cases (invalid status, duplicate init, etc.)
Architecture Overview
NullGraph runs entirely on Solana with no backend server:
React Frontend (Vite)
|
v
Wallet Adapter
|
v
Solana Devnet RPC
|
v
NullGraph Program (Anchor)
- ProtocolState PDA
- NullResult PDAs (NKAs)
- NullBounty PDAs
- BountySubmission PDAs
- Vault Token Accounts
Key Components:
- Program ID:
2u3DXQq9A6UgMryeVSWCNdYLy3Fjh391R5hcfWYkCgZK
- BIO Token Mint:
GkjGV1ZF5BsMs6oAvk8jZiuXM8KwuygFCHLBpqR5Q14j
- RPC Endpoint:
https://api.devnet.solana.com
- Network: Solana Devnet
Troubleshooting
Build Errors
Error: anchor: command not found
Solution: Ensure Anchor CLI is installed and in your PATH:
Error: failed to get recent blockhash: FetchError
Solution: Check your internet connection and verify Solana CLI config:
Deployment Errors
Error: Insufficient SOL balance
Solution: Airdrop devnet SOL:
solana airdrop 2 --url devnet
Error: Transaction simulation failed
Solution: The program may already be deployed. Check the program account:
solana program show 2u3DXQq9A6UgMryeVSWCNdYLy3Fjh391R5hcfWYkCgZK --url devnet
Frontend Errors
Error: Failed to connect to wallet
Solution: Ensure Phantom is installed, unlocked, and set to Devnet.
Error: Program account does not exist
Solution: Deploy the program or use the existing devnet deployment.
Next Steps
Now that NullGraph is running, proceed to the Quickstart Guide to submit your first NKA and create a bounty.