evm-scanner

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2025 License: Apache-2.0

README ΒΆ

EVM Scanner πŸš€

Go Report Card Build Status GoDoc

A high-performance, industrial-grade EVM event scanning and indexing framework. Built for developers who need reliable, real-time access to blockchain data without the overhead of complex indexing solutions.

Features β€’ Installation β€’ Quick Start β€’ Documentation β€’ Contributing


🌟 Features

  • ⛓️ Multi-Chain Native: Optimized for Ethereum, BSC, Polygon, Arbitrum, and any EVM-compatible network.
  • πŸ’Ύ Pluggable Storage: Choose your persistence layerβ€”Memory (dev), Redis (performance), or PostgreSQL (durability).
  • πŸš€ High Performance:
    • Batch Processing: Efficient RPC call batching to minimize latency and costs.
    • Bloom Filter Support: Leverages node-level filtering for massive speed gains.
    • Worker Pool: Parallel output processing (sinks) for high-throughput environments.
  • πŸ”Œ Rich Ecosystem (Sinks): Stream data directly to Webhooks, Kafka, RabbitMQ, Redis, PostgreSQL, or flat files.
  • πŸ›‘οΈ Production Ready: Automatic reorg handling with configurable safety windows and cursor management.
  • πŸ’Ž Human Readable: Built-in ABI decoding turns raw hex logs into structured JSON data automatically.

πŸ“¦ Installation

Download the pre-compiled binary for your architecture from the Releases page.

Using Go
go install github.com/84hero/evm-scanner/cmd/scanner-cli@latest
From Source
git clone https://github.com/84hero/evm-scanner.git
cd evm-scanner
make build

πŸš€ Quick Start

1. Initialize Configuration
cp config.yaml.example config.yaml
cp app.yaml.example app.yaml
2. Run the CLI
# Start scanning based on app.yaml filters
./bin/scanner-cli
3. Docker (One-Liner)
docker-compose up -d

πŸ›  Usage Examples

CLI Mode (Standalone)

Define your filters in app.yaml:

filters:
  - description: "USDT Transfer Tracker"
    contracts: ["0xdAC17F958D2ee523a2206206994597C13D831ec7"]
    topics: ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]
    abi: '[{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},...],"name":"Transfer","type":"event"}]'
SDK Mode (As a Library)

Explore our curated examples to see how to integrate evm-scanner into your stack:

Example Description
Basic SDK Minimal setup to start scanning from a Go app.
Custom Decoder How to decode raw logs into human-readable data using ABIs.
PostgreSQL Integration Production-ready setup using Postgres for both progress tracking and data storage.
Enterprise MQ Streaming event data to Kafka for high-throughput microservices.
Multi-Sink Pipeline Dispatching events to Console and Files simultaneously.
Custom Chain Preset Configure parameters for a new L2 or AppChain (BlockTime, ReorgSafe).
Custom Sink Extend the framework by implementing your own output destination (e.g., Slack).
Webhook Receiver A simple server to receive and process events via Webhook.
import (
    "github.com/84hero/evm-scanner/pkg/scanner"
    "github.com/84hero/evm-scanner/pkg/rpc"
)

func main() {
    client, _ := rpc.NewClient(ctx, rpcCfg, 10)
    s := scanner.New(client, storage, scanCfg, filter)
    
    s.SetHandler(func(ctx context.Context, logs []types.Log) error {
        // Your custom business logic here
        return nil
    })
    
    s.Start(ctx)
}

βš™οΈ Configuration

The project uses two primary configuration files:

File Purpose Key Settings
config.yaml Infrastructure RPC Nodes, DB/Redis connections, Scan speed
app.yaml Business Logic Contracts, Topics, ABI, Output Destinations

πŸ— Supported Sinks (Outputs)

Sink Status Use Case
Webhook βœ… Real-time API integration
PostgreSQL βœ… Permanent event storage & querying
Redis βœ… Fast message passing (List/PubSub)
Kafka βœ… Big data pipelines & stream processing
RabbitMQ βœ… Enterprise message queuing
Console/File βœ… Debugging and logging

πŸ›  Development

We use Makefile for common tasks:

  • make test: Run the test suite.
  • make lint: Run code quality checks.
  • make snapshot: Local build validation with GoReleaser.

🀝 Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“§ Contact

πŸ“„ License

Distributed under the MIT License. See LICENSE for more information.


Built with ❀️ for the Web3 Community.

Directories ΒΆ

Path Synopsis
cmd
example command
scanner-cli command
examples
basic command
custom-chain command
custom-decoder command
custom-sink command
enterprise-mq command
multi-sink command
internal
pkg
rpc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL