Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
haipome authored Sep 30, 2017
1 parent 2f012e2 commit 0963187
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
# ViaBTC Exchange Server

ViaBTC Exchange Server is a high performance trade backend for exchanges like digital currency exchange. It support up to 10000 trades every second. It support push user data and market data in real time thought websocket.
ViaBTC Exchange Server is a trading backend with high-speed performance, designed for cryptocurrency exchanges. It can support up to 10000 trades every second and real-time user/market data notification though websocket.

## Architecture

![Architecture](https://user-images.githubusercontent.com/1209350/30948274-4e463044-a441-11e7-881b-b50ab903ed65.jpg)

This project is the server part in this picture.
For this project, it is marked as Server in this picture.

## code structure

**Require system**

* MySQL: save oper log, save user balance history, order history, trade history.
* MySQL: For saving operation log, user balance history, order history and trade history.

* Redis: a redis sentinel group, save market data.
* Redis: A redis sentinel group is for saving market data.

* Kafka: a message system.
* Kafka: A message system.

**Base library**

* network: a event base and high performance network programming library, easily supoort [1000K TCP connections](http://www.kegel.com/c10k.html). Include TCP/UDP/UNIX SOCKET server and client implementation, a simple timer, state machine, thread pool.
* network: An event base and high performance network programming library, easily supporting [1000K TCP connections](http://www.kegel.com/c10k.html). Include TCP/UDP/UNIX SOCKET server and client implementation, a simple timer, state machine, thread pool.

* utils: some basic library. Include log, config parse, some data structure, http/websocket/rpc server implementation.
* utils: Some basic library, including log, config parse, some data structure and http/websocket/rpc server implementation.

**Modules**

* matchengine: the most important part, it reord user balance, execute user order. It is a in memory database, save oper log in MySQL, redo the oper log when start. It also write user history into MySQL, push balance and order and deal message to kafka.
* matchengine: This is the most important part for it records user balance and executes user order. It is in memory database, saves operation log in MySQL and redoes the operation log when start. It also writes user history into MySQL, push balance, orders and deals message to kafka.

* marketprice: read message from kafka, generage k line data.
* marketprice: Reads message(s) from kafka, and generates k line data.

* readhistory: read history data from MySQL.
* readhistory: Reads history data from MySQL.

* accesshttp: support a simple HTTP interface and hide complexity for upper layer.
* accesshttp: Supports a simple HTTP interface and hides complexity for upper layer.

* accwssws: a websocket server, support user data and market data query and push. You need nginx in front to support wss.
* accwssws: A websocket server that supports query and pushes for user and market data. By the way, you need nginx in front to support wss.

* alertcenter: a simple server write FATAL level log to redis list, so we can send alert emails.
* alertcenter: A simple server that writes FATAL level log to redis list so we can send alert emails.

## Compile and Install

**operating system**

Ubuntu 14.04 or Ubuntu 16.04. Not test on other system
Ubuntu 14.04 or Ubuntu 16.04. Not yet tested on other systems.

**Requirements**

See [requirements](https://github.com/viabtc/viabtc_exchange_server/wiki/requirements). Install those system or library.
See [requirements](https://github.com/viabtc/viabtc_exchange_server/wiki/requirements). Install the mentioned system or library.

You MUST use the depends/hiredis to install the hiredis library. Or it may not compatibility.
You MUST use the depends/hiredis to install the hiredis library. Or it may not be compatible.

**Compile order**

Compile network and utils first. The rest all are independent.

**Deploy**

The matchengine and marketprice and alertcenter is a signal instance, the readhistory and accesshttp and accwssws can have multi instance work with loadbalance.
One signal instance is given for matchengine, marketprice and alertcenter, while readhistory, accesshttp and accwsswshave multi instance works with loadbalance.

Every instance better not install on same machine.
Please do not install every instance on the same machine.

Every process runing in deamon and start with a watchdog process, if crash, it will autoly restart in 1s.
Every process runs in deamon and starts with a watchdog process. It will automatically restart within 1s when crashed.

The best practice of deploy the instance is in following directory structure:
The best practice of deploying the instance is in the following directory structure:

```
matchengine
Expand All @@ -79,14 +79,14 @@ matchengine

## API

There are [HTTP Protocl](https://github.com/viabtc/viabtc_exchange_server/wiki/HTTP-Protocol) and [Websocket Protocl](https://github.com/viabtc/viabtc_exchange_server/wiki/WebSocket-Protocol) documents. But it is in Chinese, I may translate it into English in the future.
[HTTP Protocl](https://github.com/viabtc/viabtc_exchange_server/wiki/HTTP-Protocol) and [Websocket Protocl](https://github.com/viabtc/viabtc_exchange_server/wiki/WebSocket-Protocol) documents are available in Chinese. Should time permit, we will have it translated into English in the future.

## Donation

* BTC: 14x3GrEoMLituT6vF2wcEbqMAxCvt2724s
* BCC: 1364ZurPv8uTgnFr1uqowJDFF15aNFemkf
* ETH: 0xA2913166AE0689C07fCB5C423559239bB2814b6D

## Pay service
## Paid service

If you need help in deploy this system, I can give a paid support.
If you need help deploying this system, we can provide paid technical support.

0 comments on commit 0963187

Please sign in to comment.