logo

OpenWare OPEX

rk_logo

#Finex Deployment Guide

Finex consists of two daemons

  • Finex - high speed matching engine, that consume events from RabbitMQ
  • Batcher - daemon, that collect events from Finex and saves them into the DB every second

Prerequisites

  • Peatio deployed and healthy
  • RabbitMQ up and running
  • Database service up and running

Deployment

Install Finex with the following command

./bin/opex app install finex

Go to MySQL and create an event of account balances recalculation.

CREATE EVENT compact_and_recalculate
ON SCHEDULE
    EVERY 1 SECOND
COMMENT 'Compact and recalculate every second'
DO
    CALL compactor();

Maintenance

Orders created by peatio in period of inactivity, will be stored in DB with pending state.

To safely restart Finex, follow these steps:

  • Stop finex daemon
  • Wait for few seconds to save everything in the DB
  • Stop batcher daemon
  • Start batcher
  • Start finex

At this stage all events will be purged from RabbitMQ, exchanged and loaded from the database. This may take a while!