en
Back to the list

Neo News Today open-sources neo-scope, a self-hosted Neo X indexer and REST API

source-logo  neonewstoday.com 24 h
image

Neo News Today has open-sourced neo-scope, a Rust-based indexer and REST API for Neo X that syncs blockchain data into MySQL for block explorer and analytics use cases. The v0.1.0 release, published Oct. 27, is a self-contained, open-source Neo X indexer that developers can deploy on their own infrastructure without hosted service dependencies.

neo-scope is used internally to power nDapp and is now available for other developers and teams building on Neo X. The project is dual-licensed under MIT and Apache-2.0.

What neo-scope indexes

The indexer connects to a Neo X JSON-RPC node and writes blocks, transactions, receipts, event logs, addresses, contracts, and token data into MySQL. It covers ERC-20, ERC-721, and ERC-1155 tokens discovered from transfer events, with on-chain metadata fetched automatically. ERC-1155 batch transfers are expanded into individual rows for granular querying.

Know when your
coins move

Alerts, real-time prices, and market news — all in one app
qr-code Point your phone camera to install
4.8 based on 40K reviews in the App Store and Google Play

All wei values and token amounts are stored as decimal strings to avoid the precision loss that occurs when large numbers pass through JSON floating-point serialization.

The read-only REST API serves 19 endpoints under /v1/neox, covering blocks, transactions, addresses, contracts, tokens, transfers, event logs, and network statistics. Cursor-based pagination ensures queries never skip or repeat rows across pages. The API supports both MainNet (chain ID 47763) and TestNet T4 (chain ID 12227332).

Data integrity

neo-scope applies all-or-nothing batch writes, meaning an entire block range is committed or none of it is. If a hole appears mid-batch, only the contiguous prefix is stored, preventing gaps in indexed data. Re-indexing is idempotent: running the indexer over previously synced blocks widens knowledge without corrupting existing records.

The indexer handles MySQL lock contention with automatic retry logic for deadlocks and lock wait timeouts, backing off across up to six attempts. A configurable CHAIN_ID validation at startup prevents accidental cross-network indexing.

Contract invocations

The contract invocations endpoint uses a broader methodology than simple toAddress matching. A contract is considered invoked if it is either the direct recipient of a transaction or the emitter of any event log within that transaction. This approach catches router and proxy patterns where the contract doing meaningful work is not the one directly called.

Deployment

Developers can start a full neo-scope stack, including MySQL, indexer, and API, against TestNet T4 with a single Docker Compose command. For production environments, the indexer and API run as separate binaries requiring Rust 1.94+, MySQL 8 with InnoDB, and access to a Neo X JSON-RPC endpoint.

Configuration is handled through environment variables covering the RPC node URL, database connection, chain ID, batch size, and API port. A START_BLOCK option allows indexing from near the chain tip instead of genesis for faster initial setup.

Ecosystem context

Neo X has several existing infrastructure options. Block explorers include xexplorer.neo.org and NeoXScan, while SubQuery provides both a hosted service and a self-hostable indexing SDK. neo-scope takes a simpler approach: a single Rust indexer that writes to a plain MySQL schema, so developers control their own database and can run custom SQL queries directly against it without adopting an indexing framework or relying on third-party services.

Alpha status

neo-scope is released at alpha maturity. The database schema and API response formats may change between releases without guaranteed migration paths. The current scope does not cover internal transactions, contracts deployed from within other contracts, token balances, or pending transactions.

The project includes contribution guidelines, a code of conduct, and issue and pull request templates for developers interested in contributing.

The neo-scope repository can be found at the link below:
https://github.com/neonewstoday/neo-scope

neonewstoday.com