TE Essential Configuration and Setup

The following section describe the TE environment as it is organized in GIT HUB.
The project contains files that should allow to run the components out of the box after a successfull build.

Development

The TE is a 100% Java implementation. Java version 16 has used. There are a couple of places where Java records has been used. Besides that the code should be java 1.8 complaint.

IntelliJ (2021.2.3) has been used as IDE when developing the code. The building tool used has been Gradle 7.3.3

And obviously, GIT HUB is used as source repository.

There are almost no dependencies to any third party products, besides Mongo DB. After trying to avoid a dependency to a datatabses I fell for the preasure and have now starting to use Mongo DB so that is now required to be installed and running. The database is used for persist user/account definitions and for persisting crypto wallets and crypto transactions.
I also have included a couple of Auxillary libraries that I frequently uses. These are found under the libs directory in the project (they should be public and found under the Hoddmimes GIT HUB).

Building

After the project has been cloned, it should be built. If using IntelliJ, open the Gradle window and execute "build" undet the top level i.e under TradingEngine. You may also build the project from a console window using Gradle, do so by;

Components

The project contains four runnable components:

TradingEngine

The script file in the directory ./bin te.sh (Linux) or te.bat (Windows) will start the TE using the configuration in the file ./configuration/TeConfiguration.json
The TE application will load market and instrument definitions from the file ./configuration/InstrumentDefinitions.json


Initially there will be no accounts/user defined in the system. However the component looks for the entry TEConfiguration/loadAccounts in the configuration file ./configuration/TeConfiguration.json. If defined it should point at a Json file containing the user accounts that should be loaded if no accounts are found in the TE DB.
You may also run the script ./bin/create-accounts.[sh.bat] should be run once after a successfull build and reset for defining users/account.

Logfiles, default the TE is configured to create a logfile under the ./logs directory i.e. ./logs/TradingEngine.log (appended). The TE used Log4J for logging and the logging configuration is controlled by the LOG4J confuturation file "./configuration/log4j2.xml

The TE also log all incomming request and responses to a seprate log file, ./logs/TeMessagesLog-<yyyy_MM_dd_HHmmss>.json

All execution i.e. trades are written to a separate trade logfile, configured to ./logs/trades-<yyMMdd-HHmmssSSS>.txl Persistence of trade excutions are most importance since they will result in a monetarily settlement. Therefor trade records are written synchronosly and on (disk) block boundary with records start / end markers to guarantee a all or nothing execution.
With the application TE trade browser trades can be extracted from txl logfiles and be written to a more readable format i.e. Excel,Json or HTML.

The TE has a crypto module that handles the interaction with a Bitcoin and/or Ethereum network. The interaction is are real-time connections allowing users to deposit / redraw coins to/from the TE in real-time. By default the interaction with the crypto networks are disabled in the TE configuration i.e. ./configuration/TeConfiguration.json However it can easily be enabled but then you should provide crypto client gateways for the Bitcoin / Etherreum network you are targeting. There are a few things to consider when testing the crypto functionality. You can read more about the crypto functionality, implementation and testing here.

Management

Is a basic Swing application for administrating and monitoring the TE setup. The management application connects to the TE components. If the TE is not running teh management app will wait until the TE is started.
The application will when starting declare it self as a listener on the multicast group and port which is used by the TE to anounce its service points. The MC address and port used by the TE is found in the TE configuration file, normally ./configuration/TeConfiguration.json This implicates that the management application must run on the same LAN as the TE components in order to discover TE management services. The application provides interfaces for:

The script file in ./bin/management.sh (Linux) and ./bin/management.bat (Win) will start the management application.



Trading Test Client

Is basic console application connecting to the trading engine. The application reads a command file with requests to be sent to the TE. The command file configured to be used is ./configuration/ClientTestScript.json.
The script file in ./bin/client.sh (Linux) and ./bin/client.bat (Windows) will start the Test Client application.

Trading GUI Test Client

Using the script client is convient when you would like to test a series of transactions repeatly but is a bit cumbersome if you would like to run add hook tests. With GUI client you are able to enter orders/delete orders, view ordersbooks, trades etc.
The script file in ./bin/guiclient.sh (Linux) and ./bin/guiclient.bat (Windows) will start the Test GUI Client application.


Trade Reports

Is basic Swing application application for viewing and extracting trades from txl logfiles. Besides viewing trades they can be extracted to readable files i.e. HTML, Excel and Json formatted.
The script file in ./bin/trades.sh (Linux) and ./bin/trades.bat will start the Trade viewer application.


This is the essential to get things going. The rest is in the source, nothing fancy or complicated. If you have some basic developer and Java knowledge the whole project should be a fairly straight forward thing.
If you would for some unfathomable reason would like to get in contact with the development team behind this project you can do so by sending mail to PoBe & Bob20200704.