js-waku/interfaces/_waku_interfaces.RelayNode.html
status-im-auto f9515dd0f6 Updates
2025-11-21 15:05:42 +00:00

99 lines
66 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>RelayNode | Documentation</title><meta name="description" content="Documentation for Documentation"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">Documentation</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../modules/_waku_interfaces.html">@waku/interfaces</a></li><li><a href="" aria-current="page">RelayNode</a></li></ul><h1>Interface RelayNode</h1></div><div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">RelayNode</span> <span class="tsd-signature-symbol">{</span><br/>    <a class="tsd-kind-property" href="#events">events</a><span class="tsd-signature-symbol">:</span> <a href="../types/_waku_interfaces.IWakuEventEmitter.html" class="tsd-signature-type tsd-kind-type-alias">IWakuEventEmitter</a><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-property" href="#filter">filter</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-property" href="#health">health</a><span class="tsd-signature-symbol">:</span> <a href="../enums/_waku_interfaces.HealthStatus.html" class="tsd-signature-type tsd-kind-enum">HealthStatus</a><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-property" href="#libp2p">libp2p</a><span class="tsd-signature-symbol">:</span> <a href="../types/_waku_interfaces.Libp2p.html" class="tsd-signature-type tsd-kind-type-alias">Libp2p</a><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-property" href="#lightpush">lightPush</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-property" href="#peerid">peerId</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">PeerId</span><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-property" href="#protocols">protocols</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-property" href="#relay">relay</a><span class="tsd-signature-symbol">:</span> <a href="../types/_waku_interfaces.IRelay.html" class="tsd-signature-type tsd-kind-type-alias">IRelay</a><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-property" href="#store">store</a><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-call-signature" href="#createdecoder-1">createDecoder</a><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">params</span><span class="tsd-signature-symbol">:</span> <a href="../types/_waku_interfaces.CreateDecoderParams.html" class="tsd-signature-type tsd-kind-type-alias">CreateDecoderParams</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="_waku_interfaces.IDecoder.html" class="tsd-signature-type tsd-kind-interface">IDecoder</a><span class="tsd-signature-symbol">&lt;</span><a href="_waku_interfaces.IDecodedMessage.html" class="tsd-signature-type tsd-kind-interface">IDecodedMessage</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-call-signature" href="#createencoder-1">createEncoder</a><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">params</span><span class="tsd-signature-symbol">:</span> <a href="../types/_waku_interfaces.CreateEncoderParams.html" class="tsd-signature-type tsd-kind-type-alias">CreateEncoderParams</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="_waku_interfaces.IEncoder.html" class="tsd-signature-type tsd-kind-interface">IEncoder</a><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-call-signature" href="#dial-1">dial</a><span class="tsd-signature-symbol">(</span><br/>        <span class="tsd-kind-parameter">peer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">PeerId</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">MultiaddrInput</span><span class="tsd-signature-symbol">,</span><br/>        <span class="tsd-kind-parameter">protocols</span><span class="tsd-signature-symbol">?:</span> <a href="../enums/_waku_interfaces.Protocols.html" class="tsd-signature-type tsd-kind-enum">Protocols</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Stream</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-call-signature" href="#getconnectedpeers-1">getConnectedPeers</a><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Peer</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-call-signature" href="#hangup-1">hangUp</a><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">peer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">PeerId</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">MultiaddrInput</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-call-signature" href="#isconnected-1">isConnected</a><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-call-signature" href="#isstarted-1">isStarted</a><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-call-signature" href="#start-1">start</a><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-call-signature" href="#stop-1">stop</a><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">;</span><br/>    <a class="tsd-kind-call-signature" href="#waitforpeers-1">waitForPeers</a><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">protocols</span><span class="tsd-signature-symbol">?:</span> <a href="../enums/_waku_interfaces.Protocols.html" class="tsd-signature-type tsd-kind-enum">Protocols</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">timeoutMs</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></div><section class="tsd-panel tsd-hierarchy" data-refl="6748"><h4>Hierarchy (<a href="../hierarchy.html#@waku/interfaces.RelayNode">View Summary</a>)</h4><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><a href="_waku_interfaces.IWaku.html" class="tsd-signature-type tsd-kind-interface">IWaku</a><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><span class="tsd-hierarchy-target">RelayNode</span></li></ul></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/waku-org/js-waku/blob/788f7e62c5141d10d013c91c28d549188d165762/packages/interfaces/src/waku.ts#L277">packages/interfaces/src/waku.ts:277</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h5 class="tsd-index-heading uppercase">Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="#events" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>events</span></a>
<a href="#filter" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>filter</span></a>
<a href="#health" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>health</span></a>
<a href="#libp2p" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>libp2p</span></a>
<a href="#lightpush" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>light<wbr/>Push</span></a>
<a href="#peerid" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>peer<wbr/>Id</span></a>
<a href="#protocols" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>protocols</span></a>
<a href="#relay" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>relay</span></a>
<a href="#store" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>store</span></a>
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="#createdecoder" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>create<wbr/>Decoder</span></a>
<a href="#createencoder" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>create<wbr/>Encoder</span></a>
<a href="#dial" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>dial</span></a>
<a href="#getconnectedpeers" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Connected<wbr/>Peers</span></a>
<a href="#hangup" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>hang<wbr/>Up</span></a>
<a href="#isconnected" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>is<wbr/>Connected</span></a>
<a href="#isstarted" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>is<wbr/>Started</span></a>
<a href="#start" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>start</span></a>
<a href="#stop" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>stop</span></a>
<a href="#waitforpeers" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Peers</span></a>
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Properties</h2></summary><section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="events"><span>events</span><a href="#events" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">events</span><span class="tsd-signature-symbol">:</span> <a href="../types/_waku_interfaces.IWakuEventEmitter.html" class="tsd-signature-type tsd-kind-type-alias">IWakuEventEmitter</a></div><div class="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><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example">Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-5">waku</span><span class="hl-1">.</span><span class="hl-5">events</span><span class="hl-1">.</span><span class="hl-0">addEventListener</span><span class="hl-1">(</span><span class="hl-5">WakuEvent</span><span class="hl-1">.</span><span class="hl-5">Connection</span><span class="hl-1">, (</span><span class="hl-5">event</span><span class="hl-1">) </span><span class="hl-4">=&gt;</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">event</span><span class="hl-1">.</span><span class="hl-5">detail</span><span class="hl-1">); </span><span class="hl-3">// true if connected, false if disconnected</span><br/><span class="hl-1">});</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><p>Inherited from <a href="_waku_interfaces.IWaku.html">IWaku</a>.<a href="_waku_interfaces.IWaku.html#events">events</a></p><ul><li>Defined in <a href="https://github.com/waku-org/js-waku/blob/788f7e62c5141d10d013c91c28d549188d165762/packages/interfaces/src/waku.ts#L79">packages/interfaces/src/waku.ts:79</a></li></ul></aside></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="filter"><span>filter</span><a href="#filter" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">filter</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span></div><aside class="tsd-sources"><p>Overrides <a href="_waku_interfaces.IWaku.html">IWaku</a>.<a href="_waku_interfaces.IWaku.html#filter">filter</a></p><ul><li>Defined in <a href="https://github.com/waku-org/js-waku/blob/788f7e62c5141d10d013c91c28d549188d165762/packages/interfaces/src/waku.ts#L280">packages/interfaces/src/waku.ts:280</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="health"><span>health</span><a href="#health" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">health</span><span class="tsd-signature-symbol">:</span> <a href="../enums/_waku_interfaces.HealthStatus.html" class="tsd-signature-type tsd-kind-enum">HealthStatus</a></div><div class="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>
</ul>
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-1">Example<a href="#example-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">waku</span><span class="hl-1">.</span><span class="hl-5">health</span><span class="hl-1">); </span><span class="hl-3">// &#39;Unhealthy&#39;</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><p>Inherited from <a href="_waku_interfaces.IWaku.html">IWaku</a>.<a href="_waku_interfaces.IWaku.html#health">health</a></p><ul><li>Defined in <a href="https://github.com/waku-org/js-waku/blob/788f7e62c5141d10d013c91c28d549188d165762/packages/interfaces/src/waku.ts#L102">packages/interfaces/src/waku.ts:102</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="libp2p"><span>libp2p</span><a href="#libp2p" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">libp2p</span><span class="tsd-signature-symbol">:</span> <a href="../types/_waku_interfaces.Libp2p.html" class="tsd-signature-type tsd-kind-type-alias">Libp2p</a></div><aside class="tsd-sources"><p>Inherited from <a href="_waku_interfaces.IWaku.html">IWaku</a>.<a href="_waku_interfaces.IWaku.html#libp2p">libp2p</a></p><ul><li>Defined in <a href="https://github.com/waku-org/js-waku/blob/788f7e62c5141d10d013c91c28d549188d165762/packages/interfaces/src/waku.ts#L60">packages/interfaces/src/waku.ts:60</a></li></ul></aside></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="lightpush"><span>light<wbr/>Push</span><a href="#lightpush" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">lightPush</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span></div><aside class="tsd-sources"><p>Overrides <a href="_waku_interfaces.IWaku.html">IWaku</a>.<a href="_waku_interfaces.IWaku.html#lightpush">lightPush</a></p><ul><li>Defined in <a href="https://github.com/waku-org/js-waku/blob/788f7e62c5141d10d013c91c28d549188d165762/packages/interfaces/src/waku.ts#L281">packages/interfaces/src/waku.ts:281</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="peerid"><span>peer<wbr/>Id</span><a href="#peerid" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">peerId</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">PeerId</span></div><div class="tsd-comment tsd-typography"><p>Returns a unique identifier for a node on the network.</p>
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-2">Example<a href="#example-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">waku</span><span class="hl-1">.</span><span class="hl-5">peerId</span><span class="hl-1">); </span><span class="hl-3">// 12D3KooWNmk9yXHfHJ4rUduRqD1TCTHkNFMPF9WP2dqWpZDL4aUb</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><p>Inherited from <a href="_waku_interfaces.IWaku.html">IWaku</a>.<a href="_waku_interfaces.IWaku.html#peerid">peerId</a></p><ul><li>Defined in <a href="https://github.com/waku-org/js-waku/blob/788f7e62c5141d10d013c91c28d549188d165762/packages/interfaces/src/waku.ts#L89">packages/interfaces/src/waku.ts:89</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="protocols"><span>protocols</span><a href="#protocols" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">protocols</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></div><div class="tsd-comment tsd-typography"><p>Returns a list of supported protocols.</p>
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-3">Example<a href="#example-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">waku</span><span class="hl-1">.</span><span class="hl-5">protocols</span><span class="hl-1">); </span><span class="hl-3">// [&#39;/ipfs/id/1.0.0&#39;, &#39;/ipfs/ping/1.0.0&#39;, &#39;/vac/waku/filter-push/2.0.0-beta1&#39;, &#39;/vac/waku/metadata/1.0.0&#39;]</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><p>Inherited from <a href="_waku_interfaces.IWaku.html">IWaku</a>.<a href="_waku_interfaces.IWaku.html#protocols">protocols</a></p><ul><li>Defined in <a href="https://github.com/waku-org/js-waku/blob/788f7e62c5141d10d013c91c28d549188d165762/packages/interfaces/src/waku.ts#L112">packages/interfaces/src/waku.ts:112</a></li></ul></aside></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="relay"><span>relay</span><a href="#relay" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">relay</span><span class="tsd-signature-symbol">:</span> <a href="../types/_waku_interfaces.IRelay.html" class="tsd-signature-type tsd-kind-type-alias">IRelay</a></div><aside class="tsd-sources"><p>Overrides <a href="_waku_interfaces.IWaku.html">IWaku</a>.<a href="_waku_interfaces.IWaku.html#relay">relay</a></p><ul><li>Defined in <a href="https://github.com/waku-org/js-waku/blob/788f7e62c5141d10d013c91c28d549188d165762/packages/interfaces/src/waku.ts#L278">packages/interfaces/src/waku.ts:278</a></li></ul></aside></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="store"><span>store</span><a href="#store" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">store</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span></div><aside class="tsd-sources"><p>Overrides <a href="_waku_interfaces.IWaku.html">IWaku</a>.<a href="_waku_interfaces.IWaku.html#store">store</a></p><ul><li>Defined in <a href="https://github.com/waku-org/js-waku/blob/788f7e62c5141d10d013c91c28d549188d165762/packages/interfaces/src/waku.ts#L279">packages/interfaces/src/waku.ts:279</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Methods</h2></summary><section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="createdecoder"><span>create<wbr/>Decoder</span><a href="#createdecoder" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited"><li class="tsd-is-inherited"><div class="tsd-signature tsd-anchor-link" id="createdecoder-1"><span class="tsd-kind-call-signature">createDecoder</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">params</span><span class="tsd-signature-symbol">:</span> <a href="../types/_waku_interfaces.CreateDecoderParams.html" class="tsd-signature-type tsd-kind-type-alias">CreateDecoderParams</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="_waku_interfaces.IDecoder.html" class="tsd-signature-type tsd-kind-interface">IDecoder</a><span class="tsd-signature-symbol">&lt;</span><a href="_waku_interfaces.IDecodedMessage.html" class="tsd-signature-type tsd-kind-interface">IDecodedMessage</a><span class="tsd-signature-symbol">&gt;</span><a href="#createdecoder-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="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><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">params</span>: <a href="../types/_waku_interfaces.CreateDecoderParams.html" class="tsd-signature-type tsd-kind-type-alias">CreateDecoderParams</a></span><div class="tsd-comment tsd-typography"><p>Configuration for the decoder</p>
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="_waku_interfaces.IDecoder.html" class="tsd-signature-type tsd-kind-interface">IDecoder</a><span class="tsd-signature-symbol">&lt;</span><a href="_waku_interfaces.IDecodedMessage.html" class="tsd-signature-type tsd-kind-interface">IDecodedMessage</a><span class="tsd-signature-symbol">&gt;</span></h4><p>A decoder instance configured for the specified content topic</p>
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws">Throws<a href="#throws" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>If the shard configuration is incompatible with the node's network settings</p>
</div><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-4">Example<a href="#example-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">// Create a decoder with default network shard settings</span><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-7">decoder</span><span class="hl-1"> = </span><span class="hl-5">waku</span><span class="hl-1">.</span><span class="hl-0">createDecoder</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-5">contentTopic:</span><span class="hl-1"> </span><span class="hl-2">&quot;/my-app/1/chat/proto&quot;</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-3">// Create a decoder with custom shard settings</span><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-7">customDecoder</span><span class="hl-1"> = </span><span class="hl-5">waku</span><span class="hl-1">.</span><span class="hl-0">createDecoder</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-5">contentTopic:</span><span class="hl-1"> </span><span class="hl-2">&quot;/my-app/1/chat/proto&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">shardInfo:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">clusterId:</span><span class="hl-1"> </span><span class="hl-9">1</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">shard:</span><span class="hl-1"> </span><span class="hl-9">5</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">});</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><p>Inherited from <a href="_waku_interfaces.IWaku.html">IWaku</a>.<a href="_waku_interfaces.IWaku.html#createdecoder">createDecoder</a></p><ul><li>Defined in <a href="https://github.com/waku-org/js-waku/blob/788f7e62c5141d10d013c91c28d549188d165762/packages/interfaces/src/waku.ts#L222">packages/interfaces/src/waku.ts:222</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="createencoder"><span>create<wbr/>Encoder</span><a href="#createencoder" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited"><li class="tsd-is-inherited"><div class="tsd-signature tsd-anchor-link" id="createencoder-1"><span class="tsd-kind-call-signature">createEncoder</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">params</span><span class="tsd-signature-symbol">:</span> <a href="../types/_waku_interfaces.CreateEncoderParams.html" class="tsd-signature-type tsd-kind-type-alias">CreateEncoderParams</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="_waku_interfaces.IEncoder.html" class="tsd-signature-type tsd-kind-interface">IEncoder</a><a href="#createencoder-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="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><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">params</span>: <a href="../types/_waku_interfaces.CreateEncoderParams.html" class="tsd-signature-type tsd-kind-type-alias">CreateEncoderParams</a></span><div class="tsd-comment tsd-typography"><p>Configuration for the encoder including content topic and optionally shard information and ephemeral flag</p>
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="_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>
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-1">Throws<a href="#throws-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>If the shard configuration is incompatible with the node's network settings</p>
</div><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-5">Example<a href="#example-5" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-3">// Create a basic encoder with default network shard settings</span><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-7">encoder</span><span class="hl-1"> = </span><span class="hl-5">waku</span><span class="hl-1">.</span><span class="hl-0">createEncoder</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-5">contentTopic:</span><span class="hl-1"> </span><span class="hl-2">&quot;/my-app/1/chat/proto&quot;</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-3">// Create an ephemeral encoder (messages won&#39;t be stored by store nodes)</span><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-7">ephemeralEncoder</span><span class="hl-1"> = </span><span class="hl-5">waku</span><span class="hl-1">.</span><span class="hl-0">createEncoder</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-5">contentTopic:</span><span class="hl-1"> </span><span class="hl-2">&quot;/my-app/1/notifications/proto&quot;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">ephemeral:</span><span class="hl-1"> </span><span class="hl-4">true</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">shardInfo:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">clusterId:</span><span class="hl-1"> </span><span class="hl-9">2</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">shardsUnderCluster:</span><span class="hl-1"> </span><span class="hl-9">16</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">});</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><p>Inherited from <a href="_waku_interfaces.IWaku.html">IWaku</a>.<a href="_waku_interfaces.IWaku.html#createencoder">createEncoder</a></p><ul><li>Defined in <a href="https://github.com/waku-org/js-waku/blob/788f7e62c5141d10d013c91c28d549188d165762/packages/interfaces/src/waku.ts#L252">packages/interfaces/src/waku.ts:252</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="dial"><span>dial</span><a href="#dial" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited"><li class="tsd-is-inherited"><div class="tsd-signature tsd-anchor-link" id="dial-1"><span class="tsd-kind-call-signature">dial</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">peer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">PeerId</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">MultiaddrInput</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">protocols</span><span class="tsd-signature-symbol">?:</span> <a href="../enums/_waku_interfaces.Protocols.html" class="tsd-signature-type tsd-kind-enum">Protocols</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Stream</span><span class="tsd-signature-symbol">&gt;</span><a href="#dial-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Dials to the provided peer</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">peer</span>: <span class="tsd-signature-type">PeerId</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">MultiaddrInput</span></span><div class="tsd-comment tsd-typography"><p>information to use for dialing</p>
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">protocols</span>: <a href="../enums/_waku_interfaces.Protocols.html" class="tsd-signature-type tsd-kind-enum">Protocols</a><span class="tsd-signature-symbol">[]</span></span><div class="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><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Stream</span><span class="tsd-signature-symbol">&gt;</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 class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-6">Example<a href="#example-6" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-8">await</span><span class="hl-1"> </span><span class="hl-5">waku</span><span class="hl-1">.</span><span class="hl-0">dial</span><span class="hl-1">(</span><span class="hl-5">remotePeerId</span><span class="hl-1">, [</span><span class="hl-5">Protocols</span><span class="hl-1">.</span><span class="hl-5">LightPush</span><span class="hl-1">]);</span><br/><br/><span class="hl-5">waku</span><span class="hl-1">.</span><span class="hl-0">isConnected</span><span class="hl-1">() === </span><span class="hl-4">true</span><span class="hl-1">;</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><p>Inherited from <a href="_waku_interfaces.IWaku.html">IWaku</a>.<a href="_waku_interfaces.IWaku.html#dial">dial</a></p><ul><li>Defined in <a href="https://github.com/waku-org/js-waku/blob/788f7e62c5141d10d013c91c28d549188d165762/packages/interfaces/src/waku.ts#L129">packages/interfaces/src/waku.ts:129</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="getconnectedpeers"><span>get<wbr/>Connected<wbr/>Peers</span><a href="#getconnectedpeers" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited"><li class="tsd-is-inherited"><div class="tsd-signature tsd-anchor-link" id="getconnectedpeers-1"><span class="tsd-kind-call-signature">getConnectedPeers</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Peer</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span><a href="#getconnectedpeers-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Peer</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></h4><p>an array of all connected peers</p>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="_waku_interfaces.IWaku.html">IWaku</a>.<a href="_waku_interfaces.IWaku.html#getconnectedpeers">getConnectedPeers</a></p><ul><li>Defined in <a href="https://github.com/waku-org/js-waku/blob/788f7e62c5141d10d013c91c28d549188d165762/packages/interfaces/src/waku.ts#L267">packages/interfaces/src/waku.ts:267</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="hangup"><span>hang<wbr/>Up</span><a href="#hangup" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited"><li class="tsd-is-inherited"><div class="tsd-signature tsd-anchor-link" id="hangup-1"><span class="tsd-kind-call-signature">hangUp</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">peer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">PeerId</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">MultiaddrInput</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">&gt;</span><a href="#hangup-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Hang up a connection to a peer</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">peer</span>: <span class="tsd-signature-type">PeerId</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">MultiaddrInput</span></span><div class="tsd-comment tsd-typography"><p>information to use for hanging up</p>
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">&gt;</span></h4><p><code>Promise</code> that will resolve to <code>true</code> if the connection is hung up, <code>false</code> otherwise</p>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="_waku_interfaces.IWaku.html">IWaku</a>.<a href="_waku_interfaces.IWaku.html#hangup">hangUp</a></p><ul><li>Defined in <a href="https://github.com/waku-org/js-waku/blob/788f7e62c5141d10d013c91c28d549188d165762/packages/interfaces/src/waku.ts#L138">packages/interfaces/src/waku.ts:138</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="isconnected"><span>is<wbr/>Connected</span><a href="#isconnected" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited"><li class="tsd-is-inherited"><div class="tsd-signature tsd-anchor-link" id="isconnected-1"><span class="tsd-kind-call-signature">isConnected</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><a href="#isconnected-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><p><code>true</code> if the node has working connection and <code>false</code> otherwise</p>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="_waku_interfaces.IWaku.html">IWaku</a>.<a href="_waku_interfaces.IWaku.html#isconnected">isConnected</a></p><ul><li>Defined in <a href="https://github.com/waku-org/js-waku/blob/788f7e62c5141d10d013c91c28d549188d165762/packages/interfaces/src/waku.ts#L262">packages/interfaces/src/waku.ts:262</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="isstarted"><span>is<wbr/>Started</span><a href="#isstarted" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited"><li class="tsd-is-inherited"><div class="tsd-signature tsd-anchor-link" id="isstarted-1"><span class="tsd-kind-call-signature">isStarted</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><a href="#isstarted-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><p><code>true</code> if the node was started and <code>false</code> otherwise</p>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="_waku_interfaces.IWaku.html">IWaku</a>.<a href="_waku_interfaces.IWaku.html#isstarted">isStarted</a></p><ul><li>Defined in <a href="https://github.com/waku-org/js-waku/blob/788f7e62c5141d10d013c91c28d549188d165762/packages/interfaces/src/waku.ts#L257">packages/interfaces/src/waku.ts:257</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="start"><span>start</span><a href="#start" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited"><li class="tsd-is-inherited"><div class="tsd-signature tsd-anchor-link" id="start-1"><span class="tsd-kind-call-signature">start</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#start-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Starts all services and components related to functionality of Waku node.</p>
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><p><code>Promise</code> that will resolve when started.</p>
<div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-7">Example<a href="#example-7" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-8">await</span><span class="hl-1"> </span><span class="hl-5">waku</span><span class="hl-1">.</span><span class="hl-0">start</span><span class="hl-1">();</span><br/><br/><span class="hl-5">waku</span><span class="hl-1">.</span><span class="hl-0">isStarted</span><span class="hl-1">() === </span><span class="hl-4">true</span><span class="hl-1">;</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><p>Inherited from <a href="_waku_interfaces.IWaku.html">IWaku</a>.<a href="_waku_interfaces.IWaku.html#start">start</a></p><ul><li>Defined in <a href="https://github.com/waku-org/js-waku/blob/788f7e62c5141d10d013c91c28d549188d165762/packages/interfaces/src/waku.ts#L152">packages/interfaces/src/waku.ts:152</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="stop"><span>stop</span><a href="#stop" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited"><li class="tsd-is-inherited"><div class="tsd-signature tsd-anchor-link" id="stop-1"><span class="tsd-kind-call-signature">stop</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#stop-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Stops all recurring processes and services that are needed for functionality of Waku node.</p>
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><p><code>Promise</code> that resolves when stopped.</p>
<div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-8">Example<a href="#example-8" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-8">await</span><span class="hl-1"> </span><span class="hl-5">waku</span><span class="hl-1">.</span><span class="hl-0">stop</span><span class="hl-1">();</span><br/><br/><span class="hl-5">waku</span><span class="hl-1">.</span><span class="hl-5">isStarted</span><span class="hl-1"> === </span><span class="hl-4">false</span><span class="hl-1">;</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><p>Inherited from <a href="_waku_interfaces.IWaku.html">IWaku</a>.<a href="_waku_interfaces.IWaku.html#stop">stop</a></p><ul><li>Defined in <a href="https://github.com/waku-org/js-waku/blob/788f7e62c5141d10d013c91c28d549188d165762/packages/interfaces/src/waku.ts#L166">packages/interfaces/src/waku.ts:166</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="waitforpeers"><span>wait<wbr/>For<wbr/>Peers</span><a href="#waitforpeers" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited"><li class="tsd-is-inherited"><div class="tsd-signature tsd-anchor-link" id="waitforpeers-1"><span class="tsd-kind-call-signature">waitForPeers</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">protocols</span><span class="tsd-signature-symbol">?:</span> <a href="../enums/_waku_interfaces.Protocols.html" class="tsd-signature-type tsd-kind-enum">Protocols</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">timeoutMs</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#waitforpeers-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="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 <a href="_waku_interfaces.IWaku.html#dial" class="tsd-kind-method">IWaku.dial</a> or
if was bootstrapped by using <a href="_waku_interfaces.IPeerExchange.html" class="tsd-kind-interface">IPeerExchange</a> or <a href="_waku_interfaces.DnsDiscoveryComponents.html" class="tsd-kind-interface">DnsDiscoveryComponents</a>.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">protocols</span>: <a href="../enums/_waku_interfaces.Protocols.html" class="tsd-signature-type tsd-kind-enum">Protocols</a><span class="tsd-signature-symbol">[]</span></span><div class="tsd-comment tsd-typography"><p>Protocols that need to be enabled by remote peers</p>
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">timeoutMs</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>Timeout value in milliseconds after which promise rejects</p>
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</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>
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-2">Throws<a href="#throws-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../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><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-9">Example<a href="#example-9" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-8">try</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-3">// let&#39;s wait for at least one LightPush node and timeout in 1 second</span><br/><span class="hl-1"> </span><span class="hl-8">await</span><span class="hl-1"> </span><span class="hl-5">waku</span><span class="hl-1">.</span><span class="hl-0">waitForPeers</span><span class="hl-1">([</span><span class="hl-5">Protocols</span><span class="hl-1">.</span><span class="hl-5">LightPush</span><span class="hl-1">], </span><span class="hl-9">1000</span><span class="hl-1">);</span><br/><span class="hl-1">} </span><span class="hl-8">catch</span><span class="hl-1">(</span><span class="hl-5">e</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-5">waku</span><span class="hl-1">.</span><span class="hl-0">isConnected</span><span class="hl-1">() === </span><span class="hl-4">false</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">error</span><span class="hl-1">(</span><span class="hl-2">&quot;Failed to connect due to&quot;</span><span class="hl-1">, </span><span class="hl-5">e</span><span class="hl-1">);</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-5">waku</span><span class="hl-1">.</span><span class="hl-0">isConnected</span><span class="hl-1">() === </span><span class="hl-4">true</span><span class="hl-1">;</span>
</code><button type="button">Copy</button></pre>
</div></div><aside class="tsd-sources"><p>Inherited from <a href="_waku_interfaces.IWaku.html">IWaku</a>.<a href="_waku_interfaces.IWaku.html#waitforpeers">waitForPeers</a></p><ul><li>Defined in <a href="https://github.com/waku-org/js-waku/blob/788f7e62c5141d10d013c91c28d549188d165762/packages/interfaces/src/waku.ts#L193">packages/interfaces/src/waku.ts:193</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#events" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>events</span></a><a href="#filter"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>filter</span></a><a href="#health" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>health</span></a><a href="#libp2p" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>libp2p</span></a><a href="#lightpush"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>light<wbr/>Push</span></a><a href="#peerid" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>peer<wbr/>Id</span></a><a href="#protocols" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>protocols</span></a><a href="#relay"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>relay</span></a><a href="#store"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>store</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#createdecoder" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>create<wbr/>Decoder</span></a><a href="#createencoder" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>create<wbr/>Encoder</span></a><a href="#dial" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>dial</span></a><a href="#getconnectedpeers" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Connected<wbr/>Peers</span></a><a href="#hangup" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>hang<wbr/>Up</span></a><a href="#isconnected" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>is<wbr/>Connected</span></a><a href="#isstarted" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>is<wbr/>Started</span></a><a href="#start" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>start</span></a><a href="#stop" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>stop</span></a><a href="#waitforpeers" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>wait<wbr/>For<wbr/>Peers</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">Documentation</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>