Local & Devnet Testing
Before going live, you can fully test FX402 on Solana Devnet using test USDC and the sandbox facilitator.
🧩 1. Setup Solana Devnet
Set your Solana config and get some test SOL:
solana config set --url https://api.devnet.solana.com
solana airdrop 2Fund your wallet and get Devnet USDC via faucet:
- Faucet: https://spl-token-faucet.com/
- USDC Mint:
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
🧠 2. Sandbox Facilitator
For testing, use the official sandbox facilitator:
https://sandbox.fx402.xyz/settleThe sandbox:
- Accepts fake USDC transfers
- Signs mock JWT receipts
- Simulates verification latency
🧰 3. Example cURL Flow
Request a protected resource:
curl -i https://sandbox.fx402.xyz/api/meme-001.pngThen respond with payment proof (fake tx allowed):
curl -i -X POST https://sandbox.fx402.xyz/api/meme-001.png \
-H "Content-Type: application/json" \
-d '{"profile":"r402/v1","tier_id":"1d","payment_proof":{"chain":"solana","currency":"USDC","tx":"FAKE123"}}'🔧 4. Local Development Tips
| Component | Tool/Stack |
|---|---|
| API Mock | FastAPI + fx402-fastapi |
| Client | JS SDK (@fx402/r402) |
| Database | SQLite or Supabase (for caching receipts) |
| Payments | Devnet USDC or stub facilitator |
✅ 5. Final Checklist Before Mainnet
- Verify facilitator endpoint (
/verify) - Test
valid_untilexpiry behavior - Ensure all tiers are properly priced
- Log and store receipts securely
- Disable sandbox endpoints in production
📚 You’re Ready!
You can now test FX402 end-to-end, including:
- Full HTTP 402 flow
- Solana Devnet payments
- Receipt verification
- CDN gating with receipts
Last updated on