Documentation ¶
Index ¶
- type Service
- func (s *Service) ListenAddrs() ([]multiaddr.Multiaddr, error)
- func (s *Service) NewStream(ctx context.Context, pids ...protocol.ID) (network.Stream, error)
- func (s *Service) PublishOnTopic(topic string, data []byte) error
- func (s *Service) Run(ctx context.Context) error
- func (s *Service) SetProtocolHandler(pid protocol.ID, handler func(network.Stream))
- func (s *Service) SubscribePeerConnectednessChanged(ctx context.Context) (<-chan event.EvtPeerConnectednessChanged, error)
- func (s *Service) SubscribeToTopic(topic string) (chan []byte, func(), error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewWithHost ¶ added in v0.6.0
func (*Service) ListenAddrs ¶
func (*Service) NewStream ¶ added in v0.6.0
NewStream creates a bidirectional connection to a random peer that implements a set of protocol ids
func (*Service) PublishOnTopic ¶ added in v0.6.0
func (*Service) Run ¶
Run starts the p2p service. Calling any other function before run is undefined behaviour
func (*Service) SetProtocolHandler ¶ added in v0.6.0
func (*Service) SubscribePeerConnectednessChanged ¶
Click to show internal directories.
Click to hide internal directories.