docs.waku.org/assets/js/406e0176.80c37701.js
2025-08-13 03:52:48 +00:00

1 line
16 KiB
JavaScript

"use strict";(self.webpackChunkwaku_guide=self.webpackChunkwaku_guide||[]).push([[3922],{4865:(e,n,t)=>{t.d(n,{A:()=>x});var s=t(96540),i=t(34164),r=t(23104),o=t(47751),d=t(92303);const a={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var c=t(74848);function l({className:e,block:n,selectedValue:t,selectValue:s,tabValues:o}){const d=[],{blockElementScrollPositionUntilNextRender:l}=(0,r.a_)(),h=e=>{const n=e.currentTarget,i=d.indexOf(n),r=o[i].value;r!==t&&(l(n),s(r))},u=e=>{let n=null;switch(e.key){case"Enter":h(e);break;case"ArrowRight":{const t=d.indexOf(e.currentTarget)+1;n=d[t]??d[0];break}case"ArrowLeft":{const t=d.indexOf(e.currentTarget)-1;n=d[t]??d[d.length-1];break}}n?.focus()};return(0,c.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.A)("tabs",{"tabs--block":n},e),children:o.map(({value:e,label:n,attributes:s})=>(0,c.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{d.push(e)},onKeyDown:u,onClick:h,...s,className:(0,i.A)("tabs__item",a.tabItem,s?.className,{"tabs__item--active":t===e}),children:n??e},e))})}function h({lazy:e,children:n,selectedValue:t}){const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=r.find(e=>e.props.value===t);return e?(0,s.cloneElement)(e,{className:(0,i.A)("margin-top--md",e.props.className)}):null}return(0,c.jsx)("div",{className:"margin-top--md",children:r.map((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==t}))})}function u(e){const n=(0,o.u)(e);return(0,c.jsxs)("div",{className:(0,i.A)("tabs-container",a.tabList),children:[(0,c.jsx)(l,{...n,...e}),(0,c.jsx)(h,{...n,...e})]})}function x(e){const n=(0,d.default)();return(0,c.jsx)(u,{...e,children:(0,o.v)(e.children)},String(n))}},19365:(e,n,t)=>{t.d(n,{A:()=>o});t(96540);var s=t(34164);const i={tabItem:"tabItem_Ymn6"};var r=t(74848);function o({children:e,hidden:n,className:t}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,s.A)(i.tabItem,t),hidden:n,children:e})}},28453:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>d});var s=t(96540);const i={},r=s.createContext(i);function o(e){const n=s.useContext(r);return s.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(i):e.components||i:o(e.components),s.createElement(r.Provider,{value:n},e.children)}},60338:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>c,default:()=>x,frontMatter:()=>a,metadata:()=>s,toc:()=>h});const s=JSON.parse('{"id":"guides/nwaku/run-node","title":"Run a Nwaku Node","description":"Nwaku is a lightweight and robust Nim client for running a Waku node, equipped with tools to monitor and maintain a running node. Nwaku is highly configurable, enabling operators to select the protocols they want to support based on their needs, motivations, and available resources.","source":"@site/docs/guides/nwaku/run-node.md","sourceDirName":"guides/nwaku","slug":"/guides/nwaku/run-node","permalink":"/guides/nwaku/run-node","draft":false,"unlisted":false,"editUrl":"https://github.com/waku-org/docs.waku.org/tree/develop/docs/guides/nwaku/run-node.md","tags":[],"version":"current","lastUpdatedAt":null,"frontMatter":{"title":"Run a Nwaku Node","hide_table_of_contents":true},"sidebar":"guides","previous":{"title":"Introduction to Waku","permalink":"/"},"next":{"title":"Run Nwaku with Docker Compose","permalink":"/guides/nwaku/run-docker-compose"}}');var i=t(74848),r=t(28453),o=t(4865),d=t(19365);const a={title:"Run a Nwaku Node",hide_table_of_contents:!0},c=void 0,l={},h=[{value:"Get the node binary",id:"get-the-node-binary",level:2},{value:"Run nwaku in Docker (recommended)",id:"run-nwaku-in-docker-recommended",level:4},{value:"Download the binary",id:"download-the-binary",level:4},{value:"Build the binary",id:"build-the-binary",level:4},{value:"Run the node",id:"run-the-node",level:2},{value:"Bootstrap the node",id:"bootstrap-the-node",level:2},{value:"Interact with the node",id:"interact-with-the-node",level:2},{value:"Check the node health status",id:"check-the-node-health-status",level:2}];function u(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h4:"h4",img:"img",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["Nwaku is a lightweight and robust Nim client for running a Waku node, equipped with tools to monitor and maintain a running node. Nwaku is highly configurable, enabling operators to select the ",(0,i.jsx)(n.a,{href:"/learn/concepts/protocols",children:"protocols"})," they want to support based on their needs, motivations, and available resources."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"waku architecture",src:t(84720).A+"",width:"1376",height:"1083"})}),"\n",(0,i.jsxs)(n.p,{children:["This guide provides detailed steps to download, build, configure, and connect a ",(0,i.jsx)(n.code,{children:"nwaku"})," node to the Waku Network. It also includes interacting with the node and finding its addresses."]}),"\n",(0,i.jsx)(n.admonition,{type:"info",children:(0,i.jsxs)(n.p,{children:["We recommend running a ",(0,i.jsx)(n.code,{children:"nwaku"})," node with at least 2GB of RAM, especially if ",(0,i.jsx)(n.code,{children:"WSS"})," is enabled. If running just a ",(0,i.jsx)(n.code,{children:"Relay"})," node, 0.5GB of RAM is sufficient."]})}),"\n",(0,i.jsx)(n.h2,{id:"get-the-node-binary",children:"Get the node binary"}),"\n",(0,i.jsxs)(n.p,{children:["To run a node, you must have the ",(0,i.jsx)(n.code,{children:"nwaku"})," binary. Nwaku provides multiple options for running a node:"]}),"\n",(0,i.jsx)(n.h4,{id:"run-nwaku-in-docker-recommended",children:"Run nwaku in Docker (recommended)"}),"\n",(0,i.jsxs)(n.p,{children:["We recommend ",(0,i.jsx)(n.a,{href:"/guides/nwaku/run-docker-compose",children:"using Docker Compose"})," to run a node because it's the simplest and fastest way to configure and run one:"]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Documentation"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Docker Compose"}),(0,i.jsxs)(n.td,{children:["Run a ",(0,i.jsx)(n.code,{children:"nwaku"})," node with Docker Compose"]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"/guides/nwaku/run-docker-compose",children:"Run Nwaku with Docker Compose"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Docker Container"}),(0,i.jsxs)(n.td,{children:["Run a ",(0,i.jsx)(n.code,{children:"nwaku"})," node in a Docker Container"]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"/guides/nwaku/run-docker",children:"Run Nwaku in a Docker Container"})})]})]})]}),"\n",(0,i.jsx)(n.h4,{id:"download-the-binary",children:"Download the binary"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Documentation"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Precompiled Binary"}),(0,i.jsxs)(n.td,{children:["Download a precompiled binary of the ",(0,i.jsx)(n.code,{children:"nwaku"})," node"]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"https://github.com/waku-org/nwaku/tags",children:"Download Nwaku Binary"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Nightly Release"}),(0,i.jsxs)(n.td,{children:["Try the latest ",(0,i.jsx)(n.code,{children:"nwaku"})," updates without compiling the binaries"]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"https://github.com/waku-org/nwaku/releases/tag/nightly",children:"Download Nightly Release"})})]})]})]}),"\n",(0,i.jsx)(n.h4,{id:"build-the-binary",children:"Build the binary"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Documentation"})]})}),(0,i.jsx)(n.tbody,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Build from Source"}),(0,i.jsxs)(n.td,{children:["Build the node from the ",(0,i.jsx)(n.a,{href:"https://github.com/waku-org/nwaku",children:"nwaku source code"})]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"/guides/nwaku/build-source",children:"Build Nwaku from Source"})})]})})]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["You can run the ",(0,i.jsx)(n.code,{children:"nwaku"})," binaries and Docker images on cloud service providers like ",(0,i.jsx)(n.a,{href:"https://cloud.google.com/",children:"Google Cloud"}),", ",(0,i.jsx)(n.a,{href:"https://azure.microsoft.com/",children:"Microsoft Azure"}),", ",(0,i.jsx)(n.a,{href:"https://aws.amazon.com/",children:"Amazon Web Services"}),", and ",(0,i.jsx)(n.a,{href:"https://www.digitalocean.com/",children:"DigitalOcean"}),"."]})}),"\n",(0,i.jsx)(n.h2,{id:"run-the-node",children:"Run the node"}),"\n",(0,i.jsxs)(n.p,{children:["Once you have gotten the ",(0,i.jsx)(n.code,{children:"nwaku"})," binary, run it using the ",(0,i.jsx)(n.a,{href:"/guides/nwaku/config-methods#default-configuration-values",children:"default configuration"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-shell",children:"# Run the Docker Compose\ndocker-compose up -d\n\n# Run the standalone binary\n./build/wakunode2\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["To learn how to customise the configuration of a ",(0,i.jsx)(n.code,{children:"nwaku"})," node, have a look at the ",(0,i.jsx)(n.a,{href:"/guides/nwaku/config-methods",children:"Node Configuration Methods"})," and ",(0,i.jsx)(n.a,{href:"/guides/nwaku/configure-nwaku",children:"Node Configuration Examples"})," guides."]})}),"\n",(0,i.jsx)(n.h2,{id:"bootstrap-the-node",children:"Bootstrap the node"}),"\n",(0,i.jsxs)(n.p,{children:["To join the Waku Network, nodes must ",(0,i.jsx)(n.a,{href:"/learn/glossary#bootstrapping",children:"bootstrap"})," for an entry point before discovering more peers. Nwaku provides multiple ",(0,i.jsx)(n.a,{href:"/learn/concepts/peer-discovery",children:"peer discovery"})," mechanisms:"]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Documentation"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Static Peers"}),(0,i.jsxs)(n.td,{children:["Configure the bootstrap nodes that ",(0,i.jsx)(n.code,{children:"nwaku"})," should establish connections upon startup"]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"/guides/nwaku/configure-discovery#configure-static-peers",children:"Configure Static Peers"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"DNS Discovery"}),(0,i.jsxs)(n.td,{children:["Enable ",(0,i.jsx)(n.code,{children:"nwaku"})," to bootstrap nodes using the ",(0,i.jsx)(n.a,{href:"/learn/concepts/dns-discovery",children:"DNS Discovery"})," mechanism"]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"/guides/nwaku/configure-discovery#configure-dns-discovery",children:"Configure DNS Discovery"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Discv5"}),(0,i.jsxs)(n.td,{children:["Enable ",(0,i.jsx)(n.code,{children:"nwaku"})," to discover peers using the ",(0,i.jsx)(n.a,{href:"/learn/concepts/discv5",children:"Discv5"})," mechanism"]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"/guides/nwaku/configure-discovery#configure-discv5",children:"Configure Discv5"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Peer Exchange"}),(0,i.jsxs)(n.td,{children:["Enable ",(0,i.jsx)(n.a,{href:"/learn/concepts/peer-exchange",children:"Peer Exchange"})," protocol for light nodes to request peers from your ",(0,i.jsx)(n.code,{children:"nwaku"})," node"]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.a,{href:"/guides/nwaku/configure-discovery#configure-peer-exchange",children:"Configure Peer Exchange"})})]})]})]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["We suggest ",(0,i.jsx)(n.a,{href:"/guides/nwaku/configure-nwaku#configure-websocket-transport",children:"configuring WebSocket transport"})," for your node to enable support and serving of browser peers using ",(0,i.jsx)(n.a,{href:"/guides/js-waku/",children:"@waku/sdk"}),"."]})}),"\n",(0,i.jsx)(n.h2,{id:"interact-with-the-node",children:"Interact with the node"}),"\n",(0,i.jsxs)(n.p,{children:["You can interact with a running ",(0,i.jsx)(n.code,{children:"nwaku"})," node through the ",(0,i.jsx)(n.a,{href:"https://waku-org.github.io/waku-rest-api/",children:"REST API"}),", such as querying the node information using the ",(0,i.jsx)(n.a,{href:"https://waku-org.github.io/waku-rest-api/#get-/debug/v1/info",children:"Get node info"})," endpoint:"]}),"\n","\n",(0,i.jsxs)(o.A,{children:[(0,i.jsx)(d.A,{value:"request",label:"Request",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-shell",children:"curl --location 'http://127.0.0.1:8645/debug/v1/info' \\\n--header 'Accept: application/json'\n"})})}),(0,i.jsx)(d.A,{value:"response",label:"Response",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n "listenAddresses": [\n "/ip4/0.0.0.0/tcp/60000/p2p/16Uiu2HAmUbPquFQqje3jiqoB5YoiUbBya59NB4qqEzeiTNGHeA6w"\n ],\n "enrUri": "enr:-Iu4QCQZXZDb_JsYmLoYor0F5E_95HbIywgO_wgx2rIdDbmCJZkTzmlCr0wmMzV47lgik_tVwww5mIng90Ris83TisMBgmlkgnY0gmlwhAAAAACJc2VjcDI1NmsxoQPszztG-Ev52ZB7tk0jF8s6Md4KvyY_rhzNZokaaB_ABIN0Y3CC6mCFd2FrdTIB"\n}\n'})})})]}),"\n",(0,i.jsx)(n.admonition,{type:"info",children:(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"listenAddresses"})," field stores the node's listening addresses, while the ",(0,i.jsx)(n.code,{children:"enrUri"})," field stores the discoverable ",(0,i.jsx)(n.code,{children:"ENR"})," URI for peer discovery."]})}),"\n",(0,i.jsx)(n.h2,{id:"check-the-node-health-status",children:"Check the node health status"}),"\n",(0,i.jsxs)(n.p,{children:["You can check the health status of the node by calling the ",(0,i.jsx)(n.a,{href:"https://waku-org.github.io/waku-rest-api/#get-/health",children:"Get node health status"})," endpoint of the ",(0,i.jsx)(n.a,{href:"https://waku-org.github.io/waku-rest-api/",children:"REST API"}),":"]}),"\n",(0,i.jsxs)(o.A,{children:[(0,i.jsx)(d.A,{value:"request",label:"Request",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-shell",children:"curl --location 'http://127.0.0.1:8645/health' \\\n--header 'Accept: text/plain'\n"})})}),(0,i.jsx)(d.A,{value:"response",label:"Response",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-txt",children:"Node is healthy\n"})})})]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["If you encounter issues running your node or require assistance with anything, please visit the ",(0,i.jsx)(n.a,{href:"https://discord.com/channels/1110799176264056863/1216748184592711691",children:"#node-help channel"})," on our Discord."]})}),"\n",(0,i.jsx)(n.admonition,{title:"Congratulations!",type:"tip",children:(0,i.jsxs)(n.p,{children:["You have successfully started, configured, and connected a ",(0,i.jsx)(n.code,{children:"nwaku"})," node to the Waku Network. Have a look at the ",(0,i.jsx)(n.a,{href:"/guides/nwaku/configure-nwaku",children:"Node Configuration Examples"})," guide to learn how to configure ",(0,i.jsx)(n.code,{children:"nwaku"})," for different use cases."]})})]})}function x(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(u,{...e})}):u(e)}},84720:(e,n,t)=>{t.d(n,{A:()=>s});const s=t.p+"assets/images/architecture-c96184127d80feae83e3f85471c5112a.png"}}]);