Spectrum.DEX off-chain services#
Taken from ergo-dex-backend
Introduction#
A set of off-chain services facilitating Spectrum.DEX functioning.
AMM DEX services:
- UTXO Tracker - extracts AMM orders and pool state updates from the UTXO feed
- AMM Executor - executes AMM orders into a transaction chain
- Pool Resolver - tracks pool updates
OrderBook DEX services:
- UTXO Tracker - extracts orders from the UTXO feed
- Matcher - order-book matching engine
- Orders Executor - executes orders
- Markets API - aggregates market data and provides a convenient API to access it
Building & Running the off-chain services#
Prerequisites#
The services require access to an Ergo node, so if you do not have one yet install as instructed here: Ergo github Besides the node the services depend on tools such as Kafka and Redis to run, to make it easier to manage a docker based solution has been made to allow for easy building and running of the services. The only requirements besides the node are that you have the following installed: - GIT to download the code and help fetch updates. GIT - SBT (which requires Java) for building the bots. SBT - Docker and Docker-compose (included in Docker for Windows). Docker
Building#
First, you need to download the code from this repo. The easiest way to keep it updated in the future is by using git:
cd <the folder you want to keep the off-chain services code in>
git clone https://github.com/ergolabs/ergo-dex-backend.git
cd ergo-dex-backend
cp ./config-example.env ./config.env
./build
Running the services#
Once the Docker images are built the only thing left to do is to run them:
./run
Verifying the services are running correctly#
You can look into the logs of the services to ensure they are running correctly. To look at a combined log for all services use the following command: Windows:
cd ergo-dex-backend
docker compose logs -f
cd ergo-dex-backend
sudo docker-compose logs -f