WakuStore | js-waku
Options
All
  • Public
  • Public/Protected
  • All
Menu

Implements the .

The Waku Store protocol can be used to retrieved historical messages.

Hierarchy

  • WakuStore

Index

Constructors

Properties

decryptionKeys: Map<Uint8Array, { contentTopics?: string[]; method?: DecryptionMethod }>
libp2p: Libp2p
pubSubTopic: string

Accessors

  • get peers(): AsyncIterable<Peer>
  • Returns known peers from the address book (libp2p.peerStore) that support store protocol. Waku may or may not be currently connected to these peers.

    Returns AsyncIterable<Peer>

  • get randomPeer(): Promise<undefined | Peer>
  • Returns a random peer that supports store protocol from the address book (libp2p.peerStore). Waku may or may not be currently connected to this peer.

    Returns Promise<undefined | Peer>

Methods

  • addDecryptionKey(key: string | Uint8Array, options?: { contentTopics?: string[]; method?: DecryptionMethod }): void
  • Register a decryption key to attempt decryption of messages received in any subsequent queryHistory call. This can either be a private key for asymmetric encryption or a symmetric key. WakuStore will attempt to decrypt messages using both methods.

    Strings must be in hex format.

    Parameters

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

    Returns void

  • deleteDecryptionKey(key: string | Uint8Array): void
  • cursorV2Beta4 Delete a decryption key that was used to attempt decryption of messages received in subsequent queryHistory calls.

    Strings must be in hex format.

    Parameters

    • key: string | Uint8Array

    Returns void

  • Do a query to a Waku Store to retrieve historical/missed messages.

    throws

    If not able to reach a Waku Store peer to query or if an error is encountered when processing the reply.

    Parameters

    • contentTopics: string[]

      The content topics to pass to the query, leave empty to retrieve all messages.

    • Optional options: QueryOptions

      Optional parameters.

    Returns Promise<WakuMessage[]>

Generated using