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 infinity.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 *ifi.Address, err error)
- func (s *Service) Disconnect(overlay infinity.Address) error
- func (s *Service) GetWelcomeMessage() string
- func (s *Service) Metrics() []prometheus.Collector
- func (s *Service) NATManager() basichost.NATManager
- func (s *Service) NewStream(ctx context.Context, overlay infinity.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 (*Service) AddProtocol ¶
func (s *Service) AddProtocol(p p2p.ProtocolSpec) (err error)
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) SetPickyNotifier ¶
func (s *Service) SetPickyNotifier(n p2p.PickyNotifier)
func (*Service) SetWelcomeMessage ¶
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.