Deploy order matters: Program → Server → Dashboard
Each depends on the previous for configuration values.
cd program
# Build
anchor build
# Get the program ID
solana address -k target/deploy/guardrails-keypair.json
# Update program ID in:
# - Anchor.toml: [programs.devnet] guardrails = "<ID>"
# - programs/guardrails/src/lib.rs: declare_id!("<ID>")
# Rebuild with correct ID
anchor build
# Fund your wallet
solana airdrop 5 --url devnet
# Deploy
anchor deploy --provider.cluster devnet
# Sync IDL to SDK
cd ..
bash scripts/sync-sdk.shVia GitHub Actions: Go to Actions → "Deploy — Program" → Run workflow → type "deploy". Requires SOLANA_DEPLOY_KEYPAIR secret (base64-encoded keypair JSON).
- Create a project at neon.tech
- Note the pooled and direct connection strings
- Run migrations:
cd server
DATABASE_URL="<pooled>" DIRECT_URL="<direct>" npx prisma migrate deployDeploy the Express server to any Node.js hosting platform. Set the following environment variables:
PORT=8080
SOLANA_RPC_URL=https://devnet.helius-rpc.com/?api-key=<KEY>
GUARDRAILS_PROGRAM_ID=<from step 1>
MONITOR_KEYPAIR=<base64-encoded keypair>
HELIUS_WEBHOOK_SECRET=<from Helius dashboard>
ANTHROPIC_API_KEY=<your key>
DATABASE_URL=<from step 2, pooled>
DIRECT_URL=<from step 2, direct>
JWT_SECRET=<random secret>
CORS_ORIGIN=https://guardrails.vercel.app
Note the deployed URL — you'll need it for the Helius webhook and dashboard config.
After server is deployed:
- Go to Helius webhook dashboard
- Create webhook:
- URL:
https://<your-server-url>/webhook - Transaction type: ANY
- Account addresses: Your deployed program ID
- URL:
- Copy the webhook secret → set as
HELIUS_WEBHOOK_SECRETin server secrets
Connect the GitHub repo to Vercel:
- Import project at vercel.com/new
- Set Root Directory to
dashboard - Framework preset: Next.js (auto-detected)
- Add environment variables:
NEXT_PUBLIC_SOLANA_RPC_URL= Helius devnet RPC URLNEXT_PUBLIC_GUARDRAILS_PROGRAM_ID= from step 1NEXT_PUBLIC_API_URL= server URL from step 3
- Deploy
Vercel auto-deploys on push to main. Configure Ignored Build Step to skip builds when only program/ or server/ change:
git diff --quiet HEAD^ HEAD -- dashboard/