https://github.com/shunkakinoki/evm-indexer
A scalable SQL indexer for EVM compatible blockchains
https://github.com/shunkakinoki/evm-indexer
Last synced: 2 months ago
JSON representation
A scalable SQL indexer for EVM compatible blockchains
- Host: GitHub
- URL: https://github.com/shunkakinoki/evm-indexer
- Owner: shunkakinoki
- License: mit
- Created: 2023-05-05T04:54:07.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-04T23:54:45.000Z (about 2 years ago)
- Last Synced: 2025-03-06T21:58:01.753Z (2 months ago)
- Homepage:
- Size: 868 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
EVM Blockchain Indexer
Scalable SQL indexer for EVM compatible blockchains
An indexer is a program that fetches and stores blockchain data for later analysis.
This indexer is specifically created to parse known data for EVM compatible chains.
It stores all the blockchain primitives (blocks, transactions, receipts, logs, traces) and some other useful information (contracts, dex trades, erc20 transfers, erc721 transfers, erc1155 transfers)
## Requirements
- [Rust](https://www.rust-lang.org/tools/install)
- [ClickHouse](https://clickhouse.com/)## Install
You can install the indexer from the crate public repositor
```
cargo install evm-indexer
```And run it
```
evm-indexer --rpcs "" --database ""
```## Build
You can try the indexer locally or through Docker.
### Local
1. Clone the repository
```
git clone https://github.com/kindynosmx/evm-indexer && cd evm-indexer
```2. Build the program
```
cargo build --release
```3. Copy the `.env.example` file to `.env` and add your environment variables.
### Docker
1. Clone the repository
```
git clone https://github.com/kindynosmx/evm-indexer && cd evm-indexer
```2. Build the image and tag it as `indexer`
```
docker build . -t indexer
```3. Copy the `.env.example` file to `.env` and add your environment variables.
## Program flags
| Flag | Default | Purpose |
| --------------- | :-----: | ------------------------------------------------------ |
| `--debug` | false | Start log with debug. |
| `--chain` | 1 | Number identifying the chain id to sync. |
| `--start-block` | 0 | Block to start syncing. |
| `--end-block` | 0 | Last block to sync (0 to sync all the blocks). |
| `--batch-size` | 200 | Amount of blocks to fetch in parallel. |
| `--rpcs` | `empty` | Comma separated list of rpcs to use to fetch blocks. |
| `--database` | `empty` | Clickhouse database string with username and password. |
| `--ws` | `empty` | Url of the websocket endpoint to fetch new blocks. |