Implementation of the Peer Exchange protocol (https://rfc.vac.dev/spec/34/)

Hierarchy

  • BaseProtocol
    • WakuPeerExchange

Implements

Constructors

Properties

addLibp2pEventListener: (<K>(type, listener, options?) => void)

Type declaration

    • <K>(type, listener, options?): void
    • Type Parameters

      • K extends keyof Libp2pEvents<ServiceMap>

      Parameters

      • type: K
      • listener: null | EventHandler<Libp2pEvents<ServiceMap>[K]>
      • Optional options: boolean | AddEventListenerOptions

      Returns void

multicodec: string
removeLibp2pEventListener: (<K>(type, listener?, options?) => void)

Type declaration

    • <K>(type, listener?, options?): void
    • Type Parameters

      • K extends keyof Libp2pEvents<ServiceMap>

      Parameters

      • type: K
      • Optional listener: null | EventHandler<Libp2pEvents<ServiceMap>[K]>
      • Optional options: boolean | EventListenerOptions

      Returns void

streamManager: waku.StreamManager

Accessors

  • get peerStore(): PeerStore
  • Returns PeerStore

Methods

  • Parameters

    • Optional peerId: PeerId

    Returns Promise<Peer>

  • Retrieves a list of peers based on the specified criteria.

    Parameters

    • Optional __namedParameters: {
          maxBootstrapPeers: number;
          numPeers: number;
      }
      • maxBootstrapPeers: number
      • numPeers: number

    Returns Promise<Peer[]>

    A Promise that resolves to an array of peers based on the specified criteria.

  • Parameters

    • peer: Peer

    Returns Promise<Stream>

  • Returns known peers from the address book (libp2p.peerStore) that support the class protocol. Waku may or may not be currently connected to these peers.

    Returns Promise<Peer[]>

Generated using TypeDoc