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`.
vote-validator
vote-validator is a tool for VSP admins to verify that their vspd deployment is voting correctly according to user preferences.
What it does
- Retrieve all voted tickets from the provided vspd database file.
- Retrieve vote info from dcrdata for every voted ticket.
- For the n most recently voted tickets, compare the vote choices recorded on-chain to the vote choices set by the user.
- Write details of any discrepancies to a file for further investigation.
How to run it
Only run vote-validator using a copy of the vspd database backup file. Never use a real production database.
vote-validator can be run from the repository root as such:
go run ./cmd/vote-validator -n 1000 -f ./vspd.db-backup