jholdstock 2bd340ba08 multi: Explicitly handle help requests.
Checking for --help as an explicit step before parsing any other configs
makes the code more intuitive by removing a convoluted bit of error
handling, which happened to be unnecessarily duplicated in three places.

Moving it to a function in the internal package makes it reusable by
multiple binaries.

This also enables the IgnoreUnknown option to be used whilst parsing for
help, which ensures the presence of --help will always result in the
help message being printed. This fixes a minor inconsistency where the
help message would be printed if the flag was placed before an invalid
config, but placing it after would cause an invalid config error to be
written instead. For example, `vspd --help --fakeflag` vs `vspd
--fakeflag --help`.
2024-05-18 08:42:06 +01:00
2023-12-06 08:47:25 +00:00
2023-11-08 09:01:36 +00:00
2023-09-13 09:03:05 +01:00
2023-08-24 07:52:40 +01:00
2024-05-14 07:28:09 +01:00
2024-05-14 07:28:09 +01:00
2024-01-12 08:51:54 +00:00
2024-02-16 08:47:03 +08:00

vspd

Build Status ISC License Go Report Card Release

First announced in 2020, vspd is a from scratch implementation of a Voting Service Provider (VSP) for the Decred network.

A VSP running vspd can be used to vote on any ticket - tickets do not need to be purchased with any special conditions such as dedicated outputs for paying VSP fees. Fees are paid directly to the VSP with an independent on-chain transaction.

To use vspd, ticket holders must prove ownership of their ticket with a cryptographic signature, pay the fee requested by the VSP, and submit a private key which enables the VSP to vote the ticket. Once this process is complete the VSP will add the ticket to a pool of always-online voting wallets.

Features

  • API - Tickets are registered with the VSP using a JSON HTTP API. For more detail on the API and its usage, read api.md

  • Web front-end - A minimal website (no JavaScript) providing public pool stats. A password protected admin page provides an overview of system status, enables searching for tickets and downloading database backups.

  • Two-way accountability - All vspd requests and responses are signed by their sender, which enables both the client and the server to hold each other accountable in the case of misbehaviour. For more detail and examples, read two-way-accountability.md.

  • Dynamic fees - Clients must request a new fee address and amount for every ticket. When these are given to a client, there is an associated expiry period. If the fee is not paid in this period, the client must request a new fee. This enables the VSP admin to change their fee as often as they like.

Implementation

vspd is built and tested on go 1.21 and 1.22, making use of the following libraries:

Deployment

A vspd deployment consists of a single front-end server which handles web requests, and a number of remote servers which host voting wallets. For more information about deploying vspd, check out deployment.md.

The process for listing a new VSP on decred.org, and consequently in Decrediton, is detailed in listing.md.

Development

Test Harness

A test harness is provided in harness.sh. The test harness uses tmux to start a testnet instance of dcrd, multiple dcrwallets, and finally vspd. Further documentation can be found in harness.sh.

Web server debug mode

The config option --webserverdebug will:

  • Force HTML templates to be reloaded on every web request.
  • Reload the cached homepage data every second rather than every 5 minutes.
  • Enable detailed webserver logging to the terminal (does not get written to log file).

Issue Tracker

The integrated GitHub issue tracker is used for this project.

License

vspd is licensed under the copyfree ISC License.

Description
No description provided
Readme 2.8 MiB
Languages
Go 86.2%
HTML 9.2%
CSS 2.9%
Shell 1.7%