Testing framework for validating market data implementations
Project description
gnomepy-testing
This package is used internally at GTG for testing market data implementations.
Overview
A comprehensive testing framework for validating Python market data implementations against Java implementations for crypto exchanges using a Capture Proxy architecture with gnomepy schema types.
How It Works
- Capture Proxy - Connects to the exchange and receives raw market data
- Both clients (Python & Java) connect to the proxy and receive identical raw messages
- Schema Parsing - Each client parses messages into gnomepy schema objects (MBP1, MBP10, etc.)
- Binary Output - Clients encode schema objects to binary files
- Byte-level Comparison - Binary outputs are compared to verify implementations match exactly
This ensures both implementations receive the exact same data and produce identical binary output.
Quick Start
# Install dependencies
poetry install
# Run a quick test (proxy + Python client)
make test-proxy LISTING_ID=1 DURATION=60
# Or manually
# Terminal 1: Start proxy (listing ID 1 = Hyperliquid BTC-USD)
poetry run python -m gnomepy_testing.capture_proxy 1 --duration 60
# Terminal 2: Start Python client
poetry run python -m gnomepy_testing.client.proxy_client \
--host localhost --port 8765 --output output/python.bin --duration 30
Docker Usage
# Build
make docker-build
# Run test with default listing (ID 1)
make docker-test
# Custom test with different listing
make docker-test LISTING_ID=2 DURATION=120
Architecture
Registry API
↓
Listing Resolver (listing_id → exchange/security info)
↓
Exchange (Hyperliquid/Lighter/Binance/...)
↓
Capture Proxy Server
↓
┌────┴────┐
↓ ↓
Python Java
Client Client
↓ ↓
Parse Parse
↓ ↓
MBP1/10 MBP1/10
↓ ↓
Encode Encode
↓ ↓
python. java.
bin bin
└────┬────┘
↓
Binary Compare
↓
pass or fail
Project Structure
gnomepy-testing/
├── gnomepy_testing/
│ ├── capture_proxy/ # Proxy server and exchange connectors
│ ├── client/ # Python proxy client
│ ├── output/ # Binary output handler
│ ├── network/ # Transport/protocol abstraction
│ ├── listing_resolver.py # Registry API integration
│ └── compare_outputs.py # Binary output comparison
├── docker/ # Docker configuration
├── output/ # Test outputs (*.bin, *.log)
└── tests/ # Unit tests
Releasing a new version
The GitHub Actions workflow will automatically run with a tag matching the
pattern v*.*.* is released.
poetry version patch # or minor/major
git commit -m "Release new version"
git tag v$(poetry version -s)
git push origin main --tags
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gnomepy_testing-0.2.0.tar.gz.
File metadata
- Download URL: gnomepy_testing-0.2.0.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.13.9 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a0c00b06cff97a20a22b8c1fd248106ccd329730540b6835101b7d34df923cc
|
|
| MD5 |
bf0f561f35dff31cb26f43c2dbb672f0
|
|
| BLAKE2b-256 |
bce5bfc42462e624cbf99bf31fdc7b65e59a457bb6e797a753d7ccf1da8e8806
|
File details
Details for the file gnomepy_testing-0.2.0-py3-none-any.whl.
File metadata
- Download URL: gnomepy_testing-0.2.0-py3-none-any.whl
- Upload date:
- Size: 25.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.13.9 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3157abb08fb700f022fc22f5c33eb47adb0558c5e2a23fd99f95061393ba93ea
|
|
| MD5 |
3edeb5460d4ab9d3e6580d9e95e9ba9a
|
|
| BLAKE2b-256 |
8cffee763ba5ebef0780efc4e8f342667dfb577741cee1d066ed40363fbcef45
|