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.
Simplest dashboard for WireGuard VPN written in Python w/ Flask

Hi! I'm planning the next major update for this project, please let me know if you have any suggestions or feature requests ;) You can create an issue

Donald Zou 763 Jan 02, 2023
EUserv - A Python script which can help you renew your free EUserv IPv6 VPS

English | 简体中文 This project comes from https://github.com/a-beam-of-light/eu_ex

阿两 0 Jan 06, 2022
euserv auto-renew script - A Python script which can help you renew your free EUserv IPv6 VPS.

eu_ex eu_ex means EUserv_extend. A Python script which can help you renew your free EUserv IPv6 VPS. This Script can check the VPS amount in your acco

A beam of light 92 Jan 25, 2022
OpenNeoMC:an Open-source Tool for Particle Transport Optimization that Combining OpenMC with NEORL

OpenNeoMC:an Open-source Tool for Particle Transport Optimization that Combining OpenMC with NEORL OpenMC is a community-developed Monte Carlo neutron

7 Aug 17, 2022
Python code that get the name and ip address of a computer/laptop

IP Address This is a python code that provides the name and the internet protocol address of the computer. You need to install socket pip install sock

CODE 2 Feb 21, 2022
A Python package for handling free proxies from sslproxies.org

SSLProxies Get free working proxy from https://www.sslproxies.org/ and use it in your script This is a port/rewrite of free-proxy with additional feat

Nate Harris 2 Mar 17, 2022
Azure-function-proxy - Basic proxy as an azure function serverless app

azure function proxy (for phishing) here are config files for using *[.]azureweb

17 Nov 09, 2022
Ipscanner - A simple threaded IP-Scanner written in python3 that can monitor local IP's in your network

IPScanner 🔬 A simple threaded IP-Scanner written in python3 that can monitor lo

4 Dec 12, 2022
Use Raspberry Pi and CircuitSetup's power monitor hardware to publish electrical usage to MQTT

This repo has code and notes for whole home electrical power monitoring using a Raspberry Pi and CircuitSetup modules. Beyond just collecting data, it

Eric Tsai 10 Jul 25, 2022
Tiny JSON RPC via HTTP library.

jrpc Simplest ever possible Asynchronous JSON RPC via HTTP library for Python, backed by httpx. Installation pip install async-jrpc Usage Import JRPC

Onigiri Team 2 Jan 31, 2022
Building a Robust IOT device which is customizable, encrypted, secure and user friendly

Building a Robust IOT device which is customizable, encrypted, secure and user friendly, which uses a single GPIO pin to extract multiple sensor values

1 Jan 03, 2022
Very simple FTP client, sync folder to FTP server, use python, opensource

ftp-sync-python Opensource, A way to safe your data, avoid lost data by Virus, Randsomware Some functions: Upload a folder automatically to FTP server

4 Sep 13, 2022
Easy-to-setup bot, ChatOps project for handling telegram chat logging over docker-compose services, being runned as one of them.

Easy-to-setup bot, ChatOps project for handling telegram chat logging over docker-compose services, being runned as one of them.

Rashid 7 Aug 08, 2022
This is simple script that changes the config register of a cisco router over serial so that you can reset the password

Cisco-router-config-bypass-tool- This is simple script that changes the config register of a cisco router over serial so that you can bypass the confi

James 1 Jan 02, 2022
Library containing the core modules for the kingdom-python-server.

🏰 Kingdom Core Library containing the core modules for the kingdom-python-server. Installation Use the package manager pip to install kingdom-core. p

T10 4 Dec 27, 2021
This repository contain sample code of gRPC Communication between Python and GoLang

This repository contain sample code of gRPC Communication between Python and GoLang, the Server is running on GoLang while Python is running the client

Abdullahi Muhammad 2 Nov 29, 2021
🥑 A Python ARP and DNS Spoofer CLI and INTERFACE 🥓

NEXTGEN SPOOFER 🥑 A Python ARP and DNS Spoofer CLI and INTERFACE 🥓 CLI - advanced pentesters INTERFACE - beginners SetUp Make sure you installed P

9 Dec 25, 2022
IPV4 network calculation project in Python

Curso de Python 3 do Básico ao Avançado Desafio: Calculando redes IPV4 Criar um programa que obtem um numero de IP com o prefixo da mascara de rede. O

Diego Guedes 3 Jan 21, 2022
An open source bias lighting program which syncs up colored lights to the contents of your screen.

About Firelight Firelight is an open source bias lighting program which syncs up colored lights to the contents of your screen or TV, providing an imm

Roshan 18 Dec 18, 2022
Linux SBC featuring two wifi radios, masquerading as a USB charger.

The WiFiWart is an open source WiFi penetration device masquerading as a regular wall charger. It features a 1.2Ghz Cortex A7 MPU with two WiFi chips onboard.

Walker 151 Dec 26, 2022