Skip to content

Repository files navigation

event-sync

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.example only; your local .env is ignored by git.

Quick Start (WSL/Linux)

1) Prepare PostgreSQL

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';"

2) Create local env file

cp .env.example .env

Edit .env and set EVENT_SYNC_MASTER_DB_PASSWORD (and other values if needed).

3) Build

go mod tidy
make

4) Run migrations

source .env
./event-sync migrate

5) Run indexer (sync chain events)

source .env
./event-sync index

6) Run HTTP API

source .env
./event-sync api

Verify:

curl "http://127.0.0.1:8989/healthz"
curl "http://127.0.0.1:8989/api/v1/deposit/tokens?page=1&pageSize=10"

7) Run gRPC (optional)

source .env
./event-sync grpc

Use grpcui:

grpcui -plaintext 127.0.0.1:8987

Notes

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages