GURU Network: Multi Chain AI Compute Layer
  • Overview
  • ▶️Getting Started
    • Using Mainnet
    • Wallet Configuration
    • Using DApps
    • Technical Architecture of Guru Network
    • Ultimate Guide To Guru Network For Community Users
  • 🫡Utility
    • Fees
    • Bridges
    • Block Explorers
    • Indexer
  • 👩‍💻Development
    • Contract Deployment
    • NFT APIs
    • Account Abstraction
    • Contracts
    • Running Node
  • 🔗Links
    • Guru Network
    • How to buy $GURU
    • Web & social media
    • Official NFT Collections
    • Docs and DYOR
    • Open Source
  • 🎯Purpose and Vision
    • 🔗Atomic Franchise Mechanism
    • 👥Participation
    • 💰Rewards and Incentives
  • 💡Guru Network
    • 🎛️Guru Network ChainLink integration
      • 📄Guru Season 2 Pass And ChainLink Functions Case
    • 💲Guru Token
    • 🌐Web3 Infrastructure
    • 🌆Web2 and Off-Chain Infrastructure
    • ⛓️Multi Chain Interoperability Layer (CCIP)
    • 👩‍🔬Subsquid & Guru Network Data Partnership
    • Smart Contracts
  • 🪄Flow Orchestrator
  • 🚀BBPA Engines
  • 📋Tasklist
  • 💫Shared Event Bus
  • 🤖Individual Agents
  • 🧰Framework
    • ⚙️Setup and Configuration
    • 📚Data Warehouse API
    • 👾Block Explorer
    • ⚡Indexer
      • ⏯️Run the Indexer
      • 🔛Environment Variables
      • 🐇Parallel Indexing using RabbitMQ
    • 🔄Swap
    • 🏪Warehouse
      • 🏁Getting Started
  • 🧑‍🤝‍🧑Ecosystem and Community
  • 📜Governance and Stakeholder Engagement
  • 🗺️Q1&Q2 2024 Roadmap
  • 📄Terms Of Sale
  • 📕Glossary
  • 📖Reference Documentation
  • 🏆Contests
    • 🧑‍🎨Guru NFT Art Contest - CONTEST IS OVER
    • 😺Guru Meme Mania
    • 🧙‍♂️Guru Network Grand Riddle Hunt
  • 🖇️Our Links
  • 🧘‍♂️Guru Network Mainnet Launch Documentation
    • Network Information
    • Token Contracts
  • ⏯️Using Guru
Powered by GitBook
On this page
  • Quickstart
  • Linters/formatters
  • Useful Links
  1. Framework
  2. Indexer

Run the Indexer

How to run Guru Network Indexer

PreviousIndexerNextEnvironment Variables

Last updated 10 months ago

Quickstart

Prerequisites

Ensure you have the following installed:

  • Docker

  • Docker Compose

Step-by-Step Instructions

  1. Prepare Environment Variables

    • Copy the env.sample file and rename it to .env.

    • Edit the .env file to set the following variables according to your needs:

      • CHAIN_ID: The ID of the blockchain network you are indexing.

      • DATABASE: The name of the database that will be created in ClickHouse.

      • PROVIDER_URL: The URL of your RPC provider, such as a public node, Infura, or a local node.

    • See Environment Variables

  2. Start Indexing

    • Open your terminal and navigate to the directory containing your docker-compose.yml file.

    • Run the command:

      docker-compose up
    • This command will start indexing the Ethereum blockchain into ClickHouse.

  3. Verify Database Content

    • Once the indexing process begins, you can inspect the database to see the tables created for each entity type and a few service-related tables.

Running certain command

Install Ethereum ETL:

pip3 install -r requirements.txt
CLICKHOUSE_URL=clickhouse+http://default:@localhost:8123/ethereum alembic upgrade head 
ethereumetl export_blocks_and_transactions --start-block 0 --end-block 500000 \
--blocks-output blocks.csv --transactions-output transactions.csv \
--provider-uri https://mainnet.infura.io/v3/${INFURA_API_KEY}
ethereumetl export_token_transfers --start-block 0 --end-block 500000 \
--provider-uri file://$HOME/Library/Ethereum/geth.ipc --output token_transfers.csv
ethereumetl export_traces --start-block 0 --end-block 500000 \
--provider-uri file://$HOME/Library/Ethereum/parity.ipc --output traces.csv

ethereumetl stream --start-block 500000 -e block,transaction,log,token_transfer --log-file log.txt \
--provider-uri https://mainnet.infura.io/v3/7aef3f0cd1f64408b163814b22cc643c

Supported export destinations here.

Linters/formatters

Install

pip install black ruff mypy

Run

all-at-once run and fix:

ruff check --fix . && black . && mypy .

Or one-by-one:

  • Check and auto-fix with: ruff --fix .

  • Check typing: mypy .

  • Auto-format all: black .

Useful Links

If you want to use Clickhouse as a destination, make sure to apply migrations:

Export blocks and transactions (, ):

Export ERC20 and ERC721 transfers (, ):

Export traces (, ):

Stream blocks, transactions, logs, token_transfers continually to console ():

Find other commands .

🧰
⚡
⏯️
⚠️
Schema
Reference
Schema
Reference
Schema
Reference
Reference
here
Schema
Command Reference
How it works