- Maintainer creates an on-chain program and funds escrow via Soroban.
- Maintainer registers program metadata and contributors in Postgres (via API).
- GitHub sends a
pull_requestwebhook when a PR merges. - Gateway verifies HMAC, resolves program + contributor, submits attestation.
- Soroban contract pays
points × reward_per_pointto the contributor wallet.
cp .env.example .env
docker-compose up -dcargo run -p waveflow-api
cargo run -p waveflow-gatewaycurl -X POST http://localhost:8081/api/v1/admin/programs \
-H "Content-Type: application/json" \
-H "x-api-key: dev-admin-key-change-in-production" \
-d '{
"on_chain_program_id": 1,
"github_repo": "StellarRoute/WaveFlow",
"maintainer_address": "G...",
"reward_per_point": 100
}'curl -X POST http://localhost:8081/api/v1/admin/contributors \
-H "Content-Type: application/json" \
-H "x-api-key: dev-admin-key-change-in-production" \
-d '{
"program_id": "<uuid from step 3>",
"github_username": "alice",
"stellar_address": "G..."
}'Compute HMAC-SHA256 of the JSON body with GITHUB_WEBHOOK_SECRET, send to gateway:
curl -X POST http://localhost:8080/webhooks/github \
-H "Content-Type: application/json" \
-H "X-GitHub-Event: pull_request" \
-H "X-Hub-Signature-256: sha256=<digest>" \
-d @fixtures/merged_pr.jsoncurl http://localhost:8081/api/v1/programs/<uuid>/payoutscargo test -p waveflow-escrow record_merge_pays_contributorThis test covers fund → register → record_merge without external services.