Sign inSign up

phunv/exchange

By phunv

Updated over 9 years ago

Image
0

250

phunv/exchange repository overview

Docker-compose.yml

version: '2' services: web_bit_station: image: phunv/exchange:latest volumes: - .:/code ports: - "3000:3000" tty: true

SETUP

  • Make sure your system is up-to-date. sudo apt-get update sudo apt-get upgrade

  • Installing rbenv using a Installer sudo apt-get install git-core curl zlib1g-dev build-essential
    libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3
    libxml2-dev libxslt1-dev libcurl4-openssl-dev
    python-software-properties libffi-dev

    git clone git://github.com/sstephenson/rbenv.git .rbenv echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc echo 'eval "$(rbenv init -)"' >> ~/.bashrc exec $SHELL

    git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc exec $SHELL

  • Install Ruby through rbenv rbenv install 2.2.1 rbenv global 2.2.1

  • Install bundler echo "gem: --no-ri --no-rdoc" > ~/.gemrc gem install bundler rbenv rehash

b. Install MySQL sudo apt-get install mysql-server mysql-client libmysqlclient-dev => cahu cai dat

c. Install Redis sudo apt-add-repository -y ppa:rwky/redis sudo apt-get update sudo apt-get install redis-server

d. Install RabbitMQ Please follow instructions here: https://www.rabbitmq.com/install-debian.html sudo apt-add-repository 'deb http://www.rabbitmq.com/debian/ testing main'

curl http://www.rabbitmq.com/rabbitmq-signing-key-public.asc | sudo apt-key add -

sudo apt-get update sudo apt-get install rabbitmq-server sudo rabbitmq-plugins enable rabbitmq_management sudo service rabbitmq-server restart wget http://localhost:15672/cli/rabbitmqadmin chmod +x rabbitmqadmin sudo mv rabbitmqadmin /usr/l e. Setup bitcoind

  • install bitcoind sudo add-apt-repository ppa:bitcoin/bitcoin sudo apt-get update sudo apt-get install bitcoind mkdir -p ~/.bitcoin touch ~/.bitcoin/bitcoin.conf vim ~/.bitcoin/bitcoin.conf

  • Download bitcoin core 0.12.1 and copy to folder Home https://github.com/btcdrak/bitcoin/releases/tag/v0.12.1-addrindex

  • Run reindex bitcoin ./bitcoin-*/bin/bitcoind --reindex

g. Install Javascript Runtime A JavaScript Runtime is needed for Asset Pipeline to work. Any runtime will do but Node.js is recommended. curl -sL https://deb.nodesource.com/setup | sudo bash - sudo apt-get install nodejs

h. Install Image Magick sudo apt-get install imagemagick

i. Setup nginx Install Phusion's PGP key to verify packages sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7

Add HTTPS support to APT sudo apt-get install apt-transport-https ca-certificates

Add the passenger repository. Note that this only works for Ubuntu 14.04. For other versions of Ubuntu, you have to add the appropriate repository according to Section 2.3.1 of this link. sudo add-apt-repository 'deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main' sudo apt-get update

Install nginx and passenger sudo apt-get install nginx-extras passenger

Next, we need to update the Nginx configuration to point Passenger to the version of Ruby that we're using. You'll want to open up /etc/nginx/nginx.conf in your favorite editor, sudo vim /etc/nginx/nginx.conf

find the following lines, and uncomment them: passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini; passenger_ruby /usr/bin/ruby;

update the second line to read: passenger_ruby /home/deploy/.rbenv/shims/ruby;

j. Setup Counterparty https://github.com/unsystemizer/counterparty-config-example

k. Setup production environment variable echo "export RAILS_ENV=production" >> ~/.bashrc source ~/.bashrc

  1. Config a. Pusher Get started here: https://pusher.com/ Use key/secret for config/application.yml PUSHER_APP: “YOUR_APP” PUSHER_KEY: "YOUR_KEY" PUSHER_SECRET: "YOUR_SERECT"

b. Twilio Create your phone number here: https://www.twilio.com/ Use number/sid/token for config/application.yml TWILIO_NUMBER: YOUR_NUMBER TWILIO_SID: YOUR_SID TWILIO_TOKEN: YOUR_TOKEN

c. Notify mail settings In config/application.yml

SMTP_PORT: 587 SMTP_DOMAIN: "gmail.com" # you can using other domain SMTP_ADDRESS: "smtp.gmail.com" SMTP_USERNAME: “YOUR_EMAIL" SMTP_PASSWORD: "YOUR_PASSWORD" SMTP_AUTHENTICATION: login # could be plain, login or cram_md5

SUPPORT_MAIL: "YOUR_MAIL" SYSTEM_MAIL_FROM: "YOUR_MAIL" SYSTEM_MAIL_TO: "YOUR_MAIL" OPERATE_MAIL_TO: "YOUR_MAIL"

d. Bitcoind Copy to file .bitcoin/bitcoin.conf rpcuser=bitcoin-rpc rpcpassword=PaSSw0Rd server=1 daemon=1 testnet=0 rpcthreads=1000 rpctimeout=300 txindex=1 addrindex=1 rpcport=8332

Notify when receiving coins

walletnotify=/usr/local/sbin/rabbitmqadmin publish routing_key=exchangepro.deposit.coin payload='{"txid":"%s"}'

Start bitcoin: ./bitcoin-*/bin/bitcoind

e. Counterparty Copy to file in .config/counterparty/

  • server.conf testnet = 0 counterparty-rpc-connect = localhost counterparty-rpc-user = counterparty-rpc counterparty-rpc-password = WoRD wallet-name = bitcoincore wallet-connect = localhost
    wallet-user = bitcoin-rpc wallet-password = PaSSw0Rd [Default]

testnet = 0 backend-name = addrindex
backend-connect = localhost
backend-port = 8332 backend-user = bitcoin-rpc backend-password = PaSSw0Rd
rpc-host = localhost
testnet = 0 counterparty-rpc-connect = localhost counterparty-rpc-user = counterparty-rpc counterparty-rpc-password = WoRD wallet-name = bitcoincore wallet-connect = localhost
wallet-user = bitcoin-rpc wallet-password = PaSSw0Rd rpc-port = 4000 rpc-user = counterparty-rpc rpc-password = WoRD

  • client.conf

[Default] testnet = 0 counterparty-rpc-connect = localhost counterparty-rpc-user = counterparty-rpc counterparty-rpc-password = WoRD wallet-name = bitcoincore wallet-connect = localhost
wallet-user = bitcoin-rpc wallet-password = PaSSw0Rd

  • Start server counterparty: sudo counterparty-server start

Tag summary

Content type

Image

Digest

Size

473.3 MB

Last updated

over 9 years ago

docker pull phunv/exchange