Small AT Protocol ingest/indexing service focused on:
- mirroring PLC operations
- validating firehose commits
- backfilling repo gaps
- storing analytics-friendly data in ClickHouse
Runtime PLC storage is split:
- SQLite
plc_latestis the online current-state store used fordid:plcvalidation - ClickHouse
plc_opis the historical PLC archive
Install runtime dependencies:
pip install -r requirements.txtInstall test dependencies:
pip install -r requirements-dev.txtRun one or more services:
python main.py poll
python main.py plc-status
python main.py poll firehose
python main.py gapsEnvironment variables:
CLICKHOUSE_HOSTdefault127.0.0.1CLICKHOUSE_DBdefaultgoeoviewCLICKHOUSE_PORTdefault8123RELAY_HOSTdefaultbsky.networkFIREHOSE_INSERT_EVERYdefault1000FIREHOSE_PRINT_CLOCK_SKEW_EVERYdefault100FIREHOSE_WORKERSdefault1FIREHOSE_BATCH_SIZEdefault128FIREHOSE_BATCH_TIMEOUTdefault0.5PLC_POLLER_COUNTdefault1000PLC_CATCHUP_WORKERSdefault32PLC_EXPORT_TARGET_INTERVALdefault0.667HTTP_CONNECT_TIMEOUTdefault5.0HTTP_READ_TIMEOUTdefault30.0MAX_REPO_SIZEdefault134217728(128MB)GAP_QUEUE_SIZEdefault64GAP_MAX_PDS_CONCURRENCYdefault10GAP_PARSE_WORKERSdefault CPU countGAP_MAX_TOTAL_WORKERSdefault128WS_CONNECT_TIMEOUTdefault10.0BLOCKED_PDSdefaultatproto.brid.gy,.stream.place— comma-separated list of PDS hostnames to skip (suffix matching with leading dot)PLC_STATE_DB_PATHdefault./data/plc_state.dbQUARANTINE_DB_PATHdefault./data/quarantine.db