The magical gateway between Ogmios and Exura for Cardano blockchain synchronization
Hecate is an independent data relay service that connects through Ogmios and efficiently fetches both historical and real-time on-chain data.
Named after the Greek goddess of magic, crossroads, and keeper of keys, Hecate serves as a bridge between the chain and downstream processing systems via standardized interfaces, focusing exclusively on reliable data acquisition and transmission through well-defined API boundaries, enabling integration with any system that needs to track on-chain data.
While its main use case is to forward data via Redis, it can also be configured to output to the command line interface (CLI) for debugging or testing purposes.
NOTE: This project is in early development and is not yet ready for production use. Please use at your own risk.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HECATE โ
โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
โ โ โ โ โ โ โ โ
โ โ Async โ โ Core Processing โ โ Data Sinks โ โ
โ โ Client โโโโโโบโ โโโโโโบโ โ โ
โ โ โ โ โโโโโโโโโโโโ โโโโโโโโโโโ โ โ โโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโ โ โHistoricalโ โRealtime โ โ โ โRedis โ โ โ
โ โฒ โ โSync Flow โ โSync Flowโ โ โ โSink โ โ โ
โ โ โ โโโโโโโโโโโโ โโโโโโโโโโโ โ โ โโโโโโโโโโ โ โ
โ โ โ โ โ โโโโโโโโโโ โ โ
โ โ โ โโโโโโโโโโโโโโโโโโโ โ โ โCLI โ โ โ
โ โ โ โPeriodic โ โ โ โSink โ โ โ
โ โ โ โFlows โ โ โ โโโโโโโโโโ โ โ
โ โ โ โโโโโโโโโโโโโโโโโโโ โ โ โ โ
โ โ โ โ โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
โ โ โ โ โ
โโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโ
โ โ โ
โผ โ โผ
โโโโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ โ โ
โ Cardano โ โ โ Downstream โ
โ Node + โ โ โ Applications โ
โ Ogmios โ โ โ (e.g. Exura) โ
โโโโโโโโโโโโโโโโโโ โผ โโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโ
โ โ
โ Prefect โ
โ โ
โโโโโโโโโโโโโโโโโโ
Hecate consists of:
- Ogmios Client - Asynchronous client for the Ogmios WebSocket API
- Data Relay - Efficiently forward blockchain data with minimal transformation
- Prefect Flows - Orchestrate historical and real-time data fetching
- Redis Integration - Stream block data to downstream consumers via per-epoch Redis streams
- โก Parallel Historical Fetching - Efficiently fetch the entire blockchain history in batches
- ๐ Real-time Data Relay - Stay current with the latest blocks and relay them to Redis or CLI
- ๐ก๏ธ Reorg Detection - Catch chain reorganizations early and handle them gracefully
- ๐ Advanced Monitoring - Track connection status, latency, and throughput metrics via Prefect
- ๐งฐ Flexible Deployment - Run as a standalone service with simple configuration
- ๐ Optional Dependencies - Use only what you need - Redis is optional and can be installed separately
Hecate includes a demo script showcasing of some of the async client capabilities:
# Run the demo (assumes Ogmios on localhost)
uv run python -m demoHecate uses Prefect to orchestrate both historical and real-time data flows:
- Historical Sync: Efficiently backfill all on-chain history in a resumable, concurrent manner
- Periodic Tasks: Automatically update epoch metadata and other system constants
- See detailed flows documentation
- Python 3.12+
- uv (Python package manager)
- Redis (Optional)
- Ogmios node access
# Clone the repository
git clone https://github.com/ExuraLabs/hecate.git
cd hecate
# Install dependencies
uv venv -p 3.12
# Install one of the following:
# 1) Base installation (no Redis support)
uv sync
# 2) With development tools
uv sync --group dev
# 3) Complete installation (all features)
uv sync --all-groupshecate/
โโโ client/ # Ogmios WebSocket client
โโโ data/ # Constant historical data
โโโ flows/ # Prefect flow definitions
โ โโโ historical # Historical synchronization flows
โ โโโ periodic # Periodic flows for data updates
โ โโโ realtime # Real-time synchronization flows
โโโ sinks/ # Data sinks
โ โโโ redis/ # Redis sink for downstream service(s)
โ โโโ cli/ # CLI sink for command line output
โโโ constants # Constant values and configurations
โโโ models # Data models and type definitions
# Run mypy for type checking
uv run mypy
# Run ruff for linting
uv run ruff check
# Run ruff for formatting
uv run ruff format
# Set up pre-commit hooks
uv run pre-commit installThis project builds on the ogmios-python client, which is distributed under GPL-3.0-or-later. As a result, this project is also shares the same license terms - see the LICENSE file for details.
- Ogmios - WebSocket bridge that wraps Ouroboros' mini-protocols
- ogmios-python - Original Python SDK for Ogmios
- Koios - Distributed and open-source Cardano API
- AdaStat - Advanced Cardano blockchain explorer and query layer

