Skip to content

DigitalOcean Installation

Ali Shanaakh edited this page Oct 1, 2018 · 9 revisions

Workbench on DigitalOcean

Requirements:

  • Experience with DigitalOcean.
  • DigitalOcean Project.

Create Virtual Machine

  • At the top of the page click Create.

  • Choose Droplets.

  • Choose Debian 9.5 x64 image

DigitalOcean Image

  • Choose size of machine, recommended is 16 GB 6 vCPUs, required is 8 GB 4 vCPUs.

DigitalOcean Size Of Machine

  • Add SSH Key to droplet.

DigitalOcean SSH Key

  • Choose a datacenter region, that fits your needs best.

DigitalOcean Datacenter Region

  • Type name of workbench machine, for example workbench-vm.

DigitalOcean Name Of Machine

  • Double check your settings before creating.

  • Click Create button at the bottom of the page.

Create firewall

  • In the green rectangle you will find public IP address of your droplet.

DigitalOcean Name Of Machine

  • Open Cloud Firewalls.

DigitalOcean

  • Click Create Firewall to add new firewall.

DigitalOcean

Install workbench

SSH to the created virtual machine

$> ssh root@<public-ip>

Install docker

$> apt-get update -y && aptitude install curl
$> curl -fsSL get.docker.com | sh

Install docker-compose

$> curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
$> chmod +x /usr/local/bin/docker-compose

Install dependencies

$> apt-get update -y
$> apt-get install -y git autoconf bison build-essential libssl-dev \
                           libyaml-dev libreadline6-dev zlib1g-dev \
                           libncurses5-dev libffi-dev libgdbm3 libgdbm-dev

Create user

$> useradd --create-home -g users -G docker --shell /bin/bash workbench
$> su workbench 
$> cd $HOME

Install rbenv and ruby

$> git clone git://github.com/sstephenson/rbenv.git .rbenv
$> git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

$> echo 'export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bash_profile
$> echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

$> source ~/.bash_profile

$> rbenv install -v 2.5.1
$> rbenv global 2.5.1

$> echo "gem: --no-document" > ~/.gemrc

$> gem install bundler

Download workbench

$> git clone --recursive https://www.github.com/rubykube/workbench.git && cd workbench

Download submodules

$> make update

Download workbench dependencies

$> bundle install

Replace domain

Set $new_domain variable equal to your domain and run bash script:

#!/bin/bash

old_domain="wb.local" 
new_domain="your.domain"

files=(
    "compose/proxy.yaml"
    "compose/backend.yaml"
    "compose/app.yaml"
    "config/trading-ui.env"
    "compose/cryptonodes.yaml"
    "config/integration/fixtures/barong.json"
    "config/integration/fixtures/peatio.json"
    "config/peatio.env"
    "config/barong.env"
    "config/barong/seeds.yml"
    "config/toolbox.yaml"
)

for file in ${files[@]}; do
    sed -i "s/${old_domain}/${new_domain}/g" ${file}
done

Build images

$> make build

Run the application

$> make run

Post installation

After deployment, height of blockchains should be updated to start receiving deposits.

Go to Blockchains Tab in Peatio Admin Panel and update height

Best way to find current blockchains height:

  1. Ethereum Rinkeby Blockchain Explorer
  2. Bitcoin Testnet Blockchain Explorer