</div></div><asideclass="tsd-sources"><p>Implementation of <ahref="../interfaces/_waku_interfaces.IWaku.html">IWaku</a>.<ahref="../interfaces/_waku_interfaces.IWaku.html#events">events</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/9a1e9cecc5b2a96d1b9bffbdc4a1c4a53929d1a9/packages/utils/src/common/mock_node.ts#L121">common/mock_node.ts:121</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><h3class="tsd-anchor-link"id="filter"><codeclass="tsd-tag">Optional</code><span>filter</span><ahref="#filter"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">filter</span><spanclass="tsd-signature-symbol">?:</span><ahref="../types/_waku_interfaces.IFilter.html"class="tsd-signature-type tsd-kind-type-alias">IFilter</a></div><asideclass="tsd-sources"><p>Implementation of <ahref="../interfaces/_waku_interfaces.IWaku.html">IWaku</a>.<ahref="../interfaces/_waku_interfaces.IWaku.html#filter">filter</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/9a1e9cecc5b2a96d1b9bffbdc4a1c4a53929d1a9/packages/utils/src/common/mock_node.ts#L31">common/mock_node.ts:31</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><h3class="tsd-anchor-link"id="lightpush"><codeclass="tsd-tag">Optional</code><span>light<wbr/>Push</span><ahref="#lightpush"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">lightPush</span><spanclass="tsd-signature-symbol">?:</span><ahref="../types/_waku_interfaces.ILightPush.html"class="tsd-signature-type tsd-kind-type-alias">ILightPush</a></div><asideclass="tsd-sources"><p>Implementation of <ahref="../interfaces/_waku_interfaces.IWaku.html">IWaku</a>.<ahref="../interfaces/_waku_interfaces.IWaku.html#lightpush">lightPush</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/9a1e9cecc5b2a96d1b9bffbdc4a1c4a53929d1a9/packages/utils/src/common/mock_node.ts#L32">common/mock_node.ts:32</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><h3class="tsd-anchor-link"id="protocols"><span>protocols</span><ahref="#protocols"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">protocols</span><spanclass="tsd-signature-symbol">:</span><spanclass="tsd-signature-type">string</span><spanclass="tsd-signature-symbol">[]</span></div><divclass="tsd-comment tsd-typography"><p>Returns a list of supported protocols.</p>
</div></div><asideclass="tsd-sources"><p>Implementation of <ahref="../interfaces/_waku_interfaces.IWaku.html">IWaku</a>.<ahref="../interfaces/_waku_interfaces.IWaku.html#protocols">protocols</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/9a1e9cecc5b2a96d1b9bffbdc4a1c4a53929d1a9/packages/utils/src/common/mock_node.ts#L33">common/mock_node.ts:33</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><h3class="tsd-anchor-link"id="relay"><codeclass="tsd-tag">Optional</code><span>relay</span><ahref="#relay"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">relay</span><spanclass="tsd-signature-symbol">?:</span><ahref="../types/_waku_interfaces.IRelay.html"class="tsd-signature-type tsd-kind-type-alias">IRelay</a></div><asideclass="tsd-sources"><p>Implementation of <ahref="../interfaces/_waku_interfaces.IWaku.html">IWaku</a>.<ahref="../interfaces/_waku_interfaces.IWaku.html#relay">relay</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/9a1e9cecc5b2a96d1b9bffbdc4a1c4a53929d1a9/packages/utils/src/common/mock_node.ts#L29">common/mock_node.ts:29</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><h3class="tsd-anchor-link"id="store"><codeclass="tsd-tag">Optional</code><span>store</span><ahref="#store"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><divclass="tsd-signature"><spanclass="tsd-kind-property">store</span><spanclass="tsd-signature-symbol">?:</span><ahref="../types/_waku_interfaces.IStore.html"class="tsd-signature-type tsd-kind-type-alias">IStore</a></div><asideclass="tsd-sources"><p>Implementation of <ahref="../interfaces/_waku_interfaces.IWaku.html">IWaku</a>.<ahref="../interfaces/_waku_interfaces.IWaku.html#store">store</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/9a1e9cecc5b2a96d1b9bffbdc4a1c4a53929d1a9/packages/utils/src/common/mock_node.ts#L30">common/mock_node.ts:30</a></li></ul></aside></section></section></details><detailsclass="tsd-panel-group tsd-member-group tsd-accordion"open><summaryclass="tsd-accordion-summary"data-key="section-Accessors"><svgwidth="20"height="20"viewBox="0 0 24 24"fill="none"aria-hidden="true"><usehref="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Accessors</h2></summary><section><sectionclass="tsd-panel tsd-member"><h3class="tsd-anchor-link"id="health"><span>health</span><ahref="#health"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><li><divclass="tsd-signature"id="healthhealth"><spanclass="tsd-signature-keyword">get</span><spanclass="tsd-kind-get-signature">health</span><spanclass="tsd-signature-symbol">()</span><spanclass="tsd-signature-symbol">:</span><ahref="../enums/_waku_interfaces.HealthStatus.html"class="tsd-signature-type tsd-kind-enum">HealthStatus</a></div><divclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>The health status can be one of three states:</p>
</div></div><asideclass="tsd-sources"><p>Implementation of <ahref="../interfaces/_waku_interfaces.IWaku.html">IWaku</a>.<ahref="../interfaces/_waku_interfaces.IWaku.html#health">health</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/9a1e9cecc5b2a96d1b9bffbdc4a1c4a53929d1a9/packages/utils/src/common/mock_node.ts#L126">common/mock_node.ts:126</a></li></ul></aside></div></li></ul></section><sectionclass="tsd-panel tsd-member"><h3class="tsd-anchor-link"id="libp2p"><span>libp2p</span><ahref="#libp2p"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><li><divclass="tsd-signature"id="libp2plibp2p"><spanclass="tsd-signature-keyword">get</span><spanclass="tsd-kind-get-signature">libp2p</span><spanclass="tsd-signature-symbol">()</span><spanclass="tsd-signature-symbol">:</span><ahref="../types/_waku_interfaces.Libp2p.html"class="tsd-signature-type tsd-kind-type-alias">Libp2p</a></div><divclass="tsd-description"><h4class="tsd-returns-title">Returns <ahref="../types/_waku_interfaces.Libp2p.html"class="tsd-signature-type tsd-kind-type-alias">Libp2p</a></h4><asideclass="tsd-sources"><p>Implementation of <ahref="../interfaces/_waku_interfaces.IWaku.html">IWaku</a>.<ahref="../interfaces/_waku_interfaces.IWaku.html#libp2p">libp2p</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/9a1e9cecc5b2a96d1b9bffbdc4a1c4a53929d1a9/packages/utils/src/common/mock_node.ts#L71">common/mock_node.ts:71</a></li></ul></aside></div></li></ul></section><sectionclass="tsd-panel tsd-member"><h3class="tsd-anchor-link"id="peerid"><span>peer<wbr/>Id</span><ahref="#peerid"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><li><divclass="tsd-signature"id="peeridpeerid"><spanclass="tsd-signature-keyword">get</span><spanclass="tsd-kind-get-signature">peerId</span><spanclass="tsd-signature-symbol">()</span><spanclass="tsd-signature-symbol">:</span><spanclass="tsd-signature-type">PeerId</span></div><divclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Returns a unique identifier for a node on the network.</p>
</div></div><asideclass="tsd-sources"><p>Implementation of <ahref="../interfaces/_waku_interfaces.IWaku.html">IWaku</a>.<ahref="../interfaces/_waku_interfaces.IWaku.html#peerid">peerId</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/9a1e9cecc5b2a96d1b9bffbdc4a1c4a53929d1a9/packages/utils/src/common/mock_node.ts#L123">common/mock_node.ts:123</a></li></ul></aside></div></li></ul></section></section></details><detailsclass="tsd-panel-group tsd-member-group tsd-accordion"open><summaryclass="tsd-accordion-summary"data-key="section-Methods"><svgwidth="20"height="20"viewBox="0 0 24 24"fill="none"aria-hidden="true"><usehref="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Methods</h2></summary><section><sectionclass="tsd-panel tsd-member"><h3class="tsd-anchor-link"id="createdecoder"><span>create<wbr/>Decoder</span><ahref="#createdecoder"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass=""><divclass="tsd-signature tsd-anchor-link"id="createdecoder-1"><spanclass="tsd-kind-call-signature">createDecoder</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">_params</span><spanclass="tsd-signature-symbol">:</span><ahref="../types/_waku_interfaces.CreateDecoderParams.html"class="tsd-signature-type tsd-kind-type-alias">CreateDecoderParams</a><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">:</span><ahref="../interfaces/_waku_interfaces.IDecoder.html"class="tsd-signature-type tsd-kind-interface">IDecoder</a><spanclass="tsd-signature-symbol"><</span><ahref="../interfaces/_waku_interfaces.IDecodedMessage.html"class="tsd-signature-type tsd-kind-interface">IDecodedMessage</a><spanclass="tsd-signature-symbol">></span><ahref="#createdecoder-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></div><divclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Creates a decoder for Waku messages on a specific content topic.</p>
<p>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.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">_params</span>: <ahref="../types/_waku_interfaces.CreateDecoderParams.html"class="tsd-signature-type tsd-kind-type-alias">CreateDecoderParams</a></span></li></ul></div><h4class="tsd-returns-title">Returns <ahref="../interfaces/_waku_interfaces.IDecoder.html"class="tsd-signature-type tsd-kind-interface">IDecoder</a><spanclass="tsd-signature-symbol"><</span><ahref="../interfaces/_waku_interfaces.IDecodedMessage.html"class="tsd-signature-type tsd-kind-interface">IDecodedMessage</a><spanclass="tsd-signature-symbol">></span></h4><p>A decoder instance configured for the specified content topic</p>
<divclass="tsd-comment tsd-typography"><divclass="tsd-tag-throws"><h4class="tsd-anchor-link"id="throws">Throws<ahref="#throws"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>If the shard configuration is incompatible with the node's network settings</p>
</div><divclass="tsd-tag-example"><h4class="tsd-anchor-link"id="example-4">Example<ahref="#example-4"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><codeclass="typescript"><spanclass="hl-3">// Create a decoder with default network shard settings</span><br/><spanclass="hl-4">const</span><spanclass="hl-1"></span><spanclass="hl-7">decoder</span><spanclass="hl-1"> = </span><spanclass="hl-5">waku</span><spanclass="hl-1">.</span><spanclass="hl-0">createDecoder</span><spanclass="hl-1">({</span><br/><spanclass="hl-1"></span><spanclass="hl-5">contentTopic:</span><spanclass="hl-1"></span><spanclass="hl-2">"/my-app/1/chat/proto"</span><br/><spanclass="hl-1">});</span><br/><br/><spanclass="hl-3">// Create a decoder with custom shard settings</span><br/><spanclass="hl-4">const</span><spanclass="hl-1"></span><spanclass="hl-7">customDecoder</span><spanclass="hl-1"> = </span><spanclass="hl-5">waku</span><spanclass="hl-1">.</span><spanclass="hl-0">createDecoder</span><spanclass="hl-1">({</span><br/><spanclass="hl-1"></span><spanclass="hl-5">contentTopic:</span><spanclass="hl-1"></span><spanclass="hl-2">"/my-app/1/chat/proto"</span><spanclass="hl-1">,</span><br/><spanclass="hl-1"></span><spanclass="hl-5">shardInfo:</span><spanclass="hl-1"> {</span><br/><spanclass="hl-1"></span><spanclass="hl-5">clusterId:</span><spanclass="hl-1"></span><spanclass="hl-9">1</span><spanclass="hl-1">,</span><br/><spanclass="hl-1"></span><spanclass="hl-5">shard:</span><spanclass="hl-1"></span><spanclass="hl-9">5</span><br/><spanclass="hl-1"> }</span><br/><spanclass="hl-1">});</span>
</div></div><asideclass="tsd-sources"><p>Implementation of <ahref="../interfaces/_waku_interfaces.IWaku.html">IWaku</a>.<ahref="../interfaces/_waku_interfaces.IWaku.html#createdecoder">createDecoder</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/9a1e9cecc5b2a96d1b9bffbdc4a1c4a53929d1a9/packages/utils/src/common/mock_node.ts#L150">common/mock_node.ts:150</a></li></ul></aside></div></li></ul></section><sectionclass="tsd-panel tsd-member"><h3class="tsd-anchor-link"id="createencoder"><span>create<wbr/>Encoder</span><ahref="#createencoder"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass=""><divclass="tsd-signature tsd-anchor-link"id="createencoder-1"><spanclass="tsd-kind-call-signature">createEncoder</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">_params</span><spanclass="tsd-signature-symbol">:</span><ahref="../types/_waku_interfaces.CreateEncoderParams.html"class="tsd-signature-type tsd-kind-type-alias">CreateEncoderParams</a><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">:</span><ahref="../interfaces/_waku_interfaces.IEncoder.html"class="tsd-signature-type tsd-kind-interface">IEncoder</a><ahref="#createencoder-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></div><divclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Creates an encoder for Waku messages on a specific content topic.</p>
<p>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.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">_params</span>: <ahref="../types/_waku_interfaces.CreateEncoderParams.html"class="tsd-signature-type tsd-kind-type-alias">CreateEncoderParams</a></span></li></ul></div><h4class="tsd-returns-title">Returns <ahref="../interfaces/_waku_interfaces.IEncoder.html"class="tsd-signature-type tsd-kind-interface">IEncoder</a></h4><p>An encoder instance configured for the specified content topic</p>
<divclass="tsd-comment tsd-typography"><divclass="tsd-tag-throws"><h4class="tsd-anchor-link"id="throws-1">Throws<ahref="#throws-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>If the shard configuration is incompatible with the node's network settings</p>
</div><divclass="tsd-tag-example"><h4class="tsd-anchor-link"id="example-5">Example<ahref="#example-5"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><codeclass="typescript"><spanclass="hl-3">// Create a basic encoder with default network shard settings</span><br/><spanclass="hl-4">const</span><spanclass="hl-1"></span><spanclass="hl-7">encoder</span><spanclass="hl-1"> = </span><spanclass="hl-5">waku</span><spanclass="hl-1">.</span><spanclass="hl-0">createEncoder</span><spanclass="hl-1">({</span><br/><spanclass="hl-1"></span><spanclass="hl-5">contentTopic:</span><spanclass="hl-1"></span><spanclass="hl-2">"/my-app/1/chat/proto"</span><br/><spanclass="hl-1">});</span><br/><br/><spanclass="hl-3">// Create an ephemeral encoder (messages won't be stored by store nodes)</span><br/><spanclass="hl-4">const</span><spanclass="hl-1"></span><spanclass="hl-7">ephemeralEncoder</span><spanclass="hl-1"> = </span><spanclass="hl-5">waku</span><spanclass="hl-1">.</span><spanclass="hl-0">createEncoder</span><spanclass="hl-1">({</span><br/><spanclass="hl-1"></span><spanclass="hl-5">contentTopic:</span><spanclass="hl-1"></span><spanclass="hl-2">"/my-app/1/notifications/proto"</span><spanclass="hl-1">,</span><br/><spanclass="hl-1"></span><spanclass="hl-5">ephemeral:</span><spanclass="hl-1"></span><spanclass="hl-4">true</span><spanclass="hl-1">,</span><br/><spanclass="hl-1"></span><spanclass="hl-5">shardInfo:</span><spanclass="hl-1"> {</span><br/><spanclass="hl-1"></span><spanclass="hl-5">clusterId:</span><spanclass="hl-1"></span><spanclass="hl-9">2</span><spanclass="hl-1">,</span><br/><spanclass="hl-1"></span><spanclass="hl-5">shardsUnderCluster:</span><spanclass="hl-1"></span><spanclass="hl-9">16</span><br/><spanclass="hl-1"> }</span><br/><spanclass="hl-1">});</span>
</div></div><asideclass="tsd-sources"><p>Implementation of <ahref="../interfaces/_waku_interfaces.IWaku.html">IWaku</a>.<ahref="../interfaces/_waku_interfaces.IWaku.html#createencoder">createEncoder</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/9a1e9cecc5b2a96d1b9bffbdc4a1c4a53929d1a9/packages/utils/src/common/mock_node.ts#L155">common/mock_node.ts:155</a></li></ul></aside></div></li></ul></section><sectionclass="tsd-panel tsd-member"><h3class="tsd-anchor-link"id="dial"><span>dial</span><ahref="#dial"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass=""><divclass="tsd-signature tsd-anchor-link"id="dial-1"><spanclass="tsd-kind-call-signature">dial</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">_peer</span><spanclass="tsd-signature-symbol">:</span><spanclass="tsd-signature-type">PeerId</span><spanclass="tsd-signature-symbol">|</span><spanclass="tsd-signature-type">MultiaddrInput</span><spanclass="tsd-signature-symbol">,</span><spanclass="tsd-kind-parameter">_protocols</span><spanclass="tsd-signature-symbol">?:</span><ahref="../enums/_waku_interfaces.Protocols.html"class="tsd-signature-type tsd-kind-enum">Protocols</a><spanclass="tsd-signature-symbol">[]</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">:</span><spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><spanclass="tsd-signature-type">Stream</span><spanclass="tsd-signature-symbol">></span><ahref="#dial-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></div><divclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Dials to the provided peer</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">_peer</span>: <spanclass="tsd-signature-type">PeerId</span><spanclass="tsd-signature-symbol">|</span><spanclass="tsd-signature-type">MultiaddrInput</span></span></li><li><span><codeclass="tsd-tag">Optional</code><spanclass="tsd-kind-parameter">_protocols</span>: <ahref="../enums/_waku_interfaces.Protocols.html"class="tsd-signature-type tsd-kind-enum">Protocols</a><spanclass="tsd-signature-symbol">[]</span></span></li></ul></div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><spanclass="tsd-signature-type">Stream</span><spanclass="tsd-signature-symbol">></span></h4><p><code>Promise</code> that will resolve to a <code>Stream</code> to a dialed peer and will reject if the connection fails</p>
</div></div><asideclass="tsd-sources"><p>Implementation of <ahref="../interfaces/_waku_interfaces.IWaku.html">IWaku</a>.<ahref="../interfaces/_waku_interfaces.IWaku.html#dial">dial</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/9a1e9cecc5b2a96d1b9bffbdc4a1c4a53929d1a9/packages/utils/src/common/mock_node.ts#L129">common/mock_node.ts:129</a></li></ul></aside></div></li></ul></section><sectionclass="tsd-panel tsd-member"><h3class="tsd-anchor-link"id="getconnectedpeers"><span>get<wbr/>Connected<wbr/>Peers</span><ahref="#getconnectedpeers"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass=""><divclass="tsd-signature tsd-anchor-link"id="getconnectedpeers-1"><spanclass="tsd-kind-call-signature">getConnectedPeers</span><spanclass="tsd-signature-symbol">()</span><spanclass="tsd-signature-symbol">:</span><spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><spanclass="tsd-signature-type">Peer</span><spanclass="tsd-signature-symbol">[]</span><spanclass="tsd-signature-symbol">></span><ahref="#getconnectedpeers-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></div><divclass="tsd-description"><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><spanclass="tsd-signature-type">Peer</span><spanclass="tsd-signature-symbol">[]</span><spanclass="tsd-signature-symbol">></span></h4><p>an array of all connected peers</p>
<divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><p>Implementation of <ahref="../interfaces/_waku_interfaces.IWaku.html">IWaku</a>.<ahref="../interfaces/_waku_interfaces.IWaku.html#getconnectedpeers">getConnectedPeers</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/9a1e9cecc5b2a96d1b9bffbdc4a1c4a53929d1a9/packages/utils/src/common/mock_node.ts#L164">common/mock_node.ts:164</a></li></ul></aside></div></li></ul></section><sectionclass="tsd-panel tsd-member"><h3class="tsd-anchor-link"id="hangup"><span>hang<wbr/>Up</span><ahref="#hangup"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass=""><divclass="tsd-signature tsd-anchor-link"id="hangup-1"><spanclass="tsd-kind-call-signature">hangUp</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">_peer</span><spanclass="tsd-signature-symbol">:</span><spanclass="tsd-signature-type">PeerId</span><spanclass="tsd-signature-symbol">|</span><spanclass="tsd-signature-type">MultiaddrInput</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">:</span><spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><spanclass="tsd-signature-type">boolean</span><spanclass="tsd-signature-symbol">></span><ahref="#hangup-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></div><divclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Hang up a connection to a peer</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><spanclass="tsd-kind-parameter">_peer</span>: <spanclass="tsd-signature-type">PeerId</span><spanclass="tsd-signature-symbol">|</span><spanclass="tsd-signature-type">MultiaddrInput</span></span></li></ul></div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><spanclass="tsd-signature-type">boolean</span><spanclass="tsd-signature-symbol">></span></h4><p><code>Promise</code> that will resolve to <code>true</code> if the connection is hung up, <code>false</code> otherwise</p>
<divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><p>Implementation of <ahref="../interfaces/_waku_interfaces.IWaku.html">IWaku</a>.<ahref="../interfaces/_waku_interfaces.IWaku.html#hangup">hangUp</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/9a1e9cecc5b2a96d1b9bffbdc4a1c4a53929d1a9/packages/utils/src/common/mock_node.ts#L135">common/mock_node.ts:135</a></li></ul></aside></div></li></ul></section><sectionclass="tsd-panel tsd-member"><h3class="tsd-anchor-link"id="isconnected"><span>is<wbr/>Connected</span><ahref="#isconnected"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass=""><divclass="tsd-signature tsd-anchor-link"id="isconnected-1"><spanclass="tsd-kind-call-signature">isConnected</span><spanclass="tsd-signature-symbol">()</span><spanclass="tsd-signature-symbol">:</span><spanclass="tsd-signature-type">boolean</span><ahref="#isconnected-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></div><divclass="tsd-description"><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">boolean</span></h4><p><code>true</code> if the node has working connection and <code>false</code> otherwise</p>
<divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><p>Implementation of <ahref="../interfaces/_waku_interfaces.IWaku.html">IWaku</a>.<ahref="../interfaces/_waku_interfaces.IWaku.html#isconnected">isConnected</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/9a1e9cecc5b2a96d1b9bffbdc4a1c4a53929d1a9/packages/utils/src/common/mock_node.ts#L161">common/mock_node.ts:161</a></li></ul></aside></div></li></ul></section><sectionclass="tsd-panel tsd-member"><h3class="tsd-anchor-link"id="isstarted"><span>is<wbr/>Started</span><ahref="#isstarted"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass=""><divclass="tsd-signature tsd-anchor-link"id="isstarted-1"><spanclass="tsd-kind-call-signature">isStarted</span><spanclass="tsd-signature-symbol">()</span><spanclass="tsd-signature-symbol">:</span><spanclass="tsd-signature-type">boolean</span><ahref="#isstarted-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></div><divclass="tsd-description"><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">boolean</span></h4><p><code>true</code> if the node was started and <code>false</code> otherwise</p>
<divclass="tsd-comment tsd-typography"></div><asideclass="tsd-sources"><p>Implementation of <ahref="../interfaces/_waku_interfaces.IWaku.html">IWaku</a>.<ahref="../interfaces/_waku_interfaces.IWaku.html#isstarted">isStarted</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/9a1e9cecc5b2a96d1b9bffbdc4a1c4a53929d1a9/packages/utils/src/common/mock_node.ts#L158">common/mock_node.ts:158</a></li></ul></aside></div></li></ul></section><sectionclass="tsd-panel tsd-member"><h3class="tsd-anchor-link"id="start"><span>start</span><ahref="#start"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass=""><divclass="tsd-signature tsd-anchor-link"id="start-1"><spanclass="tsd-kind-call-signature">start</span><spanclass="tsd-signature-symbol">()</span><spanclass="tsd-signature-symbol">:</span><spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><spanclass="tsd-signature-type">void</span><spanclass="tsd-signature-symbol">></span><ahref="#start-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></div><divclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Starts all services and components related to functionality of Waku node.</p>
</div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><spanclass="tsd-signature-type">void</span><spanclass="tsd-signature-symbol">></span></h4><p><code>Promise</code> that will resolve when started.</p>
</div></div><asideclass="tsd-sources"><p>Implementation of <ahref="../interfaces/_waku_interfaces.IWaku.html">IWaku</a>.<ahref="../interfaces/_waku_interfaces.IWaku.html#start">start</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/9a1e9cecc5b2a96d1b9bffbdc4a1c4a53929d1a9/packages/utils/src/common/mock_node.ts#L138">common/mock_node.ts:138</a></li></ul></aside></div></li></ul></section><sectionclass="tsd-panel tsd-member"><h3class="tsd-anchor-link"id="stop"><span>stop</span><ahref="#stop"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass=""><divclass="tsd-signature tsd-anchor-link"id="stop-1"><spanclass="tsd-kind-call-signature">stop</span><spanclass="tsd-signature-symbol">()</span><spanclass="tsd-signature-symbol">:</span><spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><spanclass="tsd-signature-type">void</span><spanclass="tsd-signature-symbol">></span><ahref="#stop-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></div><divclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Stops all recurring processes and services that are needed for functionality of Waku node.</p>
</div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><spanclass="tsd-signature-type">void</span><spanclass="tsd-signature-symbol">></span></h4><p><code>Promise</code> that resolves when stopped.</p>
</div></div><asideclass="tsd-sources"><p>Implementation of <ahref="../interfaces/_waku_interfaces.IWaku.html">IWaku</a>.<ahref="../interfaces/_waku_interfaces.IWaku.html#stop">stop</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/9a1e9cecc5b2a96d1b9bffbdc4a1c4a53929d1a9/packages/utils/src/common/mock_node.ts#L141">common/mock_node.ts:141</a></li></ul></aside></div></li></ul></section><sectionclass="tsd-panel tsd-member"><h3class="tsd-anchor-link"id="waitforpeers"><span>wait<wbr/>For<wbr/>Peers</span><ahref="#waitforpeers"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ulclass="tsd-signatures"><liclass=""><divclass="tsd-signature tsd-anchor-link"id="waitforpeers-1"><spanclass="tsd-kind-call-signature">waitForPeers</span><spanclass="tsd-signature-symbol">(</span><spanclass="tsd-kind-parameter">_protocols</span><spanclass="tsd-signature-symbol">?:</span><ahref="../enums/_waku_interfaces.Protocols.html"class="tsd-signature-type tsd-kind-enum">Protocols</a><spanclass="tsd-signature-symbol">[]</span><spanclass="tsd-signature-symbol">,</span><spanclass="tsd-kind-parameter">_timeoutMs</span><spanclass="tsd-signature-symbol">?:</span><spanclass="tsd-signature-type">number</span><spanclass="tsd-signature-symbol">)</span><spanclass="tsd-signature-symbol">:</span><spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><spanclass="tsd-signature-type">void</span><spanclass="tsd-signature-symbol">></span><ahref="#waitforpeers-1"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></div><divclass="tsd-description"><divclass="tsd-comment tsd-typography"><p>Resolves when Waku successfully gains connection to a remote peers that fits provided requirements.
Must be used after attempting to connect to nodes, using <ahref="../interfaces/_waku_interfaces.IWaku.html#dial"class="tsd-kind-method">IWaku.dial</a> or
if was bootstrapped by using IPeerExchange or DnsDiscoveryComponents.</p>
</div><divclass="tsd-parameters"><h4class="tsd-parameters-title">Parameters</h4><ulclass="tsd-parameter-list"><li><span><codeclass="tsd-tag">Optional</code><spanclass="tsd-kind-parameter">_protocols</span>: <ahref="../enums/_waku_interfaces.Protocols.html"class="tsd-signature-type tsd-kind-enum">Protocols</a><spanclass="tsd-signature-symbol">[]</span></span></li><li><span><codeclass="tsd-tag">Optional</code><spanclass="tsd-kind-parameter">_timeoutMs</span>: <spanclass="tsd-signature-type">number</span></span></li></ul></div><h4class="tsd-returns-title">Returns <spanclass="tsd-signature-type">Promise</span><spanclass="tsd-signature-symbol"><</span><spanclass="tsd-signature-type">void</span><spanclass="tsd-signature-symbol">></span></h4><p><code>Promise</code> that <strong>resolves</strong> if all desired protocols are fulfilled by
at least one remote peer, <strong>rejects</strong> if the timeoutMs is reached</p>
<divclass="tsd-comment tsd-typography"><divclass="tsd-tag-throws"><h4class="tsd-anchor-link"id="throws-2">Throws<ahref="#throws-2"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>If passing a protocol that is not mounted or Waku node is not started</p>
</div><divclass="tsd-tag-example"><h4class="tsd-anchor-link"id="example-9">Example<ahref="#example-9"aria-label="Permalink"class="tsd-anchor-icon"><svgviewBox="0 0 24 24"aria-hidden="true"><usehref="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><codeclass="typescript"><spanclass="hl-8">try</span><spanclass="hl-1"> {</span><br/><spanclass="hl-1"></span><spanclass="hl-3">// let's wait for at least one LightPush node and timeout in 1 second</span><br/><spanclass="hl-1"></span><spanclass="hl-8">await</span><spanclass="hl-1"></span><spanclass="hl-5">waku</span><spanclass="hl-1">.</span><spanclass="hl-0">waitForPeers</span><spanclass="hl-1">([</span><spanclass="hl-5">Protocols</span><spanclass="hl-1">.</span><spanclass="hl-5">LightPush</span><spanclass="hl-1">], </span><spanclass="hl-9">1000</span><spanclass="hl-1">);</span><br/><spanclass="hl-1">} </span><spanclass="hl-8">catch</span><spanclass="hl-1">(</span><spanclass="hl-5">e</span><spanclass="hl-1">) {</span><br/><spanclass="hl-1"></span><spanclass="hl-5">waku</span><spanclass="hl-1">.</span><spanclass="hl-0">isConnected</span><spanclass="hl-1">() === </span><spanclass="hl-4">false</span><spanclass="hl-1">;</span><br/><spanclass="hl-1"></span><spanclass="hl-5">console</span><spanclass="hl-1">.</span><spanclass="hl-0">error</span><spanclass="hl-1">(</span><spanclass="hl-2">"Failed to connect due to"</span><spanclass="hl-1">, </span><spanclass="hl-5">e</span><spanclass="hl-1">);</span><br/><spanclass="hl-1">}</span><br/><br/><spanclass="hl-5">waku</span><spanclass="hl-1">.</span><spanclass="hl-0">isConnected</span><spanclass="hl-1">() === </span><spanclass="hl-4">true</span><spanclass="hl-1">;</span>