We advise you to use docker and peatio-workbench as your local development environment
Follow this guide for container-based development environment setup
- Install Homebrew
- Install Ruby
- Install MySQL
- Install Redis
- Install RabbitMQ
- Install Bitcoind
- Install PhantomJS
- Install ImageMagick
- Configure Peatio
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
Install rbenv:
brew install rbenv ruby-build
Add rbenv to bash so that it loads every time you open a terminal:
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile
Install Ruby and set it as the default version:
rbenv install 2.5.0
rbenv global 2.5.0
ruby -v
Install bundler:
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
gem install bundler
rbenv rehash
Install mysql brew package:
brew install mysql
Start the mysql server:
mysql.server start
Install redis brew package:
brew install redis
Start the redis server:
brew services start redis
Install rabbitmq brew package:
brew install rabbitmq
Start the rabbitmq server:
brew services start rabbitmq
Download and Install Bitcoin Core. Prepare config files:
mkdir -p ~/Library/Application\ Support/Bitcoin
touch ~/Library/Application\ Support/Bitcoin/bitcoin.conf
vim ~/Library/Application\ Support/Bitcoin/bitcoin.conf
Insert the following lines into bitcoin.conf
. Don't forget to replace your username and password.
server=1
daemon=1
# If run on the test network instead of the real bitcoin network
testnet=1
# You must set rpcuser and rpcpassword to secure the JSON-RPC api
# Please make rpcpassword to something secure, `5gKAgrJv8CQr2CGUhjVbBFLSj29HnE6YGXvfykHJzS3k` for example.
# Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332)
rpcuser=USERNAME
rpcpassword=PASSWORD
rpcport=18332
# Notify when receiving coins
walletnotify=/usr/local/sbin/rabbitmqadmin publish routing_key=peatio.deposit.coin payload='{"txid":"%s", "currency":"btc"}'
Open the bitcoin app:
open /Applications/Bitcoin-Qt.app
Peatio uses Capybara with PhantomJS to do the feature tests, so if you want to run the tests. Install the PhantomJS is neccessary.
brew install phantomjs
brew install imagemagick
git clone [email protected]/rubykube/peatio.git
cd peatio
bundle install
bin/init_config
npm install -g yarn
bundle exec rake yarn:install
Peatio depends on pusher.
A development key/secret pair for development/test
is provided in config/application.yml
.
PLEASE USE IT IN DEVELOPMENT/TEST ENVIRONMENT ONLY!
Set (or simply uncomment) pusher-related settings in config/application.yml
.
You can always find more details about pusher configuration at pusher website
Edit config/currencies.yml
.
Replace username:password
and port
.
username
and password
should only contain letters and numbers,
do not use email as username
.
bundle exec rake db:setup
Read how to deal with Peatio daemons at Peatio daemons.
To generate liability proof run:
bundle exec rake solvency:liability_proof
Otherwise you will get an exception at the "Solvency" page.
Start the server:
bundle exec rails server
Once server is up and running, visit http://localhost:3000
Sign in:
- user: [email protected]
- pass: Pass@word8