Options
All
  • Public
  • Public/Protected
  • All
Menu

Implements the Waku v2 Store protocol.

Hierarchy

  • WakuStore

Index

Constructors

constructor

Properties

decryptionKeys

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

libp2p

libp2p: Libp2p

pubSubTopic

pubSubTopic: string

Accessors

peers

  • get peers(): 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 Peer[]

randomPeer

  • get randomPeer(): 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 undefined | Peer

Methods

addDecryptionKey

  • 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

  • deleteDecryptionKey(key: string | Uint8Array): void
  • 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

queryHistory

  • Do a History Query to a Waku Store.

    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

    Returns Promise<waku_message.WakuMessage[]>

Generated using TypeDoc