encapsulate Allowance in RenterSettings
The renter is now structured similarly to the host; the /renter/allowance
endpoints have been merged with /renter
, and the backend has been updated accordingly.
There is one discrepancy that warrants consideration: Whereas the host has an announce
endpoint that "activates" the settings, the renter has no such corresponding call. This means that the renter will attempt to start forming contracts even if you only set funds
or period
(i.e., not both). Clearly this doesn't make much sense, so the current behavior of /renter
is to only allow calls that specify both parameters. Similarly, siac still uses renter allowance
instead of renter config
, because the former forces you to provide both parameters.
Bottom line: we may want to consider adding an endpoint that instructs the renter to put the settings into effect.
Later I would like to tweak the renter internals such that SetSettings
merely informs the contractor of the new allowance, instead of commanding it to form/renew contracts. One downside of this is that contract formation errors won't be immediately returned by the SetSettings
call; they will need to be bubbled up in some other fashion. However, this is already the case for automatically scheduled renewals, so clearly we need a better approach anyway.