16 Commits

Author SHA1 Message Date
jholdstock
4e5fec8f3b vspadmin: Write default config file.
A new command in vspadmin writes the default config file for a new vspd
deployment. The behaviour is removed from vspd and documentation has
been updated to reflect the change.
2024-06-19 09:35:41 +01:00
jholdstock
997205ed95 vspadmin: New binary to create empty databases.
vspadmin is a new binary which implements one-off admin tasks which are
necessarily interactive and thus do not fit neatly into the long-lived
vspd binary.

The first behaviour added to vspadmin is the ability to create a new
vspd database. This behaviour is removed from vspd with the associated
config option deprecated. Documentation and scripts updated to reflect
the change.
2024-06-19 09:35:41 +01:00
jholdstock
1a2b02466c vspd: Wrap RPC connection details in a struct.
Returning a single struct which contains multiple named fields reduces
the chance of a mistake in the calling code, as compared to returning
multiple unnamed values which are all of the same type.
2024-05-30 08:41:10 +01:00
jholdstock
086143fed2 vspd: Move config to internal package.
This enables the config to be reused in multiple binaries - eg. the
upcoming vsp admin binary which will be responsible for writing a
default config file for new vspd deployments.
2024-05-30 08:41:10 +01:00
jholdstock
4012b098fe vspd: Improve comment for update func.
A good comment explains what a function does, not when it is called.
2023-09-26 10:21:38 +01:00
jholdstock
ed82998fe2 webapi: Only log "ticket added to wallet" once. 2023-09-20 09:21:33 +01:00
jholdstock
fde844e2e1 vspd: Make log format consistent.
Every log line which includes a ticket hash includes it in the end at in
brackets, not inline with the message.
2023-09-20 09:21:33 +01:00
jholdstock
f5b57f4169 vspd: Increase some logs to info level. 2023-09-20 09:21:33 +01:00
jholdstock
1f62d46bdd vspd: Reduce some logs to debug level. 2023-09-20 09:21:33 +01:00
jholdstock
2994d128fe vspd: Remove funcName from info/debug logs.
Including the funcName in informational log messages is not useful for
devs or admins, its just spam which bloats the log file.
2023-09-20 09:21:33 +01:00
jholdstock
12e61bab65 vspd: Remove unnecessary dcrd error logging.
The error returned by dcrd.Client() is already very descriptive and does
not need extra context.
2023-09-20 09:21:33 +01:00
jholdstock
c4de3d5d95 vspd: Pass dcrd RPC to findSpentTickets as a param
This allows RPC clients to be reused more easily in the case that the
caller of findSpentTickets already has a connected dcrd RPC client.
2023-09-19 18:01:43 +01:00
jholdstock
61c9c7087f vspd: Split update function.
The update function performs four distinct steps which can readily be
broken down into four separate functions.
2023-09-19 18:01:43 +01:00
jholdstock
01e88f39c6 vspd: Split vspd.go into smaller files.
This splits the code from vspd.go into various other files which broadly
represent the functional areas of vspd - the main update function,
database intgrity checks and voting wallet consistency checks.

Code is just moved without any modifications.
2023-09-19 18:01:43 +01:00
jholdstock
69b27ff1e6 vspd: Rename blockConnected to update.
The name blockConnected is not very accurate as this function is also
called when vspd is initializing. It doesnt depend on a block having
been connected at all, it can be called at any time.
2023-09-19 18:01:43 +01:00
jholdstock
ee4a440534 multi: Move vspd to internal package. 2023-09-16 08:29:17 +01:00