GitHub is now capable of rendering mermaid.js diagrams, so we don't need to maintain a separate source and rendered .png file. The mermaid source can be embedded directly into the documentation itself.
This allows both tspend and treasury policies to be set by clients on a per-ticket basis. Preferences can be set when initially registering a ticket with `/payfee`, and can be later updated using `/setvotechoices`.
Any requests which alter treasury/tspend policy will be stored in the database using the existing accountability system.
**Note:** This does not include consistency checking, it will need to be added later when dcrwallet has an RPC to retrieve policies in batches.
vspd will now call dcrd RPC `getblockchaininfo` to determine if DCP-0010 is active, and take that information into consideration when calculating ticket registration fee.
This pulls a fix which enables vspd to determine remote client IP using header `X-Forwarded-For` or `X-Real-Ip`.
This depends on the reverse proxy setting those headers appropriately, which can be achieved in nginx 1.20 using the following:
```
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
```
This is an unfortunate workaround which is necessary because an instance of dcrwallet will only recognise a ticket as revoked if it has done the revoke itself. If another wallet broadcasts the revoke then the ticket will forever be reported as missed/expired. This causes problems for vspd when a wallet outside of the vspd deployment revokes a ticket (eg. a users ticketbuyer wallet).
I'm happy to include this slightly dirty workaround because this should no longer be an issue when the auto-revoke work in DCP-0009 lands.
This renames "Voting wallet status" to "VSP status" and it now includes the status of the local dcrd instance. This change impacts both the /admin page of the UI, and the response of the /admin/status API endpoint.
Errors generated during dcrd client creation were previously handled in middleware, and request handling was terminated immediately.
Now the error handling is delayed by adding the error details to the request context. This enables downstream handlers to decide what to do with the error.
If an alternate address exists for this ticket, check it first and fall
back to the commitment address if validation fails. Alternate address
failure is allowed so that other endpoints do not need to add a field to
all requests specifying whether this is the alternate address's
signature or the commitment address's signature.
To allow signing with addresses other than the commitment address, add
an alternate signature address. In order to continue to prove that the
address was chosen by the user, add an alternate signature history. Only
allow one record per ticket to be saved to cap needed db space.
This commit marks the point at which vspd will stop working against dcrd 1.6 and start to target master.
The dcrwallet RPC version has not changed, so vspd continues to work with dcrwallet 1.6 or master.
* Use features from Go 1.16 tooling.
- GO111MODULE environment variable now defaults to "on"
- "go build" and "go test" now exit with an error rather than silently modifying go.mod or go.sum files
- Update README.md
* Don't use deprecated ioutil package.
Bring in some updates from the signal handling code in other projects:
- Rename `signals` to more descriptive `interruptSignals`.
- Add SIGHUP to unix shutdown signals. Rename `signalsigterm.go` to `signal_unix.go` accordingly.
- Include extra detail in "Already shutting down..." messages log lines.
- Pass a shutdown func into `webapi.go` rather than a channel. It's more obvious how to invoke a func, whereas a channel can be used in multiple ways.
* Be more specific about consensus vote choices.
Rather than referring to just "Vote choices", refer specifically to "consensus vote choices".
This will be useful when treasury and tspend vote choices are added, and the distinction becomes more important.
* dnldd suggestion.
* Remove static cfg values from GUI cache.
Theres no need for these values to be copied into the cache when templates could simply access the config struct directly.
This also changes the cache accessor so it returns a copy of the cache rather than a pointer, which removes a potential race.
* Rename and move cache.
Cache code was previous in `homepage.go`, but its used in multiple places and not just on the homepage. Its enough code to go into its own dedicated `cache.go`.