45 Commits

Author SHA1 Message Date
jholdstock
fb8c58c512 build: Update deps. 2023-02-17 20:45:01 +00:00
jholdstock
67910d0fb3 build: Update to go 1.20. 2023-02-17 20:45:01 +00:00
Jamie Holdstock
5d7d347114
Use tagged types module. (#358) 2022-11-28 11:14:58 -05:00
Jamie Holdstock
ed1fac1a2a
Add types module for API requests/responses/errors. (#356)
* Remove helper func getCommitmentAddress.

This function is only used in one place so removing it does not introduce any duplication. Removing the func also removes the need for errors.Is comparison, which will be very useful in upcoming changes.

* Rename apiError to ErrorCode.

* Don't use inline type for API errors.

* Export webapi errors.

* Export webapi request/responses.

* Add types module for API requests/responses/errors
2022-11-18 15:06:47 -05:00
Jamie Holdstock
a5998264b3
Include commit ID in build info. (#357)
* ci: Update GitHub actions and linter.

* Update go deps.

* Include commit ID in build info.

Introduced in go 1.18, debug.ReadBuildInfo allows a go process to discover the git commit it was built from.
2022-11-18 15:06:00 -05:00
Jamie Holdstock
8bb868a5a5
Add vote-validator tool. (#335)
vote-validator is a tool for VSP admins to verify that their vspd deployment
is voting correctly according to user preferences.
2022-11-18 15:05:38 -05:00
jholdstock
63ce069a88 Use gin 1.8.1.
Nothing interesting in the release notes, but there are a few bug fixes/minor enhancements we should pick up.
2022-06-13 14:49:34 +01:00
jholdstock
78abc59e97 Update for go 1.18 2022-03-28 16:37:39 +01:00
Jamie Holdstock
f0430f1f6c
Add 1.1.0 release note 2022-02-18 06:35:47 +00:00
Jamie Holdstock
da1cb8f916
Enable treasury vote choices. (#319)
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.
2022-02-04 14:14:49 -05:00
Jamie Holdstock
040ed56f11
Use DCP-0010 status to calculate fees.
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.
2022-01-20 08:54:52 +00:00
David Hill
0fd96388ce
build: bump dcr deps (#310) 2021-12-29 11:23:45 +00:00
Jamie Holdstock
0919c6db29
Update gin to 1.7.7. (#308)
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;
```
2021-11-29 14:34:18 -05:00
Jamie Holdstock
623bb192d1
Use latest dcrd RPC version.
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.
2021-10-23 11:13:51 +01:00
Jamie Holdstock
ce0e28b8de
Use latest gin-gonic patch (#289) 2021-08-15 12:41:29 -05:00
Jamie Holdstock
e42b1cad33 Update dcrd and dcrwallet deps. 2021-06-15 21:54:22 +08:00
Jamie Holdstock
2b2f6177bb Update third party deps. 2021-06-15 21:54:22 +08:00
Jamie Holdstock
fd4f2b2dad Add commas for large ticket counts. 2021-06-15 10:18:25 +08:00
Jamie Holdstock
4858af2682
Upgrade deps (#239)
* Update to latest deps.

Includes using the dcrd stdaddr package instead of dcrutil.

* Use stdaddr.Hash160
2021-04-26 09:12:23 -05:00
David Hill
2581f84b59
build: update dcrwallet mod (#237) 2021-03-09 15:29:26 +00:00
Jamie Holdstock
91701b1a17
Update dcrd/blockchain dep (#230) 2021-01-22 19:20:53 +00:00
David Hill
7d83d6acba
build: bump dcrwallet to release (#229) 2021-01-22 14:43:14 +00:00
David Hill
bd6b2e42f4
build: upgrade deps (#210) 2020-11-25 14:52:21 +00:00
David Hill
04b07346c8 build: bump deps 2020-11-09 17:00:25 +00:00
jholdstock
1013354292 Update to latest dcrd deps 2020-10-28 12:37:03 +00:00
David Hill
c83a2a0085
rpc: verify dcrwallet's have --manualtickets set. (#187) 2020-09-25 09:55:53 +01:00
jholdstock
9d503e67ae Wallet consistency checks & setting ticket outcome 2020-07-28 20:09:23 +00:00
David Hill
b24c1a4c78
webapi: sanity check the fee transaction (#151) 2020-07-06 10:07:59 +01:00
jholdstock
c1b315bca1 Update build deps 2020-06-20 12:51:18 +00:00
jholdstock
3a76d44113 Extra ticket hash validation before using db/rpc.
Provides extra protection against DoS.
2020-06-15 13:32:51 +00:00
jholdstock
b50615bc6f Add very basic admin page. 2020-06-08 15:24:49 +00:00
jholdstock
81a6bf1ea8 Reject unvotable tickets.
/payfee and /getaddress will now only accept tickets which are immature or live.
2020-06-03 12:49:14 +00:00
jholdstock
1270f77fd6 Return err if fee tx already received. 2020-06-03 12:45:42 +00:00
jholdstock
86fdf888da Move to decred github org 2020-05-28 12:29:42 -05:00
Jamie Holdstock
67dece7041
Rename to vspd. (#75) 2020-05-27 15:59:30 +01:00
Jamie Holdstock
e1a18804ac
Check dcrwallet and dcrd config (#70)
* Verify dcrd network and txindex

* Verify dcrwallet network
2020-05-27 14:45:06 +01:00
Jamie Holdstock
87500c3fef
Delay fee broadcast and adding tickets to wallets. (#62)
* Delay fee broadcast and adding tickets to wallets.

- Adds a `background` package which implements a dcrd notification handler.  On each blockconnected notification, tickets with 6+ confirmations are marked confirmed, relevant fee transactions are broadcast, and any fees with 6+ confirmations have their tickets added to voting wallets.
- VSP fee is now an absolute value measured in DCR rather than a percentage. This simplifies the code and is more appropriate for an MVP. We can re-add percentage based fees later.
- Database code for tickets is now simplified to just "Insert/Update", rather than having functions for updating particular fields.
- Pay fee response no longer includes the fee tx hash, because we dont necessarily broadcast the fee tx straight away.

* Const for required confs
2020-05-27 06:39:38 +01:00
David Hill
033ac95c33
rpc: verify wallet version (#42) 2020-05-21 08:21:50 +01:00
David Hill
67c8e8f27c
Importxpub (#27) 2020-05-20 11:02:40 +01:00
David Hill
1092df5224
use dcrutil.VerifyMessage versus RPC (#22) 2020-05-18 08:42:35 +01:00
Jamie Holdstock
57dfc1ed6d
Add decred logging and config (#8) 2020-05-14 19:02:45 +01:00
David Hill
1a5bd03e32
add /feeaddress (#3) 2020-05-14 13:54:42 +01:00
David Hill
a1429c7d8d
prepare wsrpc usage (#1) 2020-05-13 21:59:59 +01:00
jholdstock
f919d4d8fc Add missing db stubs and begin db implementation 2020-05-13 21:25:35 +01:00
jholdstock
1c72b8f1e5 init 2020-05-13 17:08:02 +01:00