A Peer Discovery Service that leverages libp2p Pubsub to find peers.

Hierarchy

Implements

Constructors

Properties

#private: any
[peerDiscoverySymbol]: true = true
[toStringTag]: "@libp2p/pubsub-peer-discovery" = '@libp2p/pubsub-peer-discovery'
interval: number
intervalId?: Timeout
listenOnly: boolean
log: Logger
topics: string[]

Methods

  • Performs a broadcast via Pubsub publish

    Returns void

  • Type Parameters

    • K extends "peer"

    Parameters

    Returns void

  • Subscribes to the discovery topic on libp2p.pubsub and performs a broadcast immediately, and every this.interval

    Returns void

  • Returns void

  • Parameters

    Returns boolean

  • Parameters

    • type: string

    Returns number

  • Type Parameters

    • K extends "peer"

    Parameters

    Returns void

  • Type Parameters

    • Detail

    Parameters

    • type: "peer"
    • Optional detail: CustomEventInit<Detail>

    Returns boolean

  • Returns void

  • Unsubscribes from the discovery topic

    Returns void