126 lines
120 KiB
HTML
Raw Normal View History

2024-02-20 09:41:47 +00:00
<!doctype html>
2025-08-13 03:52:48 +00:00
<html lang="en-GB" dir="ltr" class="docs-wrapper plugin-docs plugin-id-default docs-version-current docs-doc-page docs-doc-id-undefined" data-has-hydrated="false">
2024-02-20 09:41:47 +00:00
<head>
<meta charset="UTF-8">
2025-08-13 03:52:48 +00:00
<meta name="generator" content="Docusaurus v3.8.1">
2025-10-03 11:14:33 +00:00
<title data-rh="true">Node Configuration Examples | Waku Documentation</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://docs.waku.org/run-node/configure-nwaku"><meta data-rh="true" property="og:locale" content="en_GB"><meta data-rh="true" name="docusaurus_locale" content="en-GB"><meta data-rh="true" name="docsearch:language" content="en-GB"><meta data-rh="true" name="keywords" content="waku, web3"><meta data-rh="true" name="image" content="https://docs.waku.org/_og/0a0044bf4fe8b7f68c5a1a1812e666c348d9a680.png"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="Node Configuration Examples | Waku Documentation"><meta data-rh="true" name="description" content="This guide provides detailed steps to configure a nwaku node for different use cases."><meta data-rh="true" property="og:description" content="This guide provides detailed steps to configure a nwaku node for different use cases."><link data-rh="true" rel="icon" href="/theme/image/favicon.ico"><link data-rh="true" rel="canonical" href="https://docs.waku.org/run-node/configure-nwaku"><link data-rh="true" rel="alternate" href="https://docs.waku.org/run-node/configure-nwaku" hreflang="en-GB"><link data-rh="true" rel="alternate" href="https://docs.waku.org/run-node/configure-nwaku" hreflang="x-default"><link rel="alternate icon" type="image/png" href="/theme/image/favicon.png">
<link rel="icon" type="image/svg+xml" href="/theme/image/favicon.svg"><link rel="stylesheet" href="/assets/css/styles.f0961b96.css">
2025-10-13 04:00:43 +00:00
<script src="/assets/js/runtime~main.fc0a4924.js" defer="defer"></script>
2025-10-03 11:14:33 +00:00
<script src="/assets/js/main.be9ec88b.js" defer="defer"></script>
2025-08-13 03:52:48 +00:00
<meta property="og:image" content="https://docs.waku.org/_og/0a0044bf4fe8b7f68c5a1a1812e666c348d9a680.png"><meta name="twitter:image" content="https://docs.waku.org/_og/0a0044bf4fe8b7f68c5a1a1812e666c348d9a680.png"></head>
2024-02-20 09:41:47 +00:00
<body class="navigation-with-keyboard">
2025-08-13 03:52:48 +00:00
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;"><defs>
<symbol id="theme-svg-external-link" viewBox="0 0 24 24"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></symbol>
</defs></svg>
<script>!function(){var t=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();document.documentElement.setAttribute("data-theme",t||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")),document.documentElement.setAttribute("data-theme-choice",t||"system")}(),function(){try{const c=new URLSearchParams(window.location.search).entries();for(var[t,e]of c)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}()</script><div id="__docusaurus"><link rel="preload" as="image" href="/theme/image/logo-black.svg"><link rel="preload" as="image" href="/theme/image/logo.svg"><style data-emotion="css-global 3rtehh">.lsd-button{width:auto;cursor:pointer;padding:6px 24px;}.lsd-button--disabled{cursor:default;opacity:0.34;}.lsd-button--large{padding:10px 40px;}.lsd-button--medium{padding:6px 24px;}.lsd-button--small{padding:6px 12px;}.lsd-button:hover:not(.lsd-button--disabled) .lsd-button__text{-webkit-text-decoration:underline;text-decoration:underline;}.lsd-button--with-icon{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.lsd-button__icon{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;}.lsd-button--large.lsd-button--with-icon{padding:10px 0px 10px 18px;}.lsd-button--large.lsd-button--with-icon .lsd-button__icon{width:42px;}.lsd-button--medium.lsd-button--with-icon{padding:6px 0px 6px 14px;}.lsd-button--medium.lsd-button--with-icon .lsd-button__icon{width:38px;}.lsd-button--small.lsd-button--with-icon{padding:6px 0px 6px 12px;}.lsd-button--small.lsd-button--with-icon .lsd-button__icon{width:34px;}.lsd-button--outlined{background:none;border:1px solid rgb(var(--lsd-border-primary));}.lsd-button--outlined .lsd-button__text{color:rgb(var(--lsd-text-primary));}.lsd-button--filled{background:rgb(var(--lsd-surface-secondary));border:1px solid rgb(var(--lsd-border-primary));}.lsd-button--filled .lsd-button__text{color:rgb(var(--lsd-text-secondary));}</style><style data-emotion="css-global 10bahxd">.lsd-icon-button{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;cursor:pointer;background:none;padding:0;border:1px solid rgb(var(--lsd-border-primary));}.lsd-icon-button--filled{background-color:rgb(var(--lsd-icon-primary));}.lsd-icon-button--filled svg{--lsd-icon-primary:var(--lsd-icon-secondary);}.lsd-icon-button--disabled{opacity:0.34;cursor:default;}.lsd-icon-button--large{width:40px;height:40px;}.lsd-icon-button--medium{width:32px;height:32px;}.lsd-icon-button--small{width:28px;height:28px;}</style><style data-emotion="css-global icqph9">.lsd-icon-button-group{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}.lsd-icon-button-group--outlined .lsd-icon-button:not(:last-child){border-right:none;}</style><style data-emotion="css-global 1f43ub2">body *{font-family:var(--lsd-typography-generic-font-family);}.lsd-typography{color:rgb(var(--lsd-text-primary));}.lsd-typography--sans-serif,.lsd-typography--sans-serif *{font-family:sans-serif;}.lsd-typography--serif,.lsd-typography--serif *{font-family:serif;}.lsd-typography--monospace,.lsd-typography--monospace *{font-family:monospace;}.lsd-typography--display1{color:rgb(var(--lsd-text-primary));font-weight:var(--lsd-display1-fontWeight);font-size:var(--lsd
2024-02-20 09:41:47 +00:00
.lsd-dropdown--error
) .lsd-dropdown__trigger:hover .lsd-dropdown__option-label,.lsd-dropdown:not(.lsd-dropdown--disabled):not(
.lsd-dropdown--error
2025-10-03 11:14:33 +00:00
) .lsd-dropdown__trigger:focus .lsd-dropdown__option-label{-webkit-text-decoration:underline;text-decoration:underline;}.lsd-dropdown__label{display:block;}.lsd-dropdown__button-container{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;}.lsd-dropdown__trigger{width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;border:none;cursor:pointer;background:none;}.lsd-dropdown__trigger:focus{outline:none;}.lsd-dropdown__option-label{cursor:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.lsd-dropdown__icons{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;gap:8px;}.lsd-dropdown__icon{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.lsd-dropdown__supporting-text{margin:6px 14px;}.lsd-dropdown--error .lsd-dropdown__option-label{-webkit-text-decoration:line-through;text-decoration:line-through;}.lsd-dropdown--disabled{opacity:0.34;cursor:initial;}.lsd-dropdown--large{width:208px;}.lsd-dropdown--large.lsd-dropdown--error{width:230px;}.lsd-dropdown--large .lsd-dropdown__label{margin:0 0 6px 18px;}.lsd-dropdown--large .lsd-dropdown__button-container{height:40px;}.lsd-dropdown--large .lsd-dropdown__trigger{padding:10px 0px 10px 18px;}.lsd-dropdown--large .lsd-dropdown__icons{padding:0px 14px;}.lsd-dropdown--medium{width:188px;}.lsd-dropdown--medium.lsd-dropdown--error{width:210px;}.lsd-dropdown--medium .lsd-dropdown__label{margin:0 0 6px 14px;}.lsd-dropdown--medium .lsd-dropdown__button-container{height:32px;}.lsd-dropdown--medium .lsd-dropdown__trigger{padding:6px 0px 6px 14px;}.lsd-dropdown--medium .lsd-dropdown__icons{padding:0px 12px;}.lsd-dropdown--small{width:164px;}.lsd-dropdown--small.lsd-dropdown--error{width:186px;}.lsd-dropdown--small .lsd-dropdown__label{margin:0 0 6px 12px;}.lsd-dropdown--small .lsd-dropdown__button-container{height:28px;}.lsd-dropdown--small .lsd-dropdown__trigger{padding:6px 0px 6px 12px;}.lsd-dropdown--small .lsd-dropdown__icons{padding:0px 10px;}.lsd-dropdown--outlined .lsd-dropdown__button-container{border:1px solid rgb(var(--lsd-border-primary));}.lsd-dropdown--underlined .lsd-dropdown__button-container{border:1px solid transparent;border-bottom:1px solid rgb(var(--lsd-border-primary));}</style><style data-emotion="css-global w2g5fy">.lsd-dropdown-item{width:100%;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border:1px solid rgb(var(--lsd-border-primary));}.lsd-dropdown-item:not(.lsd-dropdown-item--disabled){cursor:pointer;}.lsd-dropdown-item:not(.lsd-dropdown-item--disabled):hover,.lsd-dropdown-item:not(.lsd-dropdown-item--disabled):focus{outline:none;}.lsd-dropdown-item:not(.lsd-dropdown-item--disabled):hover .lsd-dropdown-item__label,.lsd-dropdown-item:not(.lsd-dropdown-item--disabled):focus .lsd-dropdown-item__label{-webkit-text-decoration:underline;text-decoration:underline;}.lsd-dropdown-item__label{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}.lsd-dropdown-item--disabled{opacity:0.34;}.lsd-dropdown-item__icon{margin-right:18px;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}.lsd-dropdown-item--small{padding:5px 9px;height:28px;}.l
2025-08-13 03:52:48 +00:00
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="connect-to-other-peers">Connect to other peers<a href="#connect-to-other-peers" class="hash-link" aria-label="Direct link to Connect to other peers" title="Direct link to Connect to other peers"></a></h2>
<p>To join the Waku Network, nodes must <a href="/learn/glossary#bootstrapping">bootstrap</a> for an entry point before discovering more peers. Nwaku provides multiple <a href="/learn/concepts/peer-discovery">peer discovery</a> mechanisms:</p>
<ul>
2025-10-03 11:14:33 +00:00
<li><a href="/run-node/configure-discovery#configure-static-peers">Configure Static Peers</a></li>
<li><a href="/run-node/configure-discovery#configure-dns-discovery">Configure DNS Discovery</a></li>
<li><a href="/run-node/configure-discovery#configure-discv5">Configure Discv5</a></li>
<li><a href="/run-node/configure-discovery#configure-peer-exchange">Configure Peer Exchange</a></li>
2025-08-13 03:52:48 +00:00
</ul>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="configure-a-domain-name">Configure a domain name<a href="#configure-a-domain-name" class="hash-link" aria-label="Direct link to Configure a domain name" title="Direct link to Configure a domain name"></a></h2>
<p>You can set up an IPv4 DNS domain name that resolves to the public IPv4 address of a node using the <code>dns4-domain-name</code> option. This allows the node&#x27;s publicly announced multiaddrs to use the <code>/dns4</code> scheme.</p>
<div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./build/wakunode2 --dns4-domain-name=[DOMAIN NAME]</span><br></span></code></pre></div></div>
<p>For example, consider the domain name <code>nwakunode.com</code>, which resolves to a <code>nwaku</code> node:</p>
<div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./build/wakunode2 --dns4-domain-name=nwakunode.com</span><br></span></code></pre></div></div>
<p>Browser nodes can only connect to nodes with a domain name and secure WebSocket (<code>wss</code>) configured. These nodes will generate a discoverable ENR with <code>/wss</code> as the multiaddr and <code>/dns4</code> as the domain name. This configuration is essential for verifying domain certificates when establishing a secure connection.</p>
<div class="theme-admonition theme-admonition-info alert--info admonition_ntHH"><span class="admonitionIcon_BGV6"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.33334 11.3333H8.66668V7.33331H7.33334V11.3333ZM8.00001 5.99998C8.1889 5.99998 8.34734 5.93598 8.47534 5.80798C8.60334 5.67998 8.66712 5.52176 8.66668 5.33331C8.66668 5.14442 8.60268 4.98598 8.47468 4.85798C8.34668 4.72998 8.18845 4.6662 8.00001 4.66665C7.81112 4.66665 7.65268 4.73065 7.52468 4.85865C7.39668 4.98665 7.3329 5.14487 7.33334 5.33331C7.33334 5.5222 7.39734 5.68065 7.52534 5.80865C7.65334 5.93665 7.81157 6.00042 8.00001 5.99998ZM8.00001 14.6666C7.07779 14.6666 6.21112 14.4915 5.40001 14.1413C4.5889 13.7911 3.88334 13.3162 3.28334 12.7166C2.68334 12.1166 2.20845 11.4111 1.85868 10.6C1.5089 9.78887 1.33379 8.9222 1.33334 7.99998C1.33334 7.07776 1.50845 6.21109 1.85868 5.39998C2.2089 4.58887 2.68379 3.88331 3.28334 3.28331C3.88334 2.68331 4.5889 2.20842 5.40001 1.85865C6.21112 1.50887 7.07779 1.33376 8.00001 1.33331C8.92223 1.33331 9.7889 1.50842 10.6 1.85865C11.4111 2.20887 12.1167 2.68376 12.7167 3.28331C13.3167 3.88331 13.7918 4.58887 14.142 5.39998C14.4922 6.21109 14.6671 7.07776 14.6667 7.99998C14.6667 8.9222 14.4916 9.78887 14.1413 10.6C13.7911 11.4111 13.3162 12.1166 12.7167 12.7166C12.1167 13.3166 11.4111 13.7918 10.6 14.142C9.7889 14.4922 8.92223 14.6671 8.00001 14.6666ZM8.00001 13.3333C9.4889 13.3333 10.75 12.8166 11.7833 11.7833C12.8167 10.75 13.3333 9.48887 13.3333 7.99998C13.3333 6.51109 12.8167 5.24998 11.7833 4.21665C10.75 3.18331 9.4889 2.66665 8.00001 2.66665C6.51112 2.66665 5.25001 3.18331 4.21668 4.21665C3.18334 5.24998 2.66668 6.51109 2.66668 7.99998C2.66668 9.48887 3.18334 10.75 4.21668 11.7833C5.25001 12.8166 6.51112 13.3333 8.00001 13.3333Z" fill="currentColor"></path></svg></span><div><span class="lsd-typography lsd-typography--body1 admonitionHeading_JPfy">info</span><span class="lsd-typography lsd-typography--body1 admonitionContent_iozl"><p>This example describes configuring a domain name that resolves to your node&#x27;s IP address and is unrelated to <a href="/learn/concepts/dns-discovery">DNS Discovery</a>.</p></span></div></div>
<div class="theme-admonition theme-admonition-tip alert--success admonition_ntHH"><span class="admonitionIcon_BGV6"><svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 14.6666C7.63333 14.6666 7.31933 14.536 7.058 14.2746C6.79667 14.0133 6.66622 13.6995 6.66667 13.3333H9.33333C9.33333 13.7 9.20267 14.014 8.94133 14.2753C8.68 14.5366 8.36622 14.6671 8 14.6666ZM5.33333 12.6666V11.3333H10.6667V12.6666H5.33333ZM5.5 10.6666C4.73333 10.2111 4.12489 9.59998 3.67467 8.83331C3.22445 8.06665 2.99956 7.23331 3 6.33331C3 4.94442 3.48622 3.76376 4.45867 2.79131C5.43111 1.81887 6.61156 1.33287 8 1.33331C9.38889 1.33331 10.5696 1.81954 11.542 2.79198C12.5144 3.76442 13.0004 4.94487 13 6.33331C13 7.23331 12.7751 8.06665 12.3253 8.83331C11.8756 9.59998 11.2671 10.2111 10.5 10.6666H5.5ZM5.9 9.33331H10.1C10.6 8.97776 10.9862 8.53887 11.2587 8.01665C11.5311 7.49442 11.6671 6.93331 11.6667 6.33331C11.6667 5.31109 11.3111 4.44442 10.6 3.73331C9.88889 3.0222 9.02222 2.66665 8 2.66665C6.97778 2.66665 6.11111 3.0222 5.4 3.73331C4.68889 4.44442 4.33333 5.31109 4.33333 6.33331C4.33333 6.93331 4.46956 7.49442 4.742 8.01665C5.01444 8.53887 5.40045 8.97776 5.9 9.33331Z" fill="currentColor"></path></svg></span><div><span class="lsd-typography lsd-typography--body1 admonitionHeading_JPfy">tip</span><span class="lsd-typography lsd-typography--body1 admonitionContent_iozl"><p>You can use the domain name provided by your cloud provider to configure the domain name for your node.</p></span></div></div>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="configure-store-protocol-and-message-store">Configure store protocol and message store<a href="#configure-store-protocol-and-message-store" class="hash-link" aria-label="Direct link to Configure store protocol and message store" title="Direct link to Configure store protocol and message store"></a></h2>
<p>To enable message caching and serve them to network peers, enable the <a href="/learn/concepts/protocols#store">Store protocol</a> using the following configuration options:</p>
<ul>
<li><code>store</code>: Enables storing messages to serve them to peers (disabled by default).</li>
<li><code>store-message-retention-policy</code>: Retention policy of the store node (how long messages will be stored). Three different retention policies are supported:
<ul>
<li>Time retention policy: <code>time:&lt;duration-in-seconds&gt;</code> (e.g., <code>time:14400</code>)</li>
<li>Capacity retention policy: <code>capacity:&lt;messages-count&gt;</code> (e.g, <code>capacity:25000</code>)</li>
<li>Size retention policy: <code>size:&lt;storage-in-MB/GB&gt;</code> (e.g, <code>size:512MB</code> or <code>size:10GB</code>)</li>
<li>Set this option to <code>none</code> to disable the retention policy. If you omit this option, it will default to <code>time:172800</code> (48 hours).</li>
</ul>
</li>
<li><code>store-message-db-url</code>: Database connection URL for storing messages in the <a href="https://docs.sqlalchemy.org/en/20/core/engines.html#database-urls" target="_blank" rel="noopener noreferrer">SQLAlchemy database URL format</a>. Setting this option to an empty string will instruct the node to use the fallback in-memory message store. If you omit this option, it will default to <code>sqlite://store.sqlite3</code>.</li>
</ul>
<div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./build/wakunode2 \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --store=true \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --store-message-retention-policy=[MESSAGE RETENTION POLICY] \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --store-message-db-url=[DATABASE CONNECTION URL]</span><br></span></code></pre></div></div>
<p>For example, consider a <code>nwaku</code> node that is configured to be a <code>Store</code> protocol and retain messages received in the last <code>21600</code> seconds (6 hours):</p>
<div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./build/wakunode2 \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --store=true \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --store-message-retention-policy=time:21600 \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --store-message-db-url=sqlite://store.sqlite3</span><br></span></code></pre></div></div>
<p>You can configure <code>nwaku</code> as a <code>Store client</code> using the <code>storenode</code> option. This allows the node to query peers for historical messages but not store any message itself.</p>
<div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./build/wakunode2 --storenode=[STORE PEER MULTIADDR]</span><br></span></code></pre></div></div>
<p>For example, consider a <code>nwaku</code> node that does not store messages but can query peers for historical messages:</p>
<div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./build/wakunode2 --storenode=/dns4/node-01.ac-cn-hongkong-c.waku.sandbox.status.im/tcp/30303/p2p/16Uiu2HAmSJvSJphxRdbnigUV5bjRRZFBhTtWFTSyiKaQByCjwmpV</span><br></span></code></pre></div></div>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="configure-store-sync">Configure store sync<a href="#configure-store-sync" class="hash-link" aria-label="Direct link to Configure store sync" title="Direct link to Configure store sync"></a></h2>
<p>To enable synchronization between stores, enable the protocol via the configuration options below;</p>
<ul>
<li><code>store-sync</code>: Enable store sync protocol (disable by default).</li>
<li><code>store-sync-interval</code>: Interval between store synchronization attempts, in seconds (300s default).</li>
<li><code>store-sync-range</code>: Amount of time to sync, in seconds (3600s default).</li>
<li><code>store-sync-relay-jitter</code>: Sync range offset to account for relay&#x27;s message propagation jitter, in seconds (20s default).</li>
</ul>
<p>Configuration example.</p>
<div class="language-text codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./build/wakunode2 \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --store-sync=true \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --store-sync-interval=300 \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --store-sync-range=3600 \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --store-sync-relay-jitter=20</span><br></span></code></pre></div></div>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="generate-and-configure-a-node-key">Generate and configure a node key<a href="#generate-and-configure-a-node-key" class="hash-link" aria-label="Direct link to Generate and configure a node key" title="Direct link to Generate and configure a node key"></a></h2>
<p>Nodes generate <a href="/learn/glossary#node-key">new random key pairs</a> at each boot, leading to different <code>multiaddrs</code>. To maintain consistency, you can use a pre-generated private key with the <code>nodekey</code> option:</p>
<div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./build/wakunode2 --nodekey=[NODE PRIVATE KEY]</span><br></span></code></pre></div></div>
<p>This option takes a <a href="https://en.bitcoin.it/wiki/Secp256k1" target="_blank" rel="noopener noreferrer">Secp256k1</a> private key (64-char hex string). On Linux, you can use the OpenSSL <code>rand</code> command for a pseudo-random 32-byte hex string:</p>
<div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">openssl rand -hex 32</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"># 286cae9f2990bfc49dafdd3a9e737f56ddba3656e5e427108cef456fb67680e8</span><br></span></code></pre></div></div>
<p>On Linux, you can create a reusable key file using OpenSSL. To get the 32-byte private key in hex format, use the <code>ecparam</code> command and some standard utilities:</p>
<div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain"># Generate key file</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">openssl ecparam -genkey -name secp256k1 -out my_private_key.pem</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"># Extract 32-byte private key</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">openssl ec -in my_private_key.pem -outform DER | tail -c +8 | head -c 32| xxd -p -c 32</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"># read EC key</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"># writing EC key</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"># 286cae9f2990bfc49dafdd3a9e737f56ddba3656e5e427108cef456fb67680e8</span><br></span></code></pre></div></div>
<p>You can use the output <code>286cae9f2990bfc49dafdd3a9e737f56ddba3656e5e427108cef456fb67680e8</code> as a <code>Node Key</code> for <code>nwaku</code>:</p>
<div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./build/wakunode2 --nodekey=286cae9f2990bfc49dafdd3a9e737f56ddba3656e5e427108cef456fb67680e8</span><br></span></code></pre></div></div>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="configure-websocket-transport">Configure WebSocket transport<a href="#configure-websocket-transport" class="hash-link" aria-label="Direct link to Configure WebSocket transport" title="Direct link to Configure WebSocket transport"></a></h2>
2025-10-03 11:14:33 +00:00
<p>WebSocket is the only <a href="/learn/concepts/transports">transport method</a> browser nodes support using <a href="/build/javascript/">@waku/sdk</a>. To enable WebSocket in <code>nwaku</code> to serve browser peers, use the following configuration options:</p>
2025-08-13 03:52:48 +00:00
<ul>
<li><code>websocket-support</code>: Enables WebSocket (<code>ws</code>) on the node (disabled by default).</li>
<li><code>websocket-port</code> (optional): WebSocket listening port. If you omit this option, it will default to <code>8000</code>.</li>
<li><code>websocket-secure-support</code>: Enables Secure WebSocket (<code>wss</code>) on the node (disabled by default).</li>
<li><code>websocket-secure-key-path</code>: Secure WebSocket key path.</li>
<li><code>websocket-secure-cert-path</code>: Secure WebSocket Certificate path.</li>
</ul>
<div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./build/wakunode2 \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --websocket-support=true \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --websocket-port=[WEBSOCKET LISTENING PORT] \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --websocket-secure-support=true \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --websocket-secure-key-path=[SECURE WEBSOCKET KEY PATH] \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --websocket-secure-cert-path=[SECURE WEBSOCKET CERTIFICATE PATH]</span><br></span></code></pre></div></div>
<p>For example, consider a <code>nwaku</code> node that enabled WebSocket (unencrypted) for local testing on port <code>8001</code>:</p>
<div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./build/wakunode2 \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --websocket-support=true \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --websocket-port=8001</span><br></span></code></pre></div></div>
<p>Consider a <code>nwaku</code> node that enabled Secure WebSocket (encrypted) using its key and certificate (<code>privkey.pem</code> and <code>fullchain.pem</code>) on port <code>8002</code>:</p>
<div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./build/wakunode2 \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --websocket-secure-support=true \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --websocket-secure-key-path=privkey.pem \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --websocket-secure-cert-path=fullchain.pem \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --websocket-port=8002</span><br></span></code></pre></div></div>
<div class="theme-admonition theme-admonition-tip alert--success admonition_ntHH"><span class="admonitionIcon_BGV6"><svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 14.6666C7.63333 14.6666 7.31933 14.536 7.058 14.2746C6.79667 14.0133 6.66622 13.6995 6.66667 13.3333H9.33333C9.33333 13.7 9.20267 14.014 8.94133 14.2753C8.68 14.5366 8.36622 14.6671 8 14.6666ZM5.33333 12.6666V11.3333H10.6667V12.6666H5.33333ZM5.5 10.6666C4.73333 10.2111 4.12489 9.59998 3.67467 8.83331C3.22445 8.06665 2.99956 7.23331 3 6.33331C3 4.94442 3.48622 3.76376 4.45867 2.79131C5.43111 1.81887 6.61156 1.33287 8 1.33331C9.38889 1.33331 10.5696 1.81954 11.542 2.79198C12.5144 3.76442 13.0004 4.94487 13 6.33331C13 7.23331 12.7751 8.06665 12.3253 8.83331C11.8756 9.59998 11.2671 10.2111 10.5 10.6666H5.5ZM5.9 9.33331H10.1C10.6 8.97776 10.9862 8.53887 11.2587 8.01665C11.5311 7.49442 11.6671 6.93331 11.6667 6.33331C11.6667 5.31109 11.3111 4.44442 10.6 3.73331C9.88889 3.0222 9.02222 2.66665 8 2.66665C6.97778 2.66665 6.11111 3.0222 5.4 3.73331C4.68889 4.44442 4.33333 5.31109 4.33333 6.33331C4.33333 6.93331 4.46956 7.49442 4.742 8.01665C5.01444 8.53887 5.40045 8.97776 5.9 9.33331Z" fill="currentColor"></path></svg></span><div><span class="lsd-typography lsd-typography--body1 admonitionHeading_JPfy">tip</span><span class="lsd-typography lsd-typography--body1 admonitionContent_iozl"><p>You can use <a href="https://letsencrypt.org/" target="_blank" rel="noopener noreferrer">Let&#x27;s Encrypt</a> or <a href="https://certbot.eff.org/" target="_blank" rel="noopener noreferrer">Certbot</a> to generate a valid certificate for your <code>nwaku</code> node:</p><div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">sudo certbot certonly -d &lt;your.domain.name&gt;</span><br></span></code></pre></div></div></span></div></div>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="configure-rest-api-server">Configure REST API server<a href="#configure-rest-api-server" class="hash-link" aria-label="Direct link to Configure REST API server" title="Direct link to Configure REST API server"></a></h2>
<p>Nwaku provides a <a href="https://waku-org.github.io/waku-rest-api/" target="_blank" rel="noopener noreferrer">REST API</a> to interact with the node and Waku Network. To enable the REST API, use the following configuration options:</p>
<ul>
<li><code>rest</code>: Enables the REST API server on the node (disabled by default).</li>
<li><code>rest-address</code> (optional): Listening address of the REST API server. If you omit this option, it will default to <code>127.0.0.1</code>.</li>
<li><code>rest-port</code> (optional): Listening port of the REST API server. If you omit this option, it will default to <code>8645</code>.</li>
<li><code>rest-relay-cache-capacity</code> (optional): Capacity of the Relay REST API message cache. If you omit this option, it will default to <code>30</code>.</li>
<li><code>rest-admin</code> (optional): Enables access to REST admin API (disabled by default).</li>
<li><code>rest-private</code> (optional): Enables access to REST private API (disabled by default).</li>
</ul>
<div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./build/wakunode2 \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --rest=true \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --rest-address=[REST SERVER LISTENING ADDRESS] \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --rest-port=[REST SERVER LISTENING PORT] \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --rest-relay-cache-capacity=[MESSAGE CACHE CAPACITY] \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --rest-admin=[true|false] \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --rest-private=[true|false]</span><br></span></code></pre></div></div>
<p>For example, consider a <code>nwaku</code> node that enabled the REST API server on port <code>9000</code>:</p>
<div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./build/wakunode2 \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --rest=true \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --rest-port=9000 \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --rest-address=127.0.0.1</span><br></span></code></pre></div></div>
<p>Consider a <code>nwaku</code> node that enabled the REST <code>admin</code> and <code>private</code> API with a message cache capacity of <code>100</code>:</p>
<div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./build/wakunode2 \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --rest=true \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --rest-admin=true \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --rest-private=true \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --rest-relay-cache-capacity=100</span><br></span></code></pre></div></div>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="configure-filter-protocol">Configure filter protocol<a href="#configure-filter-protocol" class="hash-link" aria-label="Direct link to Configure filter protocol" title="Direct link to Configure filter protocol"></a></h2>
<p>To enable <code>nwaku</code> to serve light clients, enable the <a href="/learn/concepts/protocols#filter">Filter protocol</a> using <code>filter</code> option:</p>
<div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./build/wakunode2 --filter=true</span><br></span></code></pre></div></div>
<p>You can configure <code>nwaku</code> as a <code>Filter client</code> using the <code>filternode</code> and <code>filter-timeout</code> options. This allows the node to request content filtering of messages from peers.</p>
<div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./build/wakunode2 \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --filternode=[FILTER PEER MULTIADDR] \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --filter-timeout=[FILTER PEER TIMEOUT]</span><br></span></code></pre></div></div>
<p>For example, consider a <code>nwaku</code> node that requests content filtering of messages from peers with a timeout of <code>21600</code> seconds (6 hours):</p>
<div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./build/wakunode2 \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --filternode=/dns4/node-01.ac-cn-hongkong-c.waku.sandbox.status.im/tcp/30303/p2p/16Uiu2HAmSJvSJphxRdbnigUV5bjRRZFBhTtWFTSyiKaQByCjwmpV \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --filter-timeout=21600</span><br></span></code></pre></div></div>
<div class="theme-admonition theme-admonition-info alert--info admonition_ntHH"><span class="admonitionIcon_BGV6"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.33334 11.3333H8.66668V7.33331H7.33334V11.3333ZM8.00001 5.99998C8.1889 5.99998 8.34734 5.93598 8.47534 5.80798C8.60334 5.67998 8.66712 5.52176 8.66668 5.33331C8.66668 5.14442 8.60268 4.98598 8.47468 4.85798C8.34668 4.72998 8.18845 4.6662 8.00001 4.66665C7.81112 4.66665 7.65268 4.73065 7.52468 4.85865C7.39668 4.98665 7.3329 5.14487 7.33334 5.33331C7.33334 5.5222 7.39734 5.68065 7.52534 5.80865C7.65334 5.93665 7.81157 6.00042 8.00001 5.99998ZM8.00001 14.6666C7.07779 14.6666 6.21112 14.4915 5.40001 14.1413C4.5889 13.7911 3.88334 13.3162 3.28334 12.7166C2.68334 12.1166 2.20845 11.4111 1.85868 10.6C1.5089 9.78887 1.33379 8.9222 1.33334 7.99998C1.33334 7.07776 1.50845 6.21109 1.85868 5.39998C2.2089 4.58887 2.68379 3.88331 3.28334 3.28331C3.88334 2.68331 4.5889 2.20842 5.40001 1.85865C6.21112 1.50887 7.07779 1.33376 8.00001 1.33331C8.92223 1.33331 9.7889 1.50842 10.6 1.85865C11.4111 2.20887 12.1167 2.68376 12.7167 3.28331C13.3167 3.88331 13.7918 4.58887 14.142 5.39998C14.4922 6.21109 14.6671 7.07776 14.6667 7.99998C14.6667 8.9222 14.4916 9.78887 14.1413 10.6C13.7911 11.4111 13.3162 12.1166 12.7167 12.7166C12.1167 13.3166 11.4111 13.7918 10.6 14.142C9.7889 14.4922 8.92223 14.6671 8.00001 14.6666ZM8.00001 13.3333C9.4889 13.3333 10.75 12.8166 11.7833 11.7833C12.8167 10.75 13.3333 9.48887 13.3333 7.99998C13.3333 6.51109 12.8167 5.24998 11.7833 4.21665C10.75 3.18331 9.4889 2.66665 8.00001 2.66665C6.51112 2.66665 5.25001 3.18331 4.21668 4.21665C3.18334 5.24998 2.66668 6.51109 2.66668 7.99998C2.66668 9.48887 3.18334 10.75 4.21668 11.7833C5.25001 12.8166 6.51112 13.3333 8.00001 13.3333Z" fill="currentColor"></path></svg></span><div><span class="lsd-typography lsd-typography--body1 admonitionHeading_JPfy">info</span><span class="lsd-typography lsd-typography--body1 admonitionContent_iozl"><p>If you omit the <code>filter-timeout</code> option, it will default to <code>14400</code> seconds (4 hours).</p></span></div></div>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="configure-light-push-protocol">Configure light push protocol<a href="#configure-light-push-protocol" class="hash-link" aria-label="Direct link to Configure light push protocol" title="Direct link to Configure light push protocol"></a></h2>
<p>To enable <code>nwaku</code> to serve light clients, enable the <a href="/learn/concepts/protocols#light-push">Light Push protocol</a> using the <code>lightpush</code> option:</p>
<div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./build/wakunode2 --lightpush=true</span><br></span></code></pre></div></div>
<p>You can configure <code>nwaku</code> as a <code>Light Push client</code> using the <code>lightpushnode</code> option. This allows the node to request lightpush of published messages from peers.</p>
<div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./build/wakunode2 --lightpushnode=[LIGHT PUSH PEER MULTIADDR]</span><br></span></code></pre></div></div>
<p>For example, consider a <code>nwaku</code> node that requests lightpush of published messages from peers:</p>
<div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./build/wakunode2 --lightpushnode=/dns4/node-01.ac-cn-hongkong-c.waku.sandbox.status.im/tcp/30303/p2p/16Uiu2HAmSJvSJphxRdbnigUV5bjRRZFBhTtWFTSyiKaQByCjwmpV</span><br></span></code></pre></div></div>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="run-nwaku-behind-a-reverse-proxy">Run nwaku behind a reverse proxy<a href="#run-nwaku-behind-a-reverse-proxy" class="hash-link" aria-label="Direct link to Run nwaku behind a reverse proxy" title="Direct link to Run nwaku behind a reverse proxy"></a></h2>
<p>When using a reverse proxy server for SSL/TLS encryption, you only want to announce the proxy server&#x27;s IP or domain. Nwaku provides the <code>ext-multiaddr-only</code> and <code>ext-multiaddr</code> options for specifying published multiaddr:</p>
<div class="language-shell codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./build/wakunode2 \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --ext-multiaddr-only=true \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --ext-multiaddr=[MULTIADDR TO PUBLISH]</span><br></span></code></pre></div></div>
2025-10-03 11:14:33 +00:00
<div class="theme-admonition theme-admonition-info alert--info admonition_ntHH"><span class="admonitionIcon_BGV6"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.33334 11.3333H8.66668V7.33331H7.33334V11.3333ZM8.00001 5.99998C8.1889 5.99998 8.34734 5.93598 8.47534 5.80798C8.60334 5.67998 8.66712 5.52176 8.66668 5.33331C8.66668 5.14442 8.60268 4.98598 8.47468 4.85798C8.34668 4.72998 8.18845 4.6662 8.00001 4.66665C7.81112 4.66665 7.65268 4.73065 7.52468 4.85865C7.39668 4.98665 7.3329 5.14487 7.33334 5.33331C7.33334 5.5222 7.39734 5.68065 7.52534 5.80865C7.65334 5.93665 7.81157 6.00042 8.00001 5.99998ZM8.00001 14.6666C7.07779 14.6666 6.21112 14.4915 5.40001 14.1413C4.5889 13.7911 3.88334 13.3162 3.28334 12.7166C2.68334 12.1166 2.20845 11.4111 1.85868 10.6C1.5089 9.78887 1.33379 8.9222 1.33334 7.99998C1.33334 7.07776 1.50845 6.21109 1.85868 5.39998C2.2089 4.58887 2.68379 3.88331 3.28334 3.28331C3.88334 2.68331 4.5889 2.20842 5.40001 1.85865C6.21112 1.50887 7.07779 1.33376 8.00001 1.33331C8.92223 1.33331 9.7889 1.50842 10.6 1.85865C11.4111 2.20887 12.1167 2.68376 12.7167 3.28331C13.3167 3.88331 13.7918 4.58887 14.142 5.39998C14.4922 6.21109 14.6671 7.07776 14.6667 7.99998C14.6667 8.9222 14.4916 9.78887 14.1413 10.6C13.7911 11.4111 13.3162 12.1166 12.7167 12.7166C12.1167 13.3166 11.4111 13.7918 10.6 14.142C9.7889 14.4922 8.92223 14.6671 8.00001 14.6666ZM8.00001 13.3333C9.4889 13.3333 10.75 12.8166 11.7833 11.7833C12.8167 10.75 13.3333 9.48887 13.3333 7.99998C13.3333 6.51109 12.8167 5.24998 11.7833 4.21665C10.75 3.18331 9.4889 2.66665 8.00001 2.66665C6.51112 2.66665 5.25001 3.18331 4.21668 4.21665C3.18334 5.24998 2.66668 6.51109 2.66668 7.99998C2.66668 9.48887 3.18334 10.75 4.21668 11.7833C5.25001 12.8166 6.51112 13.3333 8.00001 13.3333Z" fill="currentColor"></path></svg></span><div><span class="lsd-typography lsd-typography--body1 admonitionHeading_JPfy">info</span><span class="lsd-typography lsd-typography--body1 admonitionContent_iozl"><p>The <code>ext-multiaddr-only</code> option takes precedence over the <code>nat</code> and <code>dns4-domain-name</code> options, using the values provided by the <code>ext-multiaddr</code> option instead.</p></span></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="row margin-top--sm theme-doc-footer-edit-meta-row"><div class="col"><a href="https://github.com/waku-org/docs.waku.org/tree/develop/docs/run-node/configure-nwaku.md" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><div class="icon_S7Kx m_thRi"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="#fff" fill-rule="evenodd" d="m12.707 2.393.9.9c.526.52.526 1.367 0 1.887L4.787 14H2v-2.787l6.933-6.94 1.887-1.88c.52-.52 1.367-.52 1.887 0M3.333 12.667l.94.04 6.547-6.554-.94-.94-6.547 6.547z" clip-rule="evenodd"></path></svg></div><span class="lsd-typography lsd-typography--body2">Edit this page</span></a></div><div class="col lastUpdated_JAkA"></div></div></footer></article><nav class="docusaurus-mt-lg pagination-nav" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/run-node/config-options"><div class="icon_S7Kx m_thRi"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="none" viewBox="0 0 14 14"><path fill="#fff" d="M11.667 6.417h-7.1L7.83 3.156 7 2.333 2.334 7 7 11.667l.823-.823-3.255-3.26h7.099z"></path></svg></div><span class="lsd-typography lsd-typography--body2 pagination-nav__label">Node Configuration Options</span></a><a class="pagination-nav__link pagination-nav__link--next" href="/run-node/faq"><span class="lsd-typography lsd-typography--body2 pagination-nav__label">Frequently Asked Questions</span><div class="icon_S7Kx m_thRi"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="none" viewBox="0 0 14 14"><path fill="#fff" d="m7 2.334-.823.822 3.255 3.26H2.333v1.167h7.1l-3.256 3.261.823.823L11.667 7z"></path></svg></div></a></nav></div></div><div class="gap1_XuuQ"></div></div></div></main></d
2024-02-20 09:41:47 +00:00
</body>
</html>