Skip to content

feat(indexer): select network from environment#75

Open
Kubuxu wants to merge 1 commit into
masterfrom
feat/unified-config
Open

feat(indexer): select network from environment#75
Kubuxu wants to merge 1 commit into
masterfrom
feat/unified-config

Conversation

@Kubuxu

@Kubuxu Kubuxu commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • replace the separate mainnet and calibnet Ponder configs with one typed config selected by PONDER_NETWORK
  • preserve network-specific addresses, start blocks, RPC/database defaults, and FilBeam deployment histories
  • embed the unified config in the indexer image and configure both Compose services with strict environment validation
  • add per-network development/codegen scripts and automated coverage for both network selections and invalid environment values
  • update CI and deployment documentation for the unified configuration

Each network continues to run in a separate Ponder process with its own database and schema.

Testing

  • npm test
  • npm run codegen:calibnet
  • npm run typecheck
  • direct TypeScript check
  • indexer Docker image build
  • Docker Compose configuration validation
  • git diff --check

Deployment notes

The unified ponder.config.ts is baked into the indexer image. Existing deployments must rebuild both indexer services when upgrading:

docker compose up -d --build ponder-calibnet ponder-mainnet

No reindex is required for this change.

Replace the split Ponder configs with one typed configuration selected by PONDER_NETWORK. Embed the config in the indexer image, enforce strict deployment variables, and cover both networks in CI.

Signed-off-by: Jakub Sztandera <oss@kubuxu.com>
@FilOzzy FilOzzy added this to FOC Jul 13, 2026
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC Jul 13, 2026
@Kubuxu
Kubuxu requested a review from rvagg July 13, 2026 13:16

@rvagg rvagg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yeah, sure, cool

@github-project-automation github-project-automation Bot moved this from 📌 Triage to ✔️ Approved by reviewer in FOC Jul 13, 2026
@Kubuxu
Kubuxu requested a review from Copilot July 13, 2026 15:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Unifies the indexer’s Ponder configuration into a single typed ponder.config.ts selected by PONDER_NETWORK, and updates Docker/Compose/CI/docs so both mainnet and calibnet indexers run with strict, validated environment variables while preserving network-specific defaults and addresses.

Changes:

  • Replace per-network Ponder configs with a unified config + a typed network registry (indexer/src/networks.ts) selected by PONDER_NETWORK.
  • Bake the unified config into the indexer image and update Docker Compose services to set PONDER_NETWORK + enable strict env validation.
  • Add automated tests covering network selection and strict env failures; update scripts, CI, and documentation accordingly.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
shared/system-context.ts Updates documentation reference to the new START_BLOCK source in indexer/src/networks.ts.
README.md Documents rebuild requirement for the baked config and adds per-network dev/codegen commands.
indexer/tsconfig.json Enables TS extension imports + noEmit, and includes tests/unified config in the TS project.
indexer/test/networks.test.ts Adds node:test coverage for env parsing and runtime selection of the Ponder config.
indexer/src/networks.ts Introduces typed per-network registry, defaults, and strict env parsing helpers.
indexer/ponder.config.ts New unified Ponder config selecting chain/db/rpc/addresses by environment.
indexer/ponder.config.mainnet.ts Removes legacy mainnet-specific Ponder config.
indexer/ponder.config.calibnet.ts Removes legacy calibnet-specific Ponder config.
indexer/package.json Adds per-network dev/start/codegen scripts and a test script for the new env/config logic.
indexer/Dockerfile Copies ponder.config.ts into the image and removes the custom entrypoint.
indexer/docker-entrypoint.sh Removes entrypoint that enforced a bind-mounted config (no longer needed).
indexer/.gitignore Stops ignoring ponder.config.ts now that it is a committed source file.
indexer/.dockerignore Stops excluding Ponder config files so the unified config is included in the image build context.
docker-compose.yml Sets PONDER_NETWORK/PONDER_STRICT_ENV for both indexers and removes config bind mounts.
.github/workflows/test.yml Runs new indexer tests and ensures both network codegen paths are exercised in CI.
.env.example Updates guidance to reflect network selection via PONDER_NETWORK in Compose.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✔️ Approved by reviewer

Development

Successfully merging this pull request may close these issues.

4 participants