Documentation ¶
Index ¶
- func NewStream(s network.Stream) p2p.Stream
- 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) 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) 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) NewStream(ctx context.Context, overlay swarm.Address, headers p2p.Headers, ...) (p2p.Stream, error)
- func (s *Service) Peers() []p2p.Peer
- func (s *Service) Ready()
- 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 ¶
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(ctx context.Context, signer beecrypto.Signer, networkID uint64, overlay swarm.Address, addr string, ab addressbook.Putter, storer storage.StateStorer, lightNodes *lightnode.Container, swapBackend handshake.SenderMatcher, logger logging.Logger, tracer *tracing.Tracer, o Options) (*Service, error)
func (*Service) AddProtocol ¶
func (s *Service) AddProtocol(p p2p.ProtocolSpec) (err error)
func (*Service) BlocklistedPeers ¶ added in v0.5.0
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) 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. |
Click to show internal directories.
Click to hide internal directories.