An open-source Crypto-Currency exchange.
Clone or download
Pull request Compare This branch is 675 commits ahead, 3 commits behind peatio:master.
Permalink
Failed to load latest commit information.
app Add env RANGER_CONNECT_SECURE (#1718) Oct 11, 2018
bin Move versions to Peatio::Application. Remove lib/peatio (closes #1619) ( Sep 5, 2018
config [ci skip] Bump 1.9.1-rc.14. Oct 18, 2018
db Changed address limits (#1701) Sep 26, 2018
docs [ci skip] Bump 1.9.1-rc.14. Oct 18, 2018
lib K line daemon & API fix & specs improvement Oct 2, 2018
public Ability to see Transaction ID in user interface (#1546) Aug 17, 2018
spec K line daemon & API fix & specs improvement Oct 2, 2018
vendor Ranger integration (#1686) Sep 19, 2018
.dockerignore Add files related to development, etc to .dockerignore (#689) Mar 14, 2018
.gitignore Embed «WithdrawChannel» in «Currency» (#884) Apr 18, 2018
.rspec Updating to Rails 4.0.13 Nov 16, 2017
.ruby-version Updating patch level for gems (#1512) Aug 9, 2018
.travis.yml Remove peatio-trading-ui and dependencies from CI Aug 28, 2018
CHANGELOG.md Updating CHANGELOG for 2018 Aug 9, 2018
Dockerfile Removing Chromium from Dockerfile Aug 27, 2018
Gemfile Ranger integration (#1686) Sep 19, 2018
Gemfile.lock [Security] Bump nokogiri from 1.8.4 to 1.8.5 Oct 18, 2018
LICENSE.md Add LICENSE.md (#311) Jan 17, 2018
README.md Various fixes in docs (#1672) Sep 19, 2018
Rakefile Add magic annotation (encoding + frozen_string_literal) to each Ruby … May 15, 2018
config.ru Add magic annotation (encoding + frozen_string_literal) to each Ruby … May 15, 2018
package.json Integrate Blockchain and Wallet model and services with new transacti… Aug 9, 2018
yarn.lock [ci skip] Bump 1.9.1-rc.10. Sep 26, 2018

README.md

Peatio - an open-source crypto currency exchange

Build Status Telegram Chat

Peatio.tech Introduction

Peatio is a free and open-source crypto currency exchange implementation with the Rails framework. Peatio.tech is a fork of Peatio designed for micro-services architecture. We have simplified the code in order to use only Peatio API with external frontend and server components.

To build your own exchange you should now run Peatio as a backend instead of forking the repository, and extend it using other microservices such as Barong.

Mission

Our mission is to build an open-source crypto currency exchange with a high performance trading engine and incomparable security. We are moving toward dev/ops best practices of running an enterprise grade exchange.

We provide webinar or on site training for installing, configuring and administration best practices of Peatio. Feel free to contact us for joining the next training session: Peatio.tech

Help is greatly appreciated, feel free to submit pull-requests or open issues.

Things You Should Know

RUNNING AN EXCHANGE IS HARD.

This repository is not a turn key solution and will require engineering and design of security process by your company, with or without our assistance. This repository is one component among many we recommend using for composing an enterprise grade exchange. It is highly recommended to deploy a UAT environment and build automated tests for your needs, including Functional tests, Smoke tests and Security vulnerability scans. You may not need to have an active developer on Peatio source code, however, we recommend the following team setup: 1 dev/ops, 3 frontend developers (react / angular), 2 QA engineers, 1 Security Officer.

SECURITY KNOWLEDGE IS A REQUIREMENT.

Peatio cannot protect your customers if you leave your admin password 1234567, or open sensitive ports to public internet. No one can. Running an exchange is a very risky task because you're dealing with money directly. If you don't know how to make your exchange secure, hire an expert.

You must know what you're doing, there's no shortcut. Please get prepared before you continue:

  • Rails knowledge
  • Security knowledge
  • Cloud and Linux administration
  • Docker and Kubernetes administration
  • Micro-services and OAuth 2.0

Features

  • Designed as high performance crypto currency exchange
  • Built-in high performance matching-engine
  • Built-in multiple wallet support (e.g. deposit, hot, warm and cold)
  • Build-in Management API - server-to-server API with high privileges
  • Build-in RabbitMQ Event API
  • Usability and scalability
  • Websocket API and high frequency trading support
  • Support multiple digital currencies (e.g. Bitcoin, Litecoin, Ethereum, Ripple etc.)
  • Support ERC20 Tokens
  • API endpoint for FIAT deposits or payment gateways.
  • Powerful admin dashboard and management tools
  • Highly configurable and extendable
  • Industry standard security out of box
  • Maintained by peatio.tech
  • KYC Verification provided by Barong

Getting Started

We advice to use minimalistic environment if you want to develop only Peatio and don't touch processes which interact with other components.

Otherwise we advice to use workbench based environment

Minimalistic local development environment with docker-compose:

Prerequisites

Installation

  1. Copy initial configurations ./bin/init_config
  2. Install yarn dependencies bundle exec rake yarn:install
  3. Start backend services (RabbitMQ, Redis, MySQL) docker-compose -f config/backend.yml up -d
  4. Setup database bundle exec rake db:create db:migrate db:seed
  5. Start peatio daemons god -c lib/daemons/daemons.god
  6. Start rails server bundle exec rails server

Local development environment with workbench:

We suggest you to start using Peatio by installing Workbench. Workbench which is based on Docker containers is a convenient and straightforward way to start Peatio development environment.

Prerequisites

Prepare the workbench

  1. Recursive clone : git clone --recursive https://github.com/rubykube/workbench.git
  2. Move to workbench cd workbench
  3. Build the images: make build
  4. Run the application: make run

You should add those hosts to your /etc/hosts file:

0.0.0.0 api.wb.local
0.0.0.0 auth.wb.local

0.0.0.0 api.slanger.wb.local
0.0.0.0 ws.slanger.wb.local

0.0.0.0 pma.wb.local
0.0.0.0 monitor.wb.local

0.0.0.0 btc.wb.local
0.0.0.0 eth.wb.local

Now you have peatio up and running.

Barong

Barong is an essential part of Rubykube Peatio. It is a KYC OAuth 2.0 provider. Barong replace the KYC, 2FA, Phone verification from legacy Peatio. Barong manage roles and kyc level across all applications from the RKCP. It's easy to extend by using the EventAPI or Rest API.

Barong key features
  • KYC Verification for individuals
  • SMS and Google two-factor authentication
  • OAuth 2.0 provider
  • Transaction Signature support
  • Supply JWT tokens to frontend and mobile app

Start barong:

$> docker-compose run --rm barong bash -c "./bin/link_config && ./bin/setup"
$> docker-compose up -d barong

This will output password for admin@barong.io. Default password is Qwerty123

Peatio

Start peatio server

$> docker-compose run --rm peatio bash -c "./bin/link_config && rake db:create db:migrate db:seed"
$> docker-compose up -d peatio

After all of that you can start using Peatio in your browser just by following one of the hosts which you added earlier.

Production setup:

API

You can interact with Peatio through API:

  • API v2
  • Management API v1
  • Websocket API
  • Event API (AMQP)

Getting Involved

We want to make it super-easy for Peatio users and contributors to talk to us and connect with each other, to share ideas, solve problems and help make Peatio awesome. Here are the main channels we're running currently, we'd love to hear from you on one of them:

Discourse

Rubykube Discourse Forum

This is for all Peatio users. You can find guides, recipes, questions, and answers from Snowplow users including the Peatio.tech team. We welcome questions and contributions!

Telegram

@peatio

Chat with us and other community members on Telegram.

GitHub

Peatio issues

If you spot a bug, then please raise an issue in our main GitHub project (rubykube/peatio); likewise, if you have developed a cool new feature or improvement in your Rubykube Peatio fork, then send us a pull request! If you want to brainstorm a potential new feature, then the Rubykube Discourse Forum (see above) is probably a better place to start.

Email

hello@peatio.tech

If you want to talk directly to us (e.g. about a commercially sensitive issue), email is the easiest way.

Getting Support and Customization

If you need help with running/deploying/customizing Peatio, you can contact us on peatio.tech.

Contact us by email: hello@peatio.tech

License

Peatio is released under the terms of the MIT license.

What is Peatio?

Peatio (Chinese: 貔貅) is a Chinese mythical hybrid creature considered to be a very powerful protector to practitioners of Feng Shui.

[This illustration copyright for Peatio Team]

logo