chainquery
Chainquery is a Go-based indexer that parses LBRY blockchain data into a MySQL database, enabling fast SQL queries of blocks, transactions, addresses, and claims without RPC traversal. It syncs with LBRY full nodes (lbcd or lbrycrd), handles chain reorganizations automatically, and exposes a public read-only SQL API.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | OdyseeTeam/chainquery |
| Owner | OdyseeTeam |
| Primary language | Go |
| License | MIT — OSI-approved |
| Stars | 2.2k |
| Forks | 36 |
| Open issues | 41 |
| Latest release | v2.6.0 (2026-06-12) |
| Last updated | 2026-06-12 |
| Source | https://github.com/OdyseeTeam/chainquery |
What chainquery is
Single-binary daemon (chainquery serve) that ingests blocks from a LBRY full node via JSON-RPC, processes transactions in parallel with dependency ordering and retry logic, maintains MySQL schema consistency across reorgs (up to depth 100), and runs scheduled jobs to compute derived claim/address data. Exposes REST API with public SQL endpoint, address summaries, and Prometheus metrics.
Get the chainquery source
Clone the repository and explore it locally.
git clone https://github.com/OdyseeTeam/chainquery.gitcd chainquery# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Requires a running LBRY full node (lbcd or lbrycrd) with txindex enabled and RPC credentials matched to chainquery config.
- MySQL 8+ must allow stored functions (log_bin_trust_function_creators = 1); initialize schema from db/chainquery_schema.sql and manage schema upgrades via the built-in upgrade manager.
- Transactions within a block retry up to 1000 times on dependency failures; set maxparalleltxprocessing to tune parallelism (default NumCPU); monitor job_status and application_status tables.
- API-key-protected endpoints (/process, /sync/*) are disabled by default (apikeys empty); configure if external callers need reprocessing or resyncing.
- Configure notification endpoints (Sockety, webhooks, Slack) before production to avoid missing events; review maxsqlapitimeout and MAX_EXECUTION_TIME for SQL endpoint query limits.
When to avoid it — and what to weigh
- Multi-Blockchain Support Required — Chainquery is LBRY-specific. Projects needing Ethereum, Bitcoin, or other chains should evaluate chain-agnostic indexers (e.g., The Graph, Subgraph) or blockchain-native solutions.
- Write-Heavy API Workloads — The public SQL endpoint is read-only by design. Applications requiring write access must authenticate via separate DSN and bypass the HTTP API, complicating deployment.
- Minimal Operational Overhead — Chainquery requires a dedicated MySQL instance, a LBRY full node, Go 1.26+, and careful configuration (DSN, RPC auth, job scheduling). Teams lacking DevOps resources should consider managed indexing services if available.
- High Availability / Horizontal Scaling — The daemon is single-threaded across blocks (by design, using BlockLock) and maintains strict ordering. Scaling to multiple instances requires external coordination; not architected for multi-node failover.
License & commercial use
MIT License. Permissive open-source license allowing commercial use, modification, and distribution with minimal restrictions (retain license notice).
MIT is a standard permissive OSI-approved license explicitly permitting commercial use, including selling products or services built on Chainquery. No license fee, royalty, or attribution beyond copyright notice required. Verify you comply with any dependencies' licenses (SQLBoiler, Go standard library, MySQL drivers).
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Adequate |
| License clarity | Clear |
| Deployment complexity | High |
| DEV.co fit | Good |
| Assessment confidence | High |
Chainquery exposes a public read-only SQL endpoint; implement rate-limiting, network segmentation, and query timeouts to prevent abuse. RPC credentials (lbycrdurl) should be stored securely (environment variables, secrets manager), not in config files. API-key authentication for reprocessing endpoints uses string comparison; rotate keys regularly. No mention of input validation/escaping for SQL queries; review prepared statement usage. Ensure MySQL user permissions follow least-privilege (read for API, write for daemon only).
Alternatives to consider
The Graph (Subgraphs)
Multi-chain subgraph indexing with GraphQL API and hosted/decentralized options; requires learning AssemblyScript but eliminates custom database operations. Best if supporting multiple blockchains.
Alchemy Enhanced APIs / Infura Insights
Managed blockchain data APIs (though Ethereum/Polygon/Solana focused); no self-hosting overhead. Not suitable for LBRY but easier for other chains if that becomes priority.
Custom JSON-RPC Parser + PostgreSQL
Build lightweight indexer in-house using chain's native RPC; avoids third-party dependencies but requires engineering effort. Viable for teams with LBRY-only scope and high customization needs.
Build on chainquery with DEV.co software developers
Chainquery provides production-ready schema and APIs to index and query LBRY data. Evaluate our DevOps and API development services to architect your deployment.
Talk to DEV.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
chainquery FAQ
Do I need to run my own LBRY full node, or can Chainquery connect to a public node?
What happens if the blockchain reorgs while Chainquery is running?
Can I use the public SQL API for production analytics without authentication?
How do I scale Chainquery to handle high query load?
Custom software development services
Adopting chainquery is usually one piece of a larger software development effort. As a software development agency, DEV.co provides software development services and web development expertise — pairing senior software developers and web developers with your team to design, build, and operate open-source databases software in production.
Need LBRY blockchain indexing for your platform?
Chainquery provides production-ready schema and APIs to index and query LBRY data. Evaluate our DevOps and API development services to architect your deployment.