554 Commits

Author SHA1 Message Date
jholdstock
d190a83b6f Release version 1.4.0 2025-11-27 09:35:27 +00:00
Jamie Holdstock
e293116c51
docs: Add 1.4.0 release note 2025-11-27 09:33:42 +00:00
jholdstock
dd2bfe97dc Update to gin 1.10.1 2025-11-26 11:39:57 +00:00
jholdstock
2d525c0496 Update to wsrpc 2.4.0 2025-11-26 11:39:57 +00:00
jholdstock
cb6435da62 Update to bbolt 1.4.3 2025-11-26 11:39:57 +00:00
jholdstock
1d2340d61c Update Decred dependencies for 2.1.0 2025-11-26 11:39:57 +00:00
jholdstock
2edf4eb200 config: Use any instead of interface{} 2025-11-26 11:39:57 +00:00
jholdstock
143302cfcd build: Update GitHub actions and use go 1.25. 2025-11-26 11:39:57 +00:00
jholdstock
5263bfc2e1 build: Update golangci-lint to v2.0.2
Various changes in this new major version, including a new config file
format:

- "gofmt" and "goimports" are now categorized as formatters
  (instead of linters) and are moved to their own section.
- The functionality of "gosimple" has been bundled into "staticcheck".
- "typecheck" is now always on and cannot be independently
  enabled/disabled.
2025-04-15 09:34:37 +01:00
jholdstock
30dcf49c62 vote-validator: Simplify f.WriteString
fmt.Fprintf acheives the same thing in a single func.
2025-04-15 09:34:37 +01:00
jholdstock
4b2219938c build: Update dependencies. 2025-02-28 09:04:56 +00:00
jholdstock
713ee511bd ci: Update GitHub Actions & linter. 2025-02-28 09:04:56 +00:00
jholdstock
16753b34a0 build: Bump minimum go version 1.23 2025-02-28 09:04:56 +00:00
jholdstock
4855f94750 Update to bbolt 1.3.11. 2025-02-28 09:04:56 +00:00
jholdstock
0d7b33d9bd multi: Use go 1.22 language features. 2025-02-28 09:04:56 +00:00
jholdstock
cba9b0368b Bump minimum go version 1.22 2025-02-28 09:04:56 +00:00
jholdstock
ca8d67e34a webapi: Distinguish between current/old xpub
Showing current and old pubkeys under separate headers makes the
information easier to parse, and also fixes a bug where the current
pubkey was showing a retired timestamp of unix epoch.
2024-11-02 08:26:04 +00:00
jholdstock
b6ffde116a webapi: Remove duplicate code to render admin.html 2024-11-02 08:26:04 +00:00
Jamie Holdstock
363fdcb224
Minor GUI improvements and bugfixes.
Also included is an upgrade from bootstrap 4.5 to 4.6.2. Nothing major changes
in the new version, just some improved compatibility/consistency between
browsers.

- Fixed an issue where long pages (such as ticket search result) would allow the
viewer to scroll beyond the footer.
- Fixed footer stretching to full widescreen size rather than staying inside
  bounds of bootstrap container
- More consistent style for inputs (password prompt, ticket search input)
2024-11-02 08:19:01 +00:00
jholdstock
b0fb5469c0 webapi: Footer update time relative not absolute.
Using a relative time rather than absolute requires far less effort for
a reader to understand, e.g. compare "25 Oct 2024 11:12:49 UTC" to "3
minutes ago".

As a nice side-effect this also fixes a minor privacy issue where using
the full absolute timestamp would expose the server timezone to the
public.
2024-10-26 09:26:44 +01:00
jholdstock
ddd7fd5bee Use tagged client v4.0.1 2024-10-23 12:19:34 +01:00
jholdstock
6335ad4f96 client: Send empty maps instead of nil. 2024-10-16 16:43:38 +01:00
jholdstock
caf02de645 Update golangci-lint to 1.61.0. 2024-10-16 16:36:51 +01:00
jholdstock
19572593b1 Update dependencies.
Not gaining any new features here but some minor bug fixes.

gorilla/sessions v1.4.0 and bbolt v1.3.11 are available but not taking
them at this time because they will force this project to bump its
minimum required go version.
2024-10-16 16:36:51 +01:00
jholdstock
690b06412a ci: Update tested go versions to 1.22 and 1.23. 2024-09-05 10:31:37 +01:00
jholdstock
caca0b45d0 ci: Update GitHub Actions and linter. 2024-09-05 10:31:37 +01:00
jholdstock
85e992e520 main: Use tagged client/v4. 2024-07-24 16:46:47 +01:00
jholdstock
a80e40d650 v3tool: Continue if a ticket already has paid fee.
v3tool will now attempt to register all tickets with the VSP rather
than immediately exiting if one of the tickets already has a paid fee.
2024-07-17 10:20:35 +01:00
Jamie Holdstock
63b2a6117d
Use latest golangci-lint release and update linter list. (#484)
* ci: Update linter to 1.59.1.

Also remove deprecated linter "vetshadow", its functionality is now
included in the "govet" linter.

* ci: Add new linters.

- fatcontext - Detects nested contexts in loops.
- mirror - Reports wrong mirror patterns of bytes/strings usage.
- nilnil - Checks that there is no simultaneous return of nil error and
  an invalid value.
- usestdlibvars - detect the possibility to use variables/constants from
  the Go standard library.
2024-07-08 09:52:43 -04:00
Jamie Holdstock
aa8d2a34ea
Use tagged types/v3 and update some other dependencies. (#483)
* client: Use tagged types/v3.

* main: Use tagged types/v3.

* client: Update to txscript 4.1.1.

* multi: Update transitive deps.
2024-07-08 09:52:13 -04:00
jholdstock
906ffc9e88 multi: Consider DCP0012 in VSP fee calculations.
Upgrade the dcrwallet dependency to pick up the new version of
txrules.StakePoolTicketFee which considers the status of DCP0012 in its
fee calculation.
2024-06-30 09:22:21 +01:00
jholdstock
fef56a24a0 vote-validator: Use stdlib built-in "POST" const. 2024-06-30 09:16:31 +01:00
jholdstock
cab4058710 vspadmin: Add retirexpub command.
The new command opens an existing vspd database and replaces the
currently used xpub with a new one.
2024-06-27 09:20:32 +01:00
jholdstock
c23095444f webapi: Add xpub ID to ticket details page. 2024-06-27 09:20:32 +01:00
jholdstock
844d2ce1ba webapi: List xpubs on admin page.
A new tab is added to the admin page to display current and historic
xpub keys used by vspd.
2024-06-27 09:20:32 +01:00
jholdstock
4e4121335a database: Store xpub keys in a bucket.
**Warning: This commit contains a database upgrade.**

In order to add future support for retiring xpub keys, the database is
upgraded such that the keys are now stored in a dedicated bucket which
can hold multiple values rather than storing a single key as individual
values in the root bucket.

A new ID field is added to distinguish between keys. This ID is added to
every ticket record in the database in order to track which pubkey was
used for each ticket.

A new field named "Retired" has also been added to pubkeys. It is a unix
timestamp representing the moment the key was retired, or zero for the
currently active key.
2024-06-27 09:20:32 +01:00
jholdstock
1fa81d3697 vspadmin: Reject private keys in fee xpub config.
The provided key should always be a public key, enforcing this in
software provides an extra safety net for users.
2024-06-19 09:56:29 +01:00
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
Jamie Holdstock
0633260a3c
database: Combine xpub and index concepts.
Fee xpub key and last used address index are now wrapped into a struct,
with both fields being set and retrieved together rather than
individually.

The underlying format for storing these values in the database does not
change. The only change is the interface between the database code and
the caller.
2024-06-11 11:26:12 +01:00
jholdstock
be31d54dac database: Don't run unnecessary upgrades.
New databases are now created at the latest version by default, rather
than being version 1 and immediately requiring all upgrades to be
executed.
2024-06-07 13:10:17 +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
10457e6110 vspd: Accessors for derived config values.
This enables the derived config values, which are not exported, to still
be accessed after config.go is moved to the internal vspd package.
2024-05-30 08:41:10 +01:00
jholdstock
ba5b1b2990 types: Remove Revoked from VSP info response.
This was marked as deprecated in the previous release and is now being
removed.
2024-05-29 11:02:50 +01:00
jholdstock
ecf2baa193 Begin module dev cycles.
Upcoming changes constitute breaking public API changes to both the
client and types modules, therefore this bumps the version numbers of
both modules and adds local replacements to go.mod files such that the
new versions can be used before they are publicly tagged.
2024-05-29 11:02:50 +01:00
jholdstock
1720fd2062 ci: Simplify run_test.sh script.
Run tests and linters against a hard-coded set of local submodules
instead of attempting to find submodules dynamically.

While this has the obvious drawback of needing to manually update the
list of submodules, it greatly simplifies the script by removing a bunch
of regexes and string manipulation. This trade-off seems worthwhile
because the list of submodules in this repo will not be something which
changes often.

This change makes the script less brittle because it is hard-coded to
always run against the local code, regardless of any changes to module
versionining or project dependencies.
2024-05-29 11:02:29 +01:00
jholdstock
6e558fb283 vspd: Decouple config loading & log initialization
Loading config and preparing loggers are two separate concepts which
should be handled individually. Nesting one inside the other makes
little sense and complicates reusing the code.
2024-05-23 08:39:24 +01:00
jholdstock
64ad28e19b database: Remove log param from CreateNew.
This logger did not write any useful information and all errors
generated by the func are already returned to the caller for logging.
2024-05-23 08:39:24 +01:00
jholdstock
17f993ae83 config: Initialize default config struct directly.
There is no need to declare a dozen different "default..." vars only to
immediately insert them into a default config struct when the struct
itself could just be initialized with the default values instead.
2024-05-23 08:28:42 +01:00