mirror of
https://github.com/logos-messaging/docs.waku.org.git
synced 2026-01-03 21:33:05 +00:00
1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
"use strict";(self.webpackChunkwaku_guide=self.webpackChunkwaku_guide||[]).push([[2811],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>k});var a=n(67294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},l=Object.keys(e);for(a=0;a<l.length;a++)n=l[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a<l.length;a++)n=l[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var u=a.createContext({}),s=function(e){var t=a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=s(e.components);return a.createElement(u.Provider,{value:t},e.children)},c="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,l=e.originalType,u=e.parentName,d=i(e,["components","mdxType","originalType","parentName"]),c=s(n),m=r,k=c["".concat(u,".").concat(m)]||c[m]||p[m]||l;return n?a.createElement(k,o(o({ref:t},d),{},{components:n})):a.createElement(k,o({ref:t},d))}));function k(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=n.length,o=new Array(l);o[0]=m;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i[c]="string"==typeof e?e:r,o[1]=i;for(var s=2;s<l;s++)o[s]=n[s];return a.createElement.apply(null,o)}return a.createElement.apply(null,n)}m.displayName="MDXCreateElement"},85162:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(67294),r=n(86010);const l={tabItem:"tabItem_Ymn6"};function o(e){let{children:t,hidden:n,className:o}=e;return a.createElement("div",{role:"tabpanel",className:(0,r.default)(l.tabItem,o),hidden:n},t)}},65488:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(87462),r=n(67294),l=n(86010),o=n(12466),i=n(70989),u=n(72389);const s={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function d(e){let{className:t,block:n,selectedValue:i,selectValue:u,tabValues:d}=e;const c=[],{blockElementScrollPositionUntilNextRender:p}=(0,o.o5)(),m=e=>{const t=e.currentTarget,n=c.indexOf(t),a=d[n].value;a!==i&&(p(t),u(a))},k=e=>{let t=null;switch(e.key){case"Enter":m(e);break;case"ArrowRight":{const n=c.indexOf(e.currentTarget)+1;t=c[n]??c[0];break}case"ArrowLeft":{const n=c.indexOf(e.currentTarget)-1;t=c[n]??c[c.length-1];break}}t?.focus()};return r.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.default)("tabs",{"tabs--block":n},t)},d.map((e=>{let{value:t,label:n,attributes:o}=e;return r.createElement("li",(0,a.Z)({role:"tab",tabIndex:i===t?0:-1,"aria-selected":i===t,key:t,ref:e=>c.push(e),onKeyDown:k,onClick:m},o,{className:(0,l.default)("tabs__item",s.tabItem,o?.className,{"tabs__item--active":i===t})}),n??t)})))}function c(e){let{lazy:t,children:n,selectedValue:a}=e;const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return r.createElement("div",{className:"margin-top--md"},l.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a}))))}function p(e){const t=(0,i.Y)(e);return r.createElement("div",{className:(0,l.default)("tabs-container",s.tabList)},r.createElement(d,(0,a.Z)({},e,t)),r.createElement(c,(0,a.Z)({},e,t)))}function m(e){const t=(0,u.default)();return r.createElement(p,(0,a.Z)({key:String(t)},e))}},43733:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>u,default:()=>k,frontMatter:()=>i,metadata:()=>s,toc:()=>c});var a=n(87462),r=(n(67294),n(3905)),l=n(65488),o=n(85162);const i={title:"Build Nwaku from Source",hide_table_of_contents:!0},u=void 0,s={unversionedId:"guides/nwaku/build-source",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:!1,editUrl:"https://github.com/waku-org/docs.waku.org/tree/develop/docs/guides/nwaku/build-source.md",tags:[],version:"current",lastUpdatedAt:1707524948,formattedLastUpdatedAt:"10 Feb 2024",frontMatter:{title:"Build Nwaku from Source",hide_table_of_contents:!0},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"}},d={},c=[{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}],p={toc:c},m="wrapper";function k(e){let{components:t,...n}=e;return(0,r.kt)(m,(0,a.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"This guide provides detailed steps to build a ",(0,r.kt)("inlineCode",{parentName:"p"},"nwaku")," node from the source code to access the latest development version or a specific commit or release of ",(0,r.kt)("inlineCode",{parentName:"p"},"nwaku"),". For your convenience, you may want to ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/waku-org/nwaku/tags"},"download a pre-compiled binary")," instead."),(0,r.kt)("admonition",{type:"info"},(0,r.kt)("ul",{parentName:"admonition"},(0,r.kt)("li",{parentName:"ul"},"A minimum of 2GB of RAM is required to build ",(0,r.kt)("inlineCode",{parentName:"li"},"nwaku"),"."),(0,r.kt)("li",{parentName:"ul"},"Nwaku is available for Linux and macOS, with experimental Windows support."))),(0,r.kt)("h2",{id:"prerequisites"},"Prerequisites"),(0,r.kt)("p",null,"To build ",(0,r.kt)("inlineCode",{parentName:"p"},"nwaku"),", you need the standard developer tools, including a C compiler, GNU Make, Bash, Git, Rustup, and PostgreSQL client library."),(0,r.kt)(l.Z,{mdxType:"Tabs"},(0,r.kt)(o.Z,{value:"debian",label:"Debian and Ubuntu",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-shell"},"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,r.kt)(o.Z,{value:"fedora",label:"Fedora",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-shell"},"sudo dnf install @development-tools git libpq-devel\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n"))),(0,r.kt)(o.Z,{value:"arch",label:"Arch Linux",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-shell"},"# 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,r.kt)(o.Z,{value:"mac",label:"MacOS (Homebrew)",mdxType:"TabItem"},(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-shell"},"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")))),(0,r.kt)("h2",{id:"clone-the-repository"},"Clone the repository"),(0,r.kt)("p",null,"Get the source code from the GitHub repository. The default branch is ",(0,r.kt)("inlineCode",{parentName:"p"},"master"),", the release candidate for major updates."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-shell"},"git clone https://github.com/waku-org/nwaku\ncd nwaku\n")),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"You can use ",(0,r.kt)("inlineCode",{parentName:"p"},"git tag -l")," to check specific version tags.")),(0,r.kt)("h2",{id:"build-the-binary"},"Build the binary"),(0,r.kt)("p",null,"Build the ",(0,r.kt)("inlineCode",{parentName:"p"},"nwaku")," binary:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-shell"},"make wakunode2\n")),(0,r.kt)("p",null,"The first ",(0,r.kt)("inlineCode",{parentName:"p"},"make")," invocation updates to all Git submodules. After each ",(0,r.kt)("inlineCode",{parentName:"p"},"git pull"),", run ",(0,r.kt)("inlineCode",{parentName:"p"},"make update")," to keep the submodules updated in the future."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-shell"},"make update\n")),(0,r.kt)("h2",{id:"run-the-binary"},"Run the binary"),(0,r.kt)("p",null,"Nwaku will create the ",(0,r.kt)("inlineCode",{parentName:"p"},"wakunode2")," binary in the ",(0,r.kt)("inlineCode",{parentName:"p"},"./build/")," directory."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-shell"},"# Run with default configuration\n./build/wakunode2\n\n# See available command line options\n./build/wakunode2 --help\n")),(0,r.kt)("p",null,"To learn more about running nwaku, have a look at these guides:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/guides/nwaku/run-node#run-the-node"},"Run a Nwaku Node")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/guides/nwaku/run-docker"},"Run Nwaku in a Docker Container")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/guides/nwaku/run-docker-compose"},"Run Nwaku with Docker Compose")),(0,r.kt)("li",{parentName:"ul"},(0,r.kt)("a",{parentName:"li",href:"/guides/nwaku/config-methods"},"Node Configuration Methods"))),(0,r.kt)("h2",{id:"run-test-suite"},"Run test suite"),(0,r.kt)("p",null,"Run the tests for Waku:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-shell"},"make test\n")),(0,r.kt)("admonition",{title:"Congratulations!",type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"You have successfully built the ",(0,r.kt)("inlineCode",{parentName:"p"},"nwaku")," binary from the source code. Have a look at the ",(0,r.kt)("a",{parentName:"p",href:"/guides/nwaku/configure-nwaku"},"Node Configuration Examples")," guide to learn how to configure ",(0,r.kt)("inlineCode",{parentName:"p"},"nwaku")," for different use cases.")))}k.isMDXComponent=!0}}]); |