ChronikCache is a high-performance caching layer for Chronik Indexer, designed to accelerate eCash blockchain queries. Current stable version is 1.2.3, released as a TypeScript-first package with full type definitions. It provides automatic background updates via WebSocket synchronization, LevelDB-based persistent storage, and support for address, token, and script history caching. Key differentiators include configurable cache limits, failover logic with retry, real-time cache status tracking (UNKNOWN, UPDATING, LATEST, REJECT), and automatic script-to-address conversion using ecashaddrjs. It requires chronik-client as a peer dependency.
npm install chronik-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows CommonJS setup with ChronikClient and ChronikCache, configuration, and basic usage to fetch cached address history and check cache status.
Use `import ChronikCache from 'chronik-cache'` (no named import).
Ensure chronik-client is installed and instantiated with a valid URL.
Refer to README for status code meanings: 1=preparing, 2=limit exceeded, 3=fallback.
Cache data is stored in a default LevelDB directory; ensure write permissions in the execution environment.
Use `const ChronikCache = require('chronik-cache')` or `import ChronikCache from 'chronik-cache'`.Run `npm install chronik-cache` in your project directory.
Ensure chronik is a proper ChronikClient instance: `new ChronikClient('https://example.com')`.