debugapi

package
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 53 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	DataDir        string
	NetworkID      uint64
	NATAddr        string
	EnableWS       bool
	EnableQUIC     bool
	NodeMode       address.Model
	LightNodeLimit int
	WelcomeMessage string
	Transaction    []byte
}

type PeerItem

type PeerItem struct {
	Address   boson.Address `json:"address"`
	FullNode  bool          `json:"fullNode"`
	Direction string        `json:"direction"`
}

type PublicIP added in v1.4.1

type PublicIP struct {
	IPv4 string `json:"ipv4"`
	IPv6 string `json:"ipv6"`
}

func GetPublicIp

func GetPublicIp(logger logging.Logger) *PublicIP

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service implements http.Handler interface to be used in HTTP server.

func New

func New(overlay boson.Address, publicKey ecdsa.PublicKey, logger logging.Logger, tracer *tracing.Tracer, corsAllowedOrigins []string, restrict bool, auth authenticator, o Options) *Service

New creates a new Debug API Service with only basic routers enabled in order to expose /addresses, /health endpoints, Go metrics and pprof. It is useful to expose these endpoints before all dependencies are configured and injected to have access to basic debugging tools and /health endpoint.

func (*Service) Configure

func (s *Service) Configure(p2p p2p.DebugService, pingpong pingpong.Interface, group *multicast.Service, topologyDriver topology.Driver, lightNodes *lightnode.Container,
	bootNodes *bootnode.Container, storer storage.Storer, route routetab.RouteTab, chunkinfo chunkinfo.Interface, fileInfo fileinfo.Interface, retrieval retrieval.Interface,
	ab addressbook.Interface)

Configure injects required dependencies and configuration parameters and constructs HTTP routes that depend on them. It is intended and safe to call this method only once.

func (*Service) MustRegisterMetrics

func (s *Service) MustRegisterMetrics(cs ...prometheus.Collector)

func (*Service) MustRegisterTraffic

func (s *Service) MustRegisterTraffic(traffic traffic.ApiInterface)

func (*Service) ServeHTTP

func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL