|
1 | 1 | # Mento Monitoring Monorepo |
2 | 2 |
|
3 | | -Real-time monitoring infrastructure for Mento v3 on-chain pools — an [Envio HyperIndex](https://docs.envio.dev/) indexer paired with a Next.js 16 + Plotly.js dashboard. |
| 3 | +Real-time monitoring infrastructure for Mento v3 on-chain pools — a multichain [Envio HyperIndex](https://docs.envio.dev/) indexer paired with a Next.js 16 + Plotly.js dashboard. |
4 | 4 |
|
5 | 5 | **Live dashboard:** [monitoring.mento.org](https://monitoring.mento.org) |
6 | 6 |
|
7 | 7 | ## Packages |
8 | 8 |
|
9 | | -| Package | Description | |
10 | | -| ----------------------------------- | ------------------------------------------------------------------------------ | |
11 | | -| [`indexer-envio`](./indexer-envio/) | Envio HyperIndex indexer for Celo + Monad (FPMM pools + VirtualPools) | |
12 | | -| [`ui-dashboard`](./ui-dashboard/) | Next.js 16 + Plotly.js monitoring dashboard with multi-chain network switching | |
13 | | -| [`shared-config`](./shared-config/) | Shared deployment config (chain ID → treb namespace mappings) | |
| 9 | +| Package | Description | |
| 10 | +| ----------------------------------- | ------------------------------------------------------------------- | |
| 11 | +| [`indexer-envio`](./indexer-envio/) | Envio HyperIndex indexer — Celo + Monad multichain | |
| 12 | +| [`ui-dashboard`](./ui-dashboard/) | Next.js 16 + Plotly.js dashboard with multi-chain network switching | |
| 13 | +| [`shared-config`](./shared-config/) | Shared deployment config (chain ID → treb namespace mappings) | |
14 | 14 |
|
15 | 15 | ## Architecture |
16 | 16 |
|
17 | 17 | ```text |
18 | | -┌─────────────────┐ ┌──────────────────┐ ┌────────────────┐ |
19 | | -│ Celo Chain │────▶│ Envio HyperIndex │────▶│ Hasura │ |
20 | | -│ (RPC / GRPC) │ │ (Hosted) │ │ (GraphQL API) │ |
21 | | -└─────────────────┘ └──────────────────┘ └───────┬────────┘ |
22 | | - │ |
23 | | - ┌──────▼──────┐ |
24 | | - │ Next.js │ |
25 | | - │ Dashboard │ |
26 | | - │ (Vercel) │ |
27 | | - └─────────────┘ |
| 18 | +┌──────────────────────┐ ┌──────────────────┐ ┌────────────────┐ |
| 19 | +│ Celo + Monad Chains │────▶│ Envio HyperIndex │────▶│ Hasura │ |
| 20 | +│ (HyperSync / RPC) │ │ (Hosted, mento) │ │ (GraphQL API) │ |
| 21 | +└──────────────────────┘ └──────────────────┘ └───────┬────────┘ |
| 22 | + │ |
| 23 | + ┌──────▼──────┐ |
| 24 | + │ Next.js │ |
| 25 | + │ Dashboard │ |
| 26 | + │ (Vercel) │ |
| 27 | + └─────────────┘ |
28 | 28 | ``` |
29 | 29 |
|
30 | | -The indexer runs on Envio's hosted free tier. Each deploy produces a new GraphQL endpoint hash. The dashboard reads from this endpoint via Hasura's GraphQL API. |
| 30 | +Both Celo Mainnet (42220) and Monad Mainnet (143) are served from a single Envio project (`mento`) using `config.multichain.mainnet.yaml`. Pool IDs are namespaced as `{chainId}-{address}` to prevent cross-chain collisions. |
| 31 | + |
| 32 | +**Static production endpoint:** `https://indexer.hyperindex.xyz/2f3dd15/v1/graphql` |
31 | 33 |
|
32 | 34 | ## Networks |
33 | 35 |
|
34 | | -| Network | Chain ID | Status | |
35 | | -| ------------- | -------- | ----------------------------- | |
36 | | -| Celo Mainnet | 42220 | ✅ Live | |
37 | | -| Celo Sepolia | 44787 | ✅ Live | |
38 | | -| Monad Mainnet | — | ⏳ Blocked on contract deploy | |
| 36 | +| Network | Chain ID | Status | |
| 37 | +| ------------- | -------- | ------- | |
| 38 | +| Celo Mainnet | 42220 | ✅ Live | |
| 39 | +| Monad Mainnet | 143 | ✅ Live | |
| 40 | +| Celo Sepolia | 11142220 | ✅ Live | |
| 41 | +| Monad Testnet | 10143 | ✅ Live | |
39 | 42 |
|
40 | 43 | ## Getting Started |
41 | 44 |
|
@@ -70,132 +73,74 @@ pnpm indexer:monad-testnet:codegen && pnpm indexer:monad-testnet:dev |
70 | 73 | pnpm dashboard:dev |
71 | 74 | ``` |
72 | 75 |
|
73 | | -The dashboard connects to Hasura (local or hosted) to display real-time pool data. |
74 | | - |
75 | 76 | ## Environment Variables |
76 | 77 |
|
77 | 78 | ### Indexer |
78 | 79 |
|
79 | 80 | Create `indexer-envio/.env` from `indexer-envio/.env.example`: |
80 | 81 |
|
81 | | -| Variable | Description | Default | |
82 | | -| ------------------- | ---------------------------- | ---------- | |
83 | | -| `ENVIO_API_TOKEN` | Envio platform API token | — | |
84 | | -| `ENVIO_RPC_URL` | Celo RPC endpoint | — | |
85 | | -| `ENVIO_START_BLOCK` | Block to start indexing from | `60664513` | |
| 82 | +| Variable | Description | |
| 83 | +| ------------------------- | ------------------------------------- | |
| 84 | +| `ENVIO_RPC_URL_42220` | Celo Mainnet RPC endpoint | |
| 85 | +| `ENVIO_RPC_URL_143` | Monad Mainnet RPC endpoint | |
| 86 | +| `ENVIO_START_BLOCK_CELO` | Celo start block (default: 60664500) | |
| 87 | +| `ENVIO_START_BLOCK_MONAD` | Monad start block (default: 60730000) | |
86 | 88 |
|
87 | 89 | ### Dashboard |
88 | 90 |
|
89 | | -The dashboard supports multiple network targets via `_<NETWORK>` suffix env vars: |
90 | | - |
91 | | -| Variable | Description | |
92 | | -| --------------------------------------------- | ------------------------------------------------ | |
93 | | -| `NEXT_PUBLIC_HASURA_URL_CELO_MAINNET_HOSTED` | Hasura/GraphQL endpoint — Celo Mainnet (hosted) | |
94 | | -| `NEXT_PUBLIC_HASURA_URL_MONAD_MAINNET_HOSTED` | Hasura/GraphQL endpoint — Monad Mainnet (hosted) | |
95 | | -| `NEXT_PUBLIC_HASURA_URL_MONAD_TESTNET_HOSTED` | Hasura/GraphQL endpoint — Monad Testnet (hosted) | |
96 | | -| `NEXT_PUBLIC_HASURA_URL_CELO_SEPOLIA_HOSTED` | Hasura/GraphQL endpoint — Celo Sepolia (hosted) | |
97 | | -| `NEXT_PUBLIC_HASURA_URL_CELO_MAINNET` | Hasura endpoint — Celo Mainnet (local) | |
98 | | -| `NEXT_PUBLIC_HASURA_URL_CELO_SEPOLIA` | Hasura endpoint — Celo Sepolia (local) | |
99 | | -| `NEXT_PUBLIC_EXPLORER_URL_CELO_MAINNET` | Block explorer — Celo Mainnet | |
100 | | -| `NEXT_PUBLIC_EXPLORER_URL_CELO_SEPOLIA` | Block explorer — Celo Sepolia | |
101 | | -| `UPSTASH_REDIS_REST_URL` | Address labels storage (Upstash Redis) | |
102 | | -| `UPSTASH_REDIS_REST_TOKEN` | Address labels Redis auth token | |
103 | | -| `BLOB_READ_WRITE_TOKEN` | Vercel Blob token for daily label backups | |
104 | | - |
105 | | -Production env vars are managed by Terraform — do not edit them in the Vercel dashboard. See [`terraform/`](./terraform/) and [`docs/deployment.md`](./docs/deployment.md). |
| 91 | +| Variable | Description | |
| 92 | +| -------------------------------------------- | ------------------------------------------------- | |
| 93 | +| `NEXT_PUBLIC_HASURA_URL_MULTICHAIN_HOSTED` | Shared multichain GraphQL endpoint (Celo + Monad) | |
| 94 | +| `NEXT_PUBLIC_HASURA_URL_CELO_SEPOLIA_HOSTED` | Celo Sepolia hosted endpoint | |
| 95 | +| `UPSTASH_REDIS_REST_URL` | Address labels storage (Upstash Redis) | |
| 96 | +| `UPSTASH_REDIS_REST_TOKEN` | Address labels Redis auth token | |
| 97 | +| `BLOB_READ_WRITE_TOKEN` | Vercel Blob token for daily label backups | |
106 | 98 |
|
107 | | -## Contract Addresses |
108 | | - |
109 | | -Contract addresses and ABIs are sourced from the published [`@mento-protocol/contracts`](https://www.npmjs.com/package/@mento-protocol/contracts) npm package — no vendored JSON files. The active treb deployment namespace per chain is declared in [`shared-config/deployment-namespaces.json`](./shared-config/deployment-namespaces.json): |
110 | | - |
111 | | -```json |
112 | | -{ |
113 | | - "42220": "mainnet", |
114 | | - "11142220": "testnet-v2-rc5" |
115 | | -} |
116 | | -``` |
117 | | - |
118 | | -**To promote a new treb deployment** (e.g. after a new `mento-deployments-v2` release): |
119 | | - |
120 | | -1. Publish a new `@mento-protocol/contracts` version from `mento-deployments-v2` |
121 | | -2. Update the package version in `indexer-envio/package.json` and `ui-dashboard/package.json` |
122 | | -3. Update the namespace string(s) in `shared-config/deployment-namespaces.json` |
123 | | -4. Run `pnpm install` |
| 99 | +Production env vars are managed by Terraform. See [`terraform/`](./terraform/). |
124 | 100 |
|
125 | 101 | ## Deployment |
126 | 102 |
|
127 | 103 | ### Indexer → Envio Hosted |
128 | 104 |
|
129 | | -Each network has a dedicated deploy branch Envio watches: |
130 | | - |
131 | | -| Network | Deploy Branch | |
132 | | -| ------------- | ---------------------- | |
133 | | -| Celo Mainnet | `deploy/celo-mainnet` | |
134 | | -| Celo Sepolia | `deploy/celo-sepolia` | |
135 | | -| Monad Mainnet | `deploy/monad-mainnet` | |
136 | | -| Monad Testnet | `deploy/monad-testnet` | |
137 | | - |
138 | | -Push to trigger a redeploy: |
| 105 | +Push to the `envio` branch to trigger a hosted reindex: |
139 | 106 |
|
140 | 107 | ```bash |
141 | | -pnpm deploy:indexer celo-mainnet |
142 | | -# or run without args to be prompted: |
143 | 108 | pnpm deploy:indexer |
144 | | -# or push directly: |
145 | | -git push origin main:deploy/celo-mainnet |
146 | 109 | ``` |
147 | 110 |
|
148 | | -> ⚠️ **Celo Sepolia endpoint changes on each Envio redeploy.** After redeploying the Celo Sepolia indexer, update `hasura_url_celo_sepolia_hosted` in `terraform/terraform.tfvars` and run `pnpm infra:apply`. |
| 111 | +The `mento` project on [Envio Cloud](https://envio.dev/app/mento-protocol/mento) watches this branch. |
149 | 112 |
|
150 | 113 | ### Dashboard → Vercel |
151 | 114 |
|
152 | | -Vercel's native Git integration watches `main` — every push that touches `ui-dashboard/` auto-deploys the dashboard to [monitoring.mento.org](https://monitoring.mento.org). |
| 115 | +Every push to `main` that touches `ui-dashboard/` auto-deploys to [monitoring.mento.org](https://monitoring.mento.org). |
153 | 116 |
|
154 | | -All infrastructure (Vercel project, env vars, Upstash Redis, custom domain) is managed by Terraform: |
| 117 | +Infrastructure (Vercel project, env vars, Upstash Redis) is managed by Terraform: |
155 | 118 |
|
156 | 119 | ```bash |
157 | 120 | pnpm infra:plan # preview changes |
158 | 121 | pnpm infra:apply # apply changes |
159 | 122 | ``` |
160 | 123 |
|
161 | | -See [`docs/deployment.md`](./docs/deployment.md) for the full setup guide and troubleshooting. |
162 | | - |
163 | | -## CI |
164 | | - |
165 | | -GitHub Actions runs on every PR: |
| 124 | +## Contract Addresses |
166 | 125 |
|
167 | | -- ESLint 10 (no `eslint-config-next` — uses `@eslint/js` + `typescript-eslint` + `@eslint-react`) |
168 | | -- Vitest (105 tests) |
169 | | -- TypeScript typecheck |
170 | | -- Codecov coverage reporting |
| 126 | +Sourced from the published [`@mento-protocol/contracts`](https://www.npmjs.com/package/@mento-protocol/contracts) npm package. The active treb deployment namespace per chain is declared in [`shared-config/deployment-namespaces.json`](./shared-config/deployment-namespaces.json). |
171 | 127 |
|
172 | 128 | ## Key Files |
173 | 129 |
|
174 | | -| What | Where | |
175 | | -| ------------------------------ | -------------------------------------------- | |
176 | | -| **Deployment namespace map** | `shared-config/deployment-namespaces.json` | |
177 | | -| Indexer schema | `indexer-envio/schema.graphql` | |
178 | | -| Event handlers | `indexer-envio/src/EventHandlers.ts` | |
179 | | -| Contract address resolution | `indexer-envio/src/contractAddresses.ts` | |
180 | | -| Celo mainnet config | `indexer-envio/config.celo.mainnet.yaml` | |
181 | | -| Celo Sepolia config | `indexer-envio/config.celo.sepolia.yaml` | |
182 | | -| Monad mainnet/testnet configs | `indexer-envio/config.monad.*.yaml` | |
183 | | -| Dashboard app | `ui-dashboard/src/app/` | |
184 | | -| Address book page | `ui-dashboard/src/app/address-book/page.tsx` | |
185 | | -| Address labels API | `ui-dashboard/src/app/api/address-labels/` | |
186 | | -| Address labels storage | `ui-dashboard/src/lib/address-labels.ts` | |
187 | | -| Network defs + contract labels | `ui-dashboard/src/lib/networks.ts` | |
188 | | -| GraphQL queries | `ui-dashboard/src/lib/queries.ts` | |
189 | | -| Pool type helper | `ui-dashboard/src/lib/tokens.ts` | |
190 | | -| Terraform infrastructure | `terraform/` | |
191 | | -| Deployment guide | `docs/deployment.md` | |
192 | | -| Technical spec | `SPEC.md` | |
193 | | -| Roadmap | `docs/ROADMAP.md` | |
| 130 | +| What | Where | |
| 131 | +| ------------------------- | ---------------------------------------------- | |
| 132 | +| Indexer schema | `indexer-envio/schema.graphql` | |
| 133 | +| Event handlers | `indexer-envio/src/EventHandlers.ts` | |
| 134 | +| Pool ID helpers | `indexer-envio/src/helpers.ts` | |
| 135 | +| Multichain config | `indexer-envio/config.multichain.mainnet.yaml` | |
| 136 | +| Indexer status + endpoint | `indexer-envio/STATUS.md` | |
| 137 | +| Dashboard app | `ui-dashboard/src/app/` | |
| 138 | +| Network defs | `ui-dashboard/src/lib/networks.ts` | |
| 139 | +| GraphQL queries | `ui-dashboard/src/lib/queries.ts` | |
| 140 | +| Terraform infrastructure | `terraform/` | |
194 | 141 |
|
195 | 142 | ## Documentation |
196 | 143 |
|
197 | | -- [`SPEC.md`](./SPEC.md) — Full technical specification |
198 | | -- [`docs/ROADMAP.md`](./docs/ROADMAP.md) — Current state + upcoming work |
199 | | -- [`docs/BACKLOG.md`](./docs/BACKLOG.md) — Detailed task backlog |
200 | | -- [`docs/deployment.md`](./docs/deployment.md) — Deployment guide |
201 | 144 | - [`indexer-envio/README.md`](./indexer-envio/README.md) — Indexer reference |
| 145 | +- [`indexer-envio/STATUS.md`](./indexer-envio/STATUS.md) — Current sync state + endpoint |
| 146 | +- [`docs/deployment.md`](./docs/deployment.md) — Full deployment guide |
0 commit comments