Skip to content

Commit

Permalink
feat(telemetry): add zetaclientd :8123/version endpoint (#636)
Browse files Browse the repository at this point in the history
* refactor: rename bitcoin RPCEndpoint to RPCHost

to make it less confusing. btcd library expects IP:PORT
or HOSTNAME:PORT as the RPCHost format.

* chore: remove .git from dockerignore file

as the build rule in Makefile uses .git/ to find tags and
generate version string.

* zetaclient: add :8123/version endpoint

---------

Co-authored-by: brewmaster012 <>
  • Loading branch information
brewmaster012 committed May 23, 2023
1 parent 84e0c7d commit e4d8b19
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
localnet
package.json
yarn.lock
.git/
.github/
.gitignore
7 changes: 7 additions & 0 deletions zetaclient/tss_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"github.com/zeta-chain/zetacore/common"
"net/http"
"time"

Expand Down Expand Up @@ -40,6 +41,7 @@ func (t *HTTPServer) Handlers() http.Handler {
router := mux.NewRouter()
router.Handle("/ping", http.HandlerFunc(t.pingHandler)).Methods(http.MethodGet)
router.Handle("/p2p", http.HandlerFunc(t.p2pHandler)).Methods(http.MethodGet)
router.Handle("/version", http.HandlerFunc(t.versionHandler)).Methods(http.MethodGet)
//router.Handle("/pending", http.HandlerFunc(t.pendingHandler)).Methods(http.MethodGet)
router.Use(logMiddleware())
return router
Expand Down Expand Up @@ -90,3 +92,8 @@ func (t *HTTPServer) p2pHandler(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)
fmt.Fprintf(w, "%s", t.p2pid)
}

func (t *HTTPServer) versionHandler(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)
fmt.Fprintf(w, "%s", common.Version)
}

0 comments on commit e4d8b19

Please sign in to comment.