🗃 Fuel Indexer
The Fuel indexer is a standalone service that can be used to index various components of the blockchain. These indexable components include blocks, transactions, receipts, and state within the Fuel network, allowing for high-performance read-only access to the blockchain for advanced dApp use-cases.
By using a combination of Fuel-flavored GraphQL schema, a SQL backend, and indexers written in Rust, users of the Fuel indexer can get started creating production-ready backends for their dApps, meant to go fast 🚗💨.
For those wanting to build dApp backends right away, feel free to check out the Quickstart. And for those willing to contribute to the Fuel indexer project, please feel free to read our contributor guidelines as well as the For Contributors chapter of the book.
The Fuel indexer is meant to run alongside a Fuel node and a database. Generally, the typical flow of information through the indexer is as follows:
- A Sway smart contract emits receipts during its execution on the Fuel node.
- Blocks, transactions, and receipts from the node are monitored by the Fuel indexer service and checked for specific user-defined event types.
- When a specific event type is found, an indexer executes the corresponding handler from its module.
- The handler processes the event and stores the indexed information in the database.
- A dApp queries for blockchain data by using the indexer's GraphQL API endpoint, which fetches the desired information from the corresponding index in the database and returns it to the user.