eth-indexer/README.md

67 lines
1.5 KiB
Markdown
Raw Permalink Normal View History

2024-09-30 09:47:03 +02:00
# eth-indexer
2024-06-10 09:45:43 +02:00
2024-09-30 09:47:03 +02:00
![GitHub Tag](https://img.shields.io/github/v/tag/grassrootseconomics/eth-indexer)
2024-06-10 09:45:43 +02:00
2025-01-20 13:59:33 +01:00
A lightweight Postgres chain indexer designed to couple with
[eth-tracker](https://github.com/grassrootseconomics/eth-tracker) to index all
relevant GE related blockchain data on any EVM chain.
2024-06-10 09:45:43 +02:00
## Getting Started
### Prerequisites
2025-01-20 13:59:33 +01:00
- Git
- Docker
- Postgres server
- Access to a `eth-tracker` instance
2024-06-10 09:45:43 +02:00
2025-01-20 13:59:33 +01:00
See [docker-compose.yaml](dev/docker-compose.yaml) for an example on how to run
and deploy a single instance.
2024-06-10 09:45:43 +02:00
### 1. Build the Docker image
We provide pre-built images for `linux/amd64`. See the packages tab on Github.
If you are on any other platform:
```bash
git clone https://github.com/grassrootseconomics/eth-indexer.git
2024-09-30 09:47:03 +02:00
cd eth-indexer
docker buildx build --build-arg BUILD=$(git rev-parse --short HEAD) --tag eth-indexer:$(git rev-parse --short HEAD) --tag eth-indexer:latest .
2024-06-10 09:45:43 +02:00
docker images
```
### 2. Run Postgres
For an example, see `dev/docker-compose.postgres.yaml`.
### 3. Update config values
2025-01-20 13:59:33 +01:00
See `.env.example` on how to override default values defined in `config.toml`
using env variables. Alternatively, mount your own config.toml either during
build time or Docker runtime.
2024-06-10 09:45:43 +02:00
```bash
# Override only specific config values
nano .env.example
mv .env.example .env
```
Special env variables:
2025-01-20 13:59:33 +01:00
- DEV=*
2024-06-10 09:45:43 +02:00
2025-01-20 13:59:33 +01:00
Refer to [`config.toml`](config.toml) to understand different config value
settings.
2024-06-10 09:45:43 +02:00
### 4. Run the indexer
```bash
cd dev
docker compose up
```
## License
2025-01-20 13:59:33 +01:00
[AGPL-3.0](LICENSE).