The OUCH Project - OUCH Server/Client

Related tags

Networkingtheouchteam
Overview

The OUCH Project - OUCH Server/Client

Description

This software simulates OUCH Server/Client communication through a script which initialises a central server and another script which simulates clients connecting to the server. Multiple connections can be handled and supported at once. Additionally there is a prototype web interface where orders can be inputted using an HTML form.

See future considerations for optimisation and features below.

Dependencies

Before running the server and client, the following dependencies are required:

  • tabulate

If running the web interface, additional dependencies are required:

  • flask
  • flask_bootstrap
  • flask_wtf

These dependencies can be installed with pip or another package manager.

pip install tabulate

pip install flask
pip install flask_bootstrap
pip install flask_wtf

Usage

The config.ini file contains items which will be read by the ouch_server and ouch_client as the host and port used to establish a connection. The port which the application listens on can be changed by the user if a different listening address or port is desired.

Start an instance of ouch_server.py first using python. If debug is passed as a command line argument, the console output will be in debugging mode as opposed to printing the orderbook once every second.

python ouch_server.py
python ouch_server.py debug

Then in another terminal/cmd instance, start an instance of ouch_client.py. The client will prompt the user for input and pass completed input into the exchange server (NOT IMPLEMENTED YET - USE PROVIDED TEST INPUTS).

python ouch_client.py

The Client can be initialised with one optional command line argument which specifies a path to a json file containing a sequence of inputs for the client to send to the exchange. Every time the enter key is pressed, one message will be sent in sequence. After all messages have been sent, the client will terminate and disconnect from the server. An example of the json format can be found in the client_inputs folder.

python ouch_client.py test_inputs/client_1.json

Optimisation and Future Extensions

  • Implement a matching engine for the exchange to support order execution.
  • Create a web interface for ease of placing orders.
  • A mechanism for opening and closing the exchange.
  • Orderbook data structure optimisation using numpy or caching (such as using the memcached package).
  • Increase client connection thread handling performance using thread pools and connection pools.
  • Client message data processing can be made faster by setting up and integrating an Apache Pulsar cluster.

Client Input JSON Format

The JSON should be structured as follows:

{
    "_expected_behaviour": [
        "1. ...",
        "2. ...",
        "3. ...",
        ...
    ],
    "actions": [
        {
            "message_type": "O",
            ...
        },
        {
            "message_type": "U",
            ...
        },
        {
            "message_type": "X",
            ...
        },
        ...
    ]
}
  • _expected_behaviour: A list of comment strings describing the expected behaviour of the program for each corresponding action. 1.corresponds to the first action etc. This will not be used in the program, and is for documentation purposes only.
  • actions: A list of json dictionaries which follow the OUCH protocol's Section 6 (Inbound) specifications. The messages will be sent by the client to the exchange in sequence.

Web Interface Usage

This interface allows for easier data entry and provides a GUI that more accurately simulates how a typical client will enter order entries.

python web_application.py

On web browser, type http://127.0.0.1:5000/ to load website.

On a separate terminal/cmd instance start an instance of ouch_server.py. Sudo may be needed.

python ouch_server.py

To create your orders, continually fill in the enter order, replace order and cancel order forms. Once finished, click on the OUCH logo and click submit your order. Continually press enter on command line and observe appropriate response messages on both terminal consoles

Owner
Jahin Z.
Jahin Z.
Multiple-requests-poster - A tool to send multiple requests to a particular website written in Python

Multiple-requests-poster - A tool to send multiple requests to a particular website written in Python

RLX 2 Feb 14, 2022
Python 3 tool for finding unclaimed groups on Roblox. Supports multi-threading, multi-processing and HTTP proxies.

roblox-group-scanner Python 3 tool for finding unclaimed groups on Roblox. Supports multi-threading, multi-processing and HTTP proxies. Usage usage: s

h0nda 43 May 11, 2022
Equibles Stocks API for Python

Equibles Stocks API for Python Requirements. Python 2.7 and 3.4+ Installation & Usage pip install If the python package is hosted on Github, you can i

Equibles 3 Apr 15, 2022
pyWhisker is a Python equivalent of the original Whisker made by Elad Shamir and written in C#.

PyWhisker pyWhisker is a Python equivalent of the original Whisker made by Elad Shamir and written in C#. This tool allows users to manipulate the msD

Shutdown 325 Jan 08, 2023
test whether http(s) proxies actually hide your ip

Proxy anonymity I made this for other projects, to find working proxies. If it gets enough support and if i have time i might make it into a gui Repos

gxzs1337 1 Nov 09, 2021
Serves some data over HTTP, once. Based on the built-in Python module http.server

serve-me-once Serves some data over HTTP, once. Based on the built-in Python module http.server.

Peder Bergebakken Sundt 2 Jan 06, 2022
No-dependency, single file NNTP server library for developing modern, rfc3977-compliant (bridge) NNTP servers.

nntpserver.py No-dependency, single file NNTP server library for developing modern, rfc3977-compliant (bridge) NNTP servers for python =3.7. Develope

Manos Pitsidianakis 44 Nov 14, 2022
track IP Address

ipX Table of Contents ipX Welcome Features Uses Author 📝 License Welcome find the location of an IP address. Specifically, you can get the following

Ali Shahid 15 Sep 26, 2022
A repo with study material, exercises, examples, etc for Devnet SPAUTO

MPLS in the SDN Era -- DevNet SPAUTO All of the study notes have now been moved to use auto-generated documentation to build a static site with Githu

Hugo Tinoco 67 Nov 16, 2022
A Project to resolve hostname and receive IP

hostname-resolver A Project to resolve hostname and receive IP Installation git clone https://github.com/ihapiw/hostname-resolver.git Head into the ho

iHapiW 5 Sep 12, 2022
A Python script that alerts via SMS when a stock is reaching an inflection point

TradeAlert Not sure what this will ultimately become, but for now, its a Python script that alerts via SMS when a stock is reaching an inflection poin

3 Feb 22, 2022
DNS monitoring system built with Python.

DNS monitoring system built with Python.

Andressa Cabistani 7 Sep 28, 2021
ARTEMIS: Real-Time Detection and Automatic Mitigation for BGP Prefix Hijacking.

ARTEMIS: Real-Time Detection and Automatic Mitigation for BGP Prefix Hijacking. This is the main ARTEMIS repository that composes artemis-frontend, artemis-backend, artemis-monitor and other needed c

INSPIRE Group @FORTH-ICS 273 Jan 01, 2023
Simple local RPG turn-based to play while learn something using the anki system

Simple local RPG turn-based to play while learn something using the anki system

Raphael Kieling 5 Aug 02, 2022
Cobalt Strike script for ScareCrow payloads

🎃 🌽 ScareCrow Cobalt Strike intergration CNA A Cobalt Strike script for ScareCrow payload generation. Works only with the binary and DLL Loader. 💣

UserX 401 Dec 11, 2022
Enrich IP addresses with metadata and security IoC

Stratosphere IP enrich Get an IP address and enrich it with metadata and IoC You need API keys for VirusTotal and PassiveTotal (RiskIQ) How to use fro

Stratosphere IPS 10 Sep 25, 2022
Uses machine learning to scan the similarity of two texts

PlagiarismChecker Uses machine learning to scan the similarity of two documents. End Points: http://localhost:3000/register (create a/c) http://localh

Elvis Chege 2 Aug 10, 2022
Simple client for the Sirah Matisse Commander TCP server.

Simple client for the Sirah Matisse Commander TCP server.

Nelson Darkwah Oppong 1 Nov 02, 2021
A Powerful, Smart And Simple Userbot In Telethon

Owner: KeinShin 🇮🇳 BLACK LIGHTNING A Powerful, Smart And Simple Userbot In Telethon. Credits This is A Remix Bot Of Many UserBot. DARKCOBRA FridayUs

Akki ThePro 1 Nov 29, 2021
Solismod - A script subscribes to MQTT topics and waits for a message

SolisMod This is a first attempt to modify Solis inverter settings As SolisMon3,

9 Nov 14, 2022