Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server provides a bitcoin server for handling communications to and from bitcoin peers.
func NewServer ¶
func NewServer(listenAddrs []string, chainParams *chaincfg.Params, monitorListenAddrs []string) (*Server, error)
NewServer returns a new btcd Server configured to listen on addr for the bitcoin network type specified by chainParams. Use start to begin accepting connections from peers. monitorListenAddrs is added for temporary hardcoded metrics exporting. TODO: remove monitorListenAddrs when we use metric exporter instead.
func (*Server) NetTotals ¶
NetTotals returns the sum of all bytes received and sent across the network for all peers. It is safe for concurrent access.
func (*Server) OutboundGroupCount ¶
OutboundGroupCount returns the number of peers connected to the given outbound group key.
func (*Server) ScheduleShutdown ¶
ScheduleShutdown schedules a Server shutdown after the specified duration. It also dynamically adjusts how often to warn the Server is going down based on remaining duration.
func (*Server) Stop ¶
Stop gracefully shuts down the Server by stopping and disconnecting all peers and the main listener.
func (*Server) WaitForShutdown ¶
func (s *Server) WaitForShutdown()
WaitForShutdown blocks until the main listener and peer handlers are stopped.