Skip to content

Commit 9af19f8

Browse files
moose-codeclaude
andcommitted
chore: dual-write all entities to Postgres + ClickHouse
Add a storage block enabling ClickHouse alongside Postgres, both default:true so every entity syncs to both backends (Postgres serves the GraphQL API, ClickHouse the columnar analytics store). envio auto-provisions a ClickHouse container in dev; for an external ClickHouse set ENVIO_CLICKHOUSE_HOST / _DATABASE / _USERNAME / _PASSWORD in .env. Verified locally: all 26 entity tables mirrored; PegKeeper data identical in both (3 keepers / 382 actions); a ClickHouse aggregation confirms keepers provide above peg (avg 1.0024) and withdraw below (avg 0.9998). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 8e1fafe commit 9af19f8

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
# yaml-language-server: $schema=./node_modules/envio/evm.schema.json
22
name: curve-crypto-pools
33

4+
# Storage backends. Every entity is written to BOTH Postgres (serves the GraphQL
5+
# API) and ClickHouse (columnar store for analytics). Both backends are marked
6+
# `default: true` so all entities without an explicit @storage directive land in
7+
# both — note that enabling ClickHouse flips Postgres's implicit default to false,
8+
# so Postgres must be set explicitly here. Per-entity routing is also possible via
9+
# an `@storage` directive in schema.graphql; omitted because we want full coverage.
10+
# ClickHouse connection is read from .env:
11+
# ENVIO_CLICKHOUSE_HOST, ENVIO_CLICKHOUSE_DATABASE,
12+
# ENVIO_CLICKHOUSE_USERNAME, ENVIO_CLICKHOUSE_PASSWORD
13+
storage:
14+
postgres:
15+
default: true
16+
clickhouse:
17+
default: true
18+
419
contracts:
520
- name: TricryptoFactoryNG
621
events:

0 commit comments

Comments
 (0)