{"id":13582651,"url":"https://github.com/openware/opendax","last_synced_at":"2025-05-16T16:06:13.452Z","repository":{"id":35828078,"uuid":"198693545","full_name":"openware/opendax","owner":"openware","description":"Open-Source Cloud-Native Digital Asset \u0026 Cryptocurrency Exchange Platform","archived":false,"fork":false,"pushed_at":"2023-12-02T13:15:55.000Z","size":501,"stargazers_count":683,"open_issues_count":106,"forks_count":565,"subscribers_count":52,"default_branch":"2-6-stable","last_synced_at":"2025-05-11T17:55:44.123Z","etag":null,"topics":["barong","crypto-exchange-software","cryptocurrency","cryptocurrency-exchange-software","exchange","matching-engine","opendax","peatio","trading","trading-platform"],"latest_commit_sha":null,"homepage":"https://www.openware.com/products/opendax","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-24T18:57:31.000Z","updated_at":"2025-05-06T15:37:30.000Z","dependencies_parsed_at":"2024-11-09T21:02:24.210Z","dependency_job_id":null,"html_url":"https://github.com/openware/opendax","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openware%2Fopendax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openware%2Fopendax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openware%2Fopendax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openware%2Fopendax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openware","download_url":"https://codeload.github.com/openware/opendax/tar.gz/refs/heads/2-6-stable","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254564127,"owners_count":22092122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["barong","crypto-exchange-software","cryptocurrency","cryptocurrency-exchange-software","exchange","matching-engine","opendax","peatio","trading","trading-platform"],"created_at":"2024-08-01T15:02:54.763Z","updated_at":"2025-05-16T16:06:13.410Z","avatar_url":"https://github.com/openware.png","language":"HTML","funding_links":[],"categories":["HTML"],"sub_categories":[],"readme":"![Cryptocurrency Exchange Platform - OpenDAX](https://github.com/openware/meta/raw/main/images/github_opendax.png)\n\n\u003ch3 align=\"center\"\u003e\n\u003ca href=\"https://www.openware.com/sdk\"\u003eGuide\u003c/a\u003e \u003cspan\u003e\u0026vert;\u003c/span\u003e\n\u003ca href=\"https://www.openware.com/sdk/api.html\"\u003eAPI Docs\u003c/a\u003e \u003cspan\u003e\u0026vert;\u003c/span\u003e\n\u003ca href=\"https://www.openware.com/\"\u003eConsulting\u003c/a\u003e \u003cspan\u003e\u0026vert;\u003c/span\u003e\n\u003ca href=\"https://t.me/peatio\"\u003eCommunity\u003c/a\u003e\n\u003c/h3\u003e\n\u003ch6 align=\"center\"\u003e\u003ca href=\"https://github.com/openware/opendax\"\u003eOpenDAX Trading Platform\u003c/a\u003e\u003c/h6\u003e\n\n# OpenDAX\n\nOpenDAX is an open-source cloud-native multi-service platform for building a Blockchain/FinTech exchange of digital assets, cryptocurrency and security tokens.\n\n## Getting started with OpenDAX\n\n### 1. Get a VM\n\nMinimum VM requirements for OpenDAX:\n * 8GB of RAM (12GB recommended)\n * 4 cores vCPU (6 cores recommended)\n * 300GB disk space (SSD recommended)\n\nA VM from any cloud provider like DigitalOcean, Vultr, GCP, AWS as well as any dedicated server with Ubuntu, Debian or Centos would work\n\n### 2. Prepare the VM\n\n#### 2.1 Create Unix user\nSSH using root user, then create new user for the application\n```bash\nuseradd -g users -s `which bash` -m app\n```\n\n#### 2.2 Install Docker and docker compose\n\nWe highly recommend using docker and compose from docker.com install guide instead of the system provided package, which would most likely be deprecated.\n\nDocker follow instruction here: [docker](https://docs.docker.com/install/)\nDocker compose follow steps: [docker compose](https://docs.docker.com/compose/install/)\n\n#### 2.3 Install ruby in user app\n\n##### 2.3.1 Change user using\n```bash\nsu - app\n```\n\n##### 2.3.2 Clone OpenDAX\n```bash\ngit clone https://github.com/openware/opendax.git\n```\n\n##### 2.3.3 Install RVM\n```bash\ngpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB\ncurl -sSL https://get.rvm.io | bash -s stable\ncd opendax\nrvm install .\n```\n\n### 3. Bundle install dependencies\n\n```bash\nbundle install\nrake -T # To see if ruby and lib works\n```\n\nUsing `rake -T` you can see all available commands, and can create new ones in `lib/tasks`\n\n### 4. Run everything\n\n#### 4.1 Configure your domain\nIf using a VM you can point your domain name to the VM ip address before this stage.\nRecommended if you enabled SSL, for local development edit the `/etc/hosts`\n\nInsert in file `/etc/hosts`\n```\n0.0.0.0 www.app.local\n```\n\n#### 4.2 Bring everything up\n\n```bash\nrake service:all\n```\n\nYou can login on `www.app.local` with the following default users from seeds.yaml\n```\nSeeded users:\nEmail: admin@barong.io, password: 0lDHd9ufs9t@\nEmail: john@barong.io, password: Am8icnzEI3d!\n```\n\n### [Optional] KYCAID\n\nIn order to  accelerate customer interaction, reduce risks and simplify business processes you can use KYC Verification Service from KYCaid.\nKYC goal is to prevent fraud and to decline users that don’t fulfill certain standards of credibility.\nTo learn more about KYCaid and pricing you can visit their website - [kycaid.com](https://www.kycaid.com/)\n\n#### How to configure KYCAID on the platform?\n\nKYCAID is already integrated into our stack, to use it you'd need to create an account on [kycaid.com](https://www.kycaid.com/), and set up authentification creds there and the callback url: https://example.com/api/v2/barong/public/kyc\n\nAfter that all you have to do is to change several lines in `config/app.yml`:\n\n```yaml\nkyc:\n  provider: kycaid\n  authorization_token: changeme             # your production API token from the 'Settings' section of kycaid.com\n  sandbox_mode: true                        # 'true' for test environments - documents will be verified/rejected automatically, without payment for verification\n  api_endpoint: https://api.kycaid.com/\n```\n\n##### Additional settings for KYCAID\n\n* Be sure to check `BARONG_REQUIRED_DOCS_EXPIRE` ENV value inside `config/barong.env` to be `false` if you want to include `address` verification in your KYC process. You can set it to `true` if you need the document check only.\n* Check if  you have the correct list of `document_types` in the `config/barong/barong.yml` file:\n  - Passport\n  - Identity card\n  - Driver license\n  - Address\n* Frontend KYC steps can be configured in `templates/config/frontend/env.js.erb` via the `kycSteps` field\n* Tower KYC labels can be configured in `templates/config/frontend/tower.js.erb` via the `labelSwitcher` field\n\n## Usage\n\n### Initial configuration\n\nAll the OpenDAX deployment files have their confguration stored in `config/app.yml`.\n\n#### app.yml\n\nThe following table lists the configurable parameters of the config/app.yml configuration file and its default values.\n\nParameter | Description | Default\n--- | --- | ---\n`app.name` | global application name | `\"OpenDax\"`\n`app.domain` | base domain name | `app.local`\n`app.subdomain` | subdomain | `www`\n`app.show_landing` | enable/disable landing page display for the frontend application | `true`\n`render_protect` | enable read-only mode for rendered files | `false`\n`csrfEnabled` | enable CSRF protection on Barong | `false`\n`ssl.enabled` | enable SSL certificate generation | `false`\n`ssl.email` | email address used for SSL certificate issuing | `\"support@example.com\"`\n`updateVersions` | update all image tags by fetching global ones for OpenDAX | `false`\n`images` | Docker image tags per component\n`vendor.frontend` | optional Git URL for a development frontend repo | `git@github.com:openware/baseapp.git`\n`kyc.provider` |  KYC provider, can be `kycaid` or `local` | `kycaid`\n`kyc.authorization_token` |  optional API token for KYCAID use | `changeme`\n`kyc.sandbox` |  enable KYCAID test mode  | `true`\n`kyc.api_endpoint` |  API endpoint for KYCAID | `https://api.kycaid.com/`\n`vault.root_token` | Root Vault authentication token | `changeme `\n`vault.peatio_rails_token` | Peatio Server Vault authentication token | `changeme `\n`vault.peatio_crypto_token` | Peatio Daemons (cron_job, deposit, deposit_coin_address, withdraw_coin) Vault authentication token | `changeme `\n`vault.peatio_upstream_token` | Peatio Upstream Daemon Vault authentication token | `changeme `\n`vault.peatio_matching_token` | Peatio Daemons (matching, order_processor, trade_executor) Vault authentication token | `changeme `\n`vault.barong_token` | Barong Vault authentication token | `changeme `\n`vault.finex_engine_token` | Finex Engine Vault authentication token | `changeme `\n`database.adapter`| database adapter kind either `mysql` or `postgresql` |`mysql`\n`database.host` | database host name | `db`\n`database.port` | database port | `3306 `\n`database.user` | database username | `root`\n`database.password` | database root password | `changeme`\n`storage.provider` | object storage provider | `\"Google\"`\n`storage.bucketname` | storage bucket name | `\"opendax-barong-docs-bucket\"`\n`storage.endpoint` | S3-compatible storage API endpoint | `\"https://fra1.digitaloceanspaces.com\"`\n`storage.region` | storage region | `\"fra1\"`\n`storage.signatureVersion` | S3-compatible storage API signature version(2 or 4) | `\"fra1\"`\n`storage.secretkey`, `storage.accesskey` | storage access keys | `\"changeme\"`\n`twilio` | [Twilio](https://www.twilio.com/) SMS provider configs\n`gaTrackerKey` | [Google Analytics](https://analytics.google.com/) tracker key inserted into the frontend app\n`smtp` | SMTP configs used for sending platform emails\n`captcha` | captcha configuration([Recaptcha](https://www.google.com/recaptcha) or [Geetest](https://www.geetest.com))\n`wallets` | configs for wallets seeded during the initial deployment of Peatio\n`parity` | Parity cryptonode configuration\n`bitcoind` | Bitcoind cryptonode configuration\n`litecoind` | Litecoind cryptonode configuration\n`terraform.credentials` | local path to a GCP service account JSON key | `\"~/safe/opendax.json\"`\n`terraform.project` | GCP project name | `\"example-opendax\"`\n\n### utils.yml\n\nThe following table lists configurable parameters of the `config/utils.yml` file:\n\nParameter | Description | Default\n--- | --- | ---\nimages | Docker image tags per component |\nsuperset | Superset BI tool configs |\narke | Arke liquidity bot configs |\n\nOnce you're done with the configuration, render the files using `rake render:config`. You can easily apply your changes at any time by running this command.\n\n    Note: be sure to append all the subdomains based on app.domain to your\n    /etc/hosts file if you're running OpenDax locally\n\n### Bringing up the stack\n\nThe OpenDAX stack can be brought up using two ways:\n\n1. Bootstrap all the components at once using `rake service:all[start]`\n2. Start every component one-by-one using `rake service:*component*[start]`\n\nThe components included in the stack are:\n\n- `proxy` - [Traefik](https://traefik.io/), a robust cloud-native edge router/reverse proxy written in Go\n- `backend` - [Vault](https://www.vaultproject.io), [MySQL](https://www.mysql.com), [Redis](https://redis.io) and [RabbitMQ](https://www.rabbitmq.com) grouped together\n- `cryptonodes` - cryptocurrency nodes such as [parity](https://github.com/paritytech/parity-ethereum) **[Optional]**\n- `daemons` - Peatio and Ranger daemons **[Optional]**\n- `setup` - setup hooks for Peatio and Barong to run before the application starts (DB migration etc.)\n- `app` - Peatio is the [crypto exchange software](https://www.openware.com/), [Barong](https://github.com/openware/barong) and the [Ambassador](https://www.getambassador.io) API gateway\n- `frontend` - the frontend application located at `vendor/frontend`\n- `tower` - the Tower admin panel application located at `vendor/tower`\n- `monitoring` - [cAdvisor](https://github.com/google/cadvisor) and [Node Exporter](https://github.com/prometheus/node_exporter) monitoring tools **[Optional]**\n\nFor example, to start the `backend` services, you'll simply need to run `rake service:backend[start]`\n\n    Note: all the components marked as [Optional] need to be installed using\n    rake service:*component*[start] explicitly\n\nGo ahead and try your own OpenDAX exchange deployment!\n\n### Stopping and restarting components\n\nAny component from the stack can be easily stopped or restarted using `rake service:*component*[stop]` and `rake service:*component*[restart]`.\n\nFor example, `rake service:frontend[stop]` would stop the frontend application container and `rake service:proxy[restart]` would completely restart the reverse proxy container.\n\n# Managing component deployments\n\nEach component has a config file (ex. `config/frontend/tower.js`) and a compose file (ex. `compose/frontend.yaml`).\n\nAll config files are mounted into respective component container, except from `config/app.yml` - this file contains all the neccessary configuration of opendax deployment\n\nCompose files contain component images, environment configuration etc.\n\nThese files get rendered from their respective templates that are located under `templates` directory.\n\n## How to update component image?\n\nModify `config/app.yml` with correct image and run `rake service:all`\nThis will rerender all the files from `templates` directory and restart all the running services.\n\nAlternitavely you can update the following files:\n  * `config/app.yml`\n  * `templates/compose/*component*.yml`\n  * `compose/*component*.yml`\nAnd run `rake service:component[start]`\n\n## How to update component config?\n\nModify `config/*component*/*config*` and run `rake service:component[start]`,\nif you want the changes to be persistent, you also need to update `templates/config/*components*/*config*`\n\n#### Render compose file\n```\n# Delete all generated files\ngit clean -fdx\n\n# Re-generate config from config/app.yml values\nrake render:config\n\n# Restart the container you need to reload config\ndocker-compose up frontend -Vd\n```\n\n#### Clone the vendors and start\n```\nsource ./bin/set-env.sh\nrake vendor:clone\ndocker-compose -f compose/vendor.yaml up -d\n```\n\n## Vault management\nOpendax uses [Vault Policies](https://www.vaultproject.io/docs/concepts/policies) to restrict components' access to sensitive data. Each component has its own Vault token which allows granular access only to the data required.\n\nOpenDAX has 2 rake tasks for Vault management:\n```sh\nrake vault:setup # Initial Vault configuration (root token generation, unseal, endpoints configuration)\nrake vault:load_policies # Components' Vault token generation\n```\n\n### Troubleshooting\n#### Vault is sealed\n\nIn case of such error:\n1. Run `rake vault:setup`\n2. Restart the component\n\nMake sure you're not using an existing Docker volume for Vault(i.e. one left after a different Vault container deployment):\n```sh\ndocker volume ls | grep vault\n```\n\nIn case there are existing volumes, remove the running Vault container via `docker rm -f *id*` and run `docker volume rm -f *volume name*`\nAfterward, run `docker-compose up -Vd vault` and re-run `rake vault:setup`.\n\n#### Vault permission denied\nUsually, this means that one of your Vault tokens has expired.\n\nTo fix the issue:\n1. Run `rake vault:load_policies`\n2. Run `rake render:config`\n3. Restart Vault dependant components:\n\n    ```\n    docker-compose up -Vd barong peatio cron_job deposit deposit_coin_address withdraw_coin upstream\n\n    # If you are using Finex\n    docker-compose up -Vd finex-engine\n\n    # If you are using Peatio Matching Engine\n    docker-compose up -Vd matching order_processor trade_executor\n    ```\n\n## Terraform Infrastructure as Code Provisioning\n\nYou can easily deploy OpenDAX from scratch on Google Cloud Platform using [Terraform](https://www.terraform.io)!\n\nTo do this, just follow these simple steps:\n  - Fill `app.yml` with correct values\n  - Run `rake terraform:apply`\n  - Access your VM from the GCP Cloud Console\n\nTo destroy the provisioned infrastructure, just run `rake terraform:destroy`\n\n## Installer tool\n\n```\nruby -e \"$(curl -fsSL https://raw.githubusercontent.com/openware/opendax/master/bin/install)\"\n```\n\n## Using an OpenDAX deployment for local frontend development\n\nIf you'd like to use a real API from an existing OpenDAX deployment when developing frontend components(e.g. [baseapp](https://github.com/openware/baseapp)), modify `templates/config/gateway/envoy.yaml.erb` file the following way:\n\n1. Set `allow_origin` as `\"*\"`\n\n2. Configure all the needed HTTP methods in `allow_methods`. For example: `allow_methods: \"PUT, GET, POST, DELETE, PATCH\"`\n\n3. Add `'total, page, x-csrf-token'` to `allow_headers` value\n\n4. Configure `expose_headers` in a similar way `expose_headers:  \"total, page, x-csrf-token\"`\n\n5. Add `allow_credentials: true` to your CORS configuration\n\nAfter completing these steps, you should have the following config:\n```\ncors:\n  allow_origin:\n  - \"*\"\n  allow_methods: \"PUT, GET, POST, DELETE, PATCH\"\n  allow_headers: \"content-type, x-grpc-web, total, page, x-csrf-token\"\n  expose_headers: \"total, page, x-csrf-token\"\n  allow_credentials: true\n```\n\nAfterwards, apply the config onto your deployment:\n```\nrake render:config\ndocker-compose up -Vd gateway\n```\n\n## Happy trading with OpenDAX!\n\nIf you have any comments, feedback and suggestions, we are happy to hear from you here at GitHub or here: [crypto exchange software](https://www.openware.com/)\n\n## 2.6 Migration guide\n\nTo migrate from 2.5 to 2.6, do the following:\n1. Pull 2-6-stable branch\n   While rebasing, rename your `vault.token` to `vault.root_token` in `config/app.yml`\n2. Run `rake render:config`\n3. Run `dc up -Vd vault`\n4. Run `rake service:all`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenware%2Fopendax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenware%2Fopendax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenware%2Fopendax/lists"}