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
Release files for gnomepy-testing 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gnomepy_testing-0.2.0.tar.gz | 18.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gnomepy_testing-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 44.1 kB
Release files / gnomepy_testing-0.2.0.tar.gz
| Download URL | gnomepy_testing-0.2.0.tar.gz |
|---|---|
| Size | 18.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8a0c00b06cff97a20a22b8c1fd248106ccd329730540b6835101b7d34df923cc
|
|
BLAKE2b-256 checksum How to use checksums |
bce5bfc42462e624cbf99bf31fdc7b65e59a457bb6e797a753d7ccf1da8e8806
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.13.9 Linux/6.11.0-1018-azure
|
Release files / gnomepy_testing-0.2.0-py3-none-any.whl
| Download URL | gnomepy_testing-0.2.0-py3-none-any.whl |
|---|---|
| Size | 25.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3157abb08fb700f022fc22f5c33eb47adb0558c5e2a23fd99f95061393ba93ea
|
|
BLAKE2b-256 checksum How to use checksums |
8cffee763ba5ebef0780efc4e8f342667dfb577741cee1d066ed40363fbcef45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.13.9 Linux/6.11.0-1018-azure
|