OptionalmockMessageEmitter: TypedEventEmitter<MockWakuEvents>OptionalfilterOptionallightReturns a list of supported protocols.
OptionalrelayOptionalstoreThe health status can be one of three states:
Creates a decoder for Waku messages on a specific content topic.
A decoder is used to decode messages from the Waku network format. The decoder automatically handles shard configuration based on the Waku node's network settings.
A decoder instance configured for the specified content topic
// Create a decoder with default network shard settings
const decoder = waku.createDecoder({
contentTopic: "/my-app/1/chat/proto"
});
// Create a decoder with custom shard settings
const customDecoder = waku.createDecoder({
contentTopic: "/my-app/1/chat/proto",
shardInfo: {
clusterId: 1,
shard: 5
}
});
Creates an encoder for Waku messages on a specific content topic.
An encoder is used to encode messages into the Waku network format. The encoder automatically handles shard configuration based on the Waku node's network settings.
An encoder instance configured for the specified content topic
// Create a basic encoder with default network shard settings
const encoder = waku.createEncoder({
contentTopic: "/my-app/1/chat/proto"
});
// Create an ephemeral encoder (messages won't be stored by store nodes)
const ephemeralEncoder = waku.createEncoder({
contentTopic: "/my-app/1/notifications/proto",
ephemeral: true,
shardInfo: {
clusterId: 2,
shardsUnderCluster: 16
}
});
Dials to the provided peer
Optional_protocols: Protocols[]Promise that will resolve to a Stream to a dialed peer and will reject if the connection fails
an array of all connected peers
Hang up a connection to a peer
Promise that will resolve to true if the connection is hung up, false otherwise
true if the node has working connection and false otherwise
true if the node was started and false otherwise
Resolves when Waku successfully gains connection to a remote peers that fits provided requirements. Must be used after attempting to connect to nodes, using IWaku.dial or if was bootstrapped by using IPeerExchange or DnsDiscoveryComponents.
Optional_protocols: Protocols[]Optional_timeoutMs: numberPromise that resolves if all desired protocols are fulfilled by
at least one remote peer, rejects if the timeoutMs is reached
Emits events related to the Waku node. Those are: