Installation
@coral-xyz/anchor (v0.31.1) - Anchor framework for Solana@solana/spl-token (v0.4.14) - SPL Token utilitiesBuild and Deploy
target/deploy/nullgraph.sotarget/idl/nullgraph.jsontarget/types/nullgraph.tsThe build process may take several minutes on the first run as it downloads and compiles dependencies.
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.ProtocolState PDA from seed ["protocol_state"]initialize_protocol with fee set to 250 basis points (2.5%)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!
Run the Frontend
http://localhost:5173 in your browserConfiguration
Environment Variables
The frontend accepts optional environment variables. Createapp/.env if you need custom configuration:
Update IDL After Program Changes
If you modify the Anchor program, rebuild and sync the IDL to the frontend:Testing
Run Anchor Tests
Test the program using the Anchor 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:- 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:
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:
Transaction simulation failed
Solution: The program may already be deployed. Check the program account:
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.