Minimalistic EVM-compatible chain indexer.

Overview

EVM Indexer

Minimalistic EVM-compatible blockchain indexer written in rust.

This repository contains a program to index helpful information from any EVM-compatible chain into a PostgreSQL database.

It is ready for developing purposes. If you want more information about it, you can send me a DM on Twitter

Demo

To see the EVM indexer in action, go to https://evm-indexer.kindynos.mx

The frontend app repository can be found here https://github.com/eabz/evm-indexer-app

Chains

Currently, the indexer can index the following chains:

  • Ethereum (mainnet)
  • Polygon
  • Avalanche
  • Fantom
  • Gnosis Chain
  • Optimism
  • BNB Chain

Database Information

The indexer creates tables for:

  1. Blocks
  2. Transactions
  3. Transaction Receipts
  4. Transaction Logs
  5. Contract Creations
  6. Contract Interactions
  7. Token Transfers
  8. Tokens Details

The information structure is explained in the database structure document.

Providers

The indexer connects automatically to three different providers through the RPC.

The available providers are:

The indexer automatically selects the providers added.

During our first indexings we realized that all providers sometimes deliver the information incomplete. To do so, the indexer stores all the incomplete transactions into a separate table and refetchs the using a fallback provider.

We tried a lot of public and paid RPC providers, for some reason, the only provider that delivers complete information is QuickNode.

To enable this service you need to add the quicknode RPC (or a local node will also work) as a FALLBACK_PROVIDER in the env variables.

Environment Variables

The indexer requires the following environment variables.

Variable Purpose Required Local Required Docker
DATABASE_URL Url of the PostgreSQL database true false
DATABASE_URL Password for the PostgreSQL database false true
ANKR_PROVIDER_ID Ankr RPC nodes provider ID false false
LLAMANODES_PROVIDER_ID LlamaNodes RPC nodes provider ID false false
POKT_PROVIDER_ID Pokt RPC provider ID false false
HASURA_ADMIN_PASSWORD Hasura console and GraphQL API token false true

To add the fallback providers (QuickNode or local nodes) to refetch failed transaction receipts.

Variable
ETH_FALLBACK_RPC
BSC_FALLBACK_RPC
GNOSIS_FALLBACK_RPC
AVAX_FALLBACK_RPC
FTM_FALLBACK_RPC
POLYGON_FALLBACK_RPC
OPTIMISM_FALLBACK_RPC

If the provider is not specified, the refetcher won't start and the indexer will work normally without refetching the transaction receipts.

Install

You can try the indexer locally or through Docker.

Local

To use the program locally, make sure you have rust installed in your environment.

  1. Clone the repository
git clone https://github.com/eabz/evm-indexer && cd evm-indexer
  1. Build the program
cargo build --release
  1. Copy the .env.example file to .env and add your environment variables.

  2. Run the program

./target/release/evm-indexer

Docker

You can use the official docker image.

docker pull ghcr.io/eabz/evm-indexer:latest

You can use our docker-compose script to start a full indexer with a database, all chains enabled, and a Hasura Cloud GraphQL API.

docker-compose up

Note: When using the docker-compose the database is exposed on the port 8000 of the host.

Contribute

We appreciate your contributions. PR are accepted and open.

Some ideas for contributions are:

  1. Add more chains
  2. Increment providers to sync simultaneously.
  3. Speed up the information deserialization/storing.
You might also like...
Minimalistic governance & ledger toolkit for cold wallets

Minimalistic ledger and governance toolkit for cold wallets.

A minimalistic cross-platform malware scanner with non-blocking realtime filesystem monitoring using YARA rules.
A minimalistic cross-platform malware scanner with non-blocking realtime filesystem monitoring using YARA rules.

Sauron is a minimalistic, YARA based malware scanner with realtime filesystem monitoring written in Rust. Features Realtime scan of created and modifi

A temporary repo for ETH connector to be used by EVM

ETH connector for Rainbow bridge Definitions bridgedETH - NEP-141 fungible-token representation of ETH inside Near. nETH - native ETH inside Near EVM.

DFIP 2111-B: VOC: Ethereum Virtual Machine (EVM) Support

DeFiCh/metachain is a codename research & development for DFIP 2111-B: VOC: Ethereum Virtual Machine (EVM) Support . Proposed as a DFIP on Nov 2021; D

Parser and test runner for testing compatable common Ethereum full node tests against Polygon Zero's EVM.

EVM Test Parses and runs compatible common Ethereum tests from ethereum/tests against Polygon Zero's EVM. Note: This repo is currently very early in d

Binding generator for EVM and ink!

Sumi is a binding generator specifically designed for Astar Network ecosystem with XVM in mind. It takes EVM metadata and converts it to an ink! modul

Tiny CLI for submitting large calldata transactions to EVM networks to stress test the networking layer. Main motivation: EIP4844blobs.

stress4844 Tiny CLI for submitting large calldata transactions to EVM networks to stress test the networking layer. Main motivation: EIP4844 blobs. ca

Tiny CLI for submitting large calldata transactions to EVM networks to stress test the networking layer

Tiny CLI for submitting large calldata transactions to EVM networks to stress test the networking layer. Main motivation: EIP4844blobs.

An EVM low-level language that gives full control over the control flow of the smart contract.

Meplang - An EVM low-level language Meplang is a low-level programming language that produces EVM bytecode. It is designed for developers who need ful

Releases(v1.1.0)
  • v1.1.0(Dec 10, 2022)

    v1.1.0

    • Increase syncing performance.
    • Fetch ABIs from newly created contracts.
    • Create a methods table to store all ABIs byte4 functions id.
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Nov 30, 2022)

    v1.0.0

    • Initial release for development testing.
    • Works with seven chains (with some minor issues) but good fallback solutions.
    • Works with three providers. Using ankr and llamanodes as the primary ones.
    • One-liner docker script to run it all.
    • Frontend visualizer at https://evm-indexer.kindynos.mx with API https://evm-indexer.kindynos.mx/api-doc
    • Hasura Cloud GraphQL API with a console at https://indexer.kindynos.mx
    Source code(tar.gz)
    Source code(zip)
A high-performance, highly compatible EVM Inscriptions Indexer

Insdexer A high-performance, highly compatible EVM Inscriptions Indexer by Rust. An accessible and complete version of the documentation is available

null 105 Mar 17, 2024
EVM compatible chain with NPoS/PoC consensus

Reef Chain Reef chain is written in Rust. A basic familiarity with Rust tooling is required. To learn more about Reef chain, please refer to Documenta

Reef Finance 148 Dec 31, 2022
A Minimalistic Rust library to extract all potential function selectors from EVM bytecode without source code.

EVM Hound A Minimalistic Rust library to extract all potential function selectors from EVM bytecode without source code. Installation $ cargo add evm_

null 34 Dec 3, 2023
A tool for quickly collecting function selectors and decoding signatures from on-chain EVM bytecode.

Overview | Disclaimer | Tests | Installation | Usage | Examples | Aknowledgements | License Overview Sigmund provides a CLI that allows users to colle

wavefnx 46 Jul 22, 2024
Fiddi is a command line tool that does the boring and complex process of checking and processing/watching transactions on EVM compatible Blockchain.

Fiddi is a command line tool that does the boring and complex process of checking and processing/watching transactions on EVM compatible Blockchain.

Ahmad Abdullahi Adamu 7 Jan 9, 2023
Selendra is a multichains interoperable nominated Proof-of-Stake network for developing and running Substrate-based and EVM compatible blockchain applications.

Selendra An interoperable nominated Proof-of-Stake network for developing and running Substrate-based and EVM compatible blockchain applications. Read

Selendra 16 Nov 29, 2022
A framework for developing EVM-compatible chains

rt-evm A compact development framework for creating EVM-compatible runtimes/chains. Usage Check the example for details. Projects referenced trie, MPT

Rust Util Collections 4 Mar 15, 2023
reth-indexer reads directly from the reth db and indexes the data into a postgres database all decoded with a simple config file and no extra setup alongside exposing a API ready to query the data.

reth-indexer reth-indexer reads directly from the reth db and indexes the data into a postgres database all decoded with a simple config file and no e

Josh Stevens 306 Jul 12, 2023
Ethereum (and Ethereum like) indexer using P2P message to fetch blocks and transactions

Ethereum P2P indexer This project is an indexer for Ethereum and Ethereum forks. It takes advantage of the ETH (Ethereum Wire Protocol) to fetch block

null 5 Nov 10, 2023
Open Protocol Indexer, OPI, is the best-in-slot open-source indexing client for meta-protocols on Bitcoin.

OPI - Open Protocol Indexer Open Protocol Indexer, OPI, is the best-in-slot open-source indexing client for meta-protocols on Bitcoin. OPI uses a fork

Best in Slot 33 Dec 16, 2023