Chainquery ingests the LBRY blockchain from a full node into MySQL and exposes HTTP endpoints, including public read-only SQL, for claims, channels, and transactions.
Overview
Chainquery reads the LBRY blockchain into a structured MySQL database so blocks, transactions, addresses, and the LBRY claim system—channels, publishes, supports, tips, purchases, and tags—can be queried with SQL instead of walking the chain over RPC.
A single binary runs `chainquery serve`, which starts both a sync daemon and an HTTP API. The daemon connects to an LBRY full node over JSON-RPC (lbcd or lbrycrd), processes blocks in order, handles reorganizations, and runs scheduled jobs for claim trie state, mempool, certificates, and other derived data.
The API server binds to a configurable host and port and offers routes for public read-only SQL, address summaries, status, validation, and authenticated maintenance endpoints. Prometheus metrics and optional webhook or Sockety notifications report new blocks and events.
Operators configure the stack with a TOML file, provision MySQL 8, run schema initialization via `chainquery serve db`, and require a transaction-indexed full node. Prebuilt Linux binaries and release artifacts are published for deployment.
Key features
- MySQL-backed LBRY chain mirror
- Public read-only SQL HTTP endpoint
- Automatic blockchain reorg handling
- Parallel per-block transaction processing
- Scheduled claim and mempool sync jobs
- Prometheus metrics and webhooks
- API-key protected admin sync routes
Use cases
- SQL analytics on LBRY claims and tips
- Address balance and transaction lookup
- Backend data layer for LBRY apps