Skip to content

Commit

Permalink
feat(zetaclient): enable pprof http server
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera committed Nov 18, 2024
1 parent 6e03cc6 commit a493936
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmd/zetaclientd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import (
"encoding/json"
"fmt"
"io"
"net/http"
// #nosec G108 -- pprof enablement is intentional
_ "net/http/pprof"
"os"
"os/signal"
"path/filepath"
Expand Down Expand Up @@ -253,6 +256,15 @@ func Start(_ *cobra.Command, _ []string) error {
time.Sleep(30 * time.Second)
}
}()
// pprof http server
// zetacored/cometbft is already listening for pprof on 6060 (by default)
go func() {
// #nosec G114 -- timeouts uneeded
err := http.ListenAndServe("localhost:6061", nil)
if err != nil {
log.Error().Err(err).Msg("pprof http server error")
}
}()

// Generate a new TSS if keygen is set and add it into the tss server
// If TSS has already been generated, and keygen was successful ; we use the existing TSS
Expand Down

0 comments on commit a493936

Please sign in to comment.