event-sync is a chain event indexer for the TreasureManager contract.
- Reads contract logs from RPC
- Stores raw logs + parsed business events into PostgreSQL
- Exposes query APIs via HTTP and gRPC
Security notes (IMPORTANT):
- Never commit private keys or real passwords.
- This repo commits
.env.exampleonly; your local.envis ignored by git.
Create a database (example):
sudo -u postgres psql -c "CREATE DATABASE event_sync OWNER appuser;"
sudo -u postgres psql -c "ALTER USER appuser WITH PASSWORD 'YOUR_DB_PASSWORD';"cp .env.example .envEdit .env and set EVENT_SYNC_MASTER_DB_PASSWORD (and other values if needed).
go mod tidy
makesource .env
./event-sync migratesource .env
./event-sync indexsource .env
./event-sync apiVerify:
curl "http://127.0.0.1:8989/healthz"
curl "http://127.0.0.1:8989/api/v1/deposit/tokens?page=1&pageSize=10"source .env
./event-sync grpcUse grpcui:
grpcui -plaintext 127.0.0.1:8987-
The monitored contract address is currently hard-coded in
config/config.goasTreasureManagerAddr. -
主网 RPC 与浏览器