How openware/opendax works
Project type and purpose
• OpenDAX is a Ruby-based CLI/toolkit that orchestrates deployment of a full-stack, cloud-native, multi-service cryptocurrency exchange platform.
• It generates configuration and Docker Compose files from ERB templates, manages infrastructure provisioning via Terraform, and controls service lifecycle via Rake tasks.
Key architectural characteristics
• Microservices deployed as Docker containers
• Configuration-as-code using config/*.yml + ERB templates in templates/
• Secrets management via Vault
• Infrastructure provisioning with Terraform
• Service orchestration with Docker Compose & Rake
Main components
A. Developer/Operator Environment
• CLI tool (bin/*.sh, lib/opendax/*)
• Configuration source (config/app.yml, templates/)
• Rake tasks and Terraform code (Rakefile, terraform/*.tf, lib/tasks)
B. Rendering & Provisioning Layer
• ERB template renderer (lib/opendax/renderer.rb)
• docker-compose files generator (templates/compose/*.yml.erb → compose/*.yaml)
• rake terraform:apply provisioning
C. Docker Compose Stack
1. Proxy
– Traefik edge router
– Routes external HTTP(s) to internal services
2. API Gateway & Auth
– Ambassador API gateway
– Barong (authentication & KYC service)
3. Exchange Core
– Peatio (matching engine, order book, trade executor)
– Ranger daemons (cron_job, deposit, withdraw, upstream)
4. Backend Infra
– Vault (secrets management)
– MySQL (persistent data)
– Redis (caching, sessions)
– RabbitMQ (message queue between daemons)
5. Crypto Nodes (optional)
– parity, bitcoind, litecoind containers
6. Frontend Services
– Base frontend app (static assets served via proxy)
– Tower admin panel
7. Monitoring & Metrics (optional)
– cAdvisor, Prometheus node_exporter
8. Setup Hooks
– Database migrations, seeding (setup container)
Relationships and data flow
• External user → Traefik → Ambassador gateway
• Ambassador → Barong for authentication → issues JWT/CSRF
• Authenticated requests → Peatio REST/gRPC API → trades go to matching engine
• Peatio publishes events → RabbitMQ → Ranger daemons handle deposits/withdrawals
• Daemons interact with crypto-node containers for blockchain operations
• Vault issues tokens to components → components request secrets at runtime
• Frontend/Tower call Ambassador for API requests
• Monitoring tools scrape metrics from containers
Architectural patterns & design principles
• Microservices with single responsibility per container
• Infrastructure as code (Terraform + Docker Compose)
• Template-driven configuration (ERB → YAML)
• Secrets isolation via Vault policies per component
• Clear separation between rendering/orchestration and runtime