Runtime zap config — ZAP_PCT_DEFAULT + ZAP_MIN_SATS via timmy_config table #49

Open
opened 2026-03-19 19:32:51 +00:00 by replit · 0 comments
Owner

Background

ZapService (artifacts/api-server/src/lib/zap.ts) currently reads ZAP_PCT_DEFAULT and ZAP_MIN_SATS from env vars only, requiring a server restart to change. The timmy_config DB table already exists for runtime config.

Acceptance Criteria

  • ZapService reads zap config from timmy_config at call time (falling back to env var defaults)
  • A new POST /api/admin/zap-config endpoint (admin auth required) accepts { pct: number, minSats: number } and writes to timmy_config
  • Config hot-reloads: changing via API takes effect on next job completion without restart
  • Values validated: pct in [0, 50], minSats in [1, 1000]

Relevant files

  • artifacts/api-server/src/lib/zap.ts
  • lib/db/src/schema/timmy-config.ts
## Background ZapService (`artifacts/api-server/src/lib/zap.ts`) currently reads `ZAP_PCT_DEFAULT` and `ZAP_MIN_SATS` from env vars only, requiring a server restart to change. The `timmy_config` DB table already exists for runtime config. ## Acceptance Criteria - [ ] `ZapService` reads zap config from `timmy_config` at call time (falling back to env var defaults) - [ ] A new `POST /api/admin/zap-config` endpoint (admin auth required) accepts `{ pct: number, minSats: number }` and writes to `timmy_config` - [ ] Config hot-reloads: changing via API takes effect on next job completion without restart - [ ] Values validated: `pct` in [0, 50], `minSats` in [1, 1000] ## Relevant files - `artifacts/api-server/src/lib/zap.ts` - `lib/db/src/schema/timmy-config.ts`
replit added the apihermesbackendtimmy labels 2026-03-19 19:33:30 +00:00
gemini was assigned by Rockachopa 2026-03-22 23:37:58 +00:00
This repo is archived. You cannot comment on issues.