-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
At the moment, restarting arkd is required to update the fee policies as they can be changed only via env vars.
Let's get rid of the env vars in favor of admin apis so that fee polices can be updated at runtime and prevent any service restart.
This task requires changes at pretty much all layers:
- domain: add
IntentFeedomain andFeeRepositoryinterface with CRUD apis:
type IntentFees struct {
OnchainInputFee string
OffchainInputFee string
OnchainOutputFee string
OffchainOutputFee string
}
type FeeRepository interface {
GetIntentFees(ctx context.Context) (*IntentFees, error)
UpsertIntentFees(ctx context.Context, fees IntentFees) error
ClearIntentFees(ctx context.Context) error
Close()
}
- ports: add
Fees() domain.FeeRepositoryapi to repo manager - infrastructure: add implementations of
domain.FeeRepository(badger, sqlite and postgres) - application: add CRUD apis to admin service for fee management
- interface: add new rpcs
GetIntentFeesandUpdateIntentFeesto admin.proto - config: drop existing env vars
NOTE: repo.UpsertIntentFees should take care of updating only the non-empty fields defined in the provided struct.
#380 can be taken as reference.
Metadata
Metadata
Assignees
Labels
No labels