Indexer
This document provides an in-depth guide on setting up and operating the Indexer - a sophisticated tool designed to monitor new blocks on the blockchain, specifically targeting those containing blob data. The Indexer is an essential component for anyone looking to extract, decode, and systematically store blob data from the Ethereum blockchain.
Introduction to the Indexer
The Indexer stands as a pivotal tool in the blockchain ecosystem, engineered to meticulously observe and catalog blockchain blocks that encapsulate blob data. Its core functionality revolves around the real-time detection of blocks imbued with blob data, facilitating an automated and efficient data retrieval process.
Core Features
- Block Monitoring - Continuously scans the blockchain for new blocks, honing in on those containing relevant blob data.
- Data Retrieval - Extracts each blob hash from the detected blocks, ensuring no data is overlooked.
- Data Parsing and Decoding - Implements advanced algorithms to parse and decode the retrieved blob data, converting it into a human-readable format.
- Database Integration - Seamlessly stores the parsed data into a structured database, allowing for efficient data retrieval and management.
Operational Workflow
- Block Subscription - The Indexer subscribes to the blockchain network, constantly watching for new blocks that contain blob data.
- Blob Hash Extraction - Upon detecting such blocks, it retrieves the blob hashes embedded within, serving as pointers to the actual data.
- Blob Data Fetching - Utilizes the blob hashes to fetch the corresponding blob data, which contains the inscribed information.
- Data Parsing - Decodes and parses the blob data, translating it into a format suitable for database storage.
- Database Storage - The decoded data is systematically stored in a pre-configured database, ensuring data integrity and accessibility.
Setting Up the Indexer
To deploy the Indexer, you need to have Bun installed on your system. Bun is a modern JavaScript runtime like Node or Deno, but it includes a package manager and a bundler internally.
Installation Steps
- Clone the Repository - Start by cloning the Indexer repository from GitHub. Ensure you have the correct URL for the repository:
Indexer GitHub Repository : Not published yet
Navigate to the Directory - Once cloned, navigate to the directory containing the Indexer source code.
Install Dependencies - Run the following command to install all necessary dependencies:
bun install
Environment Configuration - Create a
.env
file in the root directory of the Indexer, containing the necessary environment variables for the application. These variables include the database connection details, blockchain network configuration, and other relevant settings.# Blockchain Network Configuration NETWORK=your_blockchain_network # Database Connection String DB=your_database_connection_string
Start the Indexer: Execute the following command to start the Indexer:
bun run indexer