Skip to content

Google Cloud Platform Installation

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

Workbench on Google Cloud Platform

Requirements:

  • Experience with Google Cloud Platform.
  • Google Cloud Project.

Create Virtual Machine

  • Open Google Cloud Console.

  • On the left sidebar find Compute Engine -> VM instances.

  • At the top of the page click CREATE INSTANCE.

  • Change name of the instance from instance-1 to a better name.

  • Choose region and zone, that fits your needs best.

  • Select machine type, recommended is n1-standart-8, required is n1-standart-4.

  • Increase size of the boot disk, recommended size is 60GB, required is 45GB.

  • Don't change default OS image: Debian GNU/Linux 9 (stretch).

  • Check two checkboxes under the Firewall section.

    • Allow HTTP traffic
    • Allow HTTPS traffic
  • Double check your settings before creating.

Settings before VM Creation

  • Click Create button at the bottom of the page.

Post creation steps

Here is your created vm. In the green rectangle you will find public IP of your virtual machine.

Compute Engine Page After Creation

  • Create A record and point it to public IP of your workbench machine.

DNS Records

Install workbench

SSH to the created virtual machine

$> gcloud compute --project <project-id> ssh --zone <vm-zone> <vm-name>

Login as root user

$> sudo -i

Install docker

$> 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