Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/gorilla/mux"
"github.com/rs/zerolog/log"
"github.com/sprintertech/sprinter-signing/api/handlers"
"github.com/sprintertech/sprinter-signing/health"
)

func Serve(
Expand All @@ -23,6 +24,7 @@ func Serve(
r.HandleFunc("/v1/chains/{chainId:[0-9]+}/signatures", signingHandler.HandleSigning).Methods("POST")
r.HandleFunc("/v1/chains/{chainId:[0-9]+}/signatures/{depositId}", statusHandler.HandleRequest).Methods("GET")
r.HandleFunc("/v1/chains/{chainId:[0-9]+}/confirmations", confirmationsHandler.HandleRequest).Methods("GET")
r.HandleFunc("/health", health.HealthHandler()).Methods("GET")

server := &http.Server{
Addr: addr,
Expand Down
3 changes: 0 additions & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import (
"github.com/sprintertech/sprinter-signing/comm/elector"
"github.com/sprintertech/sprinter-signing/comm/p2p"
"github.com/sprintertech/sprinter-signing/config"
"github.com/sprintertech/sprinter-signing/health"
"github.com/sprintertech/sprinter-signing/jobs"
"github.com/sprintertech/sprinter-signing/keyshare"
"github.com/sprintertech/sprinter-signing/metrics"
Expand Down Expand Up @@ -110,8 +109,6 @@ func Run() error {
panicOnError(err)
log.Info().Str("peerID", host.ID().String()).Msg("Successfully created libp2p host")

go health.StartHealthEndpoint(configuration.RelayerConfig.HealthPort)

communication := p2p.NewCommunication(host, "p2p/sprinter")
electorFactory := elector.NewCoordinatorElectorFactory(host, configuration.RelayerConfig.BullyConfig)
coordinator := tss.NewCoordinator(host, communication, electorFactory)
Expand Down
6 changes: 0 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -950,14 +950,8 @@ github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.9.0 h1:yR6EXjTp0y0cLN8OZg1CRZmOBdI88UcGkhgyJhu6nZk=
github.com/spf13/viper v1.9.0/go.mod h1:+i6ajR7OX2XaiBkrcZJFK21htRk7eDeLg7+O6bhUPP4=
github.com/sprintertech/lifi-solver v0.0.0-20251106144931-4586926e1a4c h1:gt7WBOMG049RFW0E0tq7t5PuaU3utWDgbzzq98iMyug=
github.com/sprintertech/lifi-solver v0.0.0-20251106144931-4586926e1a4c/go.mod h1:3yuTgBKvA5WLCFsXXuBnOzk5nNS58phc881uXLGfD0o=
github.com/sprintertech/lifi-solver v0.0.0-20251107125259-138b58fd00bc h1:h/DY03o7cOez2Ilrwt9TO9BKWIYrAo3o/KvhvEwkziQ=
github.com/sprintertech/lifi-solver v0.0.0-20251107125259-138b58fd00bc/go.mod h1:d5/fytopwudQUE9ojF54XwtqLRFD3JbpBlri7ygb3ng=
github.com/sprintertech/lifi-solver v0.0.0-20251107154632-5c22e7948a82 h1:Nq9wH4wU4W+3UXfeTqGwMBxr+yKDkz0wO6XzpSRkamg=
github.com/sprintertech/lifi-solver v0.0.0-20251107154632-5c22e7948a82/go.mod h1:d5/fytopwudQUE9ojF54XwtqLRFD3JbpBlri7ygb3ng=
github.com/sprintertech/solver-config/go v0.0.0-20251027142430-7f32bdd5da1e h1:5sSP6GbqCT/ApxxZmUtav6GHy5Ke98zh5oqQxewhJd4=
github.com/sprintertech/solver-config/go v0.0.0-20251027142430-7f32bdd5da1e/go.mod h1:MrIGW6M815PSYKtWSeOd1Z7eiSeOIk/uA/6E2PhlQVQ=
github.com/sprintertech/solver-config/go v0.0.0-20251107123115-0ea5f862cab9 h1:oo4/4LvkYMVVl/u9+iqEY91iCDFJ05pGwUJNX+6APnA=
github.com/sprintertech/solver-config/go v0.0.0-20251107123115-0ea5f862cab9/go.mod h1:MrIGW6M815PSYKtWSeOd1Z7eiSeOIk/uA/6E2PhlQVQ=
github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q=
Expand Down
26 changes: 3 additions & 23 deletions health/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,12 @@
package health

import (
"fmt"
"net/http"
"time"

"github.com/rs/zerolog/log"
)

// StartHealthEndpoint starts /health endpoint on provided port that returns ok on invocation
func StartHealthEndpoint(port uint16) {
http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
// HealthHandler returns a handler function for the /health endpoint
func HealthHandler() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
_, _ = w.Write([]byte("ok"))
})

srv := &http.Server{
Addr: fmt.Sprintf(":%d", port),
ReadTimeout: 10 * time.Second,
WriteTimeout: 10 * time.Second,
IdleTimeout: 30 * time.Second,
ReadHeaderTimeout: 2 * time.Second,
}

err := srv.ListenAndServe()
if err != nil {
log.Err(err).Msgf("Failed starting health server")
return
}

log.Info().Msgf("started /health endpoint on port %d", port)
}
6 changes: 3 additions & 3 deletions tss/ecdsa/common/mock/tss.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions tss/mock/ecdsa.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading