Skip to content

Add environment config loader and validation #21

Description

@pragmaticAweds

Repository

This issue belongs in Fundable-Protocol/Backend under indexer/.

Migrated from https://github.com/Fundable-Protocol/stellar_indexer/issues/2.

Context

Runtime configuration should be typed and validated before DB, poller, and API code depend on it.

Scope

  • Add a config loader in common
  • Validate required environment variables
  • Parse numeric values like PORT, POLL_INTERVAL_MS, and START_LEDGER
  • Add tests for valid and invalid config

Out of Scope

  • Connecting to PostgreSQL
  • Creating Soroban RPC clients
  • Loading contract YAML files

Acceptance Criteria

  • Missing required config fails with a clear error
  • Invalid numeric config fails with a clear error
  • Valid config returns typed values
  • bun run type-check passes
  • bun run test passes
  • bun run lint passes
  • bun run indexer:type-check passes
  • bun run indexer:test passes
  • bun run indexer:lint passes

Dependencies

Suggested Files or Packages

  • indexer/common/src/config/
  • .env.example

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions