#blockchain #ethereum #sqlite #sql-query #tx-hash #read-only #data-api #ens #erc20 #database-query

bin+lib mevlog

Index EVM transactions into a local SQLite DB and query them with SQL across 2k+ chains

41 releases (11 breaking)

Uses new Rust 2024

0.11.1 Jul 11, 2026
0.10.1 Jun 18, 2026
0.8.1 Jan 31, 2026
0.7.1 Sep 15, 2025
0.3.12 Mar 28, 2025

#3 in #erc20

MIT license

730KB
12K SLoC

mevlog-rs - query any EVM chain with SQL

Latest Version Downloads GH Actions

mevlog is an open-source (MIT) alternative to commercial blockchain indexers and data APIs. Instead of using a hosted service and querying an external database, it downloads raw chain data straight from an RPC endpoint, stores it in a local SQLite database, and lets you query it with plain SQL. You own the data - no API keys, no rate limits, no vendor lock-in, just a file on your disk you can query as much as you want, offline.

Quick Start

mevlog is published on crates.io. Install it with Cargo:

cargo install mevlog --locked

On the first run a signatures DB is downloaded and indexed (max ~1min).

Fetch and display the transactions in the latest Ethereum mainnet block:

mevlog block-txs -b latest --chain-id=1

With ZERO config, mevlog detects the fastest RPC endpoint from ChainList and uses it to download data. All data is cached in a local SQLite database (~/.mevlog/), so subsequent queries against the same block ranges are almost instant.

Run any read-only SQL against the local database with the query command:

# Find the most expensive TX in the given block range
mevlog query \
  -b 25314888:25314988 \
  --chain-id=1 \
  --sql "
    SELECT
      tx_hash,
      format_ether(u256_mul(gas_used, effective_gas_price)) AS cost
    FROM transactions
    ORDER BY u256_mul(gas_used, effective_gas_price) DESC
    LIMIT 1
  "

Produces:

"result": [
  {
    "tx_hash": "0x6bd55342c59905fe4c8a25f43737f60c54d43334cc54472d08f4d0069748ce9a",
    "cost": "0.044113 ETH"
  }
],

mevlog adds EVM-native SQLite helpers (256-bit math, ERC20 decoding, ETH/gwei/USD formatting, ENS resolution) that plain SQL cannot do.

Documentation & live demo

Dependencies

~120–165MB
~3M SLoC