Skip to content

Latest commit

 

History

History
147 lines (85 loc) · 3.26 KB

development.md

File metadata and controls

147 lines (85 loc) · 3.26 KB

Developing document for Mac and Linux

The Peatio installation consists of setting up the following components:

  1. Requirements
  2. Bitcoind
  3. Peatio

1. Requirements

  • Linux / Mac OSX
  • Ruby 2.1.0, using RVM or rbenv
  • MySQL
  • Redis
  • PhatomJS
  • qrencode
  • Pusher

** More details are in the requirements doc

reCAPTCHA

Peatio use reCAPTCHA to make sure certain operations is not done by bots. A development key/secrect pair is provided in config/application.yml (uncomment to use). PLEASE USE IT IN DEVELOPMENT/TEST ENVIRONMENT ONLY!

Pusher

Peatio depends on Pusher. A development key/secret pair for development/test is provided in config/application.yml (uncomment to use). PLEASE USE IT IN DEVELOPMENT/TEST ENVIRONMENT ONLY!

More details to visit pusher official website

Install PhatomJS

For Mac

brew install phantomjs

For Ubuntu

sudo apt-get install -y libfontconfig libfontconfig-dev libfreetype6-dev
  • Download the 32 bit or 64 bit binary.
  • Extract the tarball and copy bin/phantomjs into your PATH

** More details are in the poltergeist doc.

Install qrencode

For Mac

brew install qrencode

For Ubuntu

sudo apt-get install qrencode libqrencode-dev

2. Bitcoind

Install bitcoind

For Mac

Download and Install Bitcoin

For Ubuntu

sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install -y bitcoind

Configure bitcoind

Insert the following lines into your bitcoin.conf, and replce with your username and password.

server=1
daemon=1
rpcuser=INVENT_A_UNIQUE_USERNAME
rpcpassword=INVENT_A_UNIQUE_PASSWORD

# If run on the test network instead of the real bitcoin network
testnet=1

For Mac

~/Library/Application\ Support/Bitcoin/bitcoin.conf

For Linxu

~/.bitcoin/bitcoin.conf

Start Bitcoind

For Mac

open /Applications/Bitcoin-Qt.app --args -server

For Linux

bitcoind

3. Peatio

Clone the project
git clone [email protected]:peatio/peatio.git
cd peatio
bundle install
Prepare configure files:
cp config/application.yml.example config/application.yml
cp config/database.yml.example config/database.yml
Setup reCAPTCHA/Pusher:
# uncomment reCAPTCHA and Pusher related settings
vim config/application.yml
Setup bitcoind rpc endpoint
# replace username:password and port with the one you set in
# bitcoin.conf in previous step
vim config/currency.yml
Config database settings:
vim config/database.yml

# Initialize the database and load the seed data
bundle exec rake db:setup
Run Peatio
rake environment resque:work QUEUE=*
rails server
user: [email protected]
pass: Pass@word8