Opendax
Open-Source Cloud-Native Digital Asset & Cryptocurrency Exchange Platform
Install / Use
/learn @openware/OpendaxREADME

OpenDAX
OpenDAX is an open-source cloud-native multi-service platform for building a Blockchain/FinTech exchange of digital assets, cryptocurrency and security tokens.
Getting started with OpenDAX
1. Get a VM
Minimum VM requirements for OpenDAX:
- 8GB of RAM (12GB recommended)
- 4 cores vCPU (6 cores recommended)
- 300GB disk space (SSD recommended)
A VM from any cloud provider like DigitalOcean, Vultr, GCP, AWS as well as any dedicated server with Ubuntu, Debian or Centos would work
2. Prepare the VM
2.1 Create Unix user
SSH using root user, then create new user for the application
useradd -g users -s `which bash` -m app
2.2 Install Docker and docker compose
We highly recommend using docker and compose from docker.com install guide instead of the system provided package, which would most likely be deprecated.
Docker follow instruction here: docker Docker compose follow steps: docker compose
2.3 Install ruby in user app
2.3.1 Change user using
su - app
2.3.2 Clone OpenDAX
git clone https://github.com/openware/opendax.git
2.3.3 Install RVM
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s stable
cd opendax
rvm install .
3. Bundle install dependencies
bundle install
rake -T # To see if ruby and lib works
Using rake -T you can see all available commands, and can create new ones in lib/tasks
4. Run everything
4.1 Configure your domain
If using a VM you can point your domain name to the VM ip address before this stage.
Recommended if you enabled SSL, for local development edit the /etc/hosts
Insert in file /etc/hosts
0.0.0.0 www.app.local
4.2 Bring everything up
rake service:all
You can login on www.app.local with the following default users from seeds.yaml
Seeded users:
Email: admin@barong.io, password: 0lDHd9ufs9t@
Email: john@barong.io, password: Am8icnzEI3d!
[Optional] KYCAID
In order to accelerate customer interaction, reduce risks and simplify business processes you can use KYC Verification Service from KYCaid. KYC goal is to prevent fraud and to decline users that don’t fulfill certain standards of credibility. To learn more about KYCaid and pricing you can visit their website - kycaid.com
How to configure KYCAID on the platform?
KYCAID is already integrated into our stack, to use it you'd need to create an account on kycaid.com, and set up authentification creds there and the callback url: https://example.com/api/v2/barong/public/kyc
After that all you have to do is to change several lines in config/app.yml:
kyc:
provider: kycaid
authorization_token: changeme # your production API token from the 'Settings' section of kycaid.com
sandbox_mode: true # 'true' for test environments - documents will be verified/rejected automatically, without payment for verification
api_endpoint: https://api.kycaid.com/
Additional settings for KYCAID
- Be sure to check
BARONG_REQUIRED_DOCS_EXPIREENV value insideconfig/barong.envto befalseif you want to includeaddressverification in your KYC process. You can set it totrueif you need the document check only. - Check if you have the correct list of
document_typesin theconfig/barong/barong.ymlfile:- Passport
- Identity card
- Driver license
- Address
- Frontend KYC steps can be configured in
templates/config/frontend/env.js.erbvia thekycStepsfield - Tower KYC labels can be configured in
templates/config/frontend/tower.js.erbvia thelabelSwitcherfield
Usage
Initial configuration
All the OpenDAX deployment files have their confguration stored in config/app.yml.
app.yml
The following table lists the configurable parameters of the config/app.yml configuration file and its default values.
Parameter | Description | Default
--- | --- | ---
app.name | global application name | "OpenDax"
app.domain | base domain name | app.local
app.subdomain | subdomain | www
app.show_landing | enable/disable landing page display for the frontend application | true
render_protect | enable read-only mode for rendered files | false
csrfEnabled | enable CSRF protection on Barong | false
ssl.enabled | enable SSL certificate generation | false
ssl.email | email address used for SSL certificate issuing | "support@example.com"
updateVersions | update all image tags by fetching global ones for OpenDAX | false
images | Docker image tags per component
vendor.frontend | optional Git URL for a development frontend repo | git@github.com:openware/baseapp.git
kyc.provider | KYC provider, can be kycaid or local | kycaid
kyc.authorization_token | optional API token for KYCAID use | changeme
kyc.sandbox | enable KYCAID test mode | true
kyc.api_endpoint | API endpoint for KYCAID | https://api.kycaid.com/
vault.root_token | Root Vault authentication token | changeme
vault.peatio_rails_token | Peatio Server Vault authentication token | changeme
vault.peatio_crypto_token | Peatio Daemons (cron_job, deposit, deposit_coin_address, withdraw_coin) Vault authentication token | changeme
vault.peatio_upstream_token | Peatio Upstream Daemon Vault authentication token | changeme
vault.peatio_matching_token | Peatio Daemons (matching, order_processor, trade_executor) Vault authentication token | changeme
vault.barong_token | Barong Vault authentication token | changeme
vault.finex_engine_token | Finex Engine Vault authentication token | changeme
database.adapter| database adapter kind either mysql or postgresql |mysql
database.host | database host name | db
database.port | database port | 3306
database.user | database username | root
database.password | database root password | changeme
storage.provider | object storage provider | "Google"
storage.bucketname | storage bucket name | "opendax-barong-docs-bucket"
storage.endpoint | S3-compatible storage API endpoint | "https://fra1.digitaloceanspaces.com"
storage.region | storage region | "fra1"
storage.signatureVersion | S3-compatible storage API signature version(2 or 4) | "fra1"
storage.secretkey, storage.accesskey | storage access keys | "changeme"
twilio | Twilio SMS provider configs
gaTrackerKey | Google Analytics tracker key inserted into the frontend app
smtp | SMTP configs used for sending platform emails
captcha | captcha configuration(Recaptcha or Geetest)
wallets | configs for wallets seeded during the initial deployment of Peatio
parity | Parity cryptonode configuration
bitcoind | Bitcoind cryptonode configuration
litecoind | Litecoind cryptonode configuration
terraform.credentials | local path to a GCP service account JSON key | "~/safe/opendax.json"
terraform.project | GCP project name | "example-opendax"
utils.yml
The following table lists configurable parameters of the config/utils.yml file:
Parameter | Description | Default --- | --- | --- images | Docker image tags per component | superset | Superset BI tool configs | arke | Arke liquidity bot configs |
Once 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.
Note: be sure to append all the subdomains based on app.domain to your
/etc/hosts file if you're running OpenDax locally
Bringing up the stack
The OpenDAX stack can be brought up using two ways:
- Bootstrap all the components at once using
rake service:all[start] - Start every component one-by-one using
rake service:*component*[start]
The components included in the stack are:
proxy- Traefik, a robust cloud-native edge router/reverse proxy written in Gobackend- Vault, MySQL, Redis and RabbitMQ grouped togethercryptonodes- cryptocurrency nodes such as parity [Optional]daemons- Peatio and Ranger daemons [Optional]setup- setup hooks for Peatio and Barong to run before the application starts (DB migration etc.)app- Peatio is the crypto exchange software, Barong and the Ambassador API gatewayfrontend- the frontend application located atvendor/frontendtower- the Tower admin panel application located atvendor/towermonitoring- cAdvisor and Node Exporter monitoring tools [Optional]
For example, to start the backend services, you'll simply need to run rake service:backend[start]
Note: all the components marked as [Optional] need to be installed using
rake service:*component*[start] explicitly
Go ahead and try your own OpenDAX exchange de
