Skip to content

dimka90/indexer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

30 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Indexa – ERC-20 Token Transfer Indexer

Indexa is a backend indexing service that connects directly to the Base blockchain and indexes real on-chain ERC-20 token transfer data into a PostgreSQL database.
It listens to live events (and historical blocks) from the Base network and stores verified blockchain data exactly as it exists on-chain.

Indexa also includes an AI-powered natural language interface, allowing users to control indexing behavior using simple human-readable commandsβ€”without writing SQL queries or modifying code.

πŸš€ Features

  • Indexes real-time ERC-20 Transfer events from the Ethereum blockchain

  • Stores from, to, and value fields into a PostgreSQL database

  • Supports natural language queries via AI for flexible indexing

  • Users can issue commands like:

    • Index transfers for this address

    • Only index the from and value fields

    • Index this particular address from block 2000000

No need to write raw queries or modify code to change indexing target

πŸ“ Folder Structure

backend/
β”œβ”€β”€ env.sample               # Sample environment variables
β”œβ”€β”€ node_modules/            # Installed dependencies
β”œβ”€β”€ package.json             # Project metadata and scripts
β”œβ”€β”€ package-lock.json        # Locked dependency versions
β”œβ”€β”€ tsconfig.json            # TypeScript configuration
β”œβ”€β”€ src/                     # Source code
β”‚   β”œβ”€β”€ config/              # DB and blockchain config (e.g., Sequelize, provider)
β”‚   β”œβ”€β”€ models/              # Sequelize models (e.g., Transfer.ts)
β”‚   β”œβ”€β”€ migrations/          # Sequelize migration files
β”‚   β”œβ”€β”€ services/            # Logic for indexing, saving to DB
β”‚   β”œβ”€β”€ utils/               # Helper functions
β”‚   └── index.ts             # App entry point


βš™οΈ Getting Started

1. Clone the Repository

git clone https://github.com/dimka90/indexer.git
cd backend
  1. Configure Environment Variables Copy the sample .env and configure it:
cp env.sample .env

Update .env with your credentials:

INFURA_URL=https://mainnet.infura.io/v3/YOUR_INFURA_KEY
DB_HOST=localhost
DB_USER=your_user
DB_PASSWORD=your_password
DB_NAME=indexa_db
DB_PORT=5432
OPEN_AI_KEY=
  1. Install Dependencies
npm install
  1. Create the Database Make sure PostgreSQL is running, then
create your database:
  1. Run Migrations Apply your database schema:
npx sequelize-cli db:migrate
  1. Start the Indexer
npm run start

πŸ”§ Technologies Used

  1. Node.js
  2. TypeScript
  3. PostgreSQL
  4. Sequelize ORM
  5. Web3.js
  6. dotenv

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors