docs.waku.org/assets/js/f2470003.cb6db07d.js
2025-08-13 03:24:27 +00:00

1 line
9.2 KiB
JavaScript

"use strict";(self.webpackChunkwaku_guide=self.webpackChunkwaku_guide||[]).push([[2227],{4865:(e,n,s)=>{s.d(n,{A:()=>p});var i=s(96540),t=s(34164),r=s(23104),l=s(47751),a=s(92303);const o={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var d=s(74848);function c({className:e,block:n,selectedValue:s,selectValue:i,tabValues:l}){const a=[],{blockElementScrollPositionUntilNextRender:c}=(0,r.a_)(),u=e=>{const n=e.currentTarget,t=a.indexOf(n),r=l[t].value;r!==s&&(c(n),i(r))},h=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const s=a.indexOf(e.currentTarget)+1;n=a[s]??a[0];break}case"ArrowLeft":{const s=a.indexOf(e.currentTarget)-1;n=a[s]??a[a.length-1];break}}n?.focus()};return(0,d.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,t.A)("tabs",{"tabs--block":n},e),children:l.map(({value:e,label:n,attributes:i})=>(0,d.jsx)("li",{role:"tab",tabIndex:s===e?0:-1,"aria-selected":s===e,ref:e=>{a.push(e)},onKeyDown:h,onClick:u,...i,className:(0,t.A)("tabs__item",o.tabItem,i?.className,{"tabs__item--active":s===e}),children:n??e},e))})}function u({lazy:e,children:n,selectedValue:s}){const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=r.find(e=>e.props.value===s);return e?(0,i.cloneElement)(e,{className:(0,t.A)("margin-top--md",e.props.className)}):null}return(0,d.jsx)("div",{className:"margin-top--md",children:r.map((e,n)=>(0,i.cloneElement)(e,{key:n,hidden:e.props.value!==s}))})}function h(e){const n=(0,l.u)(e);return(0,d.jsxs)("div",{className:(0,t.A)("tabs-container",o.tabList),children:[(0,d.jsx)(c,{...n,...e}),(0,d.jsx)(u,{...n,...e})]})}function p(e){const n=(0,a.default)();return(0,d.jsx)(h,{...e,children:(0,l.v)(e.children)},String(n))}},19365:(e,n,s)=>{s.d(n,{A:()=>l});s(96540);var i=s(34164);const t={tabItem:"tabItem_Ymn6"};var r=s(74848);function l({children:e,hidden:n,className:s}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,i.A)(t.tabItem,s),hidden:n,children:e})}},28453:(e,n,s)=>{s.d(n,{R:()=>l,x:()=>a});var i=s(96540);const t={},r=i.createContext(t);function l(e){const n=i.useContext(r);return i.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(t):e.components||t:l(e.components),i.createElement(r.Provider,{value:n},e.children)}},73329:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>d,default:()=>p,frontMatter:()=>o,metadata:()=>i,toc:()=>u});const i=JSON.parse('{"id":"guides/nwaku/build-source","title":"Build Nwaku from Source","description":"This guide provides detailed steps to build a nwaku node from the source code to access the latest development version or a specific commit or release of nwaku. For your convenience, you may want to download a pre-compiled binary instead.","source":"@site/docs/guides/nwaku/build-source.md","sourceDirName":"guides/nwaku","slug":"/guides/nwaku/build-source","permalink":"/guides/nwaku/build-source","draft":false,"unlisted":false,"editUrl":"https://github.com/waku-org/docs.waku.org/tree/develop/docs/guides/nwaku/build-source.md","tags":[],"version":"current","lastUpdatedAt":null,"frontMatter":{"title":"Build Nwaku from Source","hide_table_of_contents":true},"sidebar":"guides","previous":{"title":"Run Nwaku in a Docker Container","permalink":"/guides/nwaku/run-docker"},"next":{"title":"Configure Peer Discovery","permalink":"/guides/nwaku/configure-discovery"}}');var t=s(74848),r=s(28453),l=s(4865),a=s(19365);const o={title:"Build Nwaku from Source",hide_table_of_contents:!0},d=void 0,c={},u=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Clone the repository",id:"clone-the-repository",level:2},{value:"Build the binary",id:"build-the-binary",level:2},{value:"Run the binary",id:"run-the-binary",level:2},{value:"Run test suite",id:"run-test-suite",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["This guide provides detailed steps to build a ",(0,t.jsx)(n.code,{children:"nwaku"})," node from the source code to access the latest development version or a specific commit or release of ",(0,t.jsx)(n.code,{children:"nwaku"}),". For your convenience, you may want to ",(0,t.jsx)(n.a,{href:"https://github.com/waku-org/nwaku/tags",children:"download a pre-compiled binary"})," instead."]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["A minimum of 2GB of RAM is required to build ",(0,t.jsx)(n.code,{children:"nwaku"}),"."]}),"\n",(0,t.jsx)(n.li,{children:"Nwaku is available for Linux and macOS, with experimental Windows support."}),"\n"]})}),"\n",(0,t.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,t.jsxs)(n.p,{children:["To build ",(0,t.jsx)(n.code,{children:"nwaku"}),", you need the standard developer tools, including a C compiler, GNU Make, Bash, Git, Rustup, and PostgreSQL client library."]}),"\n","\n",(0,t.jsxs)(l.A,{children:[(0,t.jsx)(a.A,{value:"debian",label:"Debian and Ubuntu",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"sudo apt-get install build-essential git libpq5 jq\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\nsource \"$HOME/.cargo/env\"\n"})})}),(0,t.jsx)(a.A,{value:"fedora",label:"Fedora",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"sudo dnf install @development-tools git libpq-devel which\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n"})})}),(0,t.jsx)(a.A,{value:"arch",label:"Arch Linux",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"# Using your favoured AUR helper\nsudo [AUR HELPER] -S base-devel git postgresql-libs\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n"})})}),(0,t.jsx)(a.A,{value:"mac",label:"MacOS (Homebrew)",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"brew install cmake git postgresql@15 rustup-init\n# Create a symbolic link to libpq.5.dylib in /usr/local/lib/\nsudo mkdir -p /usr/local/lib/\nsudo ln -s /opt/homebrew/opt/postgresql@15/lib/libpq.5.dylib /usr/local/lib/libpq.dylib\n"})})})]}),"\n",(0,t.jsx)(n.h2,{id:"clone-the-repository",children:"Clone the repository"}),"\n",(0,t.jsxs)(n.p,{children:["Get the source code from the GitHub repository. The default branch is ",(0,t.jsx)(n.code,{children:"master"}),", the release candidate for major updates."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"git clone https://github.com/waku-org/nwaku\ncd nwaku\n"})}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["You can use ",(0,t.jsx)(n.code,{children:"git tag -l"})," to check specific version tags."]})}),"\n",(0,t.jsx)(n.h2,{id:"build-the-binary",children:"Build the binary"}),"\n",(0,t.jsxs)(n.p,{children:["Build the ",(0,t.jsx)(n.code,{children:"nwaku"})," binary:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"make wakunode2\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The first ",(0,t.jsx)(n.code,{children:"make"})," invocation updates to all Git submodules. After each ",(0,t.jsx)(n.code,{children:"git pull"}),", run ",(0,t.jsx)(n.code,{children:"make update"})," to keep the submodules updated in the future."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"make update\n"})}),"\n",(0,t.jsx)(n.h2,{id:"run-the-binary",children:"Run the binary"}),"\n",(0,t.jsxs)(n.p,{children:["Nwaku will create the ",(0,t.jsx)(n.code,{children:"wakunode2"})," binary in the ",(0,t.jsx)(n.code,{children:"./build/"})," directory."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"# Run with default configuration\n./build/wakunode2\n\n# See available command line options\n./build/wakunode2 --help\n"})}),"\n",(0,t.jsx)(n.p,{children:"To learn more about running nwaku, have a look at these guides:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/guides/nwaku/run-node#run-the-node",children:"Run a Nwaku Node"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/guides/nwaku/run-docker",children:"Run Nwaku in a Docker Container"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/guides/nwaku/run-docker-compose",children:"Run Nwaku with Docker Compose"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"/guides/nwaku/config-methods",children:"Node Configuration Methods"})}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"run-test-suite",children:"Run test suite"}),"\n",(0,t.jsx)(n.p,{children:"Run the tests for Waku:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"make test\n"})}),"\n",(0,t.jsx)(n.admonition,{title:"Congratulations!",type:"tip",children:(0,t.jsxs)(n.p,{children:["You have successfully built the ",(0,t.jsx)(n.code,{children:"nwaku"})," binary from the source code. Have a look at the ",(0,t.jsx)(n.a,{href:"/guides/nwaku/configure-nwaku",children:"Node Configuration Examples"})," guide to learn how to configure ",(0,t.jsx)(n.code,{children:"nwaku"})," for different use cases."]})})]})}function p(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}}}]);