Skip to content
forked from bhirbec/bitbot

Fun project that computes bitcoin arbitrage opportunities

Notifications You must be signed in to change notification settings

dilongfa/bitbot

 
 

Repository files navigation

Fun side project that fetches cryptocurrency orderbooks, computes arbitrage opportunities and show cool D3 charts.

Technical stack includes:

Install

Vagrant Install

Install VirtualBox, Vagrant, and Google Cloud SDK.

Create the Vagrant machine:
$ vagrant up

Connect to the VM:
$ vagrant ssh

Create the MySQL database:
$ sudo mysql -u root < db/init.sql

Start the Services

You first need to compile the Go code and build the JavaScript application:
$ cd /vagrant
$ make

Now you can start the record service which fetches Bitcoin orderbooks from several exchangers:

$ bin/record

Start the web service that powers the UI and provides the API (you will need another SSH session):

$ bin/web -b 0.0.0.0:8080

Open your browser and point it at localhost:8080

Note: you will need to run make and restart the services each time you make a change to the code.

Deploy the Code on GCE

Install Ansible

$ git clone git://github.com/ansible/ansible.git --recursive
$ cd ./ansible
$ source ./hacking/env-setup
$ git pull --rebase
$ git submodule update --init --recursive
$ sudo make install

Create the Server

Create the VM, the disk and provision the VM:

$ ./ansible/server-create.sh

Connect to the MV and initialize the MySQL database "manually":

$ gcloud compute ssh bitbot-1

Deployment

You can test deployment playbook with vagrant: $ ansible-playbook --private-key=.vagrant/machines/default/virtualbox/private_key -i ansible/vagrant_host ansible/deploy.yaml --extra-vars "project_dir=/vagrant dev=true"

Configure gcloud ssh (only once): $ gcloud compute config-ssh --project the-bitbot-project

Run ansible-playbook:

$ ansible-playbook -i ansible/gce_host ansible/deploy.yaml

About

Fun project that computes bitcoin arbitrage opportunities

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.8%
  • HTML 0.2%
  • Makefile 0.0%
  • JavaScript 0.0%
  • Shell 0.0%
  • Dockerfile 0.0%