mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-21 19:20:39 +00:00
36 lines
934 B
Go
36 lines
934 B
Go
package diagnostics
|
|
|
|
import (
|
|
"net/http"
|
|
"strings"
|
|
|
|
"github.com/ledgerwatch/erigon/turbo/node"
|
|
"github.com/urfave/cli/v2"
|
|
)
|
|
|
|
func Setup(ctx *cli.Context, metricsMux *http.ServeMux, node *node.ErigonNode) {
|
|
debugMux := http.NewServeMux()
|
|
|
|
diagnostic := NewDiagnosticClient(ctx, debugMux, node)
|
|
diagnostic.Setup()
|
|
|
|
metricsMux.HandleFunc("/debug/", func(w http.ResponseWriter, r *http.Request) {
|
|
r.URL.Path = strings.TrimPrefix(r.URL.Path, "/debug")
|
|
r.URL.RawPath = strings.TrimPrefix(r.URL.RawPath, "/debug")
|
|
debugMux.ServeHTTP(w, r)
|
|
})
|
|
|
|
SetupLogsAccess(ctx, debugMux)
|
|
SetupDbAccess(ctx, debugMux)
|
|
SetupCmdLineAccess(debugMux)
|
|
SetupFlagsAccess(ctx, debugMux)
|
|
SetupVersionAccess(debugMux)
|
|
SetupBlockBodyDownload(debugMux)
|
|
SetupHeaderDownloadStats(debugMux)
|
|
SetupNodeInfoAccess(debugMux, node)
|
|
SetupPeersAccess(ctx, debugMux, node)
|
|
SetupBootnodesAccess(debugMux, node)
|
|
SetupStagesAccess(debugMux, diagnostic)
|
|
|
|
}
|