Update documentation
This commit is contained in:
parent
0ce85985ca
commit
b6880d0741
2
404.html
2
404.html
|
@ -16,7 +16,7 @@
|
|||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<!--
|
||||
Made with Book Theme
|
||||
https://github.com/alex-shpak/hugo-book
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<link rel="alternate" hreflang="pt" href="https://docs.wakuconnect.dev/pt/categories/" title="Categories">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<link rel="alternate" type="application/rss+xml" href="https://docs.wakuconnect.dev/categories/index.xml" title="WakuConnect Docs" />
|
||||
<!--
|
||||
Made with Book Theme
|
||||
|
|
|
@ -21,7 +21,7 @@ Symmetric encryption # Uses SubtleCrypto Web API (browser) or NodeJS' crypt
|
|||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<!--
|
||||
Made with Book Theme
|
||||
https://github.com/alex-shpak/hugo-book
|
||||
|
|
|
@ -27,7 +27,7 @@ Demonstrates:
|
|||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<!--
|
||||
Made with Book Theme
|
||||
https://github.com/alex-shpak/hugo-book
|
||||
|
|
|
@ -25,7 +25,7 @@ The format for content topics is as follows:
|
|||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<!--
|
||||
Made with Book Theme
|
||||
https://github.com/alex-shpak/hugo-book
|
||||
|
|
|
@ -14,14 +14,14 @@ For this guide, we are using a single content topic: /relay-guide/1/chat/proto."
|
|||
<meta property="og:type" content="article" />
|
||||
<meta property="og:url" content="https://docs.wakuconnect.dev/docs/guides/02_relay_receive_send_messages/" /><meta property="article:section" content="docs" />
|
||||
<meta property="article:published_time" content="2021-12-09T14:00:00+01:00" />
|
||||
<meta property="article:modified_time" content="2022-01-05T14:40:44+11:00" />
|
||||
<meta property="article:modified_time" content="2022-01-24T11:54:31+11:00" />
|
||||
|
||||
<title>Receive and Send Messages Using Waku Relay | WakuConnect Docs</title>
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<!--
|
||||
Made with Book Theme
|
||||
https://github.com/alex-shpak/hugo-book
|
||||
|
@ -550,9 +550,9 @@ Check out the <a href="/docs/guides/01_choose_content_topic/">how to choose a co
|
|||
<a class="anchor" href="#create-waku-instance">#</a>
|
||||
</h1>
|
||||
<p>In order to interact with the Waku network, you first need a Waku instance:</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-js" data-lang="js"><span style="color:#66d9ef">import</span> { <span style="color:#a6e22e">Waku</span> } <span style="color:#a6e22e">from</span> <span style="color:#e6db74">'js-waku'</span>;
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-js" data-lang="js"><span style="color:#66d9ef">import</span> {<span style="color:#a6e22e">Waku</span>} <span style="color:#a6e22e">from</span> <span style="color:#e6db74">'js-waku'</span>;
|
||||
|
||||
<span style="color:#66d9ef">const</span> <span style="color:#a6e22e">waku</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">Waku</span>.<span style="color:#a6e22e">create</span>({ <span style="color:#a6e22e">bootstrap</span><span style="color:#f92672">:</span> <span style="color:#66d9ef">true</span> });
|
||||
<span style="color:#66d9ef">const</span> <span style="color:#a6e22e">waku</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">Waku</span>.<span style="color:#a6e22e">create</span>({<span style="color:#a6e22e">bootstrap</span><span style="color:#f92672">:</span> {<span style="color:#66d9ef">default</span><span style="color:#f92672">:</span> <span style="color:#66d9ef">true</span>}});
|
||||
</code></pre></div><p>Passing the <code>bootstrap</code> option will connect your node to predefined Waku nodes.
|
||||
If you want to bootstrap to your own nodes, you can pass an array of multiaddresses instead:</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-js" data-lang="js"><span style="color:#66d9ef">import</span> { <span style="color:#a6e22e">Waku</span> } <span style="color:#a6e22e">from</span> <span style="color:#e6db74">'js-waku'</span>;
|
||||
|
@ -714,9 +714,9 @@ you need to extract the protobuf payload and decode it using <code>protons</code
|
|||
<div class="flex flex-wrap justify-between">
|
||||
|
||||
|
||||
<div><a class="flex align-center" href="https://github.com/vacp2p/docs.wakuconnect.dev/commit/16804bffb9190cf53dbaa7dbea5881d2fa7210be" title='Last modified by F | Jan 5, 2022' target="_blank" rel="noopener">
|
||||
<div><a class="flex align-center" href="https://github.com/vacp2p/docs.wakuconnect.dev/commit/23ba3e482981514df0e2954405c2ea33c751c4d3" title='Last modified by Franck R | Jan 24, 2022' target="_blank" rel="noopener">
|
||||
<img src="/svg/calendar.svg" class="book-icon" alt="Calendar" />
|
||||
<span>Jan 5, 2022</span>
|
||||
<span>Jan 24, 2022</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -12,14 +12,14 @@ Waku Relay is a gossip protocol. As a user, it means that your peers forward you
|
|||
<meta property="og:type" content="article" />
|
||||
<meta property="og:url" content="https://docs.wakuconnect.dev/docs/guides/03_store_retrieve_messages/" /><meta property="article:section" content="docs" />
|
||||
<meta property="article:published_time" content="2021-12-09T14:00:00+01:00" />
|
||||
<meta property="article:modified_time" content="2021-12-09T15:27:58+01:00" />
|
||||
<meta property="article:modified_time" content="2022-01-24T11:54:31+11:00" />
|
||||
|
||||
<title>Retrieve Messages Using Waku Store | WakuConnect Docs</title>
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<!--
|
||||
Made with Book Theme
|
||||
https://github.com/alex-shpak/hugo-book
|
||||
|
@ -558,9 +558,9 @@ Check out the <a href="/docs/guides/01_choose_content_topic/">how to choose a co
|
|||
<a class="anchor" href="#create-waku-instance">#</a>
|
||||
</h1>
|
||||
<p>In order to interact with the Waku network, you first need a Waku instance:</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-js" data-lang="js"><span style="color:#66d9ef">import</span> { <span style="color:#a6e22e">Waku</span> } <span style="color:#a6e22e">from</span> <span style="color:#e6db74">'js-waku'</span>;
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-js" data-lang="js"><span style="color:#66d9ef">import</span> {<span style="color:#a6e22e">Waku</span>} <span style="color:#a6e22e">from</span> <span style="color:#e6db74">'js-waku'</span>;
|
||||
|
||||
<span style="color:#66d9ef">const</span> <span style="color:#a6e22e">wakuNode</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">Waku</span>.<span style="color:#a6e22e">create</span>({ <span style="color:#a6e22e">bootstrap</span><span style="color:#f92672">:</span> <span style="color:#66d9ef">true</span> });
|
||||
<span style="color:#66d9ef">const</span> <span style="color:#a6e22e">wakuNode</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">Waku</span>.<span style="color:#a6e22e">create</span>({<span style="color:#a6e22e">bootstrap</span><span style="color:#f92672">:</span> {<span style="color:#66d9ef">default</span><span style="color:#f92672">:</span> <span style="color:#66d9ef">true</span>}});
|
||||
</code></pre></div><p>Passing the <code>bootstrap</code> option will connect your node to predefined Waku nodes.
|
||||
If you want to bootstrap to your own nodes, you can pass an array of multiaddresses instead:</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-js" data-lang="js"><span style="color:#66d9ef">import</span> { <span style="color:#a6e22e">Waku</span> } <span style="color:#a6e22e">from</span> <span style="color:#e6db74">'js-waku'</span>;
|
||||
|
@ -704,9 +704,9 @@ By default, js-waku sets the timestamp of outgoing message to the current time.<
|
|||
<div class="flex flex-wrap justify-between">
|
||||
|
||||
|
||||
<div><a class="flex align-center" href="https://github.com/vacp2p/docs.wakuconnect.dev/commit/89334e6efdcfefe0894f99f92b4b6352003f3aa3" title='Last modified by Jakub Sokołowski | Dec 9, 2021' target="_blank" rel="noopener">
|
||||
<div><a class="flex align-center" href="https://github.com/vacp2p/docs.wakuconnect.dev/commit/23ba3e482981514df0e2954405c2ea33c751c4d3" title='Last modified by Franck R | Jan 24, 2022' target="_blank" rel="noopener">
|
||||
<img src="/svg/calendar.svg" class="book-icon" alt="Calendar" />
|
||||
<span>Dec 9, 2021</span>
|
||||
<span>Jan 24, 2022</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ See Cryptographic Libraries for more details on the cryptographic libraries used
|
|||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<!--
|
||||
Made with Book Theme
|
||||
https://github.com/alex-shpak/hugo-book
|
||||
|
|
|
@ -25,7 +25,7 @@ Create new keypair # Generate a new keypair to sign your messages:" />
|
|||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<!--
|
||||
Made with Book Theme
|
||||
https://github.com/alex-shpak/hugo-book
|
||||
|
|
|
@ -12,14 +12,14 @@ The Waku Relay protocol sends messages to connected peers but does not provide a
|
|||
<meta property="og:type" content="article" />
|
||||
<meta property="og:url" content="https://docs.wakuconnect.dev/docs/guides/06_light_push_send_messages/" /><meta property="article:section" content="docs" />
|
||||
<meta property="article:published_time" content="2021-12-09T14:00:00+01:00" />
|
||||
<meta property="article:modified_time" content="2021-12-09T15:27:58+01:00" />
|
||||
<meta property="article:modified_time" content="2022-01-24T11:54:31+11:00" />
|
||||
|
||||
<title>Send Messages Using Waku Light Push | WakuConnect Docs</title>
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<!--
|
||||
Made with Book Theme
|
||||
https://github.com/alex-shpak/hugo-book
|
||||
|
@ -551,9 +551,9 @@ Check out the <a href="/docs/guides/01_choose_content_topic/">how to choose a co
|
|||
<a class="anchor" href="#create-waku-instance">#</a>
|
||||
</h1>
|
||||
<p>In order to interact with the Waku network, you first need a Waku instance:</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-js" data-lang="js"><span style="color:#66d9ef">import</span> { <span style="color:#a6e22e">Waku</span> } <span style="color:#a6e22e">from</span> <span style="color:#e6db74">'js-waku'</span>;
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-js" data-lang="js"><span style="color:#66d9ef">import</span> {<span style="color:#a6e22e">Waku</span>} <span style="color:#a6e22e">from</span> <span style="color:#e6db74">'js-waku'</span>;
|
||||
|
||||
<span style="color:#66d9ef">const</span> <span style="color:#a6e22e">wakuNode</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">Waku</span>.<span style="color:#a6e22e">create</span>({ <span style="color:#a6e22e">bootstrap</span><span style="color:#f92672">:</span> <span style="color:#66d9ef">true</span> });
|
||||
<span style="color:#66d9ef">const</span> <span style="color:#a6e22e">wakuNode</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">Waku</span>.<span style="color:#a6e22e">create</span>({<span style="color:#a6e22e">bootstrap</span><span style="color:#f92672">:</span> {<span style="color:#66d9ef">default</span><span style="color:#f92672">:</span> <span style="color:#66d9ef">true</span>}});
|
||||
</code></pre></div><p>Passing the <code>bootstrap</code> option will connect your node to predefined Waku nodes.
|
||||
If you want to bootstrap to your own nodes, you can pass an array of multiaddresses instead:</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-js" data-lang="js"><span style="color:#66d9ef">import</span> { <span style="color:#a6e22e">Waku</span> } <span style="color:#a6e22e">from</span> <span style="color:#e6db74">'js-waku'</span>;
|
||||
|
@ -598,9 +598,9 @@ The peer is selected among the dApp’s connected peers.</p>
|
|||
<div class="flex flex-wrap justify-between">
|
||||
|
||||
|
||||
<div><a class="flex align-center" href="https://github.com/vacp2p/docs.wakuconnect.dev/commit/89334e6efdcfefe0894f99f92b4b6352003f3aa3" title='Last modified by Jakub Sokołowski | Dec 9, 2021' target="_blank" rel="noopener">
|
||||
<div><a class="flex align-center" href="https://github.com/vacp2p/docs.wakuconnect.dev/commit/23ba3e482981514df0e2954405c2ea33c751c4d3" title='Last modified by Franck R | Jan 24, 2022' target="_blank" rel="noopener">
|
||||
<img src="/svg/calendar.svg" class="book-icon" alt="Calendar" />
|
||||
<span>Dec 9, 2021</span>
|
||||
<span>Jan 24, 2022</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -12,14 +12,14 @@ Before starting, you need to choose a Content Topic for your dApp. Check out the
|
|||
<meta property="og:type" content="article" />
|
||||
<meta property="og:url" content="https://docs.wakuconnect.dev/docs/guides/07_reactjs_relay/" /><meta property="article:section" content="docs" />
|
||||
<meta property="article:published_time" content="2021-12-09T14:00:00+01:00" />
|
||||
<meta property="article:modified_time" content="2022-01-10T12:11:15+11:00" />
|
||||
<meta property="article:modified_time" content="2022-01-24T11:54:31+11:00" />
|
||||
|
||||
<title>Receive and Send Messages Using Waku Relay With ReactJS | WakuConnect Docs</title>
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<!--
|
||||
Made with Book Theme
|
||||
https://github.com/alex-shpak/hugo-book
|
||||
|
@ -671,38 +671,38 @@ then you can inspire yourself from this <a href="https://github.com/status-im/wa
|
|||
</h1>
|
||||
<p>In order to interact with the Waku network, you first need a Waku instance.
|
||||
Go to <code>App.js</code> and modify the <code>App</code> function:</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-js" data-lang="js"><span style="color:#66d9ef">import</span> { <span style="color:#a6e22e">Waku</span> } <span style="color:#a6e22e">from</span> <span style="color:#e6db74">'js-waku'</span>;
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-js" data-lang="js"><span style="color:#66d9ef">import</span> {<span style="color:#a6e22e">Waku</span>} <span style="color:#a6e22e">from</span> <span style="color:#e6db74">'js-waku'</span>;
|
||||
<span style="color:#66d9ef">import</span> <span style="color:#f92672">*</span> <span style="color:#a6e22e">as</span> <span style="color:#a6e22e">React</span> <span style="color:#a6e22e">from</span> <span style="color:#e6db74">'react'</span>;
|
||||
|
||||
<span style="color:#66d9ef">function</span> <span style="color:#a6e22e">App</span>() {
|
||||
<span style="color:#66d9ef">const</span> [<span style="color:#a6e22e">waku</span>, <span style="color:#a6e22e">setWaku</span>] <span style="color:#f92672">=</span> <span style="color:#a6e22e">React</span>.<span style="color:#a6e22e">useState</span>(<span style="color:#66d9ef">undefined</span>);
|
||||
<span style="color:#66d9ef">const</span> [<span style="color:#a6e22e">wakuStatus</span>, <span style="color:#a6e22e">setWakuStatus</span>] <span style="color:#f92672">=</span> <span style="color:#a6e22e">React</span>.<span style="color:#a6e22e">useState</span>(<span style="color:#e6db74">'None'</span>);
|
||||
<span style="color:#66d9ef">const</span> [<span style="color:#a6e22e">waku</span>, <span style="color:#a6e22e">setWaku</span>] <span style="color:#f92672">=</span> <span style="color:#a6e22e">React</span>.<span style="color:#a6e22e">useState</span>(<span style="color:#66d9ef">undefined</span>);
|
||||
<span style="color:#66d9ef">const</span> [<span style="color:#a6e22e">wakuStatus</span>, <span style="color:#a6e22e">setWakuStatus</span>] <span style="color:#f92672">=</span> <span style="color:#a6e22e">React</span>.<span style="color:#a6e22e">useState</span>(<span style="color:#e6db74">'None'</span>);
|
||||
|
||||
<span style="color:#75715e">// Start Waku
|
||||
</span><span style="color:#75715e"></span> <span style="color:#a6e22e">React</span>.<span style="color:#a6e22e">useEffect</span>(() => {
|
||||
<span style="color:#75715e">// If Waku is already assigned, the job is done
|
||||
</span><span style="color:#75715e"></span> <span style="color:#66d9ef">if</span> (<span style="color:#f92672">!!</span><span style="color:#a6e22e">waku</span>) <span style="color:#66d9ef">return</span>;
|
||||
<span style="color:#75715e">// If Waku status not None, it means we are already starting Waku
|
||||
</span><span style="color:#75715e"></span> <span style="color:#66d9ef">if</span> (<span style="color:#a6e22e">wakuStatus</span> <span style="color:#f92672">!==</span> <span style="color:#e6db74">'None'</span>) <span style="color:#66d9ef">return</span>;
|
||||
<span style="color:#75715e">// Start Waku
|
||||
</span><span style="color:#75715e"></span> <span style="color:#a6e22e">React</span>.<span style="color:#a6e22e">useEffect</span>(() => {
|
||||
<span style="color:#75715e">// If Waku is already assigned, the job is done
|
||||
</span><span style="color:#75715e"></span> <span style="color:#66d9ef">if</span> (<span style="color:#f92672">!!</span><span style="color:#a6e22e">waku</span>) <span style="color:#66d9ef">return</span>;
|
||||
<span style="color:#75715e">// If Waku status not None, it means we are already starting Waku
|
||||
</span><span style="color:#75715e"></span> <span style="color:#66d9ef">if</span> (<span style="color:#a6e22e">wakuStatus</span> <span style="color:#f92672">!==</span> <span style="color:#e6db74">'None'</span>) <span style="color:#66d9ef">return</span>;
|
||||
|
||||
<span style="color:#a6e22e">setWakuStatus</span>(<span style="color:#e6db74">'Starting'</span>);
|
||||
<span style="color:#a6e22e">setWakuStatus</span>(<span style="color:#e6db74">'Starting'</span>);
|
||||
|
||||
<span style="color:#75715e">// Create Waku
|
||||
</span><span style="color:#75715e"></span> <span style="color:#a6e22e">Waku</span>.<span style="color:#a6e22e">create</span>({ <span style="color:#a6e22e">bootstrap</span><span style="color:#f92672">:</span> <span style="color:#66d9ef">true</span> }).<span style="color:#a6e22e">then</span>((<span style="color:#a6e22e">waku</span>) => {
|
||||
<span style="color:#75715e">// Once done, put it in the state
|
||||
</span><span style="color:#75715e"></span> <span style="color:#a6e22e">setWaku</span>(<span style="color:#a6e22e">waku</span>);
|
||||
<span style="color:#75715e">// And update the status
|
||||
</span><span style="color:#75715e"></span> <span style="color:#a6e22e">setWakuStatus</span>(<span style="color:#e6db74">'Started'</span>);
|
||||
});
|
||||
}, [<span style="color:#a6e22e">waku</span>, <span style="color:#a6e22e">wakuStatus</span>]);
|
||||
<span style="color:#75715e">// Create Waku
|
||||
</span><span style="color:#75715e"></span> <span style="color:#a6e22e">Waku</span>.<span style="color:#a6e22e">create</span>({<span style="color:#a6e22e">bootstrap</span><span style="color:#f92672">:</span> {<span style="color:#66d9ef">default</span><span style="color:#f92672">:</span> <span style="color:#66d9ef">true</span>}}).<span style="color:#a6e22e">then</span>((<span style="color:#a6e22e">waku</span>) => {
|
||||
<span style="color:#75715e">// Once done, put it in the state
|
||||
</span><span style="color:#75715e"></span> <span style="color:#a6e22e">setWaku</span>(<span style="color:#a6e22e">waku</span>);
|
||||
<span style="color:#75715e">// And update the status
|
||||
</span><span style="color:#75715e"></span> <span style="color:#a6e22e">setWakuStatus</span>(<span style="color:#e6db74">'Started'</span>);
|
||||
});
|
||||
}, [<span style="color:#a6e22e">waku</span>, <span style="color:#a6e22e">wakuStatus</span>]);
|
||||
|
||||
<span style="color:#66d9ef">return</span> (
|
||||
<span style="color:#f92672"><</span><span style="color:#a6e22e">div</span> <span style="color:#a6e22e">className</span><span style="color:#f92672">=</span><span style="color:#e6db74">'App'</span><span style="color:#f92672">></span>
|
||||
<span style="color:#f92672"><</span><span style="color:#a6e22e">header</span> <span style="color:#a6e22e">className</span><span style="color:#f92672">=</span><span style="color:#e6db74">'App-header'</span><span style="color:#f92672">></span>
|
||||
<span style="color:#f92672"><</span><span style="color:#a6e22e">p</span><span style="color:#f92672">></span><span style="color:#a6e22e">Waku</span> <span style="color:#a6e22e">node</span><span style="color:#960050;background-color:#1e0010">'</span><span style="color:#a6e22e">s</span> <span style="color:#a6e22e">status</span><span style="color:#f92672">:</span> {<span style="color:#a6e22e">wakuStatus</span>}<span style="color:#f92672"><</span><span style="color:#960050;background-color:#1e0010">/p></span>
|
||||
<span style="color:#f92672"><</span><span style="color:#960050;background-color:#1e0010">/header></span>
|
||||
<span style="color:#f92672"><</span><span style="color:#960050;background-color:#1e0010">/div></span>
|
||||
);
|
||||
<span style="color:#66d9ef">return</span> (
|
||||
<span style="color:#f92672"><</span><span style="color:#a6e22e">div</span> <span style="color:#a6e22e">className</span><span style="color:#f92672">=</span><span style="color:#e6db74">'App'</span><span style="color:#f92672">></span>
|
||||
<span style="color:#f92672"><</span><span style="color:#a6e22e">header</span> <span style="color:#a6e22e">className</span><span style="color:#f92672">=</span><span style="color:#e6db74">'App-header'</span><span style="color:#f92672">></span>
|
||||
<span style="color:#f92672"><</span><span style="color:#a6e22e">p</span><span style="color:#f92672">></span><span style="color:#a6e22e">Waku</span> <span style="color:#a6e22e">node</span><span style="color:#960050;background-color:#1e0010">'</span><span style="color:#a6e22e">s</span> <span style="color:#a6e22e">status</span><span style="color:#f92672">:</span> {<span style="color:#a6e22e">wakuStatus</span>}<span style="color:#f92672"><</span><span style="color:#960050;background-color:#1e0010">/p></span>
|
||||
<span style="color:#f92672"><</span><span style="color:#960050;background-color:#1e0010">/header></span>
|
||||
<span style="color:#f92672"><</span><span style="color:#960050;background-color:#1e0010">/div></span>
|
||||
);
|
||||
}
|
||||
|
||||
<span style="color:#66d9ef">export</span> <span style="color:#66d9ef">default</span> <span style="color:#a6e22e">App</span>;
|
||||
|
@ -714,18 +714,18 @@ Go to <code>App.js</code> and modify the <code>App</code> function:</p>
|
|||
To ensure that you have relay peers available to send and receive messages,
|
||||
use the <code>Waku.waitForConnectedPeer()</code> async function:</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-js" data-lang="js"><span style="color:#a6e22e">React</span>.<span style="color:#a6e22e">useEffect</span>(() => {
|
||||
<span style="color:#66d9ef">if</span> (<span style="color:#f92672">!!</span><span style="color:#a6e22e">waku</span>) <span style="color:#66d9ef">return</span>;
|
||||
<span style="color:#66d9ef">if</span> (<span style="color:#a6e22e">wakuStatus</span> <span style="color:#f92672">!==</span> <span style="color:#e6db74">'None'</span>) <span style="color:#66d9ef">return</span>;
|
||||
<span style="color:#66d9ef">if</span> (<span style="color:#f92672">!!</span><span style="color:#a6e22e">waku</span>) <span style="color:#66d9ef">return</span>;
|
||||
<span style="color:#66d9ef">if</span> (<span style="color:#a6e22e">wakuStatus</span> <span style="color:#f92672">!==</span> <span style="color:#e6db74">'None'</span>) <span style="color:#66d9ef">return</span>;
|
||||
|
||||
<span style="color:#a6e22e">setWakuStatus</span>(<span style="color:#e6db74">'Starting'</span>);
|
||||
<span style="color:#a6e22e">setWakuStatus</span>(<span style="color:#e6db74">'Starting'</span>);
|
||||
|
||||
<span style="color:#a6e22e">Waku</span>.<span style="color:#a6e22e">create</span>({ <span style="color:#a6e22e">bootstrap</span><span style="color:#f92672">:</span> <span style="color:#66d9ef">true</span> }).<span style="color:#a6e22e">then</span>((<span style="color:#a6e22e">waku</span>) => {
|
||||
<span style="color:#a6e22e">setWaku</span>(<span style="color:#a6e22e">waku</span>);
|
||||
<span style="color:#a6e22e">setWakuStatus</span>(<span style="color:#e6db74">'Connecting'</span>);
|
||||
<span style="color:#a6e22e">waku</span>.<span style="color:#a6e22e">waitForConnectedPeer</span>().<span style="color:#a6e22e">then</span>(() => {
|
||||
<span style="color:#a6e22e">setWakuStatus</span>(<span style="color:#e6db74">'Ready'</span>);
|
||||
<span style="color:#a6e22e">Waku</span>.<span style="color:#a6e22e">create</span>({<span style="color:#a6e22e">bootstrap</span><span style="color:#f92672">:</span> {<span style="color:#66d9ef">default</span><span style="color:#f92672">:</span> <span style="color:#66d9ef">true</span>}}).<span style="color:#a6e22e">then</span>((<span style="color:#a6e22e">waku</span>) => {
|
||||
<span style="color:#a6e22e">setWaku</span>(<span style="color:#a6e22e">waku</span>);
|
||||
<span style="color:#a6e22e">setWakuStatus</span>(<span style="color:#e6db74">'Connecting'</span>);
|
||||
<span style="color:#a6e22e">waku</span>.<span style="color:#a6e22e">waitForConnectedPeer</span>().<span style="color:#a6e22e">then</span>(() => {
|
||||
<span style="color:#a6e22e">setWakuStatus</span>(<span style="color:#e6db74">'Ready'</span>);
|
||||
});
|
||||
});
|
||||
});
|
||||
}, [<span style="color:#a6e22e">waku</span>, <span style="color:#a6e22e">wakuStatus</span>]);
|
||||
</code></pre></div><h1 id="define-message-format">
|
||||
Define Message Format
|
||||
|
@ -906,9 +906,9 @@ Try out by opening the app from different browsers.</p>
|
|||
<div class="flex flex-wrap justify-between">
|
||||
|
||||
|
||||
<div><a class="flex align-center" href="https://github.com/vacp2p/docs.wakuconnect.dev/commit/10be3e4e7f043dc232884dfb04e68068d1179004" title='Last modified by Franck R | Jan 10, 2022' target="_blank" rel="noopener">
|
||||
<div><a class="flex align-center" href="https://github.com/vacp2p/docs.wakuconnect.dev/commit/23ba3e482981514df0e2954405c2ea33c751c4d3" title='Last modified by Franck R | Jan 24, 2022' target="_blank" rel="noopener">
|
||||
<img src="/svg/calendar.svg" class="book-icon" alt="Calendar" />
|
||||
<span>Jan 10, 2022</span>
|
||||
<span>Jan 24, 2022</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -14,14 +14,14 @@ Waku Relay is a gossip protocol. As a user, it means that your peers forward you
|
|||
<meta property="og:type" content="article" />
|
||||
<meta property="og:url" content="https://docs.wakuconnect.dev/docs/guides/08_reactjs_store/" /><meta property="article:section" content="docs" />
|
||||
<meta property="article:published_time" content="2021-12-09T14:00:00+01:00" />
|
||||
<meta property="article:modified_time" content="2022-01-10T12:11:15+11:00" />
|
||||
<meta property="article:modified_time" content="2022-01-24T11:54:31+11:00" />
|
||||
|
||||
<title>Retrieve Messages Using Waku Store With ReactJS | WakuConnect Docs</title>
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<!--
|
||||
Made with Book Theme
|
||||
https://github.com/alex-shpak/hugo-book
|
||||
|
@ -700,36 +700,36 @@ npm install
|
|||
</h1>
|
||||
<p>In order to interact with the Waku network, you first need a Waku instance.
|
||||
Go to <code>App.js</code> and modify the <code>App</code> function:</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-js" data-lang="js"><span style="color:#66d9ef">import</span> { <span style="color:#a6e22e">Waku</span> } <span style="color:#a6e22e">from</span> <span style="color:#e6db74">'js-waku'</span>;
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-js" data-lang="js"><span style="color:#66d9ef">import</span> {<span style="color:#a6e22e">Waku</span>} <span style="color:#a6e22e">from</span> <span style="color:#e6db74">'js-waku'</span>;
|
||||
<span style="color:#66d9ef">import</span> <span style="color:#f92672">*</span> <span style="color:#a6e22e">as</span> <span style="color:#a6e22e">React</span> <span style="color:#a6e22e">from</span> <span style="color:#e6db74">'react'</span>;
|
||||
|
||||
<span style="color:#66d9ef">function</span> <span style="color:#a6e22e">App</span>() {
|
||||
<span style="color:#66d9ef">const</span> [<span style="color:#a6e22e">waku</span>, <span style="color:#a6e22e">setWaku</span>] <span style="color:#f92672">=</span> <span style="color:#a6e22e">React</span>.<span style="color:#a6e22e">useState</span>(<span style="color:#66d9ef">undefined</span>);
|
||||
<span style="color:#66d9ef">const</span> [<span style="color:#a6e22e">wakuStatus</span>, <span style="color:#a6e22e">setWakuStatus</span>] <span style="color:#f92672">=</span> <span style="color:#a6e22e">React</span>.<span style="color:#a6e22e">useState</span>(<span style="color:#e6db74">'None'</span>);
|
||||
<span style="color:#66d9ef">const</span> [<span style="color:#a6e22e">waku</span>, <span style="color:#a6e22e">setWaku</span>] <span style="color:#f92672">=</span> <span style="color:#a6e22e">React</span>.<span style="color:#a6e22e">useState</span>(<span style="color:#66d9ef">undefined</span>);
|
||||
<span style="color:#66d9ef">const</span> [<span style="color:#a6e22e">wakuStatus</span>, <span style="color:#a6e22e">setWakuStatus</span>] <span style="color:#f92672">=</span> <span style="color:#a6e22e">React</span>.<span style="color:#a6e22e">useState</span>(<span style="color:#e6db74">'None'</span>);
|
||||
|
||||
<span style="color:#75715e">// Start Waku
|
||||
</span><span style="color:#75715e"></span> <span style="color:#a6e22e">React</span>.<span style="color:#a6e22e">useEffect</span>(() => {
|
||||
<span style="color:#75715e">// If Waku status not None, it means we are already starting Waku
|
||||
</span><span style="color:#75715e"></span> <span style="color:#66d9ef">if</span> (<span style="color:#a6e22e">wakuStatus</span> <span style="color:#f92672">!==</span> <span style="color:#e6db74">'None'</span>) <span style="color:#66d9ef">return</span>;
|
||||
<span style="color:#75715e">// Start Waku
|
||||
</span><span style="color:#75715e"></span> <span style="color:#a6e22e">React</span>.<span style="color:#a6e22e">useEffect</span>(() => {
|
||||
<span style="color:#75715e">// If Waku status not None, it means we are already starting Waku
|
||||
</span><span style="color:#75715e"></span> <span style="color:#66d9ef">if</span> (<span style="color:#a6e22e">wakuStatus</span> <span style="color:#f92672">!==</span> <span style="color:#e6db74">'None'</span>) <span style="color:#66d9ef">return</span>;
|
||||
|
||||
<span style="color:#a6e22e">setWakuStatus</span>(<span style="color:#e6db74">'Starting'</span>);
|
||||
<span style="color:#a6e22e">setWakuStatus</span>(<span style="color:#e6db74">'Starting'</span>);
|
||||
|
||||
<span style="color:#75715e">// Create Waku
|
||||
</span><span style="color:#75715e"></span> <span style="color:#a6e22e">Waku</span>.<span style="color:#a6e22e">create</span>({ <span style="color:#a6e22e">bootstrap</span><span style="color:#f92672">:</span> <span style="color:#66d9ef">true</span> }).<span style="color:#a6e22e">then</span>((<span style="color:#a6e22e">waku</span>) => {
|
||||
<span style="color:#75715e">// Once done, put it in the state
|
||||
</span><span style="color:#75715e"></span> <span style="color:#a6e22e">setWaku</span>(<span style="color:#a6e22e">waku</span>);
|
||||
<span style="color:#75715e">// And update the status
|
||||
</span><span style="color:#75715e"></span> <span style="color:#a6e22e">setWakuStatus</span>(<span style="color:#e6db74">'Connecting'</span>);
|
||||
});
|
||||
}, [<span style="color:#a6e22e">waku</span>, <span style="color:#a6e22e">wakuStatus</span>]);
|
||||
<span style="color:#75715e">// Create Waku
|
||||
</span><span style="color:#75715e"></span> <span style="color:#a6e22e">Waku</span>.<span style="color:#a6e22e">create</span>({<span style="color:#a6e22e">bootstrap</span><span style="color:#f92672">:</span> {<span style="color:#66d9ef">default</span><span style="color:#f92672">:</span> <span style="color:#66d9ef">true</span>}}).<span style="color:#a6e22e">then</span>((<span style="color:#a6e22e">waku</span>) => {
|
||||
<span style="color:#75715e">// Once done, put it in the state
|
||||
</span><span style="color:#75715e"></span> <span style="color:#a6e22e">setWaku</span>(<span style="color:#a6e22e">waku</span>);
|
||||
<span style="color:#75715e">// And update the status
|
||||
</span><span style="color:#75715e"></span> <span style="color:#a6e22e">setWakuStatus</span>(<span style="color:#e6db74">'Connecting'</span>);
|
||||
});
|
||||
}, [<span style="color:#a6e22e">waku</span>, <span style="color:#a6e22e">wakuStatus</span>]);
|
||||
|
||||
<span style="color:#66d9ef">return</span> (
|
||||
<span style="color:#f92672"><</span><span style="color:#a6e22e">div</span> <span style="color:#a6e22e">className</span><span style="color:#f92672">=</span><span style="color:#e6db74">'App'</span><span style="color:#f92672">></span>
|
||||
<span style="color:#f92672"><</span><span style="color:#a6e22e">header</span> <span style="color:#a6e22e">className</span><span style="color:#f92672">=</span><span style="color:#e6db74">'App-header'</span><span style="color:#f92672">></span>
|
||||
<span style="color:#f92672"><</span><span style="color:#a6e22e">p</span><span style="color:#f92672">></span>{<span style="color:#a6e22e">wakuStatus</span>}<span style="color:#f92672"><</span><span style="color:#960050;background-color:#1e0010">/p></span>
|
||||
<span style="color:#f92672"><</span><span style="color:#960050;background-color:#1e0010">/header></span>
|
||||
<span style="color:#f92672"><</span><span style="color:#960050;background-color:#1e0010">/div></span>
|
||||
);
|
||||
<span style="color:#66d9ef">return</span> (
|
||||
<span style="color:#f92672"><</span><span style="color:#a6e22e">div</span> <span style="color:#a6e22e">className</span><span style="color:#f92672">=</span><span style="color:#e6db74">'App'</span><span style="color:#f92672">></span>
|
||||
<span style="color:#f92672"><</span><span style="color:#a6e22e">header</span> <span style="color:#a6e22e">className</span><span style="color:#f92672">=</span><span style="color:#e6db74">'App-header'</span><span style="color:#f92672">></span>
|
||||
<span style="color:#f92672"><</span><span style="color:#a6e22e">p</span><span style="color:#f92672">></span>{<span style="color:#a6e22e">wakuStatus</span>}<span style="color:#f92672"><</span><span style="color:#960050;background-color:#1e0010">/p></span>
|
||||
<span style="color:#f92672"><</span><span style="color:#960050;background-color:#1e0010">/header></span>
|
||||
<span style="color:#f92672"><</span><span style="color:#960050;background-color:#1e0010">/div></span>
|
||||
);
|
||||
}
|
||||
|
||||
<span style="color:#66d9ef">export</span> <span style="color:#66d9ef">default</span> <span style="color:#a6e22e">App</span>;
|
||||
|
@ -872,7 +872,7 @@ You will pass <code>processMessages</code> as a <code>callback</code> option to
|
|||
);
|
||||
}
|
||||
</code></pre></div><p>All together, you should now have:</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-js" data-lang="js"><span style="color:#66d9ef">import</span> { <span style="color:#a6e22e">Waku</span> } <span style="color:#a6e22e">from</span> <span style="color:#e6db74">'js-waku'</span>;
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-js" data-lang="js"><span style="color:#66d9ef">import</span> {<span style="color:#a6e22e">Waku</span>} <span style="color:#a6e22e">from</span> <span style="color:#e6db74">'js-waku'</span>;
|
||||
<span style="color:#66d9ef">import</span> <span style="color:#f92672">*</span> <span style="color:#a6e22e">as</span> <span style="color:#a6e22e">React</span> <span style="color:#a6e22e">from</span> <span style="color:#e6db74">'react'</span>;
|
||||
<span style="color:#66d9ef">import</span> <span style="color:#a6e22e">protons</span> <span style="color:#a6e22e">from</span> <span style="color:#e6db74">'protons'</span>;
|
||||
|
||||
|
@ -899,7 +899,7 @@ You will pass <code>processMessages</code> as a <code>callback</code> option to
|
|||
<span style="color:#a6e22e">setWakuStatus</span>(<span style="color:#e6db74">'Starting'</span>);
|
||||
|
||||
<span style="color:#75715e">// Create Waku
|
||||
</span><span style="color:#75715e"></span> <span style="color:#a6e22e">Waku</span>.<span style="color:#a6e22e">create</span>({ <span style="color:#a6e22e">bootstrap</span><span style="color:#f92672">:</span> <span style="color:#66d9ef">true</span> }).<span style="color:#a6e22e">then</span>((<span style="color:#a6e22e">waku</span>) => {
|
||||
</span><span style="color:#75715e"></span> <span style="color:#a6e22e">Waku</span>.<span style="color:#a6e22e">create</span>({<span style="color:#a6e22e">bootstrap</span><span style="color:#f92672">:</span> {<span style="color:#66d9ef">default</span><span style="color:#f92672">:</span> <span style="color:#66d9ef">true</span>}}).<span style="color:#a6e22e">then</span>((<span style="color:#a6e22e">waku</span>) => {
|
||||
<span style="color:#75715e">// Once done, put it in the state
|
||||
</span><span style="color:#75715e"></span> <span style="color:#a6e22e">setWaku</span>(<span style="color:#a6e22e">waku</span>);
|
||||
<span style="color:#75715e">// And update the status
|
||||
|
@ -930,7 +930,7 @@ You will pass <code>processMessages</code> as a <code>callback</code> option to
|
|||
};
|
||||
|
||||
<span style="color:#a6e22e">waku</span>.<span style="color:#a6e22e">store</span>
|
||||
.<span style="color:#a6e22e">queryHistory</span>([<span style="color:#a6e22e">ContentTopic</span>], { <span style="color:#a6e22e">callback</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">processMessages</span> })
|
||||
.<span style="color:#a6e22e">queryHistory</span>([<span style="color:#a6e22e">ContentTopic</span>], {<span style="color:#a6e22e">callback</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">processMessages</span>})
|
||||
.<span style="color:#66d9ef">catch</span>((<span style="color:#a6e22e">e</span>) => {
|
||||
<span style="color:#a6e22e">console</span>.<span style="color:#a6e22e">log</span>(<span style="color:#e6db74">'Failed to retrieve messages'</span>, <span style="color:#a6e22e">e</span>);
|
||||
});
|
||||
|
@ -942,7 +942,7 @@ You will pass <code>processMessages</code> as a <code>callback</code> option to
|
|||
<span style="color:#f92672"><</span><span style="color:#a6e22e">h2</span><span style="color:#f92672">></span>{<span style="color:#a6e22e">wakuStatus</span>}<span style="color:#f92672"><</span><span style="color:#960050;background-color:#1e0010">/h2></span>
|
||||
<span style="color:#f92672"><</span><span style="color:#a6e22e">h3</span><span style="color:#f92672">></span><span style="color:#a6e22e">Messages</span><span style="color:#f92672"><</span><span style="color:#960050;background-color:#1e0010">/h3></span>
|
||||
<span style="color:#f92672"><</span><span style="color:#a6e22e">ul</span><span style="color:#f92672">></span>
|
||||
<span style="color:#f92672"><</span><span style="color:#a6e22e">Messages</span> <span style="color:#a6e22e">messages</span><span style="color:#f92672">=</span>{<span style="color:#a6e22e">messages</span>} <span style="color:#f92672">/></span>
|
||||
<span style="color:#f92672"><</span><span style="color:#a6e22e">Messages</span> <span style="color:#a6e22e">messages</span><span style="color:#f92672">=</span>{<span style="color:#a6e22e">messages</span>}<span style="color:#f92672">/></span>
|
||||
<span style="color:#f92672"><</span><span style="color:#960050;background-color:#1e0010">/ul></span>
|
||||
<span style="color:#f92672"><</span><span style="color:#960050;background-color:#1e0010">/header></span>
|
||||
<span style="color:#f92672"><</span><span style="color:#960050;background-color:#1e0010">/div></span>
|
||||
|
@ -954,7 +954,7 @@ You will pass <code>processMessages</code> as a <code>callback</code> option to
|
|||
<span style="color:#66d9ef">function</span> <span style="color:#a6e22e">decodeMessage</span>(<span style="color:#a6e22e">wakuMessage</span>) {
|
||||
<span style="color:#66d9ef">if</span> (<span style="color:#f92672">!</span><span style="color:#a6e22e">wakuMessage</span>.<span style="color:#a6e22e">payload</span>) <span style="color:#66d9ef">return</span>;
|
||||
|
||||
<span style="color:#66d9ef">const</span> { <span style="color:#a6e22e">timestamp</span>, <span style="color:#a6e22e">nick</span>, <span style="color:#a6e22e">text</span> } <span style="color:#f92672">=</span> <span style="color:#a6e22e">proto</span>.<span style="color:#a6e22e">ChatMessage</span>.<span style="color:#a6e22e">decode</span>(
|
||||
<span style="color:#66d9ef">const</span> {<span style="color:#a6e22e">timestamp</span>, <span style="color:#a6e22e">nick</span>, <span style="color:#a6e22e">text</span>} <span style="color:#f92672">=</span> <span style="color:#a6e22e">proto</span>.<span style="color:#a6e22e">ChatMessage</span>.<span style="color:#a6e22e">decode</span>(
|
||||
<span style="color:#a6e22e">wakuMessage</span>.<span style="color:#a6e22e">payload</span>
|
||||
);
|
||||
|
||||
|
@ -966,11 +966,11 @@ You will pass <code>processMessages</code> as a <code>callback</code> option to
|
|||
|
||||
<span style="color:#66d9ef">const</span> <span style="color:#a6e22e">utf8Text</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">Buffer</span>.<span style="color:#a6e22e">from</span>(<span style="color:#a6e22e">text</span>).<span style="color:#a6e22e">toString</span>(<span style="color:#e6db74">'utf-8'</span>);
|
||||
|
||||
<span style="color:#66d9ef">return</span> { <span style="color:#a6e22e">text</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">utf8Text</span>, <span style="color:#a6e22e">timestamp</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">time</span>, <span style="color:#a6e22e">nick</span> };
|
||||
<span style="color:#66d9ef">return</span> {<span style="color:#a6e22e">text</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">utf8Text</span>, <span style="color:#a6e22e">timestamp</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">time</span>, <span style="color:#a6e22e">nick</span>};
|
||||
}
|
||||
|
||||
<span style="color:#66d9ef">function</span> <span style="color:#a6e22e">Messages</span>(<span style="color:#a6e22e">props</span>) {
|
||||
<span style="color:#66d9ef">return</span> <span style="color:#a6e22e">props</span>.<span style="color:#a6e22e">messages</span>.<span style="color:#a6e22e">map</span>(({ <span style="color:#a6e22e">text</span>, <span style="color:#a6e22e">timestamp</span>, <span style="color:#a6e22e">nick</span> }) => {
|
||||
<span style="color:#66d9ef">return</span> <span style="color:#a6e22e">props</span>.<span style="color:#a6e22e">messages</span>.<span style="color:#a6e22e">map</span>(({<span style="color:#a6e22e">text</span>, <span style="color:#a6e22e">timestamp</span>, <span style="color:#a6e22e">nick</span>}) => {
|
||||
<span style="color:#66d9ef">return</span> (
|
||||
<span style="color:#f92672"><</span><span style="color:#a6e22e">li</span><span style="color:#f92672">></span>
|
||||
({<span style="color:#a6e22e">formatDate</span>(<span style="color:#a6e22e">timestamp</span>)}) {<span style="color:#a6e22e">nick</span>}<span style="color:#f92672">:</span> {<span style="color:#a6e22e">text</span>}
|
||||
|
@ -1029,9 +1029,9 @@ By default, js-waku sets the timestamp of outgoing message to the current time.<
|
|||
<div class="flex flex-wrap justify-between">
|
||||
|
||||
|
||||
<div><a class="flex align-center" href="https://github.com/vacp2p/docs.wakuconnect.dev/commit/10be3e4e7f043dc232884dfb04e68068d1179004" title='Last modified by Franck R | Jan 10, 2022' target="_blank" rel="noopener">
|
||||
<div><a class="flex align-center" href="https://github.com/vacp2p/docs.wakuconnect.dev/commit/23ba3e482981514df0e2954405c2ea33c751c4d3" title='Last modified by Franck R | Jan 24, 2022' target="_blank" rel="noopener">
|
||||
<img src="/svg/calendar.svg" class="book-icon" alt="Calendar" />
|
||||
<span>Jan 10, 2022</span>
|
||||
<span>Jan 24, 2022</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<link rel="alternate" type="application/rss+xml" href="https://docs.wakuconnect.dev/docs/guides/index.xml" title="WakuConnect Docs" />
|
||||
<!--
|
||||
Made with Book Theme
|
||||
|
|
|
@ -18,7 +18,7 @@ For both functionalities, only ERC-20 token holders can create or answer polls/v
|
|||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<link rel="alternate" type="application/rss+xml" href="https://docs.wakuconnect.dev/docs/guides/vote_poll_sdk/index.xml" title="WakuConnect Docs" />
|
||||
<!--
|
||||
Made with Book Theme
|
||||
|
|
|
@ -21,7 +21,7 @@ yarn create react-app poll-dapp-ts --template typescript cd poll-dapp-ts yarn ad
|
|||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<!--
|
||||
Made with Book Theme
|
||||
https://github.com/alex-shpak/hugo-book
|
||||
|
|
|
@ -19,7 +19,7 @@ rm -f App.tsx App.css App.test.tsx Top bar # Use TopBar component to display wa
|
|||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<!--
|
||||
Made with Book Theme
|
||||
https://github.com/alex-shpak/hugo-book
|
||||
|
|
|
@ -21,7 +21,7 @@ import styled from 'styled-components' const Wrapper = styled.div` displ
|
|||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<!--
|
||||
Made with Book Theme
|
||||
https://github.com/alex-shpak/hugo-book
|
||||
|
|
|
@ -21,7 +21,7 @@ useWakuPolling takes:
|
|||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<!--
|
||||
Made with Book Theme
|
||||
https://github.com/alex-shpak/hugo-book
|
||||
|
|
|
@ -23,7 +23,7 @@ import {useState} from 'react' import {useConfig} from '@usedapp/cor
|
|||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<!--
|
||||
Made with Book Theme
|
||||
https://github.com/alex-shpak/hugo-book
|
||||
|
|
|
@ -19,7 +19,7 @@ Get Started ">
|
|||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<link rel="alternate" type="application/rss+xml" href="https://docs.wakuconnect.dev/docs/guides/vote_poll_sdk/poll_sdk/index.xml" title="WakuConnect Docs" />
|
||||
<!--
|
||||
Made with Book Theme
|
||||
|
|
|
@ -19,7 +19,7 @@ Waku can be used for chat purposes and for many machine-to-machine use cases. Yo
|
|||
<link rel="alternate" hreflang="pt" href="https://docs.wakuconnect.dev/pt/docs/" title="Introdução">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<link rel="alternate" type="application/rss+xml" href="https://docs.wakuconnect.dev/docs/index.xml" title="WakuConnect Docs" />
|
||||
<!--
|
||||
Made with Book Theme
|
||||
|
|
|
@ -27,7 +27,7 @@ Waku can be used for chat purposes and for many machine-to-machine use cases. Yo
|
|||
<description>Quick Start # In this section you will learn how to receive and send messages using Waku Relay.
|
||||
A more in depth guide for Waku Relay can be found here.
|
||||
Install # Install the js-waku package:
|
||||
npm install js-waku # or with yarn yarn add js-waku Start a waku node # import { Waku } from &#39;js-waku&#39;; const waku = await Waku.create({ bootstrap: true }); Listen for messages # The contentTopic is a metadata string that allows categorization of messages on the waku network.</description>
|
||||
npm install js-waku # or with yarn yarn add js-waku Start a waku node # import {Waku} from &#39;js-waku&#39;; const waku = await Waku.create({bootstrap: {default: true}}); Listen for messages # The contentTopic is a metadata string that allows categorization of messages on the waku network.</description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
|
|
|
@ -21,7 +21,7 @@ Waku can be used for chat purposes and for many machine-to-machine use cases. Yo
|
|||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<!--
|
||||
Made with Book Theme
|
||||
https://github.com/alex-shpak/hugo-book
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<!--
|
||||
Made with Book Theme
|
||||
https://github.com/alex-shpak/hugo-book
|
||||
|
|
|
@ -6,24 +6,24 @@
|
|||
<meta name="description" content="Quick Start # In this section you will learn how to receive and send messages using Waku Relay.
|
||||
A more in depth guide for Waku Relay can be found here.
|
||||
Install # Install the js-waku package:
|
||||
npm install js-waku # or with yarn yarn add js-waku Start a waku node # import { Waku } from 'js-waku'; const waku = await Waku.create({ bootstrap: true }); Listen for messages # The contentTopic is a metadata string that allows categorization of messages on the waku network.">
|
||||
npm install js-waku # or with yarn yarn add js-waku Start a waku node # import {Waku} from 'js-waku'; const waku = await Waku.create({bootstrap: {default: true}}); Listen for messages # The contentTopic is a metadata string that allows categorization of messages on the waku network.">
|
||||
<meta name="theme-color" content="#FFFFFF">
|
||||
<meta name="color-scheme" content="light dark"><meta property="og:title" content="Quick Start" />
|
||||
<meta property="og:description" content="Quick Start # In this section you will learn how to receive and send messages using Waku Relay.
|
||||
A more in depth guide for Waku Relay can be found here.
|
||||
Install # Install the js-waku package:
|
||||
npm install js-waku # or with yarn yarn add js-waku Start a waku node # import { Waku } from 'js-waku'; const waku = await Waku.create({ bootstrap: true }); Listen for messages # The contentTopic is a metadata string that allows categorization of messages on the waku network." />
|
||||
npm install js-waku # or with yarn yarn add js-waku Start a waku node # import {Waku} from 'js-waku'; const waku = await Waku.create({bootstrap: {default: true}}); Listen for messages # The contentTopic is a metadata string that allows categorization of messages on the waku network." />
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:url" content="https://docs.wakuconnect.dev/docs/quick_start/" /><meta property="article:section" content="docs" />
|
||||
<meta property="article:published_time" content="2021-12-09T14:00:00+01:00" />
|
||||
<meta property="article:modified_time" content="2022-01-12T14:41:29+11:00" />
|
||||
<meta property="article:modified_time" content="2022-01-24T11:54:31+11:00" />
|
||||
|
||||
<title>Quick Start | WakuConnect Docs</title>
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<!--
|
||||
Made with Book Theme
|
||||
https://github.com/alex-shpak/hugo-book
|
||||
|
@ -547,9 +547,9 @@ yarn add js-waku
|
|||
Start a waku node
|
||||
<a class="anchor" href="#start-a-waku-node">#</a>
|
||||
</h3>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-ts" data-lang="ts"><span style="color:#66d9ef">import</span> { <span style="color:#a6e22e">Waku</span> } <span style="color:#66d9ef">from</span> <span style="color:#e6db74">'js-waku'</span>;
|
||||
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-ts" data-lang="ts"><span style="color:#66d9ef">import</span> {<span style="color:#a6e22e">Waku</span>} <span style="color:#66d9ef">from</span> <span style="color:#e6db74">'js-waku'</span>;
|
||||
|
||||
<span style="color:#66d9ef">const</span> <span style="color:#a6e22e">waku</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">Waku</span>.<span style="color:#a6e22e">create</span>({ <span style="color:#a6e22e">bootstrap</span>: <span style="color:#66d9ef">true</span> });
|
||||
<span style="color:#66d9ef">const</span> <span style="color:#a6e22e">waku</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">Waku</span>.<span style="color:#a6e22e">create</span>({<span style="color:#a6e22e">bootstrap</span><span style="color:#f92672">:</span> {<span style="color:#66d9ef">default</span><span style="color:#f92672">:</span> <span style="color:#66d9ef">true</span>}});
|
||||
</code></pre></div><h3 id="listen-for-messages">
|
||||
Listen for messages
|
||||
<a class="anchor" href="#listen-for-messages">#</a>
|
||||
|
@ -586,9 +586,9 @@ here is how to listen to new messages received via <a href="https://rfc.vac.dev/
|
|||
<div class="flex flex-wrap justify-between">
|
||||
|
||||
|
||||
<div><a class="flex align-center" href="https://github.com/vacp2p/docs.wakuconnect.dev/commit/d41a5cee6b827340d4ac5d6ce75b150dad8ef457" title='Last modified by Franck R | Jan 12, 2022' target="_blank" rel="noopener">
|
||||
<div><a class="flex align-center" href="https://github.com/vacp2p/docs.wakuconnect.dev/commit/23ba3e482981514df0e2954405c2ea33c751c4d3" title='Last modified by Franck R | Jan 24, 2022' target="_blank" rel="noopener">
|
||||
<img src="/svg/calendar.svg" class="book-icon" alt="Calendar" />
|
||||
<span>Jan 12, 2022</span>
|
||||
<span>Jan 24, 2022</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ Legend:
|
|||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<!--
|
||||
Made with Book Theme
|
||||
https://github.com/alex-shpak/hugo-book
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<!--
|
||||
Made with Book Theme
|
||||
https://github.com/alex-shpak/hugo-book
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
'use strict';(function(){const g='/en.search-data.min.dd2c536f8c3960528c583f819c200056d2d0e962aa5ab68d0ff1aa16e69db682.json',h=Object.assign({cache:!0},{doc:{id:'id',field:['title','content'],store:['title','href','section']}}),a=document.querySelector('#book-search-input'),b=document.querySelector('#book-search-results');if(!a)return;a.addEventListener('focus',c),a.addEventListener('keyup',d),document.addEventListener('keypress',e);function e(b){if(b.target.value!==void 0)return;if(a===document.activeElement)return;const c=String.fromCharCode(b.charCode);if(!f(c))return;a.focus(),b.preventDefault()}function f(b){const c=a.getAttribute('data-hotkeys')||'';return c.indexOf(b)>=0}function c(){a.removeEventListener('focus',c),a.required=!0,fetch(g).then(a=>a.json()).then(a=>{window.bookSearchIndex=FlexSearch.create('balance',h),window.bookSearchIndex.add(a)}).then(()=>a.required=!1).then(d)}function d(){while(b.firstChild)b.removeChild(b.firstChild);if(!a.value)return;const c=window.bookSearchIndex.search(a.value,10);c.forEach(function(a){const c=i('<li><a href></a><small></small></li>'),d=c.querySelector('a'),e=c.querySelector('small');d.href=a.href,d.textContent=a.title,e.textContent=a.section,b.appendChild(c)})}function i(b){const a=document.createElement('div');return a.innerHTML=b,a.firstChild}})()
|
|
@ -9,10 +9,10 @@
|
|||
<lastmod>2022-01-03T11:11:07+11:00</lastmod>
|
||||
</url><url>
|
||||
<loc>https://docs.wakuconnect.dev/docs/guides/02_relay_receive_send_messages/</loc>
|
||||
<lastmod>2022-01-05T14:40:44+11:00</lastmod>
|
||||
<lastmod>2022-01-24T11:54:31+11:00</lastmod>
|
||||
</url><url>
|
||||
<loc>https://docs.wakuconnect.dev/docs/guides/03_store_retrieve_messages/</loc>
|
||||
<lastmod>2021-12-09T15:27:58+01:00</lastmod>
|
||||
<lastmod>2022-01-24T11:54:31+11:00</lastmod>
|
||||
</url><url>
|
||||
<loc>https://docs.wakuconnect.dev/docs/guides/04_encrypt_messages_version_1/</loc>
|
||||
<lastmod>2021-12-09T15:27:58+01:00</lastmod>
|
||||
|
@ -21,13 +21,13 @@
|
|||
<lastmod>2021-12-09T15:27:58+01:00</lastmod>
|
||||
</url><url>
|
||||
<loc>https://docs.wakuconnect.dev/docs/guides/06_light_push_send_messages/</loc>
|
||||
<lastmod>2021-12-09T15:27:58+01:00</lastmod>
|
||||
<lastmod>2022-01-24T11:54:31+11:00</lastmod>
|
||||
</url><url>
|
||||
<loc>https://docs.wakuconnect.dev/docs/guides/07_reactjs_relay/</loc>
|
||||
<lastmod>2022-01-10T12:11:15+11:00</lastmod>
|
||||
<lastmod>2022-01-24T11:54:31+11:00</lastmod>
|
||||
</url><url>
|
||||
<loc>https://docs.wakuconnect.dev/docs/guides/08_reactjs_store/</loc>
|
||||
<lastmod>2022-01-10T12:11:15+11:00</lastmod>
|
||||
<lastmod>2022-01-24T11:54:31+11:00</lastmod>
|
||||
</url><url>
|
||||
<loc>https://docs.wakuconnect.dev/docs/introduction/</loc>
|
||||
<lastmod>2022-01-24T09:35:35+11:00</lastmod>
|
||||
|
@ -84,7 +84,7 @@
|
|||
<lastmod>2022-01-05T11:02:48+11:00</lastmod>
|
||||
</url><url>
|
||||
<loc>https://docs.wakuconnect.dev/docs/quick_start/</loc>
|
||||
<lastmod>2022-01-12T14:41:29+11:00</lastmod>
|
||||
<lastmod>2022-01-24T11:54:31+11:00</lastmod>
|
||||
</url><url>
|
||||
<loc>https://docs.wakuconnect.dev/docs/use_cases/</loc>
|
||||
<lastmod>2022-01-12T14:41:29+11:00</lastmod>
|
||||
|
|
|
@ -20,7 +20,7 @@ Waku can be used for chat purposes and for many machine-to-machine use cases. Yo
|
|||
<link rel="alternate" hreflang="pt" href="https://docs.wakuconnect.dev/pt/" title="Introdução">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<link rel="alternate" type="application/rss+xml" href="https://docs.wakuconnect.dev/index.xml" title="WakuConnect Docs" />
|
||||
<!--
|
||||
Made with Book Theme
|
||||
|
|
|
@ -171,7 +171,7 @@ import {useState} from &#39;react&#39; import {useConfig} from &#39;
|
|||
<description>Quick Start # In this section you will learn how to receive and send messages using Waku Relay.
|
||||
A more in depth guide for Waku Relay can be found here.
|
||||
Install # Install the js-waku package:
|
||||
npm install js-waku # or with yarn yarn add js-waku Start a waku node # import { Waku } from &#39;js-waku&#39;; const waku = await Waku.create({ bootstrap: true }); Listen for messages # The contentTopic is a metadata string that allows categorization of messages on the waku network.</description>
|
||||
npm install js-waku # or with yarn yarn add js-waku Start a waku node # import {Waku} from &#39;js-waku&#39;; const waku = await Waku.create({bootstrap: {default: true}}); Listen for messages # The contentTopic is a metadata string that allows categorization of messages on the waku network.</description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<sitemap>
|
||||
<loc>https://docs.wakuconnect.dev/en/sitemap.xml</loc>
|
||||
|
||||
<lastmod>2022-01-24T09:35:35+11:00</lastmod>
|
||||
<lastmod>2022-01-24T11:54:31+11:00</lastmod>
|
||||
|
||||
</sitemap>
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<link rel="alternate" hreflang="pt" href="https://docs.wakuconnect.dev/pt/tags/" title="Tags">
|
||||
<link rel="stylesheet" href="/book.min.89a77f7e702a8626749b948bbfb01109823daf6c1246ca407d1378833494c402.css" integrity="sha256-iad/fnAqhiZ0m5SLv7ARCYI9r2wSRspAfRN4gzSUxAI=" crossorigin="anonymous">
|
||||
<script defer src="/flexsearch.min.js"></script>
|
||||
<script defer src="/en.search.min.c63bfe6c9d2e1dd3f7f40e2e31f9303f81025c9ae5d55b8a53ac3b9cf2a8593c.js" integrity="sha256-xjv+bJ0uHdP39A4uMfkwP4ECXJrl1VuKU6w7nPKoWTw=" crossorigin="anonymous"></script>
|
||||
<script defer src="/en.search.min.4b1407834b00472136a90877f41f745236339309d01b997ad233d6436d3ce4ce.js" integrity="sha256-SxQHg0sARyE2qQh39B90UjYzkwnQG5l60jPWQ2085M4=" crossorigin="anonymous"></script>
|
||||
<link rel="alternate" type="application/rss+xml" href="https://docs.wakuconnect.dev/tags/index.xml" title="WakuConnect Docs" />
|
||||
<!--
|
||||
Made with Book Theme
|
||||
|
|
Loading…
Reference in New Issue