Chain events tracker and indexer
Go to file
dependabot[bot] cd67d2608c
build(deps): bump github.com/grassrootseconomics/w3-celo-patch (#21)
Bumps [github.com/grassrootseconomics/w3-celo-patch](https://github.com/grassrootseconomics/w3-celo-patch) from 0.1.0 to 0.2.0.
- [Release notes](https://github.com/grassrootseconomics/w3-celo-patch/releases)
- [Commits](https://github.com/grassrootseconomics/w3-celo-patch/compare/v0.1.0...v0.2.0)

---
updated-dependencies:
- dependency-name: github.com/grassrootseconomics/w3-celo-patch
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-24 13:33:30 +03:00
.github Create codeql.yml 2023-01-11 12:49:32 +03:00
cmd refactor: filters, pipeline, minor fixes, remove RPC support (#27) 2023-02-24 13:28:30 +03:00
docs docs: fix minor mistakes 2023-01-19 15:27:29 +03:00
internal refactor: filters, pipeline, minor fixes, remove RPC support (#27) 2023-02-24 13:28:30 +03:00
migrations docs: add functionality, and usage 2023-01-11 09:29:16 +00:00
pkg/fetch refactor: filters, pipeline, minor fixes, remove RPC support (#27) 2023-02-24 13:28:30 +03:00
.deepsource.toml add: ci integration 2023-01-06 08:07:19 +00:00
.env.example release: v0.1.0-alpha 2023-01-05 11:45:09 +00:00
.gitignore dev: add profiler 2023-01-16 10:57:05 +00:00
.goreleaser.yaml ci: enable CGO builds 2023-01-06 11:42:58 +00:00
config.toml refactor: filters, pipeline, minor fixes, remove RPC support (#27) 2023-02-24 13:28:30 +03:00
docker-compose.build.yaml ci: enable CGO builds 2023-01-06 11:42:58 +00:00
docker-compose.yaml docs: add jetstream configs and instructions 2023-01-14 10:18:50 +00:00
Dockerfile ci: fix Docker CGO build 2023-01-06 11:45:33 +00:00
go.mod build(deps): bump github.com/grassrootseconomics/w3-celo-patch (#21) 2023-02-24 13:33:30 +03:00
go.sum build(deps): bump github.com/grassrootseconomics/w3-celo-patch (#21) 2023-02-24 13:33:30 +03:00
LICENSE release: v0.1.0-alpha 2023-01-05 11:45:09 +00:00
Makefile feat: RPC block fetcher (#15) 2023-01-19 11:42:59 +03:00
queries.sql release: v0.1.0-alpha 2023-01-05 11:45:09 +00:00
README.md docs: fix minor mistakes 2023-01-19 15:27:29 +03:00

cic-chain-events

GitHub release (latest by date) GitHub Workflow Status Go Report Card

CIC Chain Events

Filters live (and past) transactions on Celo and emits relevant events to a NATS JetStream sink for further processing/indexing.

Prerequisites

  • Linux OS (amd64) or Docker
  • Postgres >= 14
  • Celo geth with GraphQL API enabled
  • NATS server with JetStream enabled

Usage

The provided docker-compose.yaml is the fastest way to get up and running. Bring up the Postgres and NATS conatiners with docker-compose up -d

1. Run migrations

Run the SQL migrations inside the migrations folder with psql or tern (recommended).

2. Update the config

The base config is described in config.toml. Values can be overriden with env variables e.g. to disable metrics, set METRICS_GO_PROCESS=false.

3. Start the service

Compiling the binary

Run make build or download pre-compiled binaries from the releases page.

Then start the service with ./cic-chain-events

Optional flags:

  • -config - config.toml file path
  • -debug - Enable/disable debug level logs
  • -queries - queries.sql file path

Docker

To pull the pre-built docker image:

docker pull ghcr.io/grassrootseconomics/cic-chain-events/cic-chain-events:latest

Or to build it:

DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f docker-compose.build.yaml build --progress plain

4. NATS JetStream consumer

A consumer with the following NATS JetStream config is required:

  • Durable
  • Stream: CHAIN.* (See config.toml for stream subjects)

Benthos (Benthos can act as a JetStream consumer) example.

# config.yaml
input:
  label: jetstream
  nats_jetstream:
    urls:
      - nats://127.0.0.1:4222
    subject: "CHAIN.*"
    durable: benthos
    deliver: all
output:
  stdout:
    codec: lines

Then run:

benthos -c config.yaml

Functionality

Read more here.

License

AGPL-3.0.