Track any EVM chain for live and historical tx events
Go to file
2024-08-05 16:45:14 +08:00
.github ci: add docker images, update docs 2024-05-27 17:41:55 +08:00
cmd perf: increase worker pool queue buffer size 1 -> ~4k 2024-06-20 14:19:06 +08:00
dev dev: add improved example, change db directory 2024-05-27 18:29:48 +08:00
internal fix: bootstrap queue size check 2024-08-05 16:45:14 +08:00
pkg/event refactor: move event into pkg to allow external importing 2024-05-30 15:04:12 +08:00
.dockerignore docker build: add missing pkg 2024-06-03 11:16:52 +08:00
.env.example ci: add docker images, update docs 2024-05-27 17:41:55 +08:00
.gitignore dev: add improved example, change db directory 2024-05-27 18:29:48 +08:00
config.toml ci: add docker images, update docs 2024-05-27 17:41:55 +08:00
Dockerfile ci: add docker images, update docs 2024-05-27 17:41:55 +08:00
go.mod release: v1.0.0 2024-05-23 14:41:39 +08:00
go.sum release: v1.0.0 2024-05-23 14:41:39 +08:00
LICENSE docs: add LICENSE and README 2024-05-23 15:21:42 +08:00
README.md docs: update run instructions 2024-05-27 18:32:24 +08:00
revive.toml release: v1.0.0 2024-05-23 14:41:39 +08:00

celo-tracker

GitHub Tag

A fast and lightweight tracker designed to monitor the Celo blockchain for live and historical transaction events, including reverted transactions. It filters these events and publishes them to NATS for further processing.

It applies deduplication at the NATS level, making it safe to run in a distributed fashion, thus allowing for high availability.

Getting Started

Prerequisites

  • Git
  • Docker
  • NATS server
  • Access to a Celo RPC node

See 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:

git clone https://github.com/grassrootseconomics/celo-tracker.git
cd celo-tracker
docker buildx build --build-arg BUILD=$(git rev-parse --short HEAD) --tag celo-tracker:$(git rev-parse --short HEAD) --tag celo-tracker:latest .
docker images

2. Run NATS

For an example, see dev/docker-compose.nats.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.

# Override only specific config values
nano .env.example
mv .env.example .env

Special env variables:

  • DEV=*
  • FORCE_BACKFILL=*

Refer to config.toml to understand different config value settings.

4. Run the tracker

cd dev
docker compose up

Processing NATS messages

JSON structure

{
    "block": Number,
    "contractAddress": String,
    "success": Boolean,
    "timetamp" Number,
    "transactionHash": String,
    "transactionType": String,
    "payload": Object
}

Monitoring with NATS CLI

Install NATS CLI from here.

nats subscribe "TRACKER.*"

Caveats

  • Reverted transactions older than 10 minutes will be skipped due to the trie potentially missing. To override this behavior, use an archive node and set chain.archive_node to true.
  • The backfiller will only re-queue an epoch's (17,280 blocks) worth of missing blocks. To override this behavior, pass an environment variable FORCE_BACKFILL=*. This may lead to degraded RPC performance.

License

AGPL-3.0.