Welcome to MobiDAX Tutorial: How to Deploy a Centralized Cryptocurrency Trading Platform Using Opensource Software.

This guide is further supported by the 3rd videos in our tutorial video series that you can find on YouTube: https://youtu.be/IPSkhwg4AV8

In this tutorial, we show you how to create 2 Virtual Machines (VM's) and provision them using DockerSwarm. Docker Swarm is a group of physical or virtual machines that are running the Docker application and have been configured to join together in a cluster. Docker Swarm is most suitable for production deployments, as it has great scalability and allows you to balance the load between Virtual Machines efficiently.

Let's get started!

DEVOPS: Docker Swarm Deployment

  1. Creating 2 virtual machines with ssd (! important) >=600gb (use for btc blockchain) and >=700gb (use for eth blockchain)

  2. If deploying on DIGITAL OCEAN create VPC network for droplets and database, firewall:

1st-image

  1. Create shell gitlab runner with tags ‘node-manager’ on manager node, ‘node-1’ on worker node

Install on server gitlab-runner (v13) https://docs.gitlab.com/runner/install/linux-manually.html

In browser in gitlab group open Settings - CI/CD and expand RUNNERS

2nd-image

On server register new ssh gitlab-runner with command:

*sudo gitlab-runner register*

Use URL and token from gitlab group settings (see pic above)

image-3

Add user gitlab-runner to sudoers and enable for him sudo without password

  1. Install Docker (see https://docs.docker.com/engine/install/ubuntu/), create new group docker and add current user in this group

  2. Set docker log limit max-size: 2m, max-file: 3 for docker (see https://docs.docker.com/config/containers/logging/json-file/)

  3. Initialize a swarm
    (see https://docs.docker.com/engine/reference/commandline/swarm_init/)

    docker swarm init - on manager

    docker swarm join --token [token] HOST:PORT - on other nodes

  4. Create new access-token for project opendax-stage - SETTINGS / ACCESS TOKEN

image-4

  1. Clone opendax-prod on all nodes:

    git clone https://:@gitlab.tunex.io//.git

IMPORTANT: After all changes in opendax-prod - pull it in repository and push on all nodes

  1. Install rvm stable (see https://rvm.io/rvm/install), then using rvm install ruby-2.6.5

  2. Goto opendax folder and run
    bundle install

  3. Change file opendax/config/app.yml

image-5
image-6

  1. Check /templates/compose/cryptonodes.yaml.erb, after this run
    rake render:config

image-7

Then start cryptonodes - parity for etherium, bitcoind for bitcoin:

 *docker stack deploy -c compose/cryptonodes.yaml opendax*

After this step cryptonodes start synchronization.

  1. Change admin credentials in seeds: config/barong/seeds.yml

image-8

  1. Run backend services:

    docker stack deploy -c compose/backend.yaml opendax

  2. Use local port tunneling for configuring Vault:

    ssh -L 8200:localhost:8200 user@IPserver

  3. Open in browser Vault management panel: http://localhost:8200

  4. Initialize vault (key shares 3, threshold 3)

image-9

  1. Download keys and unseal using downloading. Save downloaded files in data/save

image-10

  1. Create three engines:
    transit without any correction
    totp without any correction
    kv with next corrections: path ‘secret’, version: 1

  2. Change token in section vault file /config/app.yml

image-11

  1. Create ethereum wallets (using another password - save it in data/save/eth-pass.txt)

  2. rake wallet:create["deposit","http://0.0.0.0:8545","changeme"]
    rake wallet:create["hot","http://0.0.0.0:8545","changeme"]
    rake wallet:create["fee","http://0.0.0.0:8545","changeme"]
    rake wallet:create["warm","http://0.0.0.0:8545","changeme"]

  3. Create bitcoin wallets:
    Find bitcoind container id:
    docker ps |grep bitcoind
    Run bash in a running container:
    docker exec -it bash
    Create wallets:
    export LCALL=C
    bitcoin-cli --rpcuser=admin --rpcpassword=changeme --rpcport=18332 getnewaddress "hot"
    bitcoin-cli --rpcuser=admin --rpcpassword=changeme --rpcport=18332 getnewaddress "deposit"
    bitcoin-cli --rpcuser=admin --rpcpassword=changeme --rpcport=18332 getnewaddress "warm"

  4. Update config/app.yml:

image-12

  1. Render of config/compose files:

    rake render:config

  2. Start main services:

    docker stack deploy -c compose/app.yaml -c compose/gateway.yaml opendax

  3. Seed databases:

docker exec bash -c "./bin/linkconfig && bundle exec rake db:create db:migrate"
docker exec bash -c "./bin/linkconfig && bundle exec rake db:seed"
docker exec bash -c "./bin/initconfig && bundle exec rake db:create db:migrate"
docker exec bash -c "./bin/linkconfig && bundle exec rake db:seed"

  1. Seed influxdb base:

    docker exec bash -c "cat peatio.sql | influx"

  2. Start daemons:

    docker stack deploy -c compose/daemons.yaml opendax

  3. Start frontend services:

    docker stack deploy -c compose/frontend.yaml opendax

This is a wrap! Join us in this tutorial and deploy your own cryptocurrency exchange platform!

Stay tuned for more great content, subscrive to our YouTube Channel and Telegram Opensource Support Group:

YouTube:     https://www.youtube.com/c/MobiDAX
Telegram:    https://t.me/MobiDAX_group
Email:       info@mobidax.io**

MobiDAX - Built by a team with nearly 5 years experience developing Cryptocurrency and Fiat Trading Platforms. Today, MobiDAX.io leads the evolution of deploying, customizing and maintaining such platforms as the world's first and only cross-platform solution for Web, iOS, Android and Desktop Applications.

Our specialized team is responsible for deployment of more than 50 Cryptocurrency Trading Platforms, with many listed on CMC Top100. (https://coinmarketcap.com/rankings/exchanges)

Contact our team. We will gladly assist you in the decision making process, from conceptual planning to production!

Website:     https://MobiDAX.io
Twitter:     https://twitter.com/MobiDAX
LinkedIn:    https://www.linkedin.com/company/mobidax
Facebook:    https://www.facebook.com/MobiDAX