Documentation
    Preparing search index...

    Class Relay

    Implements the Waku v2 Relay protocol. Throws if libp2p.pubsub does not support Waku Relay

    Implements

    Index

    Constructors

    • Parameters

      • params: RelayConstructorParams

      Returns Relay

    Properties

    gossipSub: GossipSub
    pubsubTopics: Set<string>
    subscribe: <T extends IDecodedMessage>(
        decoders: IDecoder<T> | IDecoder<T>[],
        callback: Callback<T>,
    ) => () => void = ...
    multicodec: string = ...

    Methods

    • Returns ActiveSubscriptions

    • Parameters

      • Optionaltopic: string

      Returns string[]

    • Mounts the gossipsub protocol onto the libp2p node and subscribes to all the topics.

      Returns Promise<void>

    • Returns Promise<void>

    • Wait for at least one peer with the given protocol to be connected and in the gossipsub mesh for all pubsubTopics.

      Returns Promise<void>