Skip to content

add Settings domain with DB persistence and admin CRUD API#939

Open
bitcoin-coder-bob wants to merge 6 commits intomasterfrom
bob/settings-domain-and-repo
Open

add Settings domain with DB persistence and admin CRUD API#939
bitcoin-coder-bob wants to merge 6 commits intomasterfrom
bob/settings-domain-and-repo

Conversation

@bitcoin-coder-bob
Copy link
Collaborator

@bitcoin-coder-bob bitcoin-coder-bob commented Feb 27, 2026

closes #934

  • Introduce a Settings domain model that moves 16 runtime-tunable config values (ban threshold/duration, exit delays, VTXO tree expiry, round participant limits, amount limits, etc.) out of environment
    variables and into the database
  • Add SettingsRepository with implementations for Postgres, SQLite, and Badger, including SQL migrations
  • Add three new Admin gRPC/REST endpoints: GetSettings, UpdateSettings, and ClearSettings
  • On startup, seed default settings to the DB if none exist (scheduler-aware: block vs time-based defaults)
  • Settings changes propagate live to the running app service via an UpdateSettings callback — no restart required
  • Remove the corresponding env vars from config, docker-compose, and .env files

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 27, 2026

Warning

Rate limit exceeded

@bitcoin-coder-bob has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 39 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between f90cc3e and 0c9a296.

⛔ Files ignored due to path filters (4)
  • api-spec/protobuf/gen/ark/v1/admin.pb.go is excluded by !**/*.pb.go, !**/gen/**
  • api-spec/protobuf/gen/ark/v1/admin.pb.rgw.go is excluded by !**/gen/**
  • api-spec/protobuf/gen/ark/v1/admin_grpc.pb.go is excluded by !**/*.pb.go, !**/gen/**
  • api-spec/protobuf/gen/ark/v1/indexer.pb.rgw.go is excluded by !**/gen/**
📒 Files selected for processing (34)
  • Makefile
  • README.md
  • api-spec/openapi/swagger/ark/v1/admin.openapi.json
  • api-spec/protobuf/ark/v1/admin.proto
  • docker-compose.regtest.yml
  • envs/arkd.dev.env
  • envs/arkd.light.env
  • internal/config/config.go
  • internal/core/application/admin.go
  • internal/core/application/admin_test.go
  • internal/core/application/service.go
  • internal/core/application/types.go
  • internal/core/domain/settings.go
  • internal/core/domain/settings_repo.go
  • internal/core/ports/repo_manager.go
  • internal/infrastructure/db/badger/settings_repo.go
  • internal/infrastructure/db/postgres/migration/20260227000000_add_settings.down.sql
  • internal/infrastructure/db/postgres/migration/20260227000000_add_settings.up.sql
  • internal/infrastructure/db/postgres/settings_repo.go
  • internal/infrastructure/db/postgres/sqlc/queries/models.go
  • internal/infrastructure/db/postgres/sqlc/queries/query.sql.go
  • internal/infrastructure/db/postgres/sqlc/query.sql
  • internal/infrastructure/db/service.go
  • internal/infrastructure/db/service_test.go
  • internal/infrastructure/db/sqlite/migration/20260227000000_add_settings.down.sql
  • internal/infrastructure/db/sqlite/migration/20260227000000_add_settings.up.sql
  • internal/infrastructure/db/sqlite/settings_repo.go
  • internal/infrastructure/db/sqlite/sqlc/queries/models.go
  • internal/infrastructure/db/sqlite/sqlc/queries/query.sql.go
  • internal/infrastructure/db/sqlite/sqlc/query.sql
  • internal/interface/grpc/handlers/adminservice.go
  • internal/interface/grpc/permissions/permissions.go
  • internal/test/e2e/single_batch_smoke_test.go
  • internal/test/e2e/utils_test.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bob/settings-domain-and-repo

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@bitcoin-coder-bob bitcoin-coder-bob marked this pull request as ready for review March 3, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add settings domain and repo

1 participant