Skip to main content
Qustody is distributed as a single Go binary plus a PostgreSQL database. Most production deployments run it as a container behind a load balancer, with managed Postgres (AWS RDS, Aurora, or equivalent) and a separate signing service.

Prerequisites

  • Go 1.24+ if you build from source
  • PostgreSQL 16+ (the schema is auto-migrated on startup when CUSTODY_DB_MIGRATE_ON_START=true)
  • A reachable Quantum Chain RPC node (HTTP and optionally WebSocket)
  • An external post-quantum signing service (callback HTTP, remote HTTP, or gRPC)
  • TLS certificates for production (terminated at your load balancer or directly on the API)

Container image

A multi-stage Dockerfile is shipped at custody/Dockerfile:
The container exposes:
  • 8080 — HTTP API
  • 9090 — Prometheus metrics (/metrics)

Local development with Docker Compose

A reference docker-compose.yaml lives at the repo root and brings up PostgreSQL, the Qustody API, and a development Quantum Chain node:
The development profile uses CUSTODY_AUTH_ENABLED=false and CUSTODY_RBAC_ENABLED=false to make exploration easy. Never deploy that combination.

Production deployment

Run at least two replicas behind a load balancer. The API is stateless; replicas coordinate through PostgreSQL row-level locks for transaction recovery.

Required environment variables

See the full list at Configuration reference.

Aurora / read-replica configuration

When CUSTODY_DB_IAM_AUTH=true, CUSTODY_DB_PASSWORD is not required — Qustody uses RDS IAM tokens.

Signer configuration (gRPC mode)

For callback or remote modes see External signing.

SSO

Compliance / AML

Health and readiness

The API exposes two endpoints used by load balancers and orchestrators: In Kubernetes:

Observability

Enable rate limiting with Redis for distributed deployments:

Database migrations

Migrations live in custody/store/postgres/migrations/. They are applied automatically on startup when CUSTODY_DB_MIGRATE_ON_START=true (default). For zero-downtime upgrades, run migrations from a single instance with CUSTODY_DB_MIGRATE_ON_START=true and start the rest with false.

Backups and disaster recovery

  • PostgreSQL is the source of truth. Use point-in-time recovery (PITR).
  • Audit log integrity is verifiable independently via GET /v1/audit/verify.
  • Webhook secrets are encrypted column-level when CUSTODY_WEBHOOK_ENCRYPTION_KEY is set; back up the key separately.