docs.waku.org/assets/js/6e63b96f.8fc0fd2e.js
2025-10-03 11:14:33 +00:00

1 line
22 KiB
JavaScript

"use strict";(self.webpackChunkwaku_guide=self.webpackChunkwaku_guide||[]).push([[8722],{11077:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>d,default:()=>h,frontMatter:()=>t,metadata:()=>o,toc:()=>l});const o=JSON.parse('{"id":"run-node/configure-nwaku","title":"Node Configuration Examples","description":"This guide provides detailed steps to configure a nwaku node for different use cases.","source":"@site/docs/run-node/configure-nwaku.md","sourceDirName":"run-node","slug":"/run-node/configure-nwaku","permalink":"/run-node/configure-nwaku","draft":false,"unlisted":false,"editUrl":"https://github.com/waku-org/docs.waku.org/tree/develop/docs/run-node/configure-nwaku.md","tags":[],"version":"current","lastUpdatedAt":null,"frontMatter":{"title":"Node Configuration Examples","hide_table_of_contents":true,"displayed_sidebar":"runNode"},"sidebar":"runNode","previous":{"title":"Node Configuration Options","permalink":"/run-node/config-options"},"next":{"title":"Frequently Asked Questions","permalink":"/run-node/faq"}}');var r=s(74848),i=s(28453);const t={title:"Node Configuration Examples",hide_table_of_contents:!0,displayed_sidebar:"runNode"},d=void 0,c={},l=[{value:"Connect to other peers",id:"connect-to-other-peers",level:2},{value:"Configure a domain name",id:"configure-a-domain-name",level:2},{value:"Configure store protocol and message store",id:"configure-store-protocol-and-message-store",level:2},{value:"Configure store sync",id:"configure-store-sync",level:2},{value:"Generate and configure a node key",id:"generate-and-configure-a-node-key",level:2},{value:"Configure WebSocket transport",id:"configure-websocket-transport",level:2},{value:"Configure REST API server",id:"configure-rest-api-server",level:2},{value:"Configure filter protocol",id:"configure-filter-protocol",level:2},{value:"Configure light push protocol",id:"configure-light-push-protocol",level:2},{value:"Run nwaku behind a reverse proxy",id:"run-nwaku-behind-a-reverse-proxy",level:2}];function a(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.p,{children:["This guide provides detailed steps to configure a ",(0,r.jsx)(n.code,{children:"nwaku"})," node for different use cases."]}),"\n",(0,r.jsx)(n.h2,{id:"connect-to-other-peers",children:"Connect to other peers"}),"\n",(0,r.jsxs)(n.p,{children:["To join the Waku Network, nodes must ",(0,r.jsx)(n.a,{href:"/learn/glossary#bootstrapping",children:"bootstrap"})," for an entry point before discovering more peers. Nwaku provides multiple ",(0,r.jsx)(n.a,{href:"/learn/concepts/peer-discovery",children:"peer discovery"})," mechanisms:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"/run-node/configure-discovery#configure-static-peers",children:"Configure Static Peers"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"/run-node/configure-discovery#configure-dns-discovery",children:"Configure DNS Discovery"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"/run-node/configure-discovery#configure-discv5",children:"Configure Discv5"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"/run-node/configure-discovery#configure-peer-exchange",children:"Configure Peer Exchange"})}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"configure-a-domain-name",children:"Configure a domain name"}),"\n",(0,r.jsxs)(n.p,{children:["You can set up an IPv4 DNS domain name that resolves to the public IPv4 address of a node using the ",(0,r.jsx)(n.code,{children:"dns4-domain-name"})," option. This allows the node's publicly announced multiaddrs to use the ",(0,r.jsx)(n.code,{children:"/dns4"})," scheme."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"./build/wakunode2 --dns4-domain-name=[DOMAIN NAME]\n"})}),"\n",(0,r.jsxs)(n.p,{children:["For example, consider the domain name ",(0,r.jsx)(n.code,{children:"nwakunode.com"}),", which resolves to a ",(0,r.jsx)(n.code,{children:"nwaku"})," node:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"./build/wakunode2 --dns4-domain-name=nwakunode.com\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Browser nodes can only connect to nodes with a domain name and secure WebSocket (",(0,r.jsx)(n.code,{children:"wss"}),") configured. These nodes will generate a discoverable ENR with ",(0,r.jsx)(n.code,{children:"/wss"})," as the multiaddr and ",(0,r.jsx)(n.code,{children:"/dns4"})," as the domain name. This configuration is essential for verifying domain certificates when establishing a secure connection."]}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["This example describes configuring a domain name that resolves to your node's IP address and is unrelated to ",(0,r.jsx)(n.a,{href:"/learn/concepts/dns-discovery",children:"DNS Discovery"}),"."]})}),"\n",(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsx)(n.p,{children:"You can use the domain name provided by your cloud provider to configure the domain name for your node."})}),"\n",(0,r.jsx)(n.h2,{id:"configure-store-protocol-and-message-store",children:"Configure store protocol and message store"}),"\n",(0,r.jsxs)(n.p,{children:["To enable message caching and serve them to network peers, enable the ",(0,r.jsx)(n.a,{href:"/learn/concepts/protocols#store",children:"Store protocol"})," using the following configuration options:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"store"}),": Enables storing messages to serve them to peers (disabled by default)."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"store-message-retention-policy"}),": Retention policy of the store node (how long messages will be stored). Three different retention policies are supported:","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Time retention policy: ",(0,r.jsx)(n.code,{children:"time:<duration-in-seconds>"})," (e.g., ",(0,r.jsx)(n.code,{children:"time:14400"}),")"]}),"\n",(0,r.jsxs)(n.li,{children:["Capacity retention policy: ",(0,r.jsx)(n.code,{children:"capacity:<messages-count>"})," (e.g, ",(0,r.jsx)(n.code,{children:"capacity:25000"}),")"]}),"\n",(0,r.jsxs)(n.li,{children:["Size retention policy: ",(0,r.jsx)(n.code,{children:"size:<storage-in-MB/GB>"})," (e.g, ",(0,r.jsx)(n.code,{children:"size:512MB"})," or ",(0,r.jsx)(n.code,{children:"size:10GB"}),")"]}),"\n",(0,r.jsxs)(n.li,{children:["Set this option to ",(0,r.jsx)(n.code,{children:"none"})," to disable the retention policy. If you omit this option, it will default to ",(0,r.jsx)(n.code,{children:"time:172800"})," (48 hours)."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"store-message-db-url"}),": Database connection URL for storing messages in the ",(0,r.jsx)(n.a,{href:"https://docs.sqlalchemy.org/en/20/core/engines.html#database-urls",children:"SQLAlchemy database URL format"}),". 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 ",(0,r.jsx)(n.code,{children:"sqlite://store.sqlite3"}),"."]}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"./build/wakunode2 \\\n --store=true \\\n --store-message-retention-policy=[MESSAGE RETENTION POLICY] \\\n --store-message-db-url=[DATABASE CONNECTION URL]\n"})}),"\n",(0,r.jsxs)(n.p,{children:["For example, consider a ",(0,r.jsx)(n.code,{children:"nwaku"})," node that is configured to be a ",(0,r.jsx)(n.code,{children:"Store"})," protocol and retain messages received in the last ",(0,r.jsx)(n.code,{children:"21600"})," seconds (6 hours):"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"./build/wakunode2 \\\n --store=true \\\n --store-message-retention-policy=time:21600 \\\n --store-message-db-url=sqlite://store.sqlite3\n"})}),"\n",(0,r.jsxs)(n.p,{children:["You can configure ",(0,r.jsx)(n.code,{children:"nwaku"})," as a ",(0,r.jsx)(n.code,{children:"Store client"})," using the ",(0,r.jsx)(n.code,{children:"storenode"})," option. This allows the node to query peers for historical messages but not store any message itself."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"./build/wakunode2 --storenode=[STORE PEER MULTIADDR]\n"})}),"\n",(0,r.jsxs)(n.p,{children:["For example, consider a ",(0,r.jsx)(n.code,{children:"nwaku"})," node that does not store messages but can query peers for historical messages:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"./build/wakunode2 --storenode=/dns4/node-01.ac-cn-hongkong-c.waku.sandbox.status.im/tcp/30303/p2p/16Uiu2HAmSJvSJphxRdbnigUV5bjRRZFBhTtWFTSyiKaQByCjwmpV\n"})}),"\n",(0,r.jsx)(n.h2,{id:"configure-store-sync",children:"Configure store sync"}),"\n",(0,r.jsx)(n.p,{children:"To enable synchronization between stores, enable the protocol via the configuration options below;"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"store-sync"}),": Enable store sync protocol (disable by default)."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"store-sync-interval"}),": Interval between store synchronization attempts, in seconds (300s default)."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"store-sync-range"}),": Amount of time to sync, in seconds (3600s default)."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"store-sync-relay-jitter"}),": Sync range offset to account for relay's message propagation jitter, in seconds (20s default)."]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Configuration example."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"./build/wakunode2 \\\n --store-sync=true \\\n --store-sync-interval=300 \\\n --store-sync-range=3600 \\\n --store-sync-relay-jitter=20\n"})}),"\n",(0,r.jsx)(n.h2,{id:"generate-and-configure-a-node-key",children:"Generate and configure a node key"}),"\n",(0,r.jsxs)(n.p,{children:["Nodes generate ",(0,r.jsx)(n.a,{href:"/learn/glossary#node-key",children:"new random key pairs"})," at each boot, leading to different ",(0,r.jsx)(n.code,{children:"multiaddrs"}),". To maintain consistency, you can use a pre-generated private key with the ",(0,r.jsx)(n.code,{children:"nodekey"})," option:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"./build/wakunode2 --nodekey=[NODE PRIVATE KEY]\n"})}),"\n",(0,r.jsxs)(n.p,{children:["This option takes a ",(0,r.jsx)(n.a,{href:"https://en.bitcoin.it/wiki/Secp256k1",children:"Secp256k1"})," private key (64-char hex string). On Linux, you can use the OpenSSL ",(0,r.jsx)(n.code,{children:"rand"})," command for a pseudo-random 32-byte hex string:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"openssl rand -hex 32\n\n# 286cae9f2990bfc49dafdd3a9e737f56ddba3656e5e427108cef456fb67680e8\n"})}),"\n",(0,r.jsxs)(n.p,{children:["On Linux, you can create a reusable key file using OpenSSL. To get the 32-byte private key in hex format, use the ",(0,r.jsx)(n.code,{children:"ecparam"})," command and some standard utilities:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"# Generate key file\nopenssl ecparam -genkey -name secp256k1 -out my_private_key.pem\n\n# Extract 32-byte private key\nopenssl ec -in my_private_key.pem -outform DER | tail -c +8 | head -c 32| xxd -p -c 32\n\n# read EC key\n# writing EC key\n# 286cae9f2990bfc49dafdd3a9e737f56ddba3656e5e427108cef456fb67680e8\n"})}),"\n",(0,r.jsxs)(n.p,{children:["You can use the output ",(0,r.jsx)(n.code,{children:"286cae9f2990bfc49dafdd3a9e737f56ddba3656e5e427108cef456fb67680e8"})," as a ",(0,r.jsx)(n.code,{children:"Node Key"})," for ",(0,r.jsx)(n.code,{children:"nwaku"}),":"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"./build/wakunode2 --nodekey=286cae9f2990bfc49dafdd3a9e737f56ddba3656e5e427108cef456fb67680e8\n"})}),"\n",(0,r.jsx)(n.h2,{id:"configure-websocket-transport",children:"Configure WebSocket transport"}),"\n",(0,r.jsxs)(n.p,{children:["WebSocket is the only ",(0,r.jsx)(n.a,{href:"/learn/concepts/transports",children:"transport method"})," browser nodes support using ",(0,r.jsx)(n.a,{href:"/build/javascript/",children:"@waku/sdk"}),". To enable WebSocket in ",(0,r.jsx)(n.code,{children:"nwaku"})," to serve browser peers, use the following configuration options:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"websocket-support"}),": Enables WebSocket (",(0,r.jsx)(n.code,{children:"ws"}),") on the node (disabled by default)."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"websocket-port"})," (optional): WebSocket listening port. If you omit this option, it will default to ",(0,r.jsx)(n.code,{children:"8000"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"websocket-secure-support"}),": Enables Secure WebSocket (",(0,r.jsx)(n.code,{children:"wss"}),") on the node (disabled by default)."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"websocket-secure-key-path"}),": Secure WebSocket key path."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"websocket-secure-cert-path"}),": Secure WebSocket Certificate path."]}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"./build/wakunode2 \\\n --websocket-support=true \\\n --websocket-port=[WEBSOCKET LISTENING PORT] \\\n --websocket-secure-support=true \\\n --websocket-secure-key-path=[SECURE WEBSOCKET KEY PATH] \\\n --websocket-secure-cert-path=[SECURE WEBSOCKET CERTIFICATE PATH]\n"})}),"\n",(0,r.jsxs)(n.p,{children:["For example, consider a ",(0,r.jsx)(n.code,{children:"nwaku"})," node that enabled WebSocket (unencrypted) for local testing on port ",(0,r.jsx)(n.code,{children:"8001"}),":"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"./build/wakunode2 \\\n --websocket-support=true \\\n --websocket-port=8001\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Consider a ",(0,r.jsx)(n.code,{children:"nwaku"})," node that enabled Secure WebSocket (encrypted) using its key and certificate (",(0,r.jsx)(n.code,{children:"privkey.pem"})," and ",(0,r.jsx)(n.code,{children:"fullchain.pem"}),") on port ",(0,r.jsx)(n.code,{children:"8002"}),":"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"./build/wakunode2 \\\n --websocket-secure-support=true \\\n --websocket-secure-key-path=privkey.pem \\\n --websocket-secure-cert-path=fullchain.pem \\\n --websocket-port=8002\n"})}),"\n",(0,r.jsxs)(n.admonition,{type:"tip",children:[(0,r.jsxs)(n.p,{children:["You can use ",(0,r.jsx)(n.a,{href:"https://letsencrypt.org/",children:"Let's Encrypt"})," or ",(0,r.jsx)(n.a,{href:"https://certbot.eff.org/",children:"Certbot"})," to generate a valid certificate for your ",(0,r.jsx)(n.code,{children:"nwaku"})," node:"]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"sudo certbot certonly -d <your.domain.name>\n"})})]}),"\n",(0,r.jsx)(n.h2,{id:"configure-rest-api-server",children:"Configure REST API server"}),"\n",(0,r.jsxs)(n.p,{children:["Nwaku provides a ",(0,r.jsx)(n.a,{href:"https://waku-org.github.io/waku-rest-api/",children:"REST API"})," to interact with the node and Waku Network. To enable the REST API, use the following configuration options:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"rest"}),": Enables the REST API server on the node (disabled by default)."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"rest-address"})," (optional): Listening address of the REST API server. If you omit this option, it will default to ",(0,r.jsx)(n.code,{children:"127.0.0.1"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"rest-port"})," (optional): Listening port of the REST API server. If you omit this option, it will default to ",(0,r.jsx)(n.code,{children:"8645"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"rest-relay-cache-capacity"})," (optional): Capacity of the Relay REST API message cache. If you omit this option, it will default to ",(0,r.jsx)(n.code,{children:"30"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"rest-admin"})," (optional): Enables access to REST admin API (disabled by default)."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"rest-private"})," (optional): Enables access to REST private API (disabled by default)."]}),"\n"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"./build/wakunode2 \\\n --rest=true \\\n --rest-address=[REST SERVER LISTENING ADDRESS] \\\n --rest-port=[REST SERVER LISTENING PORT] \\\n --rest-relay-cache-capacity=[MESSAGE CACHE CAPACITY] \\\n --rest-admin=[true|false] \\\n --rest-private=[true|false]\n"})}),"\n",(0,r.jsxs)(n.p,{children:["For example, consider a ",(0,r.jsx)(n.code,{children:"nwaku"})," node that enabled the REST API server on port ",(0,r.jsx)(n.code,{children:"9000"}),":"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"./build/wakunode2 \\\n --rest=true \\\n --rest-port=9000 \\\n --rest-address=127.0.0.1\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Consider a ",(0,r.jsx)(n.code,{children:"nwaku"})," node that enabled the REST ",(0,r.jsx)(n.code,{children:"admin"})," and ",(0,r.jsx)(n.code,{children:"private"})," API with a message cache capacity of ",(0,r.jsx)(n.code,{children:"100"}),":"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"./build/wakunode2 \\\n --rest=true \\\n --rest-admin=true \\\n --rest-private=true \\\n --rest-relay-cache-capacity=100\n"})}),"\n",(0,r.jsx)(n.h2,{id:"configure-filter-protocol",children:"Configure filter protocol"}),"\n",(0,r.jsxs)(n.p,{children:["To enable ",(0,r.jsx)(n.code,{children:"nwaku"})," to serve light clients, enable the ",(0,r.jsx)(n.a,{href:"/learn/concepts/protocols#filter",children:"Filter protocol"})," using ",(0,r.jsx)(n.code,{children:"filter"})," option:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"./build/wakunode2 --filter=true\n"})}),"\n",(0,r.jsxs)(n.p,{children:["You can configure ",(0,r.jsx)(n.code,{children:"nwaku"})," as a ",(0,r.jsx)(n.code,{children:"Filter client"})," using the ",(0,r.jsx)(n.code,{children:"filternode"})," and ",(0,r.jsx)(n.code,{children:"filter-timeout"})," options. This allows the node to request content filtering of messages from peers."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"./build/wakunode2 \\\n --filternode=[FILTER PEER MULTIADDR] \\\n --filter-timeout=[FILTER PEER TIMEOUT]\n"})}),"\n",(0,r.jsxs)(n.p,{children:["For example, consider a ",(0,r.jsx)(n.code,{children:"nwaku"})," node that requests content filtering of messages from peers with a timeout of ",(0,r.jsx)(n.code,{children:"21600"})," seconds (6 hours):"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"./build/wakunode2 \\\n --filternode=/dns4/node-01.ac-cn-hongkong-c.waku.sandbox.status.im/tcp/30303/p2p/16Uiu2HAmSJvSJphxRdbnigUV5bjRRZFBhTtWFTSyiKaQByCjwmpV \\\n --filter-timeout=21600\n"})}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["If you omit the ",(0,r.jsx)(n.code,{children:"filter-timeout"})," option, it will default to ",(0,r.jsx)(n.code,{children:"14400"})," seconds (4 hours)."]})}),"\n",(0,r.jsx)(n.h2,{id:"configure-light-push-protocol",children:"Configure light push protocol"}),"\n",(0,r.jsxs)(n.p,{children:["To enable ",(0,r.jsx)(n.code,{children:"nwaku"})," to serve light clients, enable the ",(0,r.jsx)(n.a,{href:"/learn/concepts/protocols#light-push",children:"Light Push protocol"})," using the ",(0,r.jsx)(n.code,{children:"lightpush"})," option:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"./build/wakunode2 --lightpush=true\n"})}),"\n",(0,r.jsxs)(n.p,{children:["You can configure ",(0,r.jsx)(n.code,{children:"nwaku"})," as a ",(0,r.jsx)(n.code,{children:"Light Push client"})," using the ",(0,r.jsx)(n.code,{children:"lightpushnode"})," option. This allows the node to request lightpush of published messages from peers."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"./build/wakunode2 --lightpushnode=[LIGHT PUSH PEER MULTIADDR]\n"})}),"\n",(0,r.jsxs)(n.p,{children:["For example, consider a ",(0,r.jsx)(n.code,{children:"nwaku"})," node that requests lightpush of published messages from peers:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"./build/wakunode2 --lightpushnode=/dns4/node-01.ac-cn-hongkong-c.waku.sandbox.status.im/tcp/30303/p2p/16Uiu2HAmSJvSJphxRdbnigUV5bjRRZFBhTtWFTSyiKaQByCjwmpV\n"})}),"\n",(0,r.jsx)(n.h2,{id:"run-nwaku-behind-a-reverse-proxy",children:"Run nwaku behind a reverse proxy"}),"\n",(0,r.jsxs)(n.p,{children:["When using a reverse proxy server for SSL/TLS encryption, you only want to announce the proxy server's IP or domain. Nwaku provides the ",(0,r.jsx)(n.code,{children:"ext-multiaddr-only"})," and ",(0,r.jsx)(n.code,{children:"ext-multiaddr"})," options for specifying published multiaddr:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"./build/wakunode2 \\\n --ext-multiaddr-only=true \\\n --ext-multiaddr=[MULTIADDR TO PUBLISH]\n"})}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"ext-multiaddr-only"})," option takes precedence over the ",(0,r.jsx)(n.code,{children:"nat"})," and ",(0,r.jsx)(n.code,{children:"dns4-domain-name"})," options, using the values provided by the ",(0,r.jsx)(n.code,{children:"ext-multiaddr"})," option instead."]})})]})}function h(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},28453:(e,n,s)=>{s.d(n,{R:()=>t,x:()=>d});var o=s(96540);const r={},i=o.createContext(r);function t(e){const n=o.useContext(i);return o.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:t(e.components),o.createElement(i.Provider,{value:n},e.children)}}}]);