decred / dcrtime

Decred anchored timestamp client, proxy, and server.
ISC License
28 stars 23 forks source link

[api-v2] Add routes for API v2 #60

Closed thi4go closed 4 years ago

thi4go commented 4 years ago

This PR includes a initial v2 API for dcrtime. It contains the routes previously present on v1, plus a new route that allow clients to send a single digest string to the server. The need for this route was motivated by the no-js version of dcrtimegui. Also, the api v2 directory is being handled by go modules.

It also doesn't make any changes to v1 relative routes and how the daemon handles them, so it's backward compatible, since third parties can still use v1.

thi4go commented 4 years ago

@marcopeereboom fixed the versioning :+1:

thi4go commented 4 years ago

Appreciate the review and the time put in debugging that route with me @degeri ! Commit 3ee5ea3 addresses that problem and fixes data receival in that route :+1:

thi4go commented 4 years ago

Addressed the comments @lukebp, appreciate the review mate :+1:

marcopeereboom commented 4 years ago

We need the ability to exercise the old version for tests. It has to work. We can default to v2 but v1 shall be supported.

On Feb 19, 2020, at 19:09, Thiago de Freitas Figueiredo notifications@github.com wrote:

 @thi4go commented on this pull request.

In cmd/dcrtime/dcrtime.go:

@@ -19,7 +19,7 @@ import ( "os" "strconv"

  • v1 "github.com/decred/dcrtime/api/v1" Talked to luke about this and we thought better just to bump the cli to use the latest version. I'll add the config and cli flag 👍

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.