</div></section></div></details></section></section><detailsclass="tsd-panel-group tsd-member-group tsd-accordion"open><summaryclass="tsd-accordion-summary"data-key="section-Properties"><svgwidth="20"height="20"viewBox="0 0 24 24"fill="none"aria-hidden="true"><usehref="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Properties</h2></summary><section><sectionclass="tsd-panel tsd-member tsd-is-inherited"><h3class="tsd-anchor-link"id="events"><span>events</span><ahref="#events"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">events</span><spanclass="tsd-signature-symbol">:</span><ahref="../types/_waku_interfaces.IWakuEventEmitter.html"class="tsd-signature-type tsd-kind-type-alias">IWakuEventEmitter</a></div><divclass="tsd-comment tsd-typography"><p>Emits events related to the Waku node.
Those are:</p>
<ul>
<li>WakuEvent.Connection</li>
<li>WakuEvent.Health</li>
</ul>
</div><divclass="tsd-comment tsd-typography"><divclass="tsd-tag-example"><h4class="tsd-anchor-link"id="example">Example<ahref="#example"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-5">waku</span><spanclass="hl-1">.</span><spanclass="hl-5">events</span><spanclass="hl-1">.</span><spanclass="hl-0">addEventListener</span><spanclass="hl-1">(</span><spanclass="hl-5">WakuEvent</span><spanclass="hl-1">.</span><spanclass="hl-5">Connection</span><spanclass="hl-1">, (</span><spanclass="hl-5">event</span><spanclass="hl-1">) </span><spanclass="hl-4">=></span><spanclass="hl-1"> {</span><br/><spanclass="hl-1"></span><spanclass="hl-5">console</span><spanclass="hl-1">.</span><spanclass="hl-0">log</span><spanclass="hl-1">(</span><spanclass="hl-5">event</span><spanclass="hl-1">.</span><spanclass="hl-5">detail</span><spanclass="hl-1">); </span><spanclass="hl-3">// true if connected, false if disconnected</span><br/><spanclass="hl-1">});</span>
</code><buttontype="button">Copy</button></pre>
</div></div><asideclass="tsd-sources"><p>Inherited from <ahref="_waku_interfaces.IWaku.html">IWaku</a>.<ahref="_waku_interfaces.IWaku.html#events">events</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/d48b5805e9cf33df3d4d76fdbc5e840964eb249c/packages/interfaces/src/waku.ts#L79">packages/interfaces/src/waku.ts:79</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><h3class="tsd-anchor-link"id="filter"><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>Overrides <ahref="_waku_interfaces.IWaku.html">IWaku</a>.<ahref="_waku_interfaces.IWaku.html#filter">filter</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/d48b5805e9cf33df3d4d76fdbc5e840964eb249c/packages/interfaces/src/waku.ts#L273">packages/interfaces/src/waku.ts:273</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member tsd-is-inherited"><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><divclass="tsd-signature"><spanclass="tsd-kind-property">health</span><spanclass="tsd-signature-symbol">:</span><ahref="../enums/_waku_interfaces.HealthStatus.html"class="tsd-signature-type tsd-kind-enum">HealthStatus</a></div><divclass="tsd-comment tsd-typography"><p>The health status can be one of three states:</p>
<ul>
<li>Unhealthy: No peer connections</li>
<li>MinimallyHealthy: At least 1 peer supporting both Filter and LightPush protocols</li>
<li>SufficientlyHealthy: At least 2 peers supporting both Filter and LightPush protocols</li>
</div></div><asideclass="tsd-sources"><p>Inherited from <ahref="_waku_interfaces.IWaku.html">IWaku</a>.<ahref="_waku_interfaces.IWaku.html#health">health</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/d48b5805e9cf33df3d4d76fdbc5e840964eb249c/packages/interfaces/src/waku.ts#L102">packages/interfaces/src/waku.ts:102</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member tsd-is-inherited"><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><divclass="tsd-signature"><spanclass="tsd-kind-property">libp2p</span><spanclass="tsd-signature-symbol">:</span><ahref="../types/_waku_interfaces.Libp2p.html"class="tsd-signature-type tsd-kind-type-alias">Libp2p</a></div><asideclass="tsd-sources"><p>Inherited from <ahref="_waku_interfaces.IWaku.html">IWaku</a>.<ahref="_waku_interfaces.IWaku.html#libp2p">libp2p</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/d48b5805e9cf33df3d4d76fdbc5e840964eb249c/packages/interfaces/src/waku.ts#L60">packages/interfaces/src/waku.ts:60</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member"><h3class="tsd-anchor-link"id="lightpush"><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>Overrides <ahref="_waku_interfaces.IWaku.html">IWaku</a>.<ahref="_waku_interfaces.IWaku.html#lightpush">lightPush</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/d48b5805e9cf33df3d4d76fdbc5e840964eb249c/packages/interfaces/src/waku.ts#L274">packages/interfaces/src/waku.ts:274</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member tsd-is-inherited"><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><divclass="tsd-signature"><spanclass="tsd-kind-property">peerId</span><spanclass="tsd-signature-symbol">:</span><spanclass="tsd-signature-type">PeerId</span></div><divclass="tsd-comment tsd-typography"><p>Returns a unique identifier for a node on the network.</p>
</div></div><asideclass="tsd-sources"><p>Inherited from <ahref="_waku_interfaces.IWaku.html">IWaku</a>.<ahref="_waku_interfaces.IWaku.html#peerid">peerId</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/d48b5805e9cf33df3d4d76fdbc5e840964eb249c/packages/interfaces/src/waku.ts#L89">packages/interfaces/src/waku.ts:89</a></li></ul></aside></section><sectionclass="tsd-panel tsd-member tsd-is-inherited"><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><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><divclass="tsd-comment tsd-typography"><p>Configuration for the decoder</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <ahref="_waku_interfaces.IDecoder.html"class="tsd-signature-type tsd-kind-interface">IDecoder</a><spanclass="tsd-signature-symbol"><</span><ahref="_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>
</code><buttontype="button">Copy</button></pre>
</div></div><asideclass="tsd-sources"><p>Inherited from <ahref="_waku_interfaces.IWaku.html">IWaku</a>.<ahref="_waku_interfaces.IWaku.html#createdecoder">createDecoder</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/d48b5805e9cf33df3d4d76fdbc5e840964eb249c/packages/interfaces/src/waku.ts#L222">packages/interfaces/src/waku.ts:222</a></li></ul></aside></div></li></ul></section><sectionclass="tsd-panel tsd-member tsd-is-inherited"><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 tsd-is-inherited"><liclass="tsd-is-inherited"><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="_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>
</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><divclass="tsd-comment tsd-typography"><p>Configuration for the encoder including content topic and optionally shard information and ephemeral flag</p>
</div><divclass="tsd-comment tsd-typography"></div></li></ul></div><h4class="tsd-returns-title">Returns <ahref="_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>
</code><buttontype="button">Copy</button></pre>
</div></div><asideclass="tsd-sources"><p>Inherited from <ahref="_waku_interfaces.IWaku.html">IWaku</a>.<ahref="_waku_interfaces.IWaku.html#createencoder">createEncoder</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/d48b5805e9cf33df3d4d76fdbc5e840964eb249c/packages/interfaces/src/waku.ts#L252">packages/interfaces/src/waku.ts:252</a></li></ul></aside></div></li></ul></section><sectionclass="tsd-panel tsd-member tsd-is-inherited"><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 tsd-is-inherited"><liclass="tsd-is-inherited"><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><divclass="tsd-comment tsd-typography"><p>information to use for dialing</p>
</div><divclass="tsd-comment tsd-typography"></div></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><divclass="tsd-comment tsd-typography"><p>array of Waku protocols to be used for dialing. If no provided - will be derived from mounted protocols.</p>
</div><divclass="tsd-comment tsd-typography"></div></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>Inherited from <ahref="_waku_interfaces.IWaku.html">IWaku</a>.<ahref="_waku_interfaces.IWaku.html#dial">dial</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/d48b5805e9cf33df3d4d76fdbc5e840964eb249c/packages/interfaces/src/waku.ts#L129">packages/interfaces/src/waku.ts:129</a></li></ul></aside></div></li></ul></section><sectionclass="tsd-panel tsd-member tsd-is-inherited"><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 tsd-is-inherited"><liclass="tsd-is-inherited"><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>Inherited from <ahref="_waku_interfaces.IWaku.html">IWaku</a>.<ahref="_waku_interfaces.IWaku.html#getconnectedpeers">getConnectedPeers</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/d48b5805e9cf33df3d4d76fdbc5e840964eb249c/packages/interfaces/src/waku.ts#L267">packages/interfaces/src/waku.ts:267</a></li></ul></aside></div></li></ul></section><sectionclass="tsd-panel tsd-member tsd-is-inherited"><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 tsd-is-inherited"><liclass="tsd-is-inherited"><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><divclass="tsd-comment tsd-typography"><p>information to use for hanging up</p>
</div><divclass="tsd-comment tsd-typography"></div></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>Inherited from <ahref="_waku_interfaces.IWaku.html">IWaku</a>.<ahref="_waku_interfaces.IWaku.html#hangup">hangUp</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/d48b5805e9cf33df3d4d76fdbc5e840964eb249c/packages/interfaces/src/waku.ts#L138">packages/interfaces/src/waku.ts:138</a></li></ul></aside></div></li></ul></section><sectionclass="tsd-panel tsd-member tsd-is-inherited"><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 tsd-is-inherited"><liclass="tsd-is-inherited"><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>Inherited from <ahref="_waku_interfaces.IWaku.html">IWaku</a>.<ahref="_waku_interfaces.IWaku.html#isconnected">isConnected</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/d48b5805e9cf33df3d4d76fdbc5e840964eb249c/packages/interfaces/src/waku.ts#L262">packages/interfaces/src/waku.ts:262</a></li></ul></aside></div></li></ul></section><sectionclass="tsd-panel tsd-member tsd-is-inherited"><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 tsd-is-inherited"><liclass="tsd-is-inherited"><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>Inherited from <ahref="_waku_interfaces.IWaku.html">IWaku</a>.<ahref="_waku_interfaces.IWaku.html#isstarted">isStarted</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/d48b5805e9cf33df3d4d76fdbc5e840964eb249c/packages/interfaces/src/waku.ts#L257">packages/interfaces/src/waku.ts:257</a></li></ul></aside></div></li></ul></section><sectionclass="tsd-panel tsd-member tsd-is-inherited"><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 tsd-is-inherited"><liclass="tsd-is-inherited"><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>Inherited from <ahref="_waku_interfaces.IWaku.html">IWaku</a>.<ahref="_waku_interfaces.IWaku.html#start">start</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/d48b5805e9cf33df3d4d76fdbc5e840964eb249c/packages/interfaces/src/waku.ts#L152">packages/interfaces/src/waku.ts:152</a></li></ul></aside></div></li></ul></section><sectionclass="tsd-panel tsd-member tsd-is-inherited"><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 tsd-is-inherited"><liclass="tsd-is-inherited"><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>Inherited from <ahref="_waku_interfaces.IWaku.html">IWaku</a>.<ahref="_waku_interfaces.IWaku.html#stop">stop</a></p><ul><li>Defined in <ahref="https://github.com/waku-org/js-waku/blob/d48b5805e9cf33df3d4d76fdbc5e840964eb249c/packages/interfaces/src/waku.ts#L166">packages/interfaces/src/waku.ts:166</a></li></ul></aside></div></li></ul></section><sectionclass="tsd-panel tsd-member tsd-is-inherited"><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 tsd-is-inherited"><liclass="tsd-is-inherited"><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="_waku_interfaces.IWaku.html#dial"class="tsd-kind-method">IWaku.dial</a> or
if was bootstrapped by using <ahref="_waku_interfaces.IPeerExchange.html"class="tsd-kind-interface">IPeerExchange</a> or <ahref="_waku_interfaces.DnsDiscoveryComponents.html"class="tsd-kind-interface">DnsDiscoveryComponents</a>.</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><divclass="tsd-comment tsd-typography"><p>Protocols that need to be enabled by remote peers</p>
</div><divclass="tsd-comment tsd-typography"></div></li><li><span><codeclass="tsd-tag">Optional</code><spanclass="tsd-kind-parameter">timeoutMs</span>: <spanclass="tsd-signature-type">number</span></span><divclass="tsd-comment tsd-typography"><p>Timeout value in milliseconds after which promise rejects</p>
</div><divclass="tsd-comment tsd-typography"></div></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>