(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[92893],{15156:function(e,n,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/en/network/nodes/full-node/deployments/using-source-code",function(){return i(53676)}])},53676:function(e,n,i){"use strict";i.r(n),i.d(n,{useTOC:function(){return d}});var s=i(31549),t=i(82910),r=i(1117),l=i(46977),a=i(13844),o=i(83185);function d(e){return[]}n.default=(0,t.c)(function(e){let n={a:"a",code:"code",h1:"h1",li:"li",ol:"ol",p:"p",pre:"pre",span:"span",strong:"strong",ul:"ul",...(0,l.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{children:"Deploy a PFN using Source Code"}),"\n",(0,s.jsxs)(n.p,{children:["To deploy a PFN using the ",(0,s.jsx)(n.code,{children:"aptos-core"})," source code, first, see ",(0,s.jsx)(n.a,{href:"../../building-from-source",children:"Building Aptos From Source"})," for instructions\non how to download the ",(0,s.jsx)(n.code,{children:"aptos-core"})," repository and build the binary. Then, follow the steps below:"]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Make sure your current working directory is ",(0,s.jsx)(n.code,{children:"aptos-core"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Check out the ",(0,s.jsx)(n.code,{children:"mainnet"})," branch using ",(0,s.jsx)(n.code,{children:"git checkout --track origin/mainnet"}),"; remember, you may instead use ",(0,s.jsx)(n.code,{children:"devnet"})," or ",(0,s.jsx)(n.code,{children:"testnet"}),"\nif you wish to run your PFN in a different network."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Next, download the ",(0,s.jsx)(n.code,{children:"genesis.blob"})," and ",(0,s.jsx)(n.code,{children:"waypoint.txt"})," files for the network your PFN will connect to:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Run this command to download the genesis blob (for mainnet):"}),"\n",(0,s.jsx)(n.pre,{icon:o.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-filename":"Terminal","data-copy":"",children:(0,s.jsx)(n.code,{children:(0,s.jsxs)(n.span,{children:[(0,s.jsx)(n.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"curl"}),(0,s.jsx)(n.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -O"}),(0,s.jsx)(n.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" https://raw.githubusercontent.com/aptos-labs/aptos-networks/main/mainnet/genesis.blob"})]})})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Run this command to download the waypoint file (for mainnet):"}),"\n",(0,s.jsx)(n.pre,{icon:o.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-filename":"Terminal","data-copy":"",children:(0,s.jsx)(n.code,{children:(0,s.jsxs)(n.span,{children:[(0,s.jsx)(n.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"curl"}),(0,s.jsx)(n.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -O"}),(0,s.jsx)(n.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" https://raw.githubusercontent.com/aptos-labs/aptos-networks/main/mainnet/waypoint.txt"})]})})}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(a.U,{type:"warning",children:(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Don’t want to connect to mainnet?"}),(0,s.jsx)("br",{}),"\nTo connect to other networks (e.g., ",(0,s.jsx)(n.code,{children:"devnet"})," and ",(0,s.jsx)(n.code,{children:"testnet"}),"), you can find the genesis and waypoint here ➜ ",(0,s.jsx)(n.a,{href:"https://github.com/aptos-labs/aptos-networks",children:"https://github.com/aptos-labs/aptos-networks"}),".\nBe sure to download the ",(0,s.jsx)(n.code,{children:"genesis.blob"})," and ",(0,s.jsx)(n.code,{children:"waypoint.txt"})," for those networks, instead of using the genesis\nand waypoint pointed to by the ",(0,s.jsx)(n.code,{children:"curl"})," commands above."]})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Next, run the command below to create a copy of the PFN configuration YAML template:"}),"\n",(0,s.jsx)(n.pre,{icon:o.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-filename":"Terminal","data-copy":"",children:(0,s.jsx)(n.code,{children:(0,s.jsxs)(n.span,{children:[(0,s.jsx)(n.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"cp"}),(0,s.jsx)(n.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" config/src/config/test_data/public_full_node.yaml"}),(0,s.jsx)(n.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" fullnode.yaml"})]})})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Finally, edit the ",(0,s.jsx)(n.code,{children:"fullnode.yaml"})," configuration file to ensure that your PFN: (i) contains the genesis blob\nand waypoint file you just downloaded; and (ii) saves the synchronized blockchain data to the location of your\nchoice (on your local machine). To do this:"]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["Specify the correct path to the ",(0,s.jsx)(n.code,{children:"genesis.blob"})," file you just downloaded by editing ",(0,s.jsx)(n.code,{children:"execution.genesis_file_location"})," in the ",(0,s.jsx)(n.code,{children:"fullnode.yaml"})," configuration. By default, it points to ",(0,s.jsx)(n.code,{children:"genesis.blob"})," in the current working directory.","\n",(0,s.jsx)(n.pre,{tabIndex:"0","data-language":"yaml","data-word-wrap":"","data-filename":"fullnode.yaml","data-copy":"",children:(0,s.jsxs)(n.code,{children:[(0,s.jsxs)(n.span,{children:[(0,s.jsx)(n.span,{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"},children:"execution"}),(0,s.jsx)(n.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:":"})]}),"\n",(0,s.jsxs)(n.span,{children:[(0,s.jsx)(n.span,{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"},children:"  genesis_file_location"}),(0,s.jsx)(n.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:": "}),(0,s.jsx)(n.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"./genesis.blob"'})]})]})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["Specify the correct path to the ",(0,s.jsx)(n.code,{children:"waypoint.txt"})," file you just downloaded by editing ",(0,s.jsx)(n.code,{children:"base.waypoint.from_file"})," in the ",(0,s.jsx)(n.code,{children:"fullnode.yaml"})," configuration. By default, it points to ",(0,s.jsx)(n.code,{children:"waypoint.txt"})," in the current working directory. For example:","\n",(0,s.jsx)(n.pre,{tabIndex:"0","data-language":"yaml","data-word-wrap":"","data-filename":"fullnode.yaml","data-copy":"",children:(0,s.jsxs)(n.code,{children:[(0,s.jsxs)(n.span,{children:[(0,s.jsx)(n.span,{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"},children:"base"}),(0,s.jsx)(n.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:":"})]}),"\n",(0,s.jsxs)(n.span,{children:[(0,s.jsx)(n.span,{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"},children:"  waypoint"}),(0,s.jsx)(n.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:":"})]}),"\n",(0,s.jsxs)(n.span,{children:[(0,s.jsx)(n.span,{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"},children:"    from_file"}),(0,s.jsx)(n.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:": "}),(0,s.jsx)(n.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"./waypoint.txt"'})]})]})}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["Specify the directory on your local machine that you want to store the blockchain database by editing the ",(0,s.jsx)(n.code,{children:"base.data_dir"})," in the ",(0,s.jsx)(n.code,{children:"fullnode.yaml"})," configuration. For example, you can create a directory ",(0,s.jsx)(n.code,{children:"my-full-node/data"})," in your home directory and specify it as:","\n",(0,s.jsx)(n.pre,{tabIndex:"0","data-language":"yaml","data-word-wrap":"","data-filename":"fullnode.yaml","data-copy":"",children:(0,s.jsxs)(n.code,{children:[(0,s.jsxs)(n.span,{children:[(0,s.jsx)(n.span,{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"},children:"base"}),(0,s.jsx)(n.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:":"})]}),"\n",(0,s.jsxs)(n.span,{children:[(0,s.jsx)(n.span,{style:{"--shiki-light":"#22863A","--shiki-dark":"#85E89D"},children:"  data_dir"}),(0,s.jsx)(n.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:": "}),(0,s.jsx)(n.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"</path/to/my/homedir/my-full-node/data>"'})]})]})}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Start your local public fullnode by running the below command:"}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.pre,{icon:o.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-filename":"Terminal","data-copy":"",children:(0,s.jsx)(n.code,{children:(0,s.jsxs)(n.span,{children:[(0,s.jsx)(n.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"cargo"}),(0,s.jsx)(n.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" run"}),(0,s.jsx)(n.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -p"}),(0,s.jsx)(n.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" aptos-node"}),(0,s.jsx)(n.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --release"}),(0,s.jsx)(n.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --"}),(0,s.jsx)(n.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -f"}),(0,s.jsx)(n.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" ./fullnode.yaml"})]})})}),"\n",(0,s.jsx)(a.U,{type:"info",children:(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Debugging?"}),(0,s.jsx)("br",{}),"\nThe command above will build a release binary for ",(0,s.jsx)(n.code,{children:"aptos-node"})," at: ",(0,s.jsx)(n.code,{children:"aptos-core/target/release/aptos-node"}),". The release\nbinaries tend to be substantially faster than debug binaries but lack debugging information useful for development.\nTo build a debug binary, omit the ",(0,s.jsx)(n.code,{children:"--release"})," flag from the command above."]})}),"\n",(0,s.jsx)(n.p,{children:"You have now successfully configured and started running a PFN in the Aptos mainnet."}),"\n",(0,s.jsx)(a.U,{type:"info",children:(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Verify your PFN"}),(0,s.jsx)("br",{}),"\nIf you want to verify that your PFN is running correctly, you can follow the instructions in the ",(0,s.jsx)(n.a,{href:"../verify-pfn",children:"Verify a PFN"})," guide."]})})]})},"/en/network/nodes/full-node/deployments/using-source-code",{filePath:"pages/en/network/nodes/full-node/deployments/using-source-code.mdx",timestamp:1728425436e3,pageMap:r.v,frontMatter:{title:"Using Source Code"},title:"Using Source Code"},"undefined"==typeof RemoteContent?d:RemoteContent.useTOC)},13844:function(e,n,i){"use strict";i.d(n,{U:function(){return o}});var s=i(31549),t=i(78364),r=i(83185);let l={default:"\uD83D\uDCA1",error:"\uD83D\uDEAB",info:(0,s.jsx)(r.AV,{className:"_mt-1"}),warning:"⚠️"},a={default:(0,t.Z)("_border-orange-100 _bg-orange-50 _text-orange-800 dark:_border-orange-400/30 dark:_bg-orange-400/20 dark:_text-orange-300"),error:(0,t.Z)("_border-red-200 _bg-red-100 _text-red-900 dark:_border-red-200/30 dark:_bg-red-900/30 dark:_text-red-200"),info:(0,t.Z)("_border-blue-200 _bg-blue-100 _text-blue-900 dark:_border-blue-200/30 dark:_bg-blue-900/30 dark:_text-blue-200"),warning:(0,t.Z)("_border-yellow-100 _bg-yellow-50 _text-yellow-900 dark:_border-yellow-200/30 dark:_bg-yellow-700/30 dark:_text-yellow-200")};function o({children:e,type:n="default",emoji:i=l[n]}){return(0,s.jsxs)("div",{className:(0,t.Z)("nextra-callout _overflow-x-auto _mt-6 _flex _rounded-lg _border _py-2 ltr:_pr-4 rtl:_pl-4","contrast-more:_border-current contrast-more:dark:_border-current",a[n]),children:[(0,s.jsx)("div",{className:"_select-none _text-xl ltr:_pl-3 ltr:_pr-2 rtl:_pr-3 rtl:_pl-2",style:{fontFamily:'"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'},children:i}),(0,s.jsx)("div",{className:"_w-full _min-w-0 _leading-7",children:e})]})}},82910:function(e,n,i){"use strict";i.d(n,{c:function(){return o}});var s=i(31549),t=i(74271),r=i(14553),l=i(55754),a=i(46977);function o(e,n,i,s){let r=globalThis[t.ud];return r.route=n,r.pageMap=i.pageMap,r.context[n]={Content:e,pageOpts:i,useTOC:s},d}function d({__nextra_pageMap:e=[],__nextra_dynamic_opts:n,...i}){let a=globalThis[t.ud],{Layout:o,themeConfig:d}=a,{route:c,locale:u}=(0,r.t)(),p=a.context[c];if(!p)throw Error(`No content found for the "${c}" route. Please report it as a bug.`);let{pageOpts:x,useTOC:g,Content:j}=p;if(c.startsWith("/["))x.pageMap=e;else for(let{route:n,children:i}of e){let e=n.split("/").slice(u?2:1);(function e(n,[i,...s]){for(let t of n)if("children"in t&&i===t.name)return s.length?e(t.children,s):t})(x.pageMap,e).children=i}if(n){let{title:e,frontMatter:i}=n;x={...x,title:e,frontMatter:i}}return(0,s.jsx)(o,{themeConfig:d,pageOpts:x,pageProps:i,children:(0,s.jsx)(l.F,{value:i,children:(0,s.jsx)(h,{useTOC:g,children:(0,s.jsx)(j,{...i})})})})}function h({children:e,useTOC:n}){let{wrapper:i}=(0,a.a)();return(0,s.jsx)(c,{useTOC:n,wrapper:i,children:e})}function c({children:e,useTOC:n,wrapper:i,...t}){let r=n(t);return i?(0,s.jsx)(i,{toc:r,children:e}):e}}},function(e){e.O(0,[68889,1117,92888,49774,40179],function(){return e(e.s=15156)}),_N_E=e.O()}]);