Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Waku

Hierarchy

  • Waku

Index

Constructors

Properties

libp2p: Libp2p
lightPush: WakuLightPush
pingKeepAliveTimers: {}

Type declaration

  • [peer: string]: ReturnType<typeof setInterval>
relay: WakuRelay
relayKeepAliveTimers: {}

Type declaration

  • [peer: string]: ReturnType<typeof setInterval>
store: WakuStore

Methods

  • addDecryptionKey(key: string | Uint8Array, options?: { contentTopics?: string[]; method?: DecryptionMethod }): void
  • Register a decryption key to attempt decryption of messages received via WakuRelay and WakuStore. This can either be a private key for asymmetric encryption or a symmetric key.

    Strings must be in hex format.

    Parameters

    • key: string | Uint8Array
    • Optional options: { contentTopics?: string[]; method?: DecryptionMethod }

    Returns void

  • addPeerToAddressBook(peerId: string | PeerId, multiaddrs: Multiaddr[] | string[]): void
  • Add peer to address book, it will be auto-dialed in the background.

    Parameters

    • peerId: string | PeerId
    • multiaddrs: Multiaddr[] | string[]

    Returns void

  • deleteDecryptionKey(key: string | Uint8Array): void
  • Delete a decryption key that was used to attempt decryption of messages received via WakuRelay or WakuStore.

    Strings must be in hex format.

    Parameters

    • key: string | Uint8Array

    Returns void

  • dial(peer: string | Multiaddr | PeerId, protocols?: Protocols[]): Promise<{ protocol: string; stream: MuxedStream }>
  • Dials to the provided peer.

    Parameters

    • peer: string | Multiaddr | PeerId

      The peer to dial

    • Optional protocols: Protocols[]

      Waku protocols we expect from the peer; Default to Relay

    Returns Promise<{ protocol: string; stream: MuxedStream }>

  • getLocalMultiaddrWithID(): string
  • Return the local multiaddr with peer id on which libp2p is listening.

    throws

    if libp2p is not listening on localhost.

    Returns string

  • startKeepAlive(peerId: PeerId, pingPeriodSecs: number, relayPeriodSecs: number): void
  • Parameters

    • peerId: PeerId
    • pingPeriodSecs: number
    • relayPeriodSecs: number

    Returns void

  • stop(): Promise<void>
  • stopKeepAlive(peerId: PeerId): void
  • waitForRemotePeer(protocols?: Protocols[]): Promise<void>

Generated using TypeDoc