Overview
Developers working on Subsquid Network testnet Quests face challenges when indexing blockchain data. This article addresses the most common issues and their solutions.
Issue #1: Missing Prerequisites
Before starting quests, make sure you have installed:
- Node v16.x or newer
- Docker
- Git
- Squid CLI
Issue #2: Data Mismatch
Query results from GraphQL endpoints may not align with corresponding subgraphs due to incorrectly tracked logs or transactions. The solution involves verifying that data tracked in processor.ts matches subgraph.yaml configuration.
Ensure that the event signatures and contract addresses in your processor exactly match those defined in the subgraph manifest.
Issue #3: Event Decoding Errors
Different SDK versions may include extra data during RPC ingestion, causing decoding failures. Processor configurations must match corresponding filters in main.ts.
Additionally, rate limiting from RPC endpoints requires switching providers or enabling Subsquid Cloud’s RPC proxy. Common symptoms include intermittent failures and timeout errors during indexing.
Issue #4: Avoiding Single Entity Operations
Rather than persisting individual entities per event, developers should implement batch upserts using in-memory caches. This approach significantly improves indexing speed by reducing database operations.
Using Maps ensures unique entity IDs when upserting, preventing duplicate ID errors. Batch-based processing can be used as a drop-in replacement for handler-based mappings when migrating from subgraphs.
The key principle is to accumulate entities in memory during a batch of blocks, then persist them all at once at the end of the batch, rather than making individual database calls for each event.