Documentation ¶
Index ¶
- type Options
- type Service
- func (s *Service) AddProtocol(p p2p.ProtocolSpec) (err error)
- func (s *Service) Addresses() (addreses []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.Peer, error)
- func (s *Service) Close() error
- func (s *Service) Connect(ctx context.Context, addr 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
- type UpnpAddressResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
func (*Service) AddProtocol ¶
func (s *Service) AddProtocol(p p2p.ProtocolSpec) (err error)
func (*Service) Blocklisted ¶ added in v1.6.1
func (*Service) BlocklistedPeers ¶ added in v0.5.0
func (*Service) Disconnect ¶
func (*Service) GetWelcomeMessage ¶ added in v0.2.0
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 ¶ added in v1.6.0
func (s *Service) NetworkStatus() p2p.NetworkStatus
NetworkStatus implements the p2p.NetworkStatuser interface.
func (*Service) SetPickyNotifier ¶ added in v0.5.3
func (s *Service) SetPickyNotifier(n p2p.PickyNotifier)
func (*Service) SetWelcomeMessage ¶ added in v0.2.0
SetWelcomeMessage sets the welcome message for the handshake protocol.
type UpnpAddressResolver ¶
type UpnpAddressResolver struct {
// contains filtered or unexported fields
}
func (*UpnpAddressResolver) Resolve ¶
Resolve checks if there is a possible better advertisable underlay then the provided observed address. In some NAT situations, for example in the case when nodes are behind upnp, observer might send the observed address with a wrong port. In this case, observed address is compared to addresses provided by host, and if there is a same address but with different port, that one is used as advertisable address instead of provided observed one. TODO: this is a quickfix and it will be improved in the future
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. |