Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/indexer-envio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ jobs:
# Monad configs are validated for syntax/schema correctness even with empty
# address arrays — this catches drift before deploy time.
run: |
pnpm --filter @mento-protocol/indexer-envio codegen --config config.monad.testnet.yaml
pnpm --filter @mento-protocol/indexer-envio codegen --config config.monad.mainnet.yaml
pnpm --filter @mento-protocol/indexer-envio codegen --config config.multichain.mainnet.yaml
pnpm --filter @mento-protocol/indexer-envio codegen --config config.celo.sepolia.yaml
pnpm --filter @mento-protocol/indexer-envio codegen --config config.celo.mainnet.yaml
pnpm --filter @mento-protocol/indexer-envio codegen --config config.monad.testnet.yaml
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two issues in this block:

  1. config.multichain.testnet.yaml is not validated at all, despite the step comment saying all configs are validated.
  2. Since codegen output is overwritten on each command, downstream typecheck/tests run against the last config here (config.monad.testnet.yaml), not the default config (config.multichain.mainnet.yaml).

Please include all active configs and make the intended downstream target explicit (run it last).

- name: Link generated package
if: steps.changes.outputs.indexer == 'true'
# pnpm install runs before generated/ exists, so the workspace symlink for
Expand Down
25 changes: 10 additions & 15 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@ pnpm monorepo with three packages:
pnpm install

# Indexer
pnpm indexer:codegen # Generate types from schema (devnet)
pnpm indexer:dev # Start indexer (devnet)
pnpm indexer:celo-sepolia:codegen # Generate types (Celo Sepolia config)
pnpm indexer:celo-sepolia:dev # Start indexer (Celo Sepolia)
pnpm indexer:celo-mainnet:codegen # Generate types (Celo mainnet)
pnpm indexer:celo-mainnet:dev # Start indexer (Celo mainnet)
pnpm indexer:monad-mainnet:codegen # Generate types (Monad mainnet)
pnpm indexer:monad-mainnet:dev # Start indexer (Monad mainnet)
pnpm indexer:codegen # Generate types from schema (multichain mainnet)
pnpm indexer:dev # Start indexer (multichain mainnet: Celo + Monad)
pnpm indexer:celo-sepolia:codegen # Generate types (Celo Sepolia testnet)
pnpm indexer:celo-sepolia:dev # Start indexer (Celo Sepolia testnet)
pnpm indexer:monad-testnet:codegen # Generate types (Monad testnet)
pnpm indexer:monad-testnet:dev # Start indexer (Monad testnet)

Expand Down Expand Up @@ -89,11 +85,10 @@ monitoring-monorepo/
│ ├── package.json
│ └── deployment-namespaces.json # ← edit this when promoting a new deployment
├── indexer-envio/
│ ├── config.celo.devnet.yaml # Devnet indexer config
│ ├── config.celo.mainnet.yaml # Celo Mainnet config
│ ├── config.celo.sepolia.yaml # Celo Sepolia config
│ ├── config.monad.mainnet.yaml # Monad Mainnet config
│ ├── config.monad.testnet.yaml # Monad Testnet config
│ ├── config.multichain.mainnet.yaml # Mainnet indexer config (Celo + Monad) — DEFAULT
│ ├── config.multichain.testnet.yaml # Testnet multichain config
│ ├── config.celo.sepolia.yaml # Celo Sepolia testnet config
│ ├── config.monad.testnet.yaml # Monad testnet config
│ ├── schema.graphql # Entity definitions
│ ├── src/
│ │ ├── EventHandlers.ts # Envio entry point (imports handlers, re-exports for tests)
Expand Down Expand Up @@ -170,7 +165,7 @@ This installs deps and runs Envio codegen (required for `indexer-envio` TypeScri
pnpm --filter @mento-protocol/ui-dashboard typecheck
pnpm --filter @mento-protocol/indexer-envio typecheck
pnpm --filter @mento-protocol/indexer-envio test
pnpm indexer:celo-mainnet:codegen # Validates Envio can parse handler entry point + module imports
pnpm indexer:codegen # Validates Envio can parse handler entry point + module imports
pnpm --filter @mento-protocol/ui-dashboard test:coverage
```

Expand All @@ -182,7 +177,7 @@ pnpm --filter @mento-protocol/ui-dashboard test:coverage

### EventHandlers.ts must remain the handler entry point

Every `config.*.yaml` specifies `handler: src/EventHandlers.ts`. Envio expects all handler registrations (e.g. `FPMM.Swap.handler(...)`) to be reachable from this file at module load time. The actual logic lives in `src/handlers/*.ts` — these are imported as side effects from `EventHandlers.ts`. If you add a new handler file, you **must** add a corresponding `import "./handlers/yourFile"` in `EventHandlers.ts` and then re-run `pnpm indexer:celo-mainnet:codegen` to verify Envio picks it up.
Every `config.*.yaml` specifies `handler: src/EventHandlers.ts`. Envio expects all handler registrations (e.g. `FPMM.Swap.handler(...)`) to be reachable from this file at module load time. The actual logic lives in `src/handlers/*.ts` — these are imported as side effects from `EventHandlers.ts`. If you add a new handler file, you **must** add a corresponding `import "./handlers/yourFile"` in `EventHandlers.ts` and then re-run `pnpm indexer:codegen` to verify Envio picks it up.

## Common Tasks

Expand Down
28 changes: 28 additions & 0 deletions bootstrap-worktree.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
# bootstrap-worktree.sh — monitoring-monorepo
# Run after worktree creation to get a fully working environment.
set -euo pipefail
cd "$(dirname "$0")"

echo "📦 Installing dependencies..."
pnpm install --frozen-lockfile

echo "🔧 Running indexer codegen (multichain mainnet)..."
pnpm indexer:codegen

echo "✅ Verifying typecheck..."
pnpm --filter @mento-protocol/ui-dashboard typecheck
pnpm --filter @mento-protocol/indexer-envio typecheck

echo "🧪 Running tests..."
pnpm --filter @mento-protocol/ui-dashboard test -- --run 2>/dev/null || echo " ⚠️ Dashboard tests: some failures (check manually)"
pnpm --filter @mento-protocol/indexer-envio test 2>/dev/null || echo " ⚠️ Indexer tests: some failures (check manually)"

echo ""
echo "🚀 monitoring-monorepo is ready to code"
echo ""
echo "Key commands:"
echo " pnpm dashboard:dev — start dashboard dev server"
echo " pnpm dashboard:build — production build"
echo " pnpm indexer:codegen — regenerate indexer types"
echo " ./tools/trunk check --all — lint everything"
7 changes: 3 additions & 4 deletions indexer-envio/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ Envio HyperIndex indexer for Mento v3 FPMM (Fixed Product Market Maker) pools on

## Key Files

- `config.celo.devnet.yaml` — Devnet indexer config (contract addresses, events, RPC)
- `config.celo.mainnet.yaml` — Celo Mainnet config
- `config.multichain.mainnet.yaml` — **Default** mainnet config (Celo + Monad)
- `config.multichain.testnet.yaml` — Testnet multichain config
- `config.celo.sepolia.yaml` — Celo Sepolia testnet config
- `config.monad.mainnet.yaml` — Monad Mainnet config
- `config.monad.testnet.yaml` — Monad Testnet config
- `config.monad.testnet.yaml` — Monad testnet config
- `schema.graphql` — Entity definitions (FPMM, Swap, Mint, Burn, UpdateReserves, Rebalanced)
- `src/EventHandlers.ts` — Event processing logic
- `src/contractAddresses.ts` — Contract address resolution from `@mento-protocol/contracts`; also exports `CONTRACT_NAMESPACE_BY_CHAIN` (backed by `config/deployment-namespaces.json`)
Expand Down
51 changes: 0 additions & 51 deletions indexer-envio/config.celo.devnet.yaml

This file was deleted.

93 changes: 0 additions & 93 deletions indexer-envio/config.celo.mainnet.yaml

This file was deleted.

17 changes: 2 additions & 15 deletions indexer-envio/config.celo.sepolia.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ networks:
- event: FPMMDeployed
- name: FPMM
abi_file_path: abis/FPMM.json
address:
- 0x550d9ecb4c373510b8a41f5fb7d98e9e1c51a07e # GBPm/USDm
address: [] # Dynamically registered via FPMMFactory.FPMMDeployed.contractRegister
handler: src/EventHandlers.ts
events:
- event: Swap
Expand All @@ -30,19 +29,7 @@ networks:
- event: LiquidityStrategyUpdated
- name: VirtualPool
abi_file_path: abis/FPMM.json
address:
- 0x671334256a893fdbc4ffe55f98f156a168bd897a
- 0x1e2506edca4ef3030e51be8b571b935d55677604
- 0x8103fb2db87ac96cc62faa399b98e1173720ab19
- 0x62722497dc8992337117ee79a02015dcea43b2c2
- 0x68d19b5a48cbbfd11057e97da9960b09d771e7b6
- 0x58f08739ea9764097b9500b6e4a4db64d168b807
- 0x284c2d99c5a12a65f10eff7183c33c1217b65a56
- 0xcbfc8c84168d7f34faba0018a3a63b998f1ffece
- 0x49a968c539599385c69c2d528500da58d933fafa
- 0x917ee035bf0a964acc75539f919a5b4f16336373
- 0x6b66271811615f4b6dadb8620ed71a1e90f41deb
- 0x22118009665b1d6810d4560a098d3e67bbcb934f
address: [] # Dynamically registered via VirtualPoolFactory.VirtualPoolDeployed.contractRegister
handler: src/EventHandlers.ts
events:
- event: Swap
Expand Down
79 changes: 0 additions & 79 deletions indexer-envio/config.monad.mainnet.yaml

This file was deleted.

5 changes: 1 addition & 4 deletions indexer-envio/config.monad.testnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ networks:
- event: FPMMDeployed
- name: FPMM
abi_file_path: abis/FPMM.json
address:
- 0xd9e9e6f6b5298e8bad390f7748035c49d6eeb055
- 0x1229e8a7b266c6db52712ba5c6899a6c4c3025cd
- 0x6d4c4b663541bf21015afb22669b0e1bbb3e2b1c
address: [] # Dynamically registered via FPMMFactory.FPMMDeployed.contractRegister
handler: src/EventHandlers.ts
events:
- event: Swap
Expand Down
Loading
Loading