Skip to content

Configuration system: YAML loading and validation #13

@tac0turtle

Description

@tac0turtle

Summary

Implement the configuration system (config/) for loading, validating, and providing typed access to apex's YAML configuration.

YAML over TOML — aligns with Evolve ecosystem and DevOps conventions. People are more accustomed to YAML.

Requirements

  • Load from config.yaml (configurable path via --config flag)
  • Validate required fields, reject unknown keys
  • Sensible defaults for optional fields
  • Environment variable overrides for sensitive values (e.g., APEX_AUTH_TOKEN)

Config structure

namespaces:
  eden: "000000000000000000000000000000000000000000000000000000006564656e"
  xo: "00000000000000000000000000000000000000000000000000000000786f"
  collect: "000000000000000000000000000000000000000000000000636f6c6c656374"

data_source:
  type: celestia-node
  endpoint: ws://localhost:26658
  auth_token: ""

storage:
  path: ./data/indexer.db

rpc:
  address: 0.0.0.0:26659

grpc:
  address: 0.0.0.0:26660

sync:
  start_height: 1000000
  backfill_batch_size: 100
  backfill_concurrency: 4

observability:
  metrics_address: 0.0.0.0:9090
  log_level: info
  tracing_enabled: false
  tracing_endpoint: ""

Implementation

  • Use gopkg.in/yaml.v3
  • Typed Go structs in config/config.go with yaml struct tags
  • Validation in config/load.go
  • Namespace hex strings decoded and validated (29 bytes)
  • Unit tests for loading, defaults, validation errors

References

  • Design doc: test_plan.md — Configuration section

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions