Skip to Content
DocsGuidesLocal & Devnet Testing

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 2

Fund your wallet and get Devnet USDC via faucet:


🧠 2. Sandbox Facilitator

For testing, use the official sandbox facilitator:

https://sandbox.fx402.xyz/settle

The 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.png

Then 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

ComponentTool/Stack
API MockFastAPI + fx402-fastapi
ClientJS SDK (@fx402/r402)
DatabaseSQLite or Supabase (for caching receipts)
PaymentsDevnet USDC or stub facilitator

✅ 5. Final Checklist Before Mainnet

  • Verify facilitator endpoint (/verify)
  • Test valid_until expiry 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