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.
A Makefile
is also provided to build the required binaries to run celo-tracker.
An optional binary, celo-tracker-cache-bootstrap
, is included to build the Redis cache with all relevant Grassroots Economics smart contract and user addresses to allow filtering on very busy smart contracts e.g. cUSD.
The cache will auto-update based on any additions/removals from all indexes.
- Git
- Docker
- NATS server
- Redis server
- Access to a Celo RPC node
See docker-compose.yaml for an example on how to run and deploy a single instance.
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
For an example, see dev/docker-compose.yaml
.
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
Refer to config.toml
to understand different config value settings.
cd dev
docker compose up
{
"block": Number,
"contractAddress": String,
"success": Boolean,
"timetamp" Number,
"transactionHash": String,
"transactionType": String,
"payload": Object
}
Install NATS CLI from here.
nats subscribe "TRACKER.*"
A tracker_db
file is created on the first run. This keeps track of all blocks missed by the processor to attempt a retry later on. This file should not be deleted if you want to maintain resume support for historical tracking across restarts.