Options
All
  • Public
  • Public/Protected
  • All
Menu

Transport that can be used to connect peers together. Transports are how Peers are discovered and connected to. An implementation of this interface must support being started and stopped and should report peers via the onPeerConnect event.

To simplify implementation transports are commonly implemented via AbstractTransport which takes care of the event firing and stopping active peers when the transport is being stopped.

Hierarchy

  • Transport

Implemented by

Index

Properties

Methods

Properties

Readonly onPeerConnect

onPeerConnect: Subscribable<Transport, [peer: Peer]>

Event for when this transport connects to a peer.

Methods

start

  • Start this transport.

    Parameters

    • options: TransportOptions
      • options describing some details about how to join the network, such as the identifier of this node, the network name and if joining as a client or not.

    Returns Promise<boolean>

    promise returning if the transport was started or not

stop

  • stop(): Promise<boolean>

Generated using TypeDoc