mirror of
https://github.com/logos-messaging/docs.waku.org.git
synced 2026-01-03 13:23:06 +00:00
1 line
9.7 KiB
JavaScript
1 line
9.7 KiB
JavaScript
"use strict";(self.webpackChunkwaku_guide=self.webpackChunkwaku_guide||[]).push([[3788],{23071:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>h,frontMatter:()=>i,metadata:()=>t,toc:()=>d});const t=JSON.parse('{"id":"run-node/run-docker-compose","title":"Run Nwaku with Docker Compose","description":"nwaku-compose is a ready-to-use Docker Compose setup that configures the following automatically:","source":"@site/docs/run-node/run-docker-compose.md","sourceDirName":"run-node","slug":"/run-node/run-docker-compose","permalink":"/run-node/run-docker-compose","draft":false,"unlisted":false,"editUrl":"https://github.com/waku-org/docs.waku.org/tree/develop/docs/run-node/run-docker-compose.md","tags":[],"version":"current","lastUpdatedAt":null,"frontMatter":{"title":"Run Nwaku with Docker Compose","hide_table_of_contents":true,"displayed_sidebar":"runNode"},"sidebar":"runNode","previous":{"title":"Run a Waku Node","permalink":"/run-node/"},"next":{"title":"Run Nwaku in a Docker Container","permalink":"/run-node/run-docker"}}');var r=o(74848),s=o(28453);const i={title:"Run Nwaku with Docker Compose",hide_table_of_contents:!0,displayed_sidebar:"runNode"},a=void 0,c={},d=[{value:"Video tutorial",id:"video-tutorial",level:2},{value:"Prerequisites",id:"prerequisites",level:2},{value:"Clone the repository",id:"clone-the-repository",level:2},{value:"Configure the setup",id:"configure-the-setup",level:2},{value:"Run the node",id:"run-the-node",level:2},{value:"Monitor the node",id:"monitor-the-node",level:2},{value:"Interact with the node",id:"interact-with-the-node",level:2}];function l(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"https://github.com/waku-org/nwaku-compose",children:"nwaku-compose"})," is a ready-to-use Docker Compose setup that configures the following automatically:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"nwaku"})," node running ",(0,r.jsx)(n.a,{href:"/learn/concepts/protocols#relay",children:"Relay"})," and ",(0,r.jsx)(n.a,{href:"/learn/concepts/protocols#store",children:"Store"})," protocols with ",(0,r.jsx)(n.a,{href:"/learn/concepts/protocols#rln-relay",children:"RLN"})," enabled."]}),"\n",(0,r.jsx)(n.li,{children:"Simple frontend to interact with the node and Waku network to send and receive messages."}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"https://grafana.com/",children:"Grafana"})," metrics dashboard for advanced users and node operators to monitor the node."]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"video-tutorial",children:"Video tutorial"}),"\n",(0,r.jsx)("div",{class:"video-container",children:(0,r.jsx)("iframe",{class:"yt-video",src:"https://www.youtube.com/embed/fs0ynLk4z0I",title:"How to run a Waku node using Nwaku Compose",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowfullscreen:!0})}),"\n",(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsxs)(n.p,{children:["Check out the ",(0,r.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:o(96343).A+"",children:"Waku Node Operator Cheatsheet"})," to learn how to easily run, monitor, and interact with a node."]})}),"\n",(0,r.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"https://git-scm.com/",children:"Git"})," or ",(0,r.jsx)(n.a,{href:"https://desktop.github.com/",children:"GitHub Desktop"})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"https://docs.docker.com/engine/install/",children:"Docker"})," and ",(0,r.jsx)(n.a,{href:"https://docs.docker.com/compose/install/",children:"Docker Compose"})]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Linea Sepolia RPC endpoint"}),": You can get a free endpoint from ",(0,r.jsx)(n.a,{href:"https://www.infura.io/",children:"Infura"})," or any other Linea Sepolia RPC provider."]}),"\n"]}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsxs)(n.p,{children:["We recommend running a ",(0,r.jsx)(n.code,{children:"nwaku"})," node with at least 2GB of RAM, especially if ",(0,r.jsx)(n.code,{children:"WSS"})," is enabled. If running just a ",(0,r.jsx)(n.code,{children:"Relay"})," node, 0.5GB of RAM is sufficient."]})}),"\n",(0,r.jsx)(n.h2,{id:"clone-the-repository",children:"Clone the repository"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"git clone https://github.com/waku-org/nwaku-compose\ncd nwaku-compose\n"})}),"\n",(0,r.jsx)(n.h2,{id:"configure-the-setup",children:"Configure the setup"}),"\n",(0,r.jsxs)(n.p,{children:["Docker Compose ",(0,r.jsx)(n.a,{href:"https://docs.docker.com/compose/environment-variables/set-environment-variables/#additional-information-3",children:"reads the .env file"})," from the filesystem. You can use ",(0,r.jsx)(n.code,{children:".env.example"})," as a template to provide the configuration values. The recommended process for working with ",(0,r.jsx)(n.code,{children:".env"})," files is to duplicate ",(0,r.jsx)(n.code,{children:".env.example"}),", rename it as ",(0,r.jsx)(n.code,{children:".env"}),", and then make the necessary value edits."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"cp .env.example .env\n${EDITOR} .env\n"})}),"\n",(0,r.jsx)(n.admonition,{type:"caution",children:(0,r.jsxs)(n.p,{children:["Ensure that you do ",(0,r.jsx)(n.strong,{children:"NOT"})," include any secrets in the ",(0,r.jsx)(n.code,{children:".env.example"})," file, as it could accidentally be shared in your Git repository."]})}),"\n",(0,r.jsx)(n.h2,{id:"run-the-node",children:"Run the node"}),"\n",(0,r.jsxs)(n.p,{children:["Launch all the processes: ",(0,r.jsx)(n.code,{children:"nwaku"})," node, database for storing messages, and Grafana for metrics with the following command. Your RLN membership is loaded into ",(0,r.jsx)(n.code,{children:"nwaku"})," under the hood:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"docker-compose up -d\n"})}),"\n",(0,r.jsx)(n.p,{children:"View the logs of the node to confirm that it is running correctly:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"docker-compose logs -f nwaku\n"})}),"\n",(0,r.jsx)(n.h2,{id:"monitor-the-node",children:"Monitor the node"}),"\n",(0,r.jsxs)(n.p,{children:["Visit ",(0,r.jsx)(n.a,{href:"http://localhost:3000/d/yns_4vFVk/nwaku-monitoring",children:"http://localhost:3000/d/yns_4vFVk/nwaku-monitoring"})," to view your node metrics in real time."]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.img,{alt:"nwaku compose dashboard",src:o(66739).A+"",width:"1080",height:"721"})}),"\n",(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsxs)(n.p,{children:["To access Grafana from outside your machine, remove ",(0,r.jsx)(n.code,{children:"127.0.0.1"})," and open the port. Consider setting up a password for Grafana to ensure security."]})}),"\n",(0,r.jsx)(n.h2,{id:"interact-with-the-node",children:"Interact with the node"}),"\n",(0,r.jsxs)(n.p,{children:["Your ",(0,r.jsx)(n.code,{children:"nwaku"})," node provides a ",(0,r.jsx)(n.a,{href:"https://waku-org.github.io/waku-rest-api/",children:"REST API"})," on port ",(0,r.jsx)(n.code,{children:"8645"})," for interacting with it:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"# Get nwaku version\ncurl --location 'http://127.0.0.1:8645/debug/v1/version'\n\n# Get nwaku info\ncurl --location 'http://127.0.0.1:8645/debug/v1/info'\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Retrieve messages sent to a ",(0,r.jsx)(n.code,{children:"contentTopic"}),". Please note that this query can be made to any ",(0,r.jsx)(n.code,{children:"Store"})," node within the network:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"curl --location 'http://127.0.0.1:8645/store/v1/messages?contentTopics=%2Fmy-app%2F2%2Fchatroom-1%2Fproto&pageSize=50&ascending=true' \\\n--header 'Accept: application/json'\n"})}),"\n",(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsxs)(n.p,{children:["If you encounter issues running your node or require assistance with anything, please visit the - Visit the #help-desk channel on ",(0,r.jsx)(n.a,{href:"https://discord.waku.org/",children:"Discord"}),"."]})}),"\n",(0,r.jsx)(n.admonition,{title:"Congratulations!",type:"tip",children:(0,r.jsxs)(n.p,{children:["You have successfully started a ",(0,r.jsx)(n.code,{children:"nwaku"})," node with ",(0,r.jsx)(n.code,{children:"RLN"})," enabled using Docker Compose. Have a look at the ",(0,r.jsx)(n.a,{href:"/run-node/configure-nwaku",children:"Node Configuration Examples"})," and ",(0,r.jsx)(n.a,{href:"https://github.com/waku-org/nwaku-compose/blob/master/ADVANCED.md",children:"Advanced Configuration"})," guides to learn how to configure ",(0,r.jsx)(n.code,{children:"nwaku"})," for different use cases."]})})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}},28453:(e,n,o)=>{o.d(n,{R:()=>i,x:()=>a});var t=o(96540);const r={},s=t.createContext(r);function i(e){const n=t.useContext(s);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),t.createElement(s.Provider,{value:n},e.children)}},66739:(e,n,o)=>{o.d(n,{A:()=>t});const t=o.p+"assets/images/nwaku-compose-dashboard-c0fdabab598b734808be427ff6b24672.png"},96343:(e,n,o)=>{o.d(n,{A:()=>t});const t=o.p+"assets/files/Waku-NodeOperator-7fabb782473f2619b0b05dc209f12f53.pdf"}}]); |