How To Deploy OpenDAX3 On Digital Ocean

In this tutorial, we will deploy OpenDAX3 - an open-source cloud-native cryptocurrency exchange software platform on the Digital Ocean cloud.

Apr 20 2021 | tutorials

How to deploy OpenDAX3 on Digital Ocean

Hello, world!

In this tutorial, we will deploy OpenDAX3 - an open-source cloud-native cryptocurrency exchange software platform on the Digital Ocean cloud.

OpenDAX™ stands for 'Open-Source Digital Assets Exchange'.is an open-source software which allows users to build a fully featured exchange service to facilitate trading of digital assets and cryptocurrencies.

Digital Ocean is a cloud infrastructure provider which will host the OpenDAX platform on its servers.

So, let's get started!

Prerequisites

Setting up Digital Ocean

1. Signup on Digital Ocean

Sign up on Digital Ocean with your email or with Google or Github.

Capture 4

2. Set up Payments

After signing in, set up the payment methods. Digital Ocean only allows credit cards or Paypal for now.

After providing the necessary details, you might have to top up with at least $5 dollars to proceed forward. There is also a free 100 dollar credit offer(https://try.digitalocean.com/freetrialoffer/) from which you can sign up using your email.

Capture 5

3. Create a Project

Once you are set up with payments. Digital Ocean redirects to their dashboard, where you can create a new OpenDAX project. On the left-hand side, you will see a (+)new project button. Click on it, and you will see the following window Capture 6

Fill up the fields and click on the green Create Project button, which will bring you to move the resources panel. Since we are using the Digital ocean from scratch, there are no existing computing resources. We will click on the skip for now option.

Capture 7

4. Creating a droplet/Virtual Machine(VM)

After clicking skip for now, there is an option to get started with a new droplet for hosting your OpenDAX platform. Click on it

Capture 8

Choose a Linux distribution Image.

We are using Debian 9 for this tutorial.

Capture 9

Choose CPU, Disk Space, and RAM

We have chosen 4GB, 80GB, 2CPU's for this tutorial, but the recommended requirements for OpenDAX are 12GB,8 CPU's, 300GB SSD disk space.

Capture 10

Attach a Block Storage

We are attaching block storage of 100GB to the VM for handling large OpenDAX project files.

Capture 11 Capture 12

Add SSH Keys

Authentication will be done using SSH keys. I have already created my own key named hmehndiratta, but you can click on add a new SSH key and follow these digital Ocean instructions on How to Add SSH Keys to Droplets

Capture 13 Capture 14

Assign Resources to Project and Create droplet

Leave other options to default and scroll down to select a project as OpenDAX3, and click on the green create droplet button.

Capture 15

Check Droplet IP

Now the Droplet/VM would become ready and would have a public IP assigned(This one has 64.227.103.148)

Capture 16

Connecting a domain to a DigitalOcean Droplet

To make the OpenDAX platform available to users. The Digital Ocean droplet has to be mapped to domain (www.example.com) which users will reach. There are many domain registrars available like GoDaddy, NameCheap, Hostgator, which provide domain names at easy rates. We are choosing Namecheap for this tutorial.

1. Setup Domain

Setting up a domain is easy with NameCheap search for the desired domain name and buy. The domain will be activated just after the payment is made.

Capture 17

Our Domain

We have bought an OpenDAX testing domain called www.testopendax.xyz, which is active and running.

Capture 18

2. Connect it with Digital Ocean Name Servers

For connecting the domain to the digital ocean droplet, we have to add digital ocean name servers as a custom DNS*. For more detailed instructions, follow this guide from Namecheap

Capture 19

*Changes might take 24-48 hrs to reflect.

3. Setup DNS Records in Digital Ocean

In your OpenDAX3 Digital ocean project, Click on the upper right create button and choose Domains/DNS.

Capture 20

Add Domain and Nameservers

Enter the domain, specify the OpenDAX3 project and click on add domain button

Capture 21

Now the domain (testopendax.xyz) redirects to nameservers mentioned in the Namecheap DNS settings.

Capture 22

Create a Manual DNS Record for connecting Droplet and Domain

Enter a hostname. In this case, we have entered "www" which will automatically add testopendax.xyz at the end of it, as shown in the screenshot. Choose the recently created droplet for redirection, leave TTL to default(3600) and click create a record.

Capture 23

Now the droplet is connected to the Namecheap Domain and directs to Droplet IP as shown in the DNS records list.

Capture 24

Check Connection between Domain and Droplet

To check the connection between the domain and droplet IP, open https://whatismyipaddress.com/hostname-ip and enter your domain name. It should show your droplet IP.

Capture 25

Deployment

Once the droplet is setup and the domain is connected to the droplet. We have to start the deployment of OpenDAX on droplet.

1. SSH to Droplet

Open Terminal/Command Prompt on your local computer and ssh as an administrator into the droplet using this command

ssh root@<droplet IP>

It will ask you to continue connecting say Yes, and you will see the following result.

Capture 26

2. Install Docker and Docker Compose.

We highly recommend installing using docker and docker-compose from the below links if you are using a different Linux distribution.

Docker Installation instructions

Docker Compose Installation Instructions

But If you are using Debian, execute these commands in order.

Docker Installation

  1. Update the apt package index and install packages to allow apt to use a repository over HTTPS:
   sudo apt-get update

   sudo apt-get install \
       apt-transport-https \
       ca-certificates \
       curl \
       gnupg \
       lsb-release
  1. Add Docker’s official GPG key:
   curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
  1. Command to set up the stable repository.
    echo \
     "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
     $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

4.Update the apt package index, and install the latest version of Docker Engine and containerd,

  sudo apt-get update
  sudo apt-get install docker-ce docker-ce-cli containerd.io

Once all the above commands are executed.Run this command to check docker is installed.

docker ps

You should see the following result.

Capture 27

Docker Compose Installation

  1. Run this command to download the current stable release of Docker Compose:
   sudo curl -L "https://github.com/docker/compose/releases/download/1.28.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  1. Apply executable permissions to the binary:
   sudo chmod +x /usr/local/bin/docker-compose

For example:

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

3.Test the installation.

$ docker-compose --version
docker-compose version 1.28.5, build 1110ad01

Here is the output of all commands

docker compose

3. Get Ruby

OpenDAX is build using Ruby programming language, which has to be installed before cloning the OpenDAX repository.

Instructions

1.Dirmngr package has to be installed to add Ruby's GPG key

 sudo apt-get install dirmngr
  1. Add Ruby's GPG Key gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
  2. Get Ruby Version Manager(RVM) curl -sSL https://get.rvm.io | bash -s stable

ruby

4. Clone OpenDAX

Clone the OpenDAX repository using the following command

git clone https://github.com/openware/opendax.git

After successful cloning, The output would be -

28

5. Restart the Command Prompt and Navigate into the OpenDAX directory

​ 1.Close and restart the terminal window for Ruby Installation to take effect.SSH into droplet and navigate into Opendax directory using the command-

cd opendax

rvm install

2.Once you navigate to the opendax directory, It will ask you to install ruby version 2.6.6, something like this

29

  1. Install Ruby 2.6.6 and Bundler 2.1.4 package for installing OpenDAX ruby packages.

Command for Ruby

   rvm install "ruby-2.6.6"

Command for Bundler

   gem install bundler:2.1.4

ruby and bundler install

6. Install the OpenDAX dependencies

  1. Make sure you are in the OpenDAX directory to install OpenDAX dependencies using the following command
bundle install

opendax bundle install

7.Configure the dependencies

  1. In the opendax directory, navigate to the config folder using

      cd config
    

    and edit the app.yml using

      nano app.yml
    

configure app

  1. app.yml will look something like this

30

There are many variables to configure here, such as images,finex, and KYC, for better functionality, but for this tutorial, we will only configure the essential ones to get the platform started

​ Fields such as the domain, subdomain, and SSL has to be configured.

domain: testopendax.xyz (your domain name) subdomain: www ssl enabled: true

After editing,the app.yml will look like this

31

Make changes to the file by hitting CTRL+X, typing y, and clicking enter.

8. Run OpenDAX platform

Navigate back to the Opendax directory using the command

cd - cd -

Fire all the OpenDAX dependencies using

rake service:all

This will take up to a minute or two.

After completion of the command, the terminal output would look something like this.

32

9. Open the OpenDAX Platform UI in Browser

To open the OpenDAX UI. Enter the registered domain(www.testopendax.xyz) in the browser.OpenDAX platform would be fully functional and accessible.

Capture 2.JPG

10. Enter User Credentials and Create your Customized Exchange

Login with the given email and password or use the following default users for the demo.

Email: admin@barong.io, password: 0lDHd9ufs9t@
Email: john@barong.io, password: Am8icnzEI3d!

Capture 2.JPG