This is a high-performance caching service designed to work with the Chronik Indexer, featuring both persistent and in-memory caching. chronik-cache provides a comprehensive caching layer that automatically caches and updates address histories, token transactions, and script queries in real time. It listens for on-chain changes via WebSocket and synchronizes the cache state automatically.
Dual-layer cache architecture: Persistent storage based on LevelDB + in-memory Map cache, providing millisecond-level response times
Automatic synchronization mechanism: Listens for transaction events via WebSocket and automatically updates the status of unconfirmed transactions
Intelligent pagination: Supports paginated storage and queries for large volumes of data
Multiple query types: Supports queries for address histories, SLP/eToken transactions, script conversions, and more
Failover mechanism: Built-in retry logic and fallback strategies
Performance monitoring: Provides interfaces for tracking cache status and statistics
Areas for improvement:
Better WebSocket handling: Optimize connection management and reconnection mechanisms
Browser support: Adapt for browser-side usage scenarios
Improved read/write design: Optimize storage structure and I/O performance
Add tests: Improve unit and integration test coverage