Skip to content

Latest commit

 

History

History

ens-simple-name-reversal

Indexing Starter Boilerplate

This repository contains boilerplate scripts, abis and schema for ENS indexing

Table of Contents

Getting Started

1️⃣ Clone this repo:

git clone https://github.com/flair-sdk/starter-boilerplate.git my-indexer
cd my-indexer

2️⃣ Install packages and authenticate:
pnpm i
pnpm flair auth

3️⃣ Set the namespace and config.json:

config.dev.json and config.prod.json are sample configs for dev and prod clusters.

Set a globally unique namespace in each config file (recommended to use {ORG_NAME}-{ENV}; e.g sushiswap-dev or sushiswap-prod) and then run:

# Setting configs for dev testing
cp config.dev.json config.json

# Or setting it for production
cp config.prod.json config.json

4️⃣ Generate manifest.yml and deploy:
pnpm generate-and-deploy

5️⃣ Backfill for a specific block number, if you have certain events you wanna test with:
pnpm flair backfill --chain 1 -b 17998797

Or backfill for the recent data in the last X minutes:

pnpm flair backfill --chain 1 --min-timestamp="5 mins ago" -d backward

6️⃣ Look at the logs:
pnpm flair logs --full -tag Level=warn
pnpm flair logs --full -tag TransactionHash=0xXXXXX
pnpm flair logs --full -tag ProcessorId=reverse-registrar-events
pnpm flair logs --full -tag ProcessorId=reverse-registrar-events --watch

7️⃣ Explore the data in playground:

Visit the playground and run the following query in Examples section.

Examples

Get all entity types total count

query {
    sql(
        query: """
            SELECT
                COUNT(*) as totalCount,
                entityType
            FROM
                entities
            WHERE
                namespace = 'ens-indexing-example'
            GROUP BY entityType
            ORDER BY totalCount DESC
            LIMIT 100
        """
    ) {
        stats {
            elapsedMs
        }
        rows
    }
}

TODO

  • PrimaryName<>Address Resolution
    • Track new Reverse Registrar with events (`0xa58E81fe9b61B5c3fE2AFD33CF304c454AbFc7Cb``)
    • Track Old Reverse Registrar with transaction tracing (`0xa58E81fe9b61B5c3fE2AFD33CF304c454AbFc7Cb``)
    • Track DNS Registrar (`0x58774Bb8acD458A640aF0B88238369A167546ef2``)

FAQ

Q: How do I enable/disable real-time ingestion for indexer?
A: For each indexer defined in config.json, you can enable/disable it via the enabled: true/false flag. Remember to run pnpm generate-and-deploy for the changes to apply on the cluster.