# Historical Data Test Client

Simple ZMQ client to test historical OHLC data retrieval from Flink.

## Usage

### Run with Docker Compose

The client is included in the docker-compose.yml. To run it:

```bash
cd redesign
docker-compose up history-test-client
```

### Run locally

```bash
pip install pyzmq
python client.py
```

## What it does

1. Connects to Flink's client request endpoint (REQ/REP on port 5559)
2. Requests 1-hour OHLC candles for BTC/USDT.BINANCE
3. Time range: January 1-7, 2026 (168 candles)
4. Waits for Flink to respond (up to 30 seconds)
5. Displays the response status and sample data

## Protocol

Uses the ZMQ message format:
- Frame 1: Protocol version byte (0x01)
- Frame 2: Message type (0x07 = OHLCRequest) + protobuf payload

Expected response:
- Frame 1: Protocol version byte (0x01)
- Frame 2: Message type (0x08 = Response) + protobuf payload

## Configuration

Edit `client.py` to change:
- `flink_host`: Flink hostname (default: 'localhost')
- `client_request_port`: Port number (default: 5559)
- Query parameters: ticker, time range, period, limit
