Documentation
¶
Index ¶
- Constants
- type Options
- type Service
- func (s *Service) AddProtocol(p p2p.ProtocolSpec) (err error)
- func (s *Service) Addresses() (addresses []ma.Multiaddr, err error)
- func (s *Service) Blocklist(overlay swarm.Address, duration time.Duration, reason string) error
- func (s *Service) Blocklisted(overlay swarm.Address) (bool, error)
- func (s *Service) BlocklistedPeers() ([]p2p.BlockListedPeer, error)
- func (s *Service) Close() error
- func (s *Service) Connect(ctx context.Context, addrs []ma.Multiaddr) (address *bzz.Address, err error)
- func (s *Service) Disconnect(overlay swarm.Address, reason string) (err error)
- func (s *Service) GetWelcomeMessage() string
- func (s *Service) Halt()
- func (s *Service) Metrics() []prometheus.Collector
- func (s *Service) NATManager() basichost.NATManager
- func (s *Service) NetworkStatus() p2p.NetworkStatus
- func (s *Service) NewStream(ctx context.Context, overlay swarm.Address, headers p2p.Headers, ...) (p2p.Stream, error)
- func (s *Service) Peers() []p2p.Peer
- func (s *Service) Ping(ctx context.Context, addr ma.Multiaddr) (rtt time.Duration, err error)
- func (s *Service) Ready() error
- func (s *Service) SetPickyNotifier(n p2p.PickyNotifier)
- func (s *Service) SetWelcomeMessage(val string) error
- func (s *Service) StatusMetrics() []prometheus.Collector
Constants ¶
View Source
const ( IncomingStreamCountLimit = 5_000 OutgoingStreamCountLimit = 10_000 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
PrivateKey *ecdsa.PrivateKey
NATAddr string
NATWSSAddr string
EnableWS bool
EnableWSS bool
WSSAddr string
AutoTLSStorageDir string
AutoTLSCAEndpoint string
AutoTLSDomain string
AutoTLSRegistrationEndpoint string
FullNode bool
LightNodeLimit int
WelcomeMessage string
Nonce []byte
ValidateOverlay bool
HeadersRWTimeout time.Duration
Registry *prometheus.Registry
// contains filtered or unexported fields
}
type Service ¶
func (*Service) AddProtocol ¶
func (s *Service) AddProtocol(p p2p.ProtocolSpec) (err error)
func (*Service) BlocklistedPeers ¶
func (s *Service) BlocklistedPeers() ([]p2p.BlockListedPeer, error)
func (*Service) Disconnect ¶
func (*Service) GetWelcomeMessage ¶
GetWelcomeMessage returns the value of the welcome message.
func (*Service) Metrics ¶
func (s *Service) Metrics() []prometheus.Collector
func (*Service) NATManager ¶
func (s *Service) NATManager() basichost.NATManager
func (*Service) NetworkStatus ¶
func (s *Service) NetworkStatus() p2p.NetworkStatus
NetworkStatus implements the p2p.NetworkStatuser interface.
func (*Service) SetPickyNotifier ¶
func (s *Service) SetPickyNotifier(n p2p.PickyNotifier)
func (*Service) SetWelcomeMessage ¶
SetWelcomeMessage sets the welcome message for the handshake protocol.
func (*Service) StatusMetrics ¶ added in v2.6.0
func (s *Service) StatusMetrics() []prometheus.Collector
StatusMetrics exposes metrics that are exposed on the status protocol.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
handshake/pb
Package pb holds only Protocol Buffer definitions and generated code.
|
Package pb holds only Protocol Buffer definitions and generated code. |
|
headers/pb
Package pb holds only Protocol Buffer definitions and generated code.
|
Package pb holds only Protocol Buffer definitions and generated code. |
|
reacher
Package reacher runs a background worker that will ping peers from an internal queue and report back the reachability to the notifier.
|
Package reacher runs a background worker that will ping peers from an internal queue and report back the reachability to the notifier. |
Click to show internal directories.
Click to hide internal directories.