Skip to content

Configure x402 environment variables for dev deployment #53

@crtahlin

Description

@crtahlin

Summary

Configure GitHub environment variables for x402 payment integration on the dev branch staging deployment.

Changes

1. Deploy workflow (.github/workflows/deploy.yml)

  • Add staging environment for dev branch deployments
  • Write /opt/swarm_connect_dev.env file with x402 configuration from GitHub variables
  • Variables use defaults if not set (x402 disabled by default)

2. Docker Compose (docker-compose.yml)

  • Add env_file directive to provenance_gateway_dev service
  • Points to /opt/swarm_connect_dev.env for x402 config
  • Main/production service unchanged

GitHub Variables to Set (staging environment)

After merging, set these variables for the staging environment:

gh variable set X402_ENABLED --body "true" --env staging
gh variable set X402_PAY_TO_ADDRESS --body "<wallet-address>" --env staging
gh variable set X402_NETWORK --body "base-sepolia" --env staging
gh variable set X402_FACILITATOR_URL --body "https://x402.org/facilitator" --env staging
gh variable set X402_FREE_TIER_ENABLED --body "true" --env staging

How It Works

  1. Push to dev triggers deployment
  2. Workflow uses staging environment (gets GitHub variables)
  3. Workflow writes env file to /opt/swarm_connect_dev.env
  4. Docker Compose reads env file for dev container
  5. x402 middleware activates with configured settings

Deployment URLs

Environment URL Branch x402
Staging provenance-gateway.dev.datafund.io dev Enabled
Production provenance-gateway.datafund.io main Disabled

Notes

  • All x402 settings are GitHub Variables (not Secrets) - no private keys needed
  • Facilitator (x402.org) handles payment settlement and gas
  • Free tier enabled by default for users without x402 capability

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions