-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
83bb29f
commit fb22f26
Showing
5 changed files
with
100 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# celo-indexer | ||
|
||
![GitHub Tag](https://img.shields.io/github/v/tag/grassrootseconomics/celo-indexer) | ||
|
||
A lightweight Postgres chain indexer designed to couple with [celo-tracker](https://github.com/grassrootseconomics/celo-tracker) to index all relevant GE related blockchain data on the Celo blockchain. | ||
|
||
## Getting Started | ||
|
||
### Prerequisites | ||
|
||
* Git | ||
* Docker | ||
* Postgres server | ||
* Access to a `celo-tracker` instance | ||
|
||
See [docker-compose.yaml](dev/docker-compose.yaml) for an example on how to run and deploy a single instance. | ||
|
||
### 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/celo-indexer.git | ||
cd celo-indexer | ||
docker buildx build --build-arg BUILD=$(git rev-parse --short HEAD) --tag celo-indexer:$(git rev-parse --short HEAD) --tag celo-indexer:latest . | ||
docker images | ||
``` | ||
|
||
### 2. Run Postgres | ||
|
||
For an example, see `dev/docker-compose.postgres.yaml`. | ||
|
||
### 3. Update config values | ||
|
||
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. | ||
|
||
```bash | ||
# Override only specific config values | ||
nano .env.example | ||
mv .env.example .env | ||
``` | ||
|
||
Special env variables: | ||
|
||
* DEV=* | ||
|
||
Refer to [`config.toml`](config.toml) to understand different config value settings. | ||
|
||
|
||
### 4. Run the indexer | ||
|
||
```bash | ||
cd dev | ||
docker compose up | ||
``` | ||
|
||
## License | ||
|
||
[AGPL-3.0](LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
services: | ||
postgres: | ||
image: postgres:16-alpine | ||
restart: unless-stopped | ||
user: postgres | ||
environment: | ||
- POSTGRES_PASSWORD=postgres | ||
- POSTGRES_USER=postgres | ||
volumes: | ||
- ./init_db.sql:/docker-entrypoint-initdb.d/init_db.sql | ||
- indexer-pg:/var/lib/postgresql/data | ||
ports: | ||
- "127.0.0.1:5432:5432" | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready"] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
volumes: | ||
indexer-pg: | ||
driver: local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters