SkillAgentSearch skills...

Broker Gateway

Distributed Commodities OTC Electronic Trading System

Install / Use

npx skills add commodity-trading-system/broker-gateway

Installs into whichever agent you are using.

About this skill

Quality Score

0/100

Supported Platforms

Universal

README

broker-gateway

This is broker gateway of a Distributed Commodities OTC Electronic Trading System. It contains three parts.

  • Receiver
  • Executor
  • Querier

Receiver takes the responsibility of receiving consignations from trader gateway and send it into the redis queue after making some necessary validation.

Executor pops the consignation from redis queue and matching it. At the same time, it will publish the latest depth and status onto Etcd

Querier is a simple http server. Trader gateway can fetch information of futrues, consignations and orders.

Architecture

Architecture

How to install

First, clone the repository.

git clone https://github.com/commodity-trading-system/broker-gateway.git

Environment

You should prepare Redis Etcd Mysql by your self. Here is a reference

# install redis
docker run -p 6739:6736 --name cts-redis  redis

# install etcd
docker run -itd --hostname etcd -p 2379:2379 --name etcd index.tenxcloud.com/coreos/etcd:2.3.1 /usr/local/bin/etcd -listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 -advertise-client-urls http://127.0.0.1:2379,http://127.0.0.1:4001

Receiver

Add .env file and change it according to your environment

cp cmd/receiver/.env.example /cmp/receiver/.env

Build the dockerfile and run the container

docker build -f ./ReceiverDockerfile -t receiver --rm  .
docker run -p 5001:80 receiver

Executor

Add .env file and change it according to your environment

cp cmd/executor/.env.example /cmp/executor/.env

Build the dockerfile and run the container

docker build -f ./ExecutorDockerfile -t executor --rm  .
docker run executor

Querier

Add .env file and change it according to your environment

cp cmd/executor/.env.example /cmp/executor/.env

Build the dockerfile and run the container

docker build -f ./QuerierDockerfile -t querier --rm  .
docker run -p 5002:80 querier

Related Skills

View on GitHub
GitHub Stars5
CategoryDevelopment
Updated6y ago
Forks2

Languages

Go

Security Score

70/100

Audited on Nov 6, 2019

No findings