diff --git a/404.html b/404.html index 9b91126eb..b5943e81a 100644 --- a/404.html +++ b/404.html @@ -13,8 +13,8 @@ - - + + diff --git a/assets/js/19f79f7b.3f316def.js b/assets/js/19f79f7b.17c4ef2c.js similarity index 99% rename from assets/js/19f79f7b.3f316def.js rename to assets/js/19f79f7b.17c4ef2c.js index cfa9c587f..aeccefe10 100644 --- a/assets/js/19f79f7b.3f316def.js +++ b/assets/js/19f79f7b.17c4ef2c.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[8489],{8816:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>l,default:()=>g,frontMatter:()=>r,metadata:()=>a,toc:()=>d});var o=n(5893),i=n(1151),s=n(3872);const r={title:"How to manage log files",hide_title:!0,slug:"how-to-manage-log-files",date:new Date("2023-10-27T12:00:00.000Z"),image:"./assets/managing-the-keystore.png?202311181211",description:"Learn how to rotate, compress the log files",category:"Tutorial",tags:["guide","logs"]},l=void 0,a={id:"Node Operators/how-to-manage-logfiles",title:"How to manage log files",description:"Learn how to rotate, compress the log files",source:"@site/guides/Node Operators/how-to-manage-logfiles.md",sourceDirName:"Node Operators",slug:"/Node Operators/how-to-manage-log-files",permalink:"/guides/Node Operators/how-to-manage-log-files",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/guides/Node Operators/how-to-manage-logfiles.md",tags:[{label:"guide",permalink:"/guides/tags/guide"},{label:"logs",permalink:"/guides/tags/logs"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"How to manage log files",hide_title:!0,slug:"how-to-manage-log-files",date:"2023-10-27T12:00:00.000Z",image:"./assets/managing-the-keystore.png?202311181211",description:"Learn how to rotate, compress the log files",category:"Tutorial",tags:["guide","logs"]},sidebar:"defaultSidebar",previous:{title:"Getting Started",permalink:"/guides/Node Operators/getting-started"},next:{title:"Managing the keystore",permalink:"/guides/Node Operators/managing-the-keystore"}},c={image:n(4110).Z},d=[{value:"Introduction",id:"introduction",level:2},{value:"Journal",id:"journal",level:2},{value:"Commands",id:"commands",level:3},{value:"Disk utilization checkup",id:"disk-utilization-checkup",level:4},{value:"Clearing logs manually",id:"clearing-logs-manually",level:4},{value:"Follow or tail logs of service",id:"follow-or-tail-logs-of-service",level:4},{value:"Show all service entries",id:"show-all-service-entries",level:4},{value:"Configuration file",id:"configuration-file",level:3},{value:"Create the directory and config file",id:"create-the-directory-and-config-file",level:3},{value:"Configuration settings",id:"configuration-settings",level:3},{value:"Logrotate",id:"logrotate",level:2},{value:"Prerequesite",id:"prerequesite",level:3},{value:"Explore the Configuration files",id:"explore-the-configuration-files",level:3},{value:"Create the Lightning logrotate configuration file",id:"create-the-lightning-logrotate-configuration-file",level:3},{value:"Lightning Configuration Settings",id:"lightning-configuration-settings",level:3},{value:"Cron job",id:"cron-job",level:3},{value:"Conclusion",id:"conclusion",level:2}];function h(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.p,{children:(0,o.jsx)(t.img,{alt:"How to manage log files",src:n(5407).Z+"",width:"1450",height:"816"})}),"\n","\n","\n",(0,o.jsx)(t.h2,{id:"introduction",children:"Introduction"}),"\n",(0,o.jsx)(t.p,{children:"The Fleek Network node streams text messages to the standard output and error in Linux. Given that disk space is a limited resource for most systems, the number of text data can be a cause of concern. Managing the file sizes by means of rotation and compression can help."}),"\n",(0,o.jsx)(t.p,{children:"A conventional Fleek Network Service setup (as per the documentation and tool recommendations), have the text data stored in a special directory for storing logs called /var/log. The /var/log directory contains logs from various applications running on the operating system, the operating system itself, and others."}),"\n",(0,o.jsx)(t.p,{children:"For the purpose of storing network node operation logs, it defaults to the /var/log/lightning directory where the files output.log (stdout) and diagnostic.log (stderr) is located and accumulated. As the node runs, the size of the files increase, as it aggregates all the output generated by the Fleek Network service operations, such as info, errors, etc."}),"\n",(0,o.jsx)(t.p,{children:"A Node Operator can configure the system to rotate, compress, and set maximum size of these files to safeguard any concerns or issues that can get out of control, such as causing disk space to become full quickly."}),"\n",(0,o.jsxs)(t.p,{children:["In this guide, we'll look into some options available to manage the logs. First, we'll look into journald.conf which controls where to store journal data (the journal is a component of systemd that handles all the messages in a Systemd enabled system). Afterwards, we'll look into ",(0,o.jsx)(t.a,{href:"https://linux.die.net/man/8/logrotate",children:"Logrotate"})," an application to help us manage automatic rotation and compression of log files."]}),"\n",(0,o.jsx)(t.p,{children:"In essence, the journal and the logs duplicate the same information, and we want to make sure that we set measures to control it."}),"\n",(0,o.jsx)(t.h2,{id:"journal",children:"Journal"}),"\n",(0,o.jsxs)(t.p,{children:["Journal is a component of Systemd, a centralized location for all messages logged by different components in a systemd-enabled Linux system. The systemd journal will happily run in parallel with the standard type log files in ",(0,o.jsx)(t.code,{children:"/var/log/*"})," where the Fleek Network Systemd Unit Service outputs Standard Output and Standard Error in the location ",(0,o.jsx)(t.code,{children:"/var/log/lightning/*.log"}),"."]}),"\n",(0,o.jsxs)(t.p,{children:["Here, we are going to learn how to configure the ",(0,o.jsx)(t.code,{children:"journald.conf"})," service configuration file for the system-wide settings (meaning that it applies to all services), but firstly we're going to learn some commands to help us troubleshoot when necessary."]}),"\n",(0,o.jsx)(t.h3,{id:"commands",children:"Commands"}),"\n",(0,o.jsx)(t.h4,{id:"disk-utilization-checkup",children:"Disk utilization checkup"}),"\n",(0,o.jsx)(t.p,{children:"To check how much disk space is used by Systemd log files, run the command below:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"sudo journalctl --disk-usage\n"})}),"\n",(0,o.jsx)(t.p,{children:"It provides information of how much disk space is utilized by the log files in your system."}),"\n",(0,o.jsx)(t.h4,{id:"clearing-logs-manually",children:"Clearing logs manually"}),"\n",(0,o.jsxs)(t.p,{children:["The best way to clear log files is done automatically by the ",(0,o.jsx)(t.code,{children:"journald.conf"})," configuration file, discussed in ",(0,o.jsx)(t.a,{href:"#configuration-file",children:"Configuration file"}),". In the ideal world, you shouldn't have to manually delete the log files, but this can be useful to know about when troubleshooting."]}),"\n",(0,o.jsxs)(t.p,{children:["To ",(0,o.jsx)(t.code,{children:"flush"})," the log files run the command below:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"sudo journalctl --flush --rotate\nsudo journalctl --vacuum-time=1s\n"})}),"\n",(0,o.jsxs)(t.admonition,{type:"tip",children:[(0,o.jsx)(t.p,{children:"The flush and rotate flag is used, as vaccum-time only clears archived logs and not active ones. It'll flush:"}),(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsx)(t.li,{children:"Move /run/log/journal to /var/log/journal"}),"\n",(0,o.jsx)(t.li,{children:"Rotate (this flag archives logs and retains it)"}),"\n"]}),(0,o.jsx)(t.p,{children:"Since it'll only keep the past 1-second-long files, it'll effectively clear everything."})]}),"\n",(0,o.jsx)(t.h4,{id:"follow-or-tail-logs-of-service",children:"Follow or tail logs of service"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"sudo journalctl -u .service -f\n"})}),"\n",(0,o.jsx)(t.p,{children:"For example, for a conventional native install (if you haven't followed the conventions, make the appropriate tweaks to fit your needs)."}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"sudo journalctl -u lightning.service -f\n"})}),"\n",(0,o.jsx)(t.p,{children:"The Docker service"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"sudo journalctl -u docker-lightning.service -f\n"})}),"\n",(0,o.jsx)(t.h4,{id:"show-all-service-entries",children:"Show all service entries"}),"\n",(0,o.jsx)(t.p,{children:"Show all journal entries, which can be fairly long:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"sudo journalctl\n"})}),"\n",(0,o.jsx)(t.h3,{id:"configuration-file",children:"Configuration file"}),"\n",(0,o.jsxs)(t.p,{children:["The default configuration file is located at ",(0,o.jsx)(t.code,{children:"/etc/systemd/journald.conf"}),". This is the main file that journal reads the configuration from, for the system instances that are controlled by root."]}),"\n",(0,o.jsxs)(t.p,{children:["In addition to the main configuration file there are a few other locations that take higher precedence and override the main configuration file. To learn more about journald read ",(0,o.jsx)(t.a,{href:"https://www.freedesktop.org/software/systemd/man/latest/journald.conf.html#Options",children:"here"}),"."]}),"\n",(0,o.jsxs)(t.p,{children:["To keep the guide short we are going to use the main location ",(0,o.jsx)(t.code,{children:"/etc/systemd/journald.conf"}),"."]}),"\n",(0,o.jsx)(t.h3,{id:"create-the-directory-and-config-file",children:"Create the directory and config file"}),"\n",(0,o.jsxs)(t.p,{children:["If the ",(0,o.jsx)(t.code,{children:"/etc/systemd/journald.conf"})," file doesn't exist, create it by:"]}),"\n",(0,o.jsxs)(t.p,{children:["Create the ",(0,o.jsx)(t.code,{children:"journald.conf"})," file:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"sudo touch /etc/systemd/journald.conf\n"})}),"\n",(0,o.jsx)(t.h3,{id:"configuration-settings",children:"Configuration settings"}),"\n",(0,o.jsx)(t.p,{children:"The Systemd provides many options for you to manage the log files and by combining these parameters you can limit the disk space used by the journal files."}),"\n",(0,o.jsxs)(t.p,{children:["A list of the available options are ",(0,o.jsx)(t.a,{href:"https://www.freedesktop.org/software/systemd/man/latest/journald.conf.html#Options",children:"here"}),"."]}),"\n",(0,o.jsx)(t.p,{children:"Here is a quick description of the options we're going to use for our example:"}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"Storage"}),", controls where to store journal data"]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"SystemMaxUse"}),", specifies the maximum disk space that can be used by the journal in persistent storage"]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"SystemMaxFileSize"}),", controls how large individual journal files can grow to in persistent storage before being rotated"]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"RuntimeMaxUse"}),", control how much disk space the journal may use up at most"]}),"\n"]}),"\n",(0,o.jsxs)(t.p,{children:["You should open the ",(0,o.jsx)(t.code,{children:"/etc/systemd/journald.conf"})," file in your favorite text editor and put:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-toml",children:"[Journal]\nStorage=persistent\nSystemMaxUse=1G\nSystemMaxFileSize=100M\nRuntimeMaxUse=100M\n"})}),"\n",(0,o.jsx)(t.p,{children:"Here, we set 1G and 100M, which means 1 Gigabyte and 100 Megabytes. You can also use K for Kbytes, amongst others."}),"\n",(0,o.jsx)(t.p,{children:"After the changes, you have to restart the journald after updating the file. To restart use the command:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"sudo systemctl restart systemd-journald\n"})}),"\n",(0,o.jsx)(t.p,{children:"You can verify the integrity of the log files by running:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"sudo journalctl --verify\n"})}),"\n",(0,o.jsx)(t.h2,{id:"logrotate",children:"Logrotate"}),"\n",(0,o.jsx)(t.p,{children:"Logrotate is a tool to manage the log files created by a system processes. It can automatically compress, rename, remove logs and more for your convenience and save your system's resources. Log files can be handled timely, or when it grows too large."}),"\n",(0,o.jsx)(t.h3,{id:"prerequesite",children:"Prerequesite"}),"\n",(0,o.jsx)(t.p,{children:"The logrotate tools is available by default on Ubuntu."}),"\n",(0,o.jsx)(t.admonition,{type:"tip",children:(0,o.jsx)(t.p,{children:"We're using Ubuntu for our guide to keep it simple. If you are using a different and support operating system make sure you install Logrotate before proceeding."})}),"\n",(0,o.jsx)(t.p,{children:"You can check if logrotate is installed by executing:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"logrotate --version\n"})}),"\n",(0,o.jsx)(t.p,{children:"At the time this guide was written, we got the following output:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"logrotate 3.21.0\n\n Default mail command: /usr/bin/mail\n Default compress command: /bin/gzip\n Default uncompress command: /bin/gunzip\n Default compress extension: .gz\n Default state file path: /var/lib/logrotate/status\n ACL support: yes\n SELinux support: yes\n"})}),"\n",(0,o.jsx)(t.p,{children:"If you run an earlier or older version, changes or tweaks might apply."}),"\n",(0,o.jsx)(t.h3,{id:"explore-the-configuration-files",children:"Explore the Configuration files"}),"\n",(0,o.jsx)(t.p,{children:"The configuration files we'll be exploring today are found in the following locations in Ubuntu:"}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsxs)(t.li,{children:["\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.strong,{children:"/etc/logrotate.conf"}),", is the main configuration settings file. It includes the statement to pull in configuration files from other directories, e.g. the ",(0,o.jsx)(t.code,{children:"/etc/logrotate.d"})]}),"\n"]}),"\n",(0,o.jsxs)(t.li,{children:["\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.strong,{children:"/etc/logrotate.d/"}),", a directory where packages drop log rotation information"]}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(t.admonition,{type:"tip",children:(0,o.jsx)(t.p,{children:"We use Ubuntu for our guide, if you are on a different distro, you have to determine the file configuration file locations"})}),"\n",(0,o.jsxs)(t.p,{children:["The content of the file ",(0,o.jsx)(t.code,{children:"/etc/logrotate.conf"})," should be similar to:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:'# see "man logrotate" for details\n\n# global options do not affect preceding include directives\n\n# rotate log files weekly\nweekly\n\n# use the adm group by default, since this is the owning group\n# of /var/log/.\nsu root adm\n\n# keep 4 weeks worth of backlogs\nrotate 4\n\n# create new (empty) log files after rotating old ones\ncreate\n\n# use date as a suffix of the rotated file\n#dateext\n\n# uncomment this if you want your log files compressed\n#compress\n\n# packages drop log rotation information into this directory\ninclude /etc/logrotate.d\n\n# system-specific logs may also be configured here.\n'})}),"\n",(0,o.jsx)(t.p,{children:"The configuration settings if anything like the above, tell us that the rotation happens weekly, keeping 4 weeks worth of backlogs, etc."}),"\n",(0,o.jsxs)(t.p,{children:["To learn more about other configuration options consult the ",(0,o.jsx)(t.a,{href:"https://linux.die.net/man/8/logrotate",children:"logrotate manual page"}),"."]}),"\n",(0,o.jsx)(t.h3,{id:"create-the-lightning-logrotate-configuration-file",children:"Create the Lightning logrotate configuration file"}),"\n",(0,o.jsx)(t.p,{children:"Let's create a Logrotate configuration file for Fleek Network Lightning Service. Create the file by running the command:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"sudo touch /etc/logrotate.d/lightning\n"})}),"\n",(0,o.jsx)(t.h3,{id:"lightning-configuration-settings",children:"Lightning Configuration Settings"}),"\n",(0,o.jsxs)(t.p,{children:["Open the recently created file ",(0,o.jsx)(t.code,{children:"/etc/logrotate.d/lightning"})," in your favorite text editor."]}),"\n",(0,o.jsx)(t.p,{children:"Add the following lines to the file:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"/var/log/lightning/*.log {\n rotate 5\n daily\n size 50M\n notifempty\n compress\n}\n"})}),"\n",(0,o.jsx)(t.p,{children:"Remember to save the file before exiting the text editor. You can test the configuration file by running the command:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"sudo logrotate /etc/logrotate.conf --debug\n"})}),"\n",(0,o.jsxs)(t.p,{children:["The configuration file above declares that for the log files in the ",(0,o.jsx)(t.code,{children:"/var/log/lightning"})," directory, the log files are rotated 5 times daily before being removed, as long they grow bigger than 50 megabytes in file size or empty. Old versions of log files are compressed with gzip."]}),"\n",(0,o.jsx)(t.admonition,{type:"tip",children:(0,o.jsxs)(t.p,{children:["Bear in mind that this configuration file also inherit the default behavior, e.g. the ",(0,o.jsx)(t.code,{children:"create"})," as set in the main configuration file ",(0,o.jsx)(t.code,{children:"/etc/logrotate.conf"}),"."]})}),"\n",(0,o.jsxs)(t.p,{children:["Feel free to customize the settings to your liking by checking the documentation in the ",(0,o.jsx)(t.a,{href:"https://linux.die.net/man/8/logrotate",children:"logrotate manual page"}),"."]}),"\n",(0,o.jsx)(t.h3,{id:"cron-job",children:"Cron job"}),"\n",(0,o.jsx)(t.admonition,{type:"note",children:(0,o.jsx)(t.p,{children:"Depending on the operating system, you have to set up a cron job to execute logrotate with the configuration file daily. Since we are using Ubuntu for our example, a daily cron job runner is already set up for us. If you are on a different Distro/OS make the required amends."})}),"\n",(0,o.jsxs)(t.p,{children:["Verify that the ",(0,o.jsx)(t.code,{children:"/etc/cron.daily/logrotate"})," exists and includes the execution of ",(0,o.jsx)(t.code,{children:"logrotate"})," with the configuration argument ",(0,o.jsx)(t.code,{children:"/etc/logrotate.conf"}),"."]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"/usr/sbin/logrotate /etc/logrotate.conf\n"})}),"\n",(0,o.jsx)(t.admonition,{type:"tip",children:(0,o.jsx)(t.p,{children:"If you have modified the location of the binary or main configuration file, make sure this is set correctly to your custom locations."})}),"\n",(0,o.jsxs)(t.p,{children:["To summarize, the ",(0,o.jsx)(t.code,{children:"logrotate /etc/logrotate.conf"})," is executed and as logrotate.conf goes through its list of commands, it calls ",(0,o.jsx)(t.code,{children:"include /etc/logrotate.d"}),". It means that any scripts in ",(0,o.jsx)(t.code,{children:"/etc/logrotate.d"})," are executed, such as the ",(0,o.jsx)(t.a,{href:"#lightning-configuration-settings",children:"Lightning Configuration Settings"}),"."]}),"\n",(0,o.jsx)(t.h2,{id:"conclusion",children:"Conclusion"}),"\n",(0,o.jsx)(t.p,{children:"The guide starts by warning us about the stream text messages that the Fleek Network emits by default. As the text data is aggregated and stored in the file system it can lead to fill up the limited available disk space quickly, causing issues to the operation of the system."}),"\n",(0,o.jsx)(t.p,{children:"To help control it, the journald is introduced, by explaining its role as a centralized message system, that runs alongside the application logs. Then, have it configured to limit the maximum file size, amongst other system-wide settings."}),"\n",(0,o.jsx)(t.p,{children:"Finally, logrotate is discussed in helping us manage the Fleek Network Lightning application log files by setting it to automatically compress, rename, remove logs for the system admin convenience and saving system's resources."}),"\n",(0,o.jsx)(s.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function g(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(h,{...e})}):h(e)}},3872:(e,t,n)=>{n.d(t,{Z:()=>i});n(7294);var o=n(5893);const i=e=>{let{image:t,name:n,title:i,url:s,communityMember:r=!1}=e;return(0,o.jsx)("section",{className:"author_card",children:(0,o.jsxs)("div",{children:[(0,o.jsx)("span",{className:"avatar",children:(0,o.jsx)("a",{href:s,target:"_blank",alt:n,children:(0,o.jsx)("img",{src:t,alt:n})})}),(0,o.jsxs)("div",{children:[(0,o.jsx)("span",{className:"name",children:(0,o.jsx)("a",{href:s,target:"_blank",alt:n,children:n})}),(0,o.jsx)("span",{className:"title",children:i}),(0,o.jsxs)("span",{className:"discord",children:[r?"Join our community on":"Got questions? Find us on"," ",(0,o.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},4110:(e,t,n)=>{n.d(t,{Z:()=>o});const o=n.p+"assets/images/managing-the-keystore-fe4cdb19d2f59c54bcf864b0e069b535.png"},5407:(e,t,n)=>{n.d(t,{Z:()=>o});const o=n.p+"assets/images/how-to-manage-log-files-be3f38ea329523fb5ec346ee98946dbe.png"},1151:(e,t,n)=>{n.d(t,{Z:()=>l,a:()=>r});var o=n(7294);const i={},s=o.createContext(i);function r(e){const t=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),o.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[8489],{8816:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>l,default:()=>g,frontMatter:()=>r,metadata:()=>a,toc:()=>d});var o=n(5893),i=n(1151),s=n(3872);const r={title:"How to manage log files",hide_title:!0,slug:"how-to-manage-log-files",date:new Date("2023-10-27T12:00:00.000Z"),image:"./assets/managing-the-keystore.png?202311181211",description:"Learn how to rotate, compress the log files",category:"Tutorial",tags:["guide","logs"]},l=void 0,a={id:"Node Operators/how-to-manage-logfiles",title:"How to manage log files",description:"Learn how to rotate, compress the log files",source:"@site/guides/Node Operators/how-to-manage-logfiles.md",sourceDirName:"Node Operators",slug:"/Node Operators/how-to-manage-log-files",permalink:"/guides/Node Operators/how-to-manage-log-files",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/guides/Node Operators/how-to-manage-logfiles.md",tags:[{label:"guide",permalink:"/guides/tags/guide"},{label:"logs",permalink:"/guides/tags/logs"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"How to manage log files",hide_title:!0,slug:"how-to-manage-log-files",date:"2023-10-27T12:00:00.000Z",image:"./assets/managing-the-keystore.png?202311181211",description:"Learn how to rotate, compress the log files",category:"Tutorial",tags:["guide","logs"]},sidebar:"defaultSidebar",previous:{title:"Getting Started",permalink:"/guides/Node Operators/getting-started"},next:{title:"Managing the keystore",permalink:"/guides/Node Operators/managing-the-keystore"}},c={image:n(4110).Z},d=[{value:"Introduction",id:"introduction",level:2},{value:"Journal",id:"journal",level:2},{value:"Commands",id:"commands",level:3},{value:"Disk utilization checkup",id:"disk-utilization-checkup",level:4},{value:"Clearing logs manually",id:"clearing-logs-manually",level:4},{value:"Follow or tail logs of service",id:"follow-or-tail-logs-of-service",level:4},{value:"Show all service entries",id:"show-all-service-entries",level:4},{value:"Configuration file",id:"configuration-file",level:3},{value:"Create the directory and config file",id:"create-the-directory-and-config-file",level:3},{value:"Configuration settings",id:"configuration-settings",level:3},{value:"Logrotate",id:"logrotate",level:2},{value:"Prerequesite",id:"prerequesite",level:3},{value:"Explore the Configuration files",id:"explore-the-configuration-files",level:3},{value:"Create the Lightning logrotate configuration file",id:"create-the-lightning-logrotate-configuration-file",level:3},{value:"Lightning Configuration Settings",id:"lightning-configuration-settings",level:3},{value:"Cron job",id:"cron-job",level:3},{value:"Conclusion",id:"conclusion",level:2}];function h(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.p,{children:(0,o.jsx)(t.img,{alt:"How to manage log files",src:n(5407).Z+"",width:"1450",height:"816"})}),"\n","\n","\n",(0,o.jsx)(t.h2,{id:"introduction",children:"Introduction"}),"\n",(0,o.jsx)(t.p,{children:"The Fleek Network node streams text messages to the standard output and error in Linux. Given that disk space is a limited resource for most systems, the number of text data can be a cause of concern. Managing the file sizes by means of rotation and compression can help."}),"\n",(0,o.jsx)(t.p,{children:"A conventional Fleek Network Service setup (as per the documentation and tool recommendations), have the text data stored in a special directory for storing logs called /var/log. The /var/log directory contains logs from various applications running on the operating system, the operating system itself, and others."}),"\n",(0,o.jsx)(t.p,{children:"For the purpose of storing network node operation logs, it defaults to the /var/log/lightning directory where the files output.log (stdout) and diagnostic.log (stderr) is located and accumulated. As the node runs, the size of the files increase, as it aggregates all the output generated by the Fleek Network service operations, such as info, errors, etc."}),"\n",(0,o.jsx)(t.p,{children:"A Node Operator can configure the system to rotate, compress, and set maximum size of these files to safeguard any concerns or issues that can get out of control, such as causing disk space to become full quickly."}),"\n",(0,o.jsxs)(t.p,{children:["In this guide, we'll look into some options available to manage the logs. First, we'll look into journald.conf which controls where to store journal data (the journal is a component of systemd that handles all the messages in a Systemd enabled system). Afterwards, we'll look into ",(0,o.jsx)(t.a,{href:"https://linux.die.net/man/8/logrotate",children:"Logrotate"})," an application to help us manage automatic rotation and compression of log files."]}),"\n",(0,o.jsx)(t.p,{children:"In essence, the journal and the logs duplicate the same information, and we want to make sure that we set measures to control it."}),"\n",(0,o.jsx)(t.h2,{id:"journal",children:"Journal"}),"\n",(0,o.jsxs)(t.p,{children:["Journal is a component of Systemd, a centralized location for all messages logged by different components in a systemd-enabled Linux system. The systemd journal will happily run in parallel with the standard type log files in ",(0,o.jsx)(t.code,{children:"/var/log/*"})," where the Fleek Network Systemd Unit Service outputs Standard Output and Standard Error in the location ",(0,o.jsx)(t.code,{children:"/var/log/lightning/*.log"}),"."]}),"\n",(0,o.jsxs)(t.p,{children:["Here, we are going to learn how to configure the ",(0,o.jsx)(t.code,{children:"journald.conf"})," service configuration file for the system-wide settings (meaning that it applies to all services), but firstly we're going to learn some commands to help us troubleshoot when necessary."]}),"\n",(0,o.jsx)(t.h3,{id:"commands",children:"Commands"}),"\n",(0,o.jsx)(t.h4,{id:"disk-utilization-checkup",children:"Disk utilization checkup"}),"\n",(0,o.jsx)(t.p,{children:"To check how much disk space is used by Systemd log files, run the command below:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"sudo journalctl --disk-usage\n"})}),"\n",(0,o.jsx)(t.p,{children:"It provides information of how much disk space is utilized by the log files in your system."}),"\n",(0,o.jsx)(t.h4,{id:"clearing-logs-manually",children:"Clearing logs manually"}),"\n",(0,o.jsxs)(t.p,{children:["The best way to clear log files is done automatically by the ",(0,o.jsx)(t.code,{children:"journald.conf"})," configuration file, discussed in ",(0,o.jsx)(t.a,{href:"#configuration-file",children:"Configuration file"}),". In the ideal world, you shouldn't have to manually delete the log files, but this can be useful to know about when troubleshooting."]}),"\n",(0,o.jsxs)(t.p,{children:["To ",(0,o.jsx)(t.code,{children:"flush"})," the log files run the command below:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"sudo journalctl --flush --rotate\nsudo journalctl --vacuum-time=1s\n"})}),"\n",(0,o.jsxs)(t.admonition,{type:"tip",children:[(0,o.jsx)(t.p,{children:"The flush and rotate flag is used, as vaccum-time only clears archived logs and not active ones. It'll flush:"}),(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsx)(t.li,{children:"Move /run/log/journal to /var/log/journal"}),"\n",(0,o.jsx)(t.li,{children:"Rotate (this flag archives logs and retains it)"}),"\n"]}),(0,o.jsx)(t.p,{children:"Since it'll only keep the past 1-second-long files, it'll effectively clear everything."})]}),"\n",(0,o.jsx)(t.h4,{id:"follow-or-tail-logs-of-service",children:"Follow or tail logs of service"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"sudo journalctl -u .service -f\n"})}),"\n",(0,o.jsx)(t.p,{children:"For example, for a conventional native install (if you haven't followed the conventions, make the appropriate tweaks to fit your needs)."}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"sudo journalctl -u lightning.service -f\n"})}),"\n",(0,o.jsx)(t.p,{children:"The Docker service"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"sudo journalctl -u docker-lightning.service -f\n"})}),"\n",(0,o.jsx)(t.h4,{id:"show-all-service-entries",children:"Show all service entries"}),"\n",(0,o.jsx)(t.p,{children:"Show all journal entries, which can be fairly long:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"sudo journalctl\n"})}),"\n",(0,o.jsx)(t.h3,{id:"configuration-file",children:"Configuration file"}),"\n",(0,o.jsxs)(t.p,{children:["The default configuration file is located at ",(0,o.jsx)(t.code,{children:"/etc/systemd/journald.conf"}),". This is the main file that journal reads the configuration from, for the system instances that are controlled by root."]}),"\n",(0,o.jsxs)(t.p,{children:["In addition to the main configuration file there are a few other locations that take higher precedence and override the main configuration file. To learn more about journald read ",(0,o.jsx)(t.a,{href:"https://www.freedesktop.org/software/systemd/man/latest/journald.conf.html#Options",children:"here"}),"."]}),"\n",(0,o.jsxs)(t.p,{children:["To keep the guide short we are going to use the main location ",(0,o.jsx)(t.code,{children:"/etc/systemd/journald.conf"}),"."]}),"\n",(0,o.jsx)(t.h3,{id:"create-the-directory-and-config-file",children:"Create the directory and config file"}),"\n",(0,o.jsxs)(t.p,{children:["If the ",(0,o.jsx)(t.code,{children:"/etc/systemd/journald.conf"})," file doesn't exist, create it by:"]}),"\n",(0,o.jsxs)(t.p,{children:["Create the ",(0,o.jsx)(t.code,{children:"journald.conf"})," file:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"sudo touch /etc/systemd/journald.conf\n"})}),"\n",(0,o.jsx)(t.h3,{id:"configuration-settings",children:"Configuration settings"}),"\n",(0,o.jsx)(t.p,{children:"The Systemd provides many options for you to manage the log files and by combining these parameters you can limit the disk space used by the journal files."}),"\n",(0,o.jsxs)(t.p,{children:["A list of the available options are ",(0,o.jsx)(t.a,{href:"https://www.freedesktop.org/software/systemd/man/latest/journald.conf.html#Options",children:"here"}),"."]}),"\n",(0,o.jsx)(t.p,{children:"Here is a quick description of the options we're going to use for our example:"}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"Storage"}),", controls where to store journal data"]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"SystemMaxUse"}),", specifies the maximum disk space that can be used by the journal in persistent storage"]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"SystemMaxFileSize"}),", controls how large individual journal files can grow to in persistent storage before being rotated"]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"RuntimeMaxUse"}),", control how much disk space the journal may use up at most"]}),"\n"]}),"\n",(0,o.jsxs)(t.p,{children:["You should open the ",(0,o.jsx)(t.code,{children:"/etc/systemd/journald.conf"})," file in your favorite text editor and put:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-toml",children:"[Journal]\nStorage=persistent\nSystemMaxUse=1G\nSystemMaxFileSize=100M\nRuntimeMaxUse=100M\n"})}),"\n",(0,o.jsx)(t.p,{children:"Here, we set 1G and 100M, which means 1 Gigabyte and 100 Megabytes. You can also use K for Kbytes, amongst others."}),"\n",(0,o.jsx)(t.p,{children:"After the changes, you have to restart the journald after updating the file. To restart use the command:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"sudo systemctl restart systemd-journald\n"})}),"\n",(0,o.jsx)(t.p,{children:"You can verify the integrity of the log files by running:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"sudo journalctl --verify\n"})}),"\n",(0,o.jsx)(t.h2,{id:"logrotate",children:"Logrotate"}),"\n",(0,o.jsx)(t.p,{children:"Logrotate is a tool to manage the log files created by a system processes. It can automatically compress, rename, remove logs and more for your convenience and save your system's resources. Log files can be handled timely, or when it grows too large."}),"\n",(0,o.jsx)(t.h3,{id:"prerequesite",children:"Prerequesite"}),"\n",(0,o.jsx)(t.p,{children:"The logrotate tools is available by default on Ubuntu."}),"\n",(0,o.jsx)(t.admonition,{type:"tip",children:(0,o.jsx)(t.p,{children:"We're using Ubuntu for our guide to keep it simple. If you are using a different and support operating system make sure you install Logrotate before proceeding."})}),"\n",(0,o.jsx)(t.p,{children:"You can check if logrotate is installed by executing:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"logrotate --version\n"})}),"\n",(0,o.jsx)(t.p,{children:"At the time this guide was written, we got the following output:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"logrotate 3.21.0\n\n Default mail command: /usr/bin/mail\n Default compress command: /bin/gzip\n Default uncompress command: /bin/gunzip\n Default compress extension: .gz\n Default state file path: /var/lib/logrotate/status\n ACL support: yes\n SELinux support: yes\n"})}),"\n",(0,o.jsx)(t.p,{children:"If you run an earlier or older version, changes or tweaks might apply."}),"\n",(0,o.jsx)(t.h3,{id:"explore-the-configuration-files",children:"Explore the Configuration files"}),"\n",(0,o.jsx)(t.p,{children:"The configuration files we'll be exploring today are found in the following locations in Ubuntu:"}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsxs)(t.li,{children:["\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.strong,{children:"/etc/logrotate.conf"}),", is the main configuration settings file. It includes the statement to pull in configuration files from other directories, e.g. the ",(0,o.jsx)(t.code,{children:"/etc/logrotate.d"})]}),"\n"]}),"\n",(0,o.jsxs)(t.li,{children:["\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.strong,{children:"/etc/logrotate.d/"}),", a directory where packages drop log rotation information"]}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(t.admonition,{type:"tip",children:(0,o.jsx)(t.p,{children:"We use Ubuntu for our guide, if you are on a different distro, you have to determine the file configuration file locations"})}),"\n",(0,o.jsxs)(t.p,{children:["The content of the file ",(0,o.jsx)(t.code,{children:"/etc/logrotate.conf"})," should be similar to:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:'# see "man logrotate" for details\n\n# global options do not affect preceding include directives\n\n# rotate log files weekly\nweekly\n\n# use the adm group by default, since this is the owning group\n# of /var/log/.\nsu root adm\n\n# keep 4 weeks worth of backlogs\nrotate 4\n\n# create new (empty) log files after rotating old ones\ncreate\n\n# use date as a suffix of the rotated file\n#dateext\n\n# uncomment this if you want your log files compressed\n#compress\n\n# packages drop log rotation information into this directory\ninclude /etc/logrotate.d\n\n# system-specific logs may also be configured here.\n'})}),"\n",(0,o.jsx)(t.p,{children:"The configuration settings if anything like the above, tell us that the rotation happens weekly, keeping 4 weeks worth of backlogs, etc."}),"\n",(0,o.jsxs)(t.p,{children:["To learn more about other configuration options consult the ",(0,o.jsx)(t.a,{href:"https://linux.die.net/man/8/logrotate",children:"logrotate manual page"}),"."]}),"\n",(0,o.jsx)(t.h3,{id:"create-the-lightning-logrotate-configuration-file",children:"Create the Lightning logrotate configuration file"}),"\n",(0,o.jsx)(t.p,{children:"Let's create a Logrotate configuration file for Fleek Network Lightning Service. Create the file by running the command:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"sudo touch /etc/logrotate.d/lightning\n"})}),"\n",(0,o.jsx)(t.h3,{id:"lightning-configuration-settings",children:"Lightning Configuration Settings"}),"\n",(0,o.jsxs)(t.p,{children:["Open the recently created file ",(0,o.jsx)(t.code,{children:"/etc/logrotate.d/lightning"})," in your favorite text editor."]}),"\n",(0,o.jsx)(t.p,{children:"Add the following lines to the file:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"/var/log/lightning/*.log {\n rotate 5\n daily\n size 50M\n notifempty\n compress\n}\n"})}),"\n",(0,o.jsx)(t.p,{children:"Remember to save the file before exiting the text editor. You can test the configuration file by running the command:"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"sudo logrotate /etc/logrotate.conf --debug\n"})}),"\n",(0,o.jsxs)(t.p,{children:["The configuration file above declares that for the log files in the ",(0,o.jsx)(t.code,{children:"/var/log/lightning"})," directory, the log files are rotated 5 times daily before being removed, as long they grow bigger than 50 megabytes in file size or empty. Old versions of log files are compressed with gzip."]}),"\n",(0,o.jsx)(t.admonition,{type:"tip",children:(0,o.jsxs)(t.p,{children:["Bear in mind that this configuration file also inherit the default behavior, e.g. the ",(0,o.jsx)(t.code,{children:"create"})," as set in the main configuration file ",(0,o.jsx)(t.code,{children:"/etc/logrotate.conf"}),"."]})}),"\n",(0,o.jsxs)(t.p,{children:["Feel free to customize the settings to your liking by checking the documentation in the ",(0,o.jsx)(t.a,{href:"https://linux.die.net/man/8/logrotate",children:"logrotate manual page"}),"."]}),"\n",(0,o.jsx)(t.h3,{id:"cron-job",children:"Cron job"}),"\n",(0,o.jsx)(t.admonition,{type:"note",children:(0,o.jsx)(t.p,{children:"Depending on the operating system, you have to set up a cron job to execute logrotate with the configuration file daily. Since we are using Ubuntu for our example, a daily cron job runner is already set up for us. If you are on a different Distro/OS make the required amends."})}),"\n",(0,o.jsxs)(t.p,{children:["Verify that the ",(0,o.jsx)(t.code,{children:"/etc/cron.daily/logrotate"})," exists and includes the execution of ",(0,o.jsx)(t.code,{children:"logrotate"})," with the configuration argument ",(0,o.jsx)(t.code,{children:"/etc/logrotate.conf"}),"."]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{children:"/usr/sbin/logrotate /etc/logrotate.conf\n"})}),"\n",(0,o.jsx)(t.admonition,{type:"tip",children:(0,o.jsx)(t.p,{children:"If you have modified the location of the binary or main configuration file, make sure this is set correctly to your custom locations."})}),"\n",(0,o.jsxs)(t.p,{children:["To summarize, the ",(0,o.jsx)(t.code,{children:"logrotate /etc/logrotate.conf"})," is executed and as logrotate.conf goes through its list of commands, it calls ",(0,o.jsx)(t.code,{children:"include /etc/logrotate.d"}),". It means that any scripts in ",(0,o.jsx)(t.code,{children:"/etc/logrotate.d"})," are executed, such as the ",(0,o.jsx)(t.a,{href:"#lightning-configuration-settings",children:"Lightning Configuration Settings"}),"."]}),"\n",(0,o.jsx)(t.h2,{id:"conclusion",children:"Conclusion"}),"\n",(0,o.jsx)(t.p,{children:"The guide starts by warning us about the stream text messages that the Fleek Network emits by default. As the text data is aggregated and stored in the file system it can lead to fill up the limited available disk space quickly, causing issues to the operation of the system."}),"\n",(0,o.jsx)(t.p,{children:"To help control it, the journald is introduced, by explaining its role as a centralized message system, that runs alongside the application logs. Then, have it configured to limit the maximum file size, amongst other system-wide settings."}),"\n",(0,o.jsx)(t.p,{children:"Finally, logrotate is discussed in helping us manage the Fleek Network Lightning application log files by setting it to automatically compress, rename, remove logs for the system admin convenience and saving system's resources."}),"\n",(0,o.jsx)(s.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function g(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(h,{...e})}):h(e)}},3872:(e,t,n)=>{n.d(t,{Z:()=>i});n(7294);var o=n(5893);const i=e=>{let{image:t,name:n,title:i,url:s,communityMember:r=!1}=e;return(0,o.jsx)("section",{className:"author_card",children:(0,o.jsxs)("div",{children:[(0,o.jsx)("span",{className:"avatar",children:(0,o.jsx)("a",{href:s,target:"_blank",alt:n,children:(0,o.jsx)("img",{src:t,alt:n})})}),(0,o.jsxs)("div",{children:[(0,o.jsx)("span",{className:"name",children:(0,o.jsx)("a",{href:s,target:"_blank",alt:n,children:n})}),(0,o.jsx)("span",{className:"title",children:i}),(0,o.jsxs)("span",{className:"discord",children:[r?"Join our community on":"Got questions? Find us on"," ",(0,o.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},4110:(e,t,n)=>{n.d(t,{Z:()=>o});const o=n.p+"assets/images/managing-the-keystore-fe4cdb19d2f59c54bcf864b0e069b535.png"},5407:(e,t,n)=>{n.d(t,{Z:()=>o});const o=n.p+"assets/images/how-to-manage-log-files-be3f38ea329523fb5ec346ee98946dbe.png"},1151:(e,t,n)=>{n.d(t,{Z:()=>l,a:()=>r});var o=n(7294);const i={},s=o.createContext(i);function r(e){const t=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),o.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/1c14429f.4d9d363d.js b/assets/js/1c14429f.09996103.js similarity index 99% rename from assets/js/1c14429f.4d9d363d.js rename to assets/js/1c14429f.09996103.js index 8864c6f5b..2307a7537 100644 --- a/assets/js/1c14429f.4d9d363d.js +++ b/assets/js/1c14429f.09996103.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[2702],{5894:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>p,frontMatter:()=>a,metadata:()=>d,toc:()=>h});var i=t(5893),o=t(1151),s=t(3872),r=t(3183);const a={template:"post",draft:!1,hide_title:!0,title:"Getting Started",slug:"getting-started",date:new Date("2023-08-31T23:00:00.000Z"),image:"./assets/getting-started.png?202311181211",canonical:"",description:"A first look at what Fleek Network is, why it's important, and a simple tutorial of running and interacting with a node on your local machine!",category:"Tutorial",tags:["Edge computing","Guide","Getting Started"]},l=void 0,d={id:"Node Operators/getting-started-guide",title:"Getting Started",description:"A first look at what Fleek Network is, why it's important, and a simple tutorial of running and interacting with a node on your local machine!",source:"@site/guides/Node Operators/getting-started-guide.md",sourceDirName:"Node Operators",slug:"/Node Operators/getting-started",permalink:"/guides/Node Operators/getting-started",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/guides/Node Operators/getting-started-guide.md",tags:[{label:"Edge computing",permalink:"/guides/tags/edge-computing"},{label:"Guide",permalink:"/guides/tags/guide"},{label:"Getting Started",permalink:"/guides/tags/getting-started"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{template:"post",draft:!1,hide_title:!0,title:"Getting Started",slug:"getting-started",date:"2023-08-31T23:00:00.000Z",image:"./assets/getting-started.png?202311181211",canonical:"",description:"A first look at what Fleek Network is, why it's important, and a simple tutorial of running and interacting with a node on your local machine!",category:"Tutorial",tags:["Edge computing","Guide","Getting Started"]},sidebar:"defaultSidebar",previous:{title:"About guides",permalink:"/guides/"},next:{title:"How to manage log files",permalink:"/guides/Node Operators/how-to-manage-log-files"}},c={image:t(3483).Z},h=[{value:"Introduction",id:"introduction",level:2},{value:"Pre-requisites",id:"pre-requisites",level:2},{value:"Need a quick Fleek Network TL;DR?",id:"need-a-quick-fleek-network-tldr",level:2},{value:"Why is Fleek Network needed?",id:"why-is-fleek-network-needed",level:2},{value:"How Does Fleek Network Work?",id:"how-does-fleek-network-work",level:2},{value:"Running a Node",id:"running-a-node",level:2},{value:"Clone the source code",id:"clone-the-source-code",level:3},{value:"Dependencies",id:"dependencies",level:3},{value:"Build",id:"build",level:3},{value:"Node Launch",id:"node-launch",level:3},{value:"Health check",id:"health-check",level:3},{value:"Next steps",id:"next-steps",level:2},{value:"Conclusion",id:"conclusion",level:2}];function u(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Getting started guide",src:t(7860).Z+"",width:"1450",height:"816"})}),"\n","\n","\n",(0,i.jsx)(n.h2,{id:"introduction",children:"Introduction"}),"\n",(0,i.jsx)(n.p,{children:"For this guide, we\u2019ll have a simple look into how Fleek Network works in its current development phase and briefly share some of the core concepts like spinning up a node."}),"\n",(0,i.jsx)(n.p,{children:"For those seeking advanced knowledge:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Read our ",(0,i.jsx)(n.a,{href:"/docs/whitepaper",children:"whitepaper"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:["Check out ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"our open-source code"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["If you find any typos in our documentation, feel free to ",(0,i.jsx)(n.a,{href:"https://discord.gg/fleekxyz",children:"provide us feedback"})," or contribute by opening a PR in our repository ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/fleek-network-docs/",children:"here"}),"."]})}),"\n",(0,i.jsx)(n.h2,{id:"pre-requisites",children:"Pre-requisites"}),"\n",(0,i.jsx)(n.p,{children:"To follow the guide, you will need the following:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Familiarity with the command-line interface"}),"\n",(0,i.jsx)(n.li,{children:"Git"}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"need-a-quick-fleek-network-tldr",children:"Need a quick Fleek Network TL;DR?"}),"\n",(0,i.jsx)(n.p,{children:"Fleek Network is an open-source edge computing platform to accelerate the development and execution of the next generation of web services."}),"\n",(0,i.jsx)(n.p,{children:"The system is built on a distributed network of nodes, where services run within a fair and incentivized ecosystem constituted by an open community of developers and operators. It relies on blockchain technology at its core, allowing governance and token rewards as incentives for participation in serving the network."}),"\n",(0,i.jsx)(n.p,{children:"Made by an open community that's free to operate nodes or build services without the need for approvals, permissions, or intermediaries. Or simply, consume Fleek Network resources on demand, from anywhere, provided by services running on the edge."}),"\n",(0,i.jsx)(n.p,{children:"Applications, platforms and protocols build and utilize decentralized services on the Fleek Network to optimize performance and reduce dependency on typical centralized cloud providers and corporate infrastructure."}),"\n",(0,i.jsx)(n.p,{children:"Developers can build faster and launch better products by offloading parts of the development stack to the edge to focus on core features for the value proposition of the services being developed."}),"\n",(0,i.jsxs)(n.p,{children:["To get started, install a Network Node in a ",(0,i.jsx)(n.a,{href:"/docs/node/requirements",children:"supported"})," Linux server, such as Debian or Ubuntu (latest) by utilizing our simple ",(0,i.jsx)(n.a,{href:"/docs/node/install#assisted-installer",children:"assisted installer"})," to help onboard as quickly as possible."]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsx)(n.p,{children:"Our network is open to everyone, so you're more than welcome to join us anytime without any restrictions, permission or formalities. We'd be happy to have you as part of our community!"})}),"\n",(0,i.jsx)(n.p,{children:"Once connected to the server, open a terminal window and execute the following command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"curl https://get.fleek.network | bash\n"})}),"\n",(0,i.jsx)(n.p,{children:"Follow the install assistant recommendations to have the node ready without hassle and as quickly as possible."}),"\n",(0,i.jsx)(n.h2,{id:"why-is-fleek-network-needed",children:"Why is Fleek Network needed?"}),"\n",(0,i.jsx)(n.p,{children:"Web3 products typically rely on centralized cloud infrastructure, which is vulnerable to attacks as computation and data can be easily manipulated to suit business goals. However, blockchain technology has paved the way for a new era of decentralized cloud computing and data storage. The Fleek Network offers a sustainable alternative to traditional centralized architectures, providing a secure, transparent, and accessible decentralized edge computing future for everyone."}),"\n",(0,i.jsx)(n.h2,{id:"how-does-fleek-network-work",children:"How Does Fleek Network Work?"}),"\n",(0,i.jsx)(n.p,{children:"When a client requests a service, the protocol determines the best route to the nodes where the service replicas and workload are allocated."}),"\n",(0,i.jsx)(n.p,{children:"Once the computation is successful, the data streaming routes to the client. On-client request fulfillment, a proof of delivery is generated containing cryptographically secured metadata about the original request, any parts involved and the resources consumed."}),"\n",(0,i.jsx)(n.p,{children:"The Delivery Acknowledgements are stored locally in the participating node memory pools, rolled up to the protocol consensus consistently throughout the Epoch. This agreement is formed by a random committee of any healthy Nodes that use the information provided to reward the Nodes fairly."}),"\n",(0,i.jsx)(n.h2,{id:"running-a-node",children:"Running a Node"}),"\n",(0,i.jsxs)(n.p,{children:["A Fleek Network node can be built and run on your machine. It\u2019s an ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"open-source project"})," and is open for contributions."]}),"\n",(0,i.jsx)(n.p,{children:"The project is written with Rust, a general-purpose programming language that you need to have installed in advance to be able to follow the current guide."}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["To set up Rust, packages and library dependencies can be tricky. The quickest is to visit the ",(0,i.jsx)(n.a,{href:"https://rustup.rs/",children:"rustup.rs"}),". Alternatively, if you haven't already, the build section has a ",(0,i.jsx)(n.a,{href:"/docs/node/install#manual-installation",children:"manual installation"})," document to help."]})}),"\n",(0,i.jsx)(n.h3,{id:"clone-the-source-code",children:"Clone the source code"}),"\n",(0,i.jsx)(n.p,{children:"We\u2019ll clone the repository locally, build it and interact with the node through the binary or the HTTP JSON-RPC API with a client like cURL, but you can use a GUI (Postman, Insomnia, amongst others) if you prefer."}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsx)(n.p,{children:"The ~/fleek-network/lightning or $HOME/fleek-network/lightning directory is the default or recommended location to store the repository. If you like to follow conventions, then is best to stick with the recommendation, to avoid confusion and make it easier to follow our documentation."})}),"\n",(0,i.jsxs)(n.p,{children:["Start by cloning the repository located at ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"https://github.com/fleek-network/lightning"})]}),"\n",(0,i.jsx)(r.ZP,{}),"\n",(0,i.jsx)(n.p,{children:"Once the git clone completes, you\u2019ll have the latest version at the time of cloning. You should use git to fetch or pull the latest versions consequently."}),"\n",(0,i.jsx)(n.h3,{id:"dependencies",children:"Dependencies"}),"\n",(0,i.jsx)(n.p,{children:"Install the required dependencies necessary for compiling general software and for our use-case Lightning CLI."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo apt-get install \\\n build-essential \\\n clang \\\n pkg-config \\\n libssl-dev \\\n gcc-multilib \\\n protobuf-compiler\n"})}),"\n",(0,i.jsx)(n.h3,{id:"build",children:"Build"}),"\n",(0,i.jsxs)(n.p,{children:["Start by changing the directory to the project directory where the source code is stored. If you have followed the recommended location that'll be ",(0,i.jsx)(n.code,{children:"~/fleek-network/lightning"}),", as follows:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"cd ~/fleek-network/lightning\n"})}),"\n",(0,i.jsx)(n.p,{children:"Run the Rust package manager clean and update commands."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"cargo clean\ncargo update\n"})}),"\n",(0,i.jsx)(n.p,{children:"Next, execute the build command to compile the Fleek Network Lightning CLI binary."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"cargo +stable build --release\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsx)(n.p,{children:"The build command uses the Rust compiler, which might take a while depending on how speedy the host machine is capable."})}),"\n",(0,i.jsxs)(n.p,{children:["Once the Rust compiler completes, the generated binary will be available in the source code project directory. If you stick with the default, that'll look like ",(0,i.jsx)(n.code,{children:"~/fleek-network/lightning/target/debug/lightning-node"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["To avoid having to specify the pathname every time, create a symbolic link to keep it short. Here we'll name the process as the global ",(0,i.jsx)(n.code,{children:"lgtn"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'sudo ln -s "~/fleek-network/lightning/target/debug/lightning-node" /usr/local/bin/lgtn\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Run the CLI with the flag ",(0,i.jsx)(n.code,{children:"version"})," to confirm it's available globally."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"lgtn --version\n"})}),"\n",(0,i.jsx)(n.p,{children:"The output should look like:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"Usage: lgtn [OPTIONS] \n\nCommands:\n run Start the node\n keys Handle keys\n print-config Print the loaded configuration\n dev-init-only Initialize the node without starting it\n dev-dump-graph Dump the infusion graph of the node instance\n help Print this message or the help of the given subcommand(s)\n\nOptions:\n -c, --config Path to the toml configuration file [default: ~/.lightning/config.toml]\n --with-mock-consensus Determines that we should be using the mock consensus backend\n -v... Increases the level of verbosity (the max level is -vvv)\n --log-location Print code location on console logs\n -h, --help Print help\n -V, --version Print version\n"})}),"\n",(0,i.jsx)(n.h3,{id:"node-launch",children:"Node Launch"}),"\n",(0,i.jsxs)(n.p,{children:["After ",(0,i.jsx)(n.a,{href:"#build",children:"building"}),", the node can be launched by running the subcommand ",(0,i.jsx)(n.code,{children:"run"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"lgtn run\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsx)(n.p,{children:"It's highly recommend to use systemd to manage the Fleek Network service for node operators. Systemd is a system and service manager for Linux operating systems that provides a consistent way to manage system services across various distributions."})}),"\n",(0,i.jsxs)(n.p,{children:["Learn how to create a new Systemd service in the ",(0,i.jsx)(n.a,{href:"/docs/node/install#manual-installation",children:"manual installation"})," document."]}),"\n",(0,i.jsx)(n.h3,{id:"health-check",children:"Health check"}),"\n",(0,i.jsx)(n.p,{children:"It's important for Node operators to regularly check on the health of their resources to make sure everything is running smoothly. By doing this, they can get helpful feedback and know for sure if their Node is up and running. Some experienced node operators even automate this process using cronjobs and get reports sent to them via email or other custom methods."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'curl -w "\\n" localhost:4230/health\n'})}),"\n",(0,i.jsx)(n.p,{children:"If everything goes well, the response should be:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"OK\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alternatively, use the JSON-RPC method ",(0,i.jsx)(n.code,{children:"flk_ping"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'curl -s \\\n -X POST \\\n -H "Content-Type: application/json" \\\n -d \'{\n "jsonrpc": "2.0",\n "method": "flk_ping",\n "params": [],\n "id": 1\n }\' \\\n localhost:4230/rpc/v0\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Which response should return the key ",(0,i.jsx)(n.code,{children:"result"})," with value ",(0,i.jsx)(n.code,{children:"pong"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'{\n "jsonrpc": "2.0",\n "result": "pong",\n "id": 1\n}\n'})}),"\n",(0,i.jsx)(n.h2,{id:"next-steps",children:"Next steps"}),"\n",(0,i.jsx)(n.p,{children:"While you can run the Network Node as described here, it's required to set up the Network Node correctly and securely! It requires some degree of patience, knowledge and time to go through our guides, but we'll provide some guides and references to help you manage your network node server!"}),"\n",(0,i.jsxs)(n.p,{children:["To avoid having to go through all the steps manually, we recommend reading our ",(0,i.jsx)(n.a,{href:"/docs/node/install#assisted-installer",children:"assisted installer"})," document for quick onboarding."]}),"\n",(0,i.jsx)(n.h2,{id:"conclusion",children:"Conclusion"}),"\n",(0,i.jsx)(n.p,{children:"We introduced Fleek Network as an open-source edge computing platform to help us accelerate the development and execution of the next generation of web services."}),"\n",(0,i.jsx)(n.p,{children:"We have learned a bit about the importance of a decentralized edge computing network to reach and fulfill the future of computation and how the Fleek Network protocol works succinctly."}),"\n",(0,i.jsx)(n.p,{children:"Furthermore, we guide you through a step-by-step installation of the network node process, where we pull the source code, build the binary and launch the service."}),"\n",(0,i.jsx)(n.p,{children:"Finally, we do a quick health check to confirm the status of our node."}),"\n",(0,i.jsxs)(n.p,{children:["Discover more about the project by ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"watching/contributing on GitHub"}),", following us on ",(0,i.jsx)(n.a,{href:"https://twitter.com/fleek_net",children:"Twitter"}),", and joining ",(0,i.jsx)(n.a,{href:"https://discord.gg/fleekxyz",children:"our community Discord"})," for any updates."]}),"\n",(0,i.jsx)(s.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function p(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(u,{...e})}):u(e)}},3183:(e,n,t)=>{t.d(n,{ZP:()=>r});var i=t(5893),o=t(1151);function s(e){const n={a:"a",admonition:"admonition",code:"code",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.a)(),...e.components};return(0,i.jsxs)(n.admonition,{type:"tip",children:[(0,i.jsx)(n.p,{children:"You have several ways of doing this:"}),(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Clone via HTTPS"}),"\n",(0,i.jsx)(n.li,{children:"Clone via SSH"}),"\n",(0,i.jsx)(n.li,{children:"Download via Github CLI"}),"\n",(0,i.jsxs)(n.li,{children:["Download the ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning/archive/refs/heads/main.zip",children:"zip package"})," from the repository"]}),"\n"]}),(0,i.jsxs)(n.p,{children:["We recommend HTTPS because it is the easiest to set up in the wild, and by users who are new to all this.\nAlthough, we strongly recommend using an SSH connection when interacting with GitHub. If you are to this and are interested read more about it ",(0,i.jsx)(n.a,{href:"https://docs.github.com/en/authentication/connecting-to-github-with-ssh",children:"here"}),"."]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git clone -b testnet-alpha-1 https://github.com/fleek-network/lightning.git \n"})}),(0,i.jsxs)(n.p,{children:["At time of writing, we are checking the branch name ",(0,i.jsx)(n.code,{children:"testnet-alpha-1"})," that corresponds to the testnet phase.\nHere's an example of what it'd look like when sticking to the recommended path location:"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git clone -b testnet-alpha-1 https://github.com/fleek-network/lightning.git ~/fleek-network/lightning\n"})})]})}function r(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(s,{...e})}):s(e)}},3872:(e,n,t)=>{t.d(n,{Z:()=>o});t(7294);var i=t(5893);const o=e=>{let{image:n,name:t,title:o,url:s,communityMember:r=!1}=e;return(0,i.jsx)("section",{className:"author_card",children:(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"avatar",children:(0,i.jsx)("a",{href:s,target:"_blank",alt:t,children:(0,i.jsx)("img",{src:n,alt:t})})}),(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"name",children:(0,i.jsx)("a",{href:s,target:"_blank",alt:t,children:t})}),(0,i.jsx)("span",{className:"title",children:o}),(0,i.jsxs)("span",{className:"discord",children:[r?"Join our community on":"Got questions? Find us on"," ",(0,i.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},3483:(e,n,t)=>{t.d(n,{Z:()=>i});const i=t.p+"assets/images/getting-started-e00548e77105d1efbb6c436314fca278.png"},7860:(e,n,t)=>{t.d(n,{Z:()=>i});const i=t.p+"assets/images/getting-started-e00548e77105d1efbb6c436314fca278.png"},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>r});var i=t(7294);const o={},s=i.createContext(o);function r(e){const n=i.useContext(s);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(o):e.components||o:r(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[2702],{5894:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>p,frontMatter:()=>a,metadata:()=>d,toc:()=>h});var i=t(5893),o=t(1151),s=t(3872),r=t(3183);const a={template:"post",draft:!1,hide_title:!0,title:"Getting Started",slug:"getting-started",date:new Date("2023-08-31T23:00:00.000Z"),image:"./assets/getting-started.png?202311181211",canonical:"",description:"A first look at what Fleek Network is, why it's important, and a simple tutorial of running and interacting with a node on your local machine!",category:"Tutorial",tags:["Edge computing","Guide","Getting Started"]},l=void 0,d={id:"Node Operators/getting-started-guide",title:"Getting Started",description:"A first look at what Fleek Network is, why it's important, and a simple tutorial of running and interacting with a node on your local machine!",source:"@site/guides/Node Operators/getting-started-guide.md",sourceDirName:"Node Operators",slug:"/Node Operators/getting-started",permalink:"/guides/Node Operators/getting-started",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/guides/Node Operators/getting-started-guide.md",tags:[{label:"Edge computing",permalink:"/guides/tags/edge-computing"},{label:"Guide",permalink:"/guides/tags/guide"},{label:"Getting Started",permalink:"/guides/tags/getting-started"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{template:"post",draft:!1,hide_title:!0,title:"Getting Started",slug:"getting-started",date:"2023-08-31T23:00:00.000Z",image:"./assets/getting-started.png?202311181211",canonical:"",description:"A first look at what Fleek Network is, why it's important, and a simple tutorial of running and interacting with a node on your local machine!",category:"Tutorial",tags:["Edge computing","Guide","Getting Started"]},sidebar:"defaultSidebar",previous:{title:"About guides",permalink:"/guides/"},next:{title:"How to manage log files",permalink:"/guides/Node Operators/how-to-manage-log-files"}},c={image:t(3483).Z},h=[{value:"Introduction",id:"introduction",level:2},{value:"Pre-requisites",id:"pre-requisites",level:2},{value:"Need a quick Fleek Network TL;DR?",id:"need-a-quick-fleek-network-tldr",level:2},{value:"Why is Fleek Network needed?",id:"why-is-fleek-network-needed",level:2},{value:"How Does Fleek Network Work?",id:"how-does-fleek-network-work",level:2},{value:"Running a Node",id:"running-a-node",level:2},{value:"Clone the source code",id:"clone-the-source-code",level:3},{value:"Dependencies",id:"dependencies",level:3},{value:"Build",id:"build",level:3},{value:"Node Launch",id:"node-launch",level:3},{value:"Health check",id:"health-check",level:3},{value:"Next steps",id:"next-steps",level:2},{value:"Conclusion",id:"conclusion",level:2}];function u(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Getting started guide",src:t(7860).Z+"",width:"1450",height:"816"})}),"\n","\n","\n",(0,i.jsx)(n.h2,{id:"introduction",children:"Introduction"}),"\n",(0,i.jsx)(n.p,{children:"For this guide, we\u2019ll have a simple look into how Fleek Network works in its current development phase and briefly share some of the core concepts like spinning up a node."}),"\n",(0,i.jsx)(n.p,{children:"For those seeking advanced knowledge:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Read our ",(0,i.jsx)(n.a,{href:"/docs/whitepaper",children:"whitepaper"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:["Check out ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"our open-source code"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["If you find any typos in our documentation, feel free to ",(0,i.jsx)(n.a,{href:"https://discord.gg/fleekxyz",children:"provide us feedback"})," or contribute by opening a PR in our repository ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/fleek-network-docs/",children:"here"}),"."]})}),"\n",(0,i.jsx)(n.h2,{id:"pre-requisites",children:"Pre-requisites"}),"\n",(0,i.jsx)(n.p,{children:"To follow the guide, you will need the following:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Familiarity with the command-line interface"}),"\n",(0,i.jsx)(n.li,{children:"Git"}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"need-a-quick-fleek-network-tldr",children:"Need a quick Fleek Network TL;DR?"}),"\n",(0,i.jsx)(n.p,{children:"Fleek Network is an open-source edge computing platform to accelerate the development and execution of the next generation of web services."}),"\n",(0,i.jsx)(n.p,{children:"The system is built on a distributed network of nodes, where services run within a fair and incentivized ecosystem constituted by an open community of developers and operators. It relies on blockchain technology at its core, allowing governance and token rewards as incentives for participation in serving the network."}),"\n",(0,i.jsx)(n.p,{children:"Made by an open community that's free to operate nodes or build services without the need for approvals, permissions, or intermediaries. Or simply, consume Fleek Network resources on demand, from anywhere, provided by services running on the edge."}),"\n",(0,i.jsx)(n.p,{children:"Applications, platforms and protocols build and utilize decentralized services on the Fleek Network to optimize performance and reduce dependency on typical centralized cloud providers and corporate infrastructure."}),"\n",(0,i.jsx)(n.p,{children:"Developers can build faster and launch better products by offloading parts of the development stack to the edge to focus on core features for the value proposition of the services being developed."}),"\n",(0,i.jsxs)(n.p,{children:["To get started, install a Network Node in a ",(0,i.jsx)(n.a,{href:"/docs/node/requirements",children:"supported"})," Linux server, such as Debian or Ubuntu (latest) by utilizing our simple ",(0,i.jsx)(n.a,{href:"/docs/node/install#assisted-installer",children:"assisted installer"})," to help onboard as quickly as possible."]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsx)(n.p,{children:"Our network is open to everyone, so you're more than welcome to join us anytime without any restrictions, permission or formalities. We'd be happy to have you as part of our community!"})}),"\n",(0,i.jsx)(n.p,{children:"Once connected to the server, open a terminal window and execute the following command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"curl https://get.fleek.network | bash\n"})}),"\n",(0,i.jsx)(n.p,{children:"Follow the install assistant recommendations to have the node ready without hassle and as quickly as possible."}),"\n",(0,i.jsx)(n.h2,{id:"why-is-fleek-network-needed",children:"Why is Fleek Network needed?"}),"\n",(0,i.jsx)(n.p,{children:"Web3 products typically rely on centralized cloud infrastructure, which is vulnerable to attacks as computation and data can be easily manipulated to suit business goals. However, blockchain technology has paved the way for a new era of decentralized cloud computing and data storage. The Fleek Network offers a sustainable alternative to traditional centralized architectures, providing a secure, transparent, and accessible decentralized edge computing future for everyone."}),"\n",(0,i.jsx)(n.h2,{id:"how-does-fleek-network-work",children:"How Does Fleek Network Work?"}),"\n",(0,i.jsx)(n.p,{children:"When a client requests a service, the protocol determines the best route to the nodes where the service replicas and workload are allocated."}),"\n",(0,i.jsx)(n.p,{children:"Once the computation is successful, the data streaming routes to the client. On-client request fulfillment, a proof of delivery is generated containing cryptographically secured metadata about the original request, any parts involved and the resources consumed."}),"\n",(0,i.jsx)(n.p,{children:"The Delivery Acknowledgements are stored locally in the participating node memory pools, rolled up to the protocol consensus consistently throughout the Epoch. This agreement is formed by a random committee of any healthy Nodes that use the information provided to reward the Nodes fairly."}),"\n",(0,i.jsx)(n.h2,{id:"running-a-node",children:"Running a Node"}),"\n",(0,i.jsxs)(n.p,{children:["A Fleek Network node can be built and run on your machine. It\u2019s an ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"open-source project"})," and is open for contributions."]}),"\n",(0,i.jsx)(n.p,{children:"The project is written with Rust, a general-purpose programming language that you need to have installed in advance to be able to follow the current guide."}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["To set up Rust, packages and library dependencies can be tricky. The quickest is to visit the ",(0,i.jsx)(n.a,{href:"https://rustup.rs/",children:"rustup.rs"}),". Alternatively, if you haven't already, the build section has a ",(0,i.jsx)(n.a,{href:"/docs/node/install#manual-installation",children:"manual installation"})," document to help."]})}),"\n",(0,i.jsx)(n.h3,{id:"clone-the-source-code",children:"Clone the source code"}),"\n",(0,i.jsx)(n.p,{children:"We\u2019ll clone the repository locally, build it and interact with the node through the binary or the HTTP JSON-RPC API with a client like cURL, but you can use a GUI (Postman, Insomnia, amongst others) if you prefer."}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsx)(n.p,{children:"The ~/fleek-network/lightning or $HOME/fleek-network/lightning directory is the default or recommended location to store the repository. If you like to follow conventions, then is best to stick with the recommendation, to avoid confusion and make it easier to follow our documentation."})}),"\n",(0,i.jsxs)(n.p,{children:["Start by cloning the repository located at ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"https://github.com/fleek-network/lightning"})]}),"\n",(0,i.jsx)(r.ZP,{}),"\n",(0,i.jsx)(n.p,{children:"Once the git clone completes, you\u2019ll have the latest version at the time of cloning. You should use git to fetch or pull the latest versions consequently."}),"\n",(0,i.jsx)(n.h3,{id:"dependencies",children:"Dependencies"}),"\n",(0,i.jsx)(n.p,{children:"Install the required dependencies necessary for compiling general software and for our use-case Lightning CLI."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo apt-get install \\\n build-essential \\\n clang \\\n pkg-config \\\n libssl-dev \\\n gcc-multilib \\\n protobuf-compiler\n"})}),"\n",(0,i.jsx)(n.h3,{id:"build",children:"Build"}),"\n",(0,i.jsxs)(n.p,{children:["Start by changing the directory to the project directory where the source code is stored. If you have followed the recommended location that'll be ",(0,i.jsx)(n.code,{children:"~/fleek-network/lightning"}),", as follows:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"cd ~/fleek-network/lightning\n"})}),"\n",(0,i.jsx)(n.p,{children:"Run the Rust package manager clean and update commands."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"cargo clean\ncargo update\n"})}),"\n",(0,i.jsx)(n.p,{children:"Next, execute the build command to compile the Fleek Network Lightning CLI binary."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"cargo +stable build --release\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsx)(n.p,{children:"The build command uses the Rust compiler, which might take a while depending on how speedy the host machine is capable."})}),"\n",(0,i.jsxs)(n.p,{children:["Once the Rust compiler completes, the generated binary will be available in the source code project directory. If you stick with the default, that'll look like ",(0,i.jsx)(n.code,{children:"~/fleek-network/lightning/target/debug/lightning-node"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["To avoid having to specify the pathname every time, create a symbolic link to keep it short. Here we'll name the process as the global ",(0,i.jsx)(n.code,{children:"lgtn"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'sudo ln -s "~/fleek-network/lightning/target/debug/lightning-node" /usr/local/bin/lgtn\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Run the CLI with the flag ",(0,i.jsx)(n.code,{children:"version"})," to confirm it's available globally."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"lgtn --version\n"})}),"\n",(0,i.jsx)(n.p,{children:"The output should look like:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"Usage: lgtn [OPTIONS] \n\nCommands:\n run Start the node\n keys Handle keys\n print-config Print the loaded configuration\n dev-init-only Initialize the node without starting it\n dev-dump-graph Dump the infusion graph of the node instance\n help Print this message or the help of the given subcommand(s)\n\nOptions:\n -c, --config Path to the toml configuration file [default: ~/.lightning/config.toml]\n --with-mock-consensus Determines that we should be using the mock consensus backend\n -v... Increases the level of verbosity (the max level is -vvv)\n --log-location Print code location on console logs\n -h, --help Print help\n -V, --version Print version\n"})}),"\n",(0,i.jsx)(n.h3,{id:"node-launch",children:"Node Launch"}),"\n",(0,i.jsxs)(n.p,{children:["After ",(0,i.jsx)(n.a,{href:"#build",children:"building"}),", the node can be launched by running the subcommand ",(0,i.jsx)(n.code,{children:"run"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"lgtn run\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsx)(n.p,{children:"It's highly recommend to use systemd to manage the Fleek Network service for node operators. Systemd is a system and service manager for Linux operating systems that provides a consistent way to manage system services across various distributions."})}),"\n",(0,i.jsxs)(n.p,{children:["Learn how to create a new Systemd service in the ",(0,i.jsx)(n.a,{href:"/docs/node/install#manual-installation",children:"manual installation"})," document."]}),"\n",(0,i.jsx)(n.h3,{id:"health-check",children:"Health check"}),"\n",(0,i.jsx)(n.p,{children:"It's important for Node operators to regularly check on the health of their resources to make sure everything is running smoothly. By doing this, they can get helpful feedback and know for sure if their Node is up and running. Some experienced node operators even automate this process using cronjobs and get reports sent to them via email or other custom methods."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'curl -w "\\n" localhost:4230/health\n'})}),"\n",(0,i.jsx)(n.p,{children:"If everything goes well, the response should be:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"OK\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alternatively, use the JSON-RPC method ",(0,i.jsx)(n.code,{children:"flk_ping"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'curl -s \\\n -X POST \\\n -H "Content-Type: application/json" \\\n -d \'{\n "jsonrpc": "2.0",\n "method": "flk_ping",\n "params": [],\n "id": 1\n }\' \\\n localhost:4230/rpc/v0\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Which response should return the key ",(0,i.jsx)(n.code,{children:"result"})," with value ",(0,i.jsx)(n.code,{children:"pong"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'{\n "jsonrpc": "2.0",\n "result": "pong",\n "id": 1\n}\n'})}),"\n",(0,i.jsx)(n.h2,{id:"next-steps",children:"Next steps"}),"\n",(0,i.jsx)(n.p,{children:"While you can run the Network Node as described here, it's required to set up the Network Node correctly and securely! It requires some degree of patience, knowledge and time to go through our guides, but we'll provide some guides and references to help you manage your network node server!"}),"\n",(0,i.jsxs)(n.p,{children:["To avoid having to go through all the steps manually, we recommend reading our ",(0,i.jsx)(n.a,{href:"/docs/node/install#assisted-installer",children:"assisted installer"})," document for quick onboarding."]}),"\n",(0,i.jsx)(n.h2,{id:"conclusion",children:"Conclusion"}),"\n",(0,i.jsx)(n.p,{children:"We introduced Fleek Network as an open-source edge computing platform to help us accelerate the development and execution of the next generation of web services."}),"\n",(0,i.jsx)(n.p,{children:"We have learned a bit about the importance of a decentralized edge computing network to reach and fulfill the future of computation and how the Fleek Network protocol works succinctly."}),"\n",(0,i.jsx)(n.p,{children:"Furthermore, we guide you through a step-by-step installation of the network node process, where we pull the source code, build the binary and launch the service."}),"\n",(0,i.jsx)(n.p,{children:"Finally, we do a quick health check to confirm the status of our node."}),"\n",(0,i.jsxs)(n.p,{children:["Discover more about the project by ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"watching/contributing on GitHub"}),", following us on ",(0,i.jsx)(n.a,{href:"https://twitter.com/fleek_net",children:"Twitter"}),", and joining ",(0,i.jsx)(n.a,{href:"https://discord.gg/fleekxyz",children:"our community Discord"})," for any updates."]}),"\n",(0,i.jsx)(s.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function p(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(u,{...e})}):u(e)}},3183:(e,n,t)=>{t.d(n,{ZP:()=>r});var i=t(5893),o=t(1151);function s(e){const n={a:"a",admonition:"admonition",code:"code",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.a)(),...e.components};return(0,i.jsxs)(n.admonition,{type:"tip",children:[(0,i.jsx)(n.p,{children:"You have several ways of doing this:"}),(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Clone via HTTPS"}),"\n",(0,i.jsx)(n.li,{children:"Clone via SSH"}),"\n",(0,i.jsx)(n.li,{children:"Download via Github CLI"}),"\n",(0,i.jsxs)(n.li,{children:["Download the ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning/archive/refs/heads/main.zip",children:"zip package"})," from the repository"]}),"\n"]}),(0,i.jsxs)(n.p,{children:["We recommend HTTPS because it is the easiest to set up in the wild, and by users who are new to all this.\nAlthough, we strongly recommend using an SSH connection when interacting with GitHub. If you are to this and are interested read more about it ",(0,i.jsx)(n.a,{href:"https://docs.github.com/en/authentication/connecting-to-github-with-ssh",children:"here"}),"."]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git clone -b testnet-alpha-1 https://github.com/fleek-network/lightning.git \n"})}),(0,i.jsxs)(n.p,{children:["At time of writing, we are checking the branch name ",(0,i.jsx)(n.code,{children:"testnet-alpha-1"})," that corresponds to the testnet phase.\nHere's an example of what it'd look like when sticking to the recommended path location:"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git clone -b testnet-alpha-1 https://github.com/fleek-network/lightning.git ~/fleek-network/lightning\n"})})]})}function r(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(s,{...e})}):s(e)}},3872:(e,n,t)=>{t.d(n,{Z:()=>o});t(7294);var i=t(5893);const o=e=>{let{image:n,name:t,title:o,url:s,communityMember:r=!1}=e;return(0,i.jsx)("section",{className:"author_card",children:(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"avatar",children:(0,i.jsx)("a",{href:s,target:"_blank",alt:t,children:(0,i.jsx)("img",{src:n,alt:t})})}),(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"name",children:(0,i.jsx)("a",{href:s,target:"_blank",alt:t,children:t})}),(0,i.jsx)("span",{className:"title",children:o}),(0,i.jsxs)("span",{className:"discord",children:[r?"Join our community on":"Got questions? Find us on"," ",(0,i.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},3483:(e,n,t)=>{t.d(n,{Z:()=>i});const i=t.p+"assets/images/getting-started-e00548e77105d1efbb6c436314fca278.png"},7860:(e,n,t)=>{t.d(n,{Z:()=>i});const i=t.p+"assets/images/getting-started-e00548e77105d1efbb6c436314fca278.png"},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>r});var i=t(7294);const o={},s=i.createContext(o);function r(e){const n=i.useContext(s);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(o):e.components||o:r(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/1d8a5d15.1a69f419.js b/assets/js/1d8a5d15.dc719163.js similarity index 99% rename from assets/js/1d8a5d15.1a69f419.js rename to assets/js/1d8a5d15.dc719163.js index 69d3fbeac..7a14fd35b 100644 --- a/assets/js/1d8a5d15.1a69f419.js +++ b/assets/js/1d8a5d15.dc719163.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[9854],{884:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>h,default:()=>p,frontMatter:()=>a,metadata:()=>d,toc:()=>g});var s=t(5893),i=t(1151),r=t(3872),o=t(8432),l=t(1586);const a={template:"post",draft:!1,hide_title:!0,title:"Transfering setup ownership",slug:"transfering-setup-ownership",image:"./assets/transfering-setup-ownership.png?202311181223",date:new Date("2023-09-12T23:00:00.000Z"),description:"A step-by-step guide to transfer the ownership of the Fleek Network Lightning CLI and service setup",category:"Tutorial",tags:["transfer","ownership","guide","setup","configuration"]},h=void 0,d={id:"Node Operators/transfering-setup-ownership",title:"Transfering setup ownership",description:"A step-by-step guide to transfer the ownership of the Fleek Network Lightning CLI and service setup",source:"@site/guides/Node Operators/transfering-setup-ownership.md",sourceDirName:"Node Operators",slug:"/Node Operators/transfering-setup-ownership",permalink:"/guides/Node Operators/transfering-setup-ownership",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/guides/Node Operators/transfering-setup-ownership.md",tags:[{label:"transfer",permalink:"/guides/tags/transfer"},{label:"ownership",permalink:"/guides/tags/ownership"},{label:"guide",permalink:"/guides/tags/guide"},{label:"setup",permalink:"/guides/tags/setup"},{label:"configuration",permalink:"/guides/tags/configuration"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{template:"post",draft:!1,hide_title:!0,title:"Transfering setup ownership",slug:"transfering-setup-ownership",image:"./assets/transfering-setup-ownership.png?202311181223",date:"2023-09-12T23:00:00.000Z",description:"A step-by-step guide to transfer the ownership of the Fleek Network Lightning CLI and service setup",category:"Tutorial",tags:["transfer","ownership","guide","setup","configuration"]},sidebar:"defaultSidebar",previous:{title:"Running a node in Docker",permalink:"/guides/Node Operators/running-a-node-in-docker"},next:{title:"Updating Lightning",permalink:"/guides/Node Operators/updating-lightning"}},c={image:t(9548).Z},g=[{value:"TL;DR",id:"tldr",level:2},{value:"Introduction",id:"introduction",level:2},{value:"Pre-requisites",id:"pre-requisites",level:2},{value:"Ownership of Lightning CLI files",id:"ownership-of-lightning-cli-files",level:2},{value:"Systemd Service",id:"systemd-service",level:2},{value:"Stop the service",id:"stop-the-service",level:2},{value:"Clear the .lightning data",id:"clear-the-lightning-data",level:2},{value:"Create a user",id:"create-a-user",level:2},{value:"Move lightning system and source code directory to user's home",id:"move-lightning-system-and-source-code-directory-to-users-home",level:2},{value:"1) Move the /root/.lightning directory from one user to the other",id:"1-move-the-rootlightning-directory-from-one-user-to-the-other",level:3},{value:"2) Move the /root/fleek-network directory from one user to the other",id:"2-move-the-rootfleek-network-directory-from-one-user-to-the-other",level:3},{value:"3) Confirm move by finding both directories",id:"3-confirm-move-by-finding-both-directories",level:3},{value:"Change ownership of files",id:"change-ownership-of-files",level:2},{value:"The lgtn symbolic link (symlink)",id:"the-lgtn-symbolic-link-symlink",level:2},{value:"Update the Systemd service unit",id:"update-the-systemd-service-unit",level:2},{value:"Update the config.toml with user-preferred file locations",id:"update-the-configtoml-with-user-preferred-file-locations",level:2},{value:"Start the service",id:"start-the-service",level:2},{value:"Conclusion",id:"conclusion",level:2}];function u(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Transfering setup ownership",src:t(2867).Z+"",width:"1450",height:"816"})}),"\n","\n","\n",(0,s.jsx)(n.h2,{id:"tldr",children:"TL;DR"}),"\n",(0,s.jsxs)(n.admonition,{type:"tip",children:[(0,s.jsxs)(n.p,{children:["The step-by-step instructions provided in the guide should be simple to follow, but the process is also available as an automated script from our familiar ",(0,s.jsx)(n.a,{href:"https://github.com/fleek-network/get.fleek.network",children:"get.fleek.network"})," tool."]}),(0,s.jsx)(n.p,{children:"To use the automated script execute the following command in your server terminal and follow the instructions:"}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"curl -sS https://get.fleek.network/transfer_system_user_setup_ownership | bash\n"})}),(0,s.jsxs)(n.p,{children:["We try to make the auomated scripts as useful as possible, but it's impossible to fit every single use-case. So, if you find any isses or have feedback to help us improve ",(0,s.jsx)(n.a,{href:"https://discord.gg/fleekxyz",children:"message us through our Discord"}),"."]})]}),"\n",(0,s.jsx)(n.h2,{id:"introduction",children:"Introduction"}),"\n",(0,s.jsx)(n.p,{children:"Our Lightning CLI and Node process is run by a user, that has some sort of permissions\u2013some users run it as a super user (root) which is questionable as root privileges are not a necessary good. We'll look into how to create a user to manage and control the Fleek Network Lightning CLI and Systemd unit service. Also, presents the concept of file permissions and ownership which is crucial in preventing private or sensitive data from being exposed to dodgy actors."}),"\n",(0,s.jsx)(n.p,{children:"Let's discuss the topic and open up a few ideas to help us improve the security of our server."}),"\n",(0,s.jsx)(n.h2,{id:"pre-requisites",children:"Pre-requisites"}),"\n",(0,s.jsx)(n.p,{children:"To follow the guide, you will need the following:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Familiarity with the command-line interface"}),"\n",(0,s.jsx)(n.li,{children:"Have installed and set up the Lightning CLI and service"}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"ownership-of-lightning-cli-files",children:"Ownership of Lightning CLI files"}),"\n",(0,s.jsx)(n.p,{children:"The user who installs the Lightning CLI and sets the Service takes an important role that determines the location of the configuration files, the setup, and how the Systemd service is managed or controlled."}),"\n",(0,s.jsxs)(n.p,{children:["Our ",(0,s.jsx)(n.a,{href:"/docs/node/install",children:"install"})," document recommends creating a user and switching to the user to set up the service. You shouldn't want installed applications to run with elevated privileges. Applications are meant to be run with non-administrative privileges. If an application requires higher privileges, the administrator, such as a ",(0,s.jsx)(n.a,{href:"https://en.wikipedia.org/wiki/Sudo",children:"sudoer"})," should be able to elevate it. An application that has full access and control of a system can modify it in harmful ways, e.g. compromise the private keys."]}),"\n",(0,s.jsx)(n.p,{children:"For our guide, we'll illustrate the process of migration from a super user (root) to another user (sudo). The knowledge should be easily appliable for any other user-to-user migration. We stick with root user for simplicity and because that's the most common use case."}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["A reference document about ",(0,s.jsx)(n.a,{href:"/references/Lightning%20CLI/file-permissions-and-ownership",children:"File permissions and ownership"})," is available that explains how it works practically, by showcasing how the process can be started, how the node process locates the Keystore, etc."]})}),"\n",(0,s.jsx)(n.h2,{id:"systemd-service",children:"Systemd Service"}),"\n",(0,s.jsx)(n.p,{children:"In systemd, a unit refers to any resource that the system knows how to operate on and manage. This is the primary object that the systemd tools know how to deal with. These resources are defined using configuration files called unit files."}),"\n",(0,s.jsxs)(n.p,{children:["The recommended installation process features a ",(0,s.jsx)(n.a,{href:"https://www.freedesktop.org/software/systemd/man/systemd.service.html",children:"systemd.service"})," which is a resource that the system knows how to operate and manage by an administrator user."]}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsx)(n.p,{children:"When using a Systemd service to run a process, it operates comparably to running it directly. The key difference is that Systemd keeps track of all the processes and threads that are spawned. This means that when a service is stopped using systemctl, such as the Fleek Network Lightning Node service, all the child processes that were started by the service are also terminated. Additionally, by utilizing Systemd, a user can run the process in the background and configure it to start automatically on system startup."})}),"\n",(0,s.jsxs)(n.p,{children:["If you have followed the installation recommendations, find the systemd service unit in the location ",(0,s.jsx)(n.code,{children:"/etc/systemd/system/lightning.service"})," (we are using Ubuntu Linux as an example to keep it short)."]}),"\n",(0,s.jsxs)(n.p,{children:["Make sure that you have set up a ",(0,s.jsx)(n.a,{href:"/docs/node/install#systemd-service-setup",children:"Systemd unit service"}),", as recommended during the installation as this guide assumes you have one setup."]}),"\n",(0,s.jsx)(n.h2,{id:"stop-the-service",children:"Stop the service"}),"\n",(0,s.jsxs)(n.p,{children:["Before we proceed with any changes required for the migration, you'll have to stop the ",(0,s.jsx)(n.code,{children:"lightning.service"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"systemctl stop lightning\n"})}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsxs)(n.p,{children:["For this guide, we are assuming that you are migrating ownership from ",(0,s.jsx)(n.strong,{children:"root"})," to a ",(0,s.jsx)(n.strong,{children:"sudoer"})," user. If not, you might be required to elevate privileges as ",(0,s.jsx)(n.strong,{children:"sudo"}),"** where required. For example, ",(0,s.jsx)(n.code,{children:"sudo systemctl stop lightning"}),"."]})}),"\n",(0,s.jsx)(n.h2,{id:"clear-the-lightning-data",children:"Clear the .lightning data"}),"\n",(0,s.jsxs)(n.p,{children:["Run the following command to clear the ",(0,s.jsx)(n.code,{children:"/root/.lightning/data"}),", as it can be quite large, and we don't need to move it."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo rm -rf /root/.lightning/data\n"})}),"\n",(0,s.jsx)(n.h2,{id:"create-a-user",children:"Create a user"}),"\n",(0,s.jsx)(o.ZP,{}),"\n",(0,s.jsx)(n.h2,{id:"move-lightning-system-and-source-code-directory-to-users-home",children:"Move lightning system and source code directory to user's home"}),"\n",(0,s.jsx)(n.p,{children:"A user should've been created, added the user to the sudo group, switched to the user, and changed the directory to the user's home."}),"\n",(0,s.jsxs)(n.p,{children:["Run the command ",(0,s.jsx)(n.code,{children:"pwd"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"pwd\n"})}),"\n",(0,s.jsx)(n.p,{children:"The output would look like:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"/home/\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Given the username ",(0,s.jsx)(n.strong,{children:"lgtn"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"/home/lgtn\n"})}),"\n",(0,s.jsx)(n.p,{children:"You'll then move two directories:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["The ",(0,s.jsx)(n.code,{children:"/root/.lightning"})]}),"\n",(0,s.jsxs)(n.li,{children:["The source code under the parent ",(0,s.jsx)(n.code,{children:"/root/fleek-network"})]}),"\n"]}),"\n",(0,s.jsxs)(n.h3,{id:"1-move-the-rootlightning-directory-from-one-user-to-the-other",children:["1) Move the ",(0,s.jsx)(n.code,{children:"/root/.lightning"})," directory from one user to the other"]}),"\n",(0,s.jsxs)(n.p,{children:["For our demo, we have assumed ",(0,s.jsx)(n.strong,{children:"root"})," user to ",(0,s.jsx)(n.strong,{children:"sudoer"})," user named ",(0,s.jsx)(n.strong,{children:"lgtn"}),", thus that'll look like this:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo mv /root/.lightning /home/lgtn/\n"})}),"\n",(0,s.jsxs)(n.h3,{id:"2-move-the-rootfleek-network-directory-from-one-user-to-the-other",children:["2) Move the ",(0,s.jsx)(n.code,{children:"/root/fleek-network"})," directory from one user to the other"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo mv /root/fleek-network /home/lgtn/\n"})}),"\n",(0,s.jsx)(n.h3,{id:"3-confirm-move-by-finding-both-directories",children:"3) Confirm move by finding both directories"}),"\n",(0,s.jsxs)(n.p,{children:["In the user $HOME directory, you should be able to list the content of the directory and find the ",(0,s.jsx)(n.code,{children:".lightning"})," and ",(0,s.jsx)(n.code,{children:"fleek-network"})," directory."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"ls -la\n"})}),"\n",(0,s.jsx)(n.p,{children:"The output should be similar to the following."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"drwxr-x--- 6 lgtn lgtn 4096 Sep 12 13:51 .\ndrwxr-xr-x 3 root root 4096 Sep 11 12:28 ..\ndrwxrwxr-x 5 root root 4096 Sep 11 15:25 .lightning\ndrwxrwxr-x 3 root root 4096 Sep 11 12:28 fleek-network\n"})}),"\n",(0,s.jsx)(n.h2,{id:"change-ownership-of-files",children:"Change ownership of files"}),"\n",(0,s.jsxs)(n.p,{children:["Once the directories and files are moved, they should have the wrong ownership, which should be set to ",(0,s.jsxs)(n.strong,{children:["root",":root"]}),". We'll now have to change the ownership of the directories and files recursively."]}),"\n",(0,s.jsxs)(n.p,{children:["Change the ownership of ",(0,s.jsx)(n.code,{children:"/home/lgtn/.lightning"})," to the user ",(0,s.jsx)(n.strong,{children:"lgtn"})," as follows:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo chown -R lgtn:lgtn .lightning\n"})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["Make sure that you use the ",(0,s.jsx)(n.code,{children:"-R"})," flag to have the ownership changes applied to the parent, the child directories and all the files."]})}),"\n",(0,s.jsxs)(n.p,{children:["Change the ownership of ",(0,s.jsx)(n.code,{children:"/home/lgtn/fleek-network"})," to the user ",(0,s.jsx)(n.strong,{children:"lgtn"})," as follows:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo chown -R lgtn:lgtn fleek-network\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Once completed, if you list the content of the directory the ownership should have changed from ",(0,s.jsx)(n.code,{children:"root:root"})," to ",(0,s.jsx)(n.code,{children:"lgtn:lgtn"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"ls -la\n"})}),"\n",(0,s.jsx)(n.p,{children:"The output should be similar to the following."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"drwxr-x--- 6 lgtn lgtn 4096 Sep 12 13:51 .\ndrwxr-xr-x 3 root root 4096 Sep 11 12:28 ..\ndrwxrwxr-x 5 lgtn lgtn 4096 Sep 11 15:25 .lightning\ndrwxrwxr-x 3 lgtn lgtn 4096 Sep 11 12:28 fleek-network\n"})}),"\n",(0,s.jsxs)(n.admonition,{type:"tip",children:[(0,s.jsxs)(n.p,{children:["Remember that we are using ",(0,s.jsx)(n.strong,{children:"lgtn"})," for our demo. If you have opted for a different username, make sure you use the correct username. To find the username you are logged in with run the command:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"whoami\n"})}),(0,s.jsxs)(n.p,{children:["For our demo, we'll assume that you understand that ",(0,s.jsx)(n.strong,{children:"lgtn"})," is the user we opted in for our demo."]})]}),"\n",(0,s.jsx)(n.h2,{id:"the-lgtn-symbolic-link-symlink",children:"The lgtn symbolic link (symlink)"}),"\n",(0,s.jsxs)(n.p,{children:["We have the symbolic link that links the binary built from the source code, to the alias ",(0,s.jsx)(n.strong,{children:"lgtn"})," that's set under the ",(0,s.jsx)(n.code,{children:"/usr/local/bin/lgtn"})," pathname."]}),"\n",(0,s.jsx)(n.p,{children:"For example, you can find where that is linked to by running:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"ls -la $(which lgtn)\n"})}),"\n",(0,s.jsxs)(n.p,{children:["On the output below, we can see that the ",(0,s.jsx)(n.code,{children:"/usr/local/bin/lgtn"})," points to ",(0,s.jsx)(n.code,{children:"/root/fleek-network/lightning/target/release/lightning-node"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"lrwxrwxrwx 1 root root 64 Sep 11 15:48 /usr/local/bin/lgtn -> /root/fleek-network/lightning/target/release/lightning-node\n"})}),"\n",(0,s.jsxs)(n.p,{children:["The target base path is ",(0,s.jsx)(n.code,{children:"/root"}),", and we know that we've moved the source code directory to the user home ",(0,s.jsx)(n.code,{children:"/home/lgtn"}),". For this reason, we need to create a new symlink with the updated location of the binary file."]}),"\n",(0,s.jsx)(n.p,{children:"Unlink the symlink:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo unlink /usr/local/bin/lgtn\n"})}),"\n",(0,s.jsx)(n.p,{children:"Create the symlink:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:'sudo ln -s "/home/lgtn/fleek-network/lightning/target/release/lightning-node" /usr/local/bin/lgtn\n'})}),"\n",(0,s.jsx)(n.p,{children:"If successful, you should be able to execute the command:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"lgtn help\n"})}),"\n",(0,s.jsx)(n.p,{children:"The output should look similar to:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"Usage: lgtn [OPTIONS] \n\nCommands:\n run Start the node\n keys Handle keys\n print-config Print the loaded configuration\n help Print this message or the help of the given subcommand(s)\n\nOptions:\n -c, --config Path to the toml configuration file [default: ~/.lightning/config.toml]\n --with-mock-consensus Determines that we should be using the mock consensus backend\n -v... Increases the level of verbosity (the max level is -vvv)\n --log-location Print code location on console logs\n -h, --help Print help\n -V, --version Print version\n"})}),"\n",(0,s.jsx)(n.h2,{id:"update-the-systemd-service-unit",children:"Update the Systemd service unit"}),"\n",(0,s.jsx)(n.p,{children:"Open the file, its settings should be similar to the following:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"[Unit]\nDescription=Fleek Network Node lightning service\n\n[Service]\nType=simple\nMemoryHigh=32G\nRestartSec=15s\nRestart=always\nExecStart=lgtn -c /home//.lightning/config.toml run\nExecStop=killall -9 lgtn\nStandardOutput=append:/var/log/lightning/output.log\nStandardError=append:/var/log/lightning/diagnostic.log\nEnvironment=TMPDIR=/var/tmp\n\n[Install]\nWantedBy=multi-user.target\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Since we opted in for the username ",(0,s.jsx)(n.strong,{children:"lgtn"})," for our demo, replaced ",(0,s.jsx)(n.code,{children:""})," with ",(0,s.jsx)(n.code,{children:"lgtn"}),", and it would look like:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"[Unit]\nDescription=Fleek Network Node lightning service\n\n[Service]\nType=simple\nMemoryHigh=32G\nRestartSec=15s\nRestart=always\nExecStart=lgtn -c /home/lgtn/.lightning/config.toml run\nExecStop=killall -9 lgtn\nStandardOutput=append:/var/log/lightning/output.log\nStandardError=append:/var/log/lightning/diagnostic.log\nEnvironment=TMPDIR=/var/tmp\n\n[Install]\nWantedBy=multi-user.target\n"})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["Notice the ",(0,s.jsx)(n.code,{children:"ExecStart="})," which includes the flag ",(0,s.jsx)(n.code,{children:"-c"})," where the location of the user files is declared. Learn how to ",(0,s.jsx)(n.a,{href:"#update-the-configtoml-with-user-preferred-file-locations",children:"update the config.toml"})," to include the user-preferred file paths, e.g. declare the keystore pathname."]})}),"\n",(0,s.jsx)(n.p,{children:"Complete the step by reloading the daemon, to apply the newly created changes. You can do this by executing:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo systemctl daemon-reload\n"})}),"\n",(0,s.jsx)(n.h2,{id:"update-the-configtoml-with-user-preferred-file-locations",children:"Update the config.toml with user-preferred file locations"}),"\n",(0,s.jsxs)(n.p,{children:["Open the ",(0,s.jsx)(n.code,{children:"/home/lgtn/.lightning/config.toml"})," file in your favorite text editor."]}),"\n",(0,s.jsxs)(n.p,{children:["Replace every instance of ",(0,s.jsx)(n.code,{children:"~"})," (tilde) with the user's home path. We do this to ensure that every time we control the service via systemctl, the configuration file that tells which keystore to use is declared upfront regardless of running it as user or delegating to root with ",(0,s.jsx)(n.strong,{children:"sudo"}),". Learn more about ",(0,s.jsx)(n.a,{href:"/references/Lightning%20CLI/file-permissions-and-ownership",children:"file permissions and ownership"})," by reading the reference document."]}),"\n",(0,s.jsx)(l.ZP,{}),"\n",(0,s.jsx)(n.h2,{id:"start-the-service",children:"Start the service"}),"\n",(0,s.jsx)(n.p,{children:"At this stage, you should have migrated the essential files to the user home."}),"\n",(0,s.jsxs)(n.p,{children:["Ideally, you would now manage the service as the ",(0,s.jsx)(n.code,{children:"user"})," (as described in the ",(0,s.jsx)(n.a,{href:"/references/Systemd/user-service/",children:"user service reference"}),"). To keep our guide wider to all users, we'll prefix the commands with ",(0,s.jsx)(n.strong,{children:"sudo"}),", which elevates the permissions to ",(0,s.jsx)(n.strong,{children:"root"}),". But since we have provided the configuration file the ",(0,s.jsx)(n.code,{children:"-c"})," in our ",(0,s.jsx)(n.a,{href:"#systemd-service",children:"systemd service"}),", we'll have the user-preferred configuration options ruling."]}),"\n",(0,s.jsx)(n.p,{children:"Start the service by running the command:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo systemctl start lightning.service\n"})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["Find the timeline of events for the Lightning service by checking the log files. Learn about it in the section ",(0,s.jsx)(n.a,{href:"/docs/node/install#analyzing-log-messages",children:"Log Messages"}),"."]})}),"\n",(0,s.jsxs)(n.p,{children:["To learn more, visit the section ",(0,s.jsx)(n.a,{href:"/docs/node/install#use-systemctl-to-manage-systemd-service",children:"Use Systemctl to manage the Lightning Service"})]}),"\n",(0,s.jsx)(n.h2,{id:"conclusion",children:"Conclusion"}),"\n",(0,s.jsx)(n.p,{children:"We started by giving a brief introduction to ownership of the Lightning CLI files."}),"\n",(0,s.jsx)(n.p,{children:"Jumped through topics of Systemd service that helps the user manage the service in the Linux environment, which helps keep track of all the processes and threads that are spawned."}),"\n",(0,s.jsxs)(n.p,{children:["We've gone through the step-by-step process to migrate the Fleek Network CLI and Systemd service setup from one user to the other. To keep it short, we decided to go with the use-case of where the migration happens between a ",(0,s.jsx)(n.strong,{children:"root"})," user and a ",(0,s.jsx)(n.strong,{children:"sudoer"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["Discover more about the project by ",(0,s.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"watching/contributing on GitHub"}),", following us on ",(0,s.jsx)(n.a,{href:"https://twitter.com/fleek_net",children:"Twitter"}),", and joining ",(0,s.jsx)(n.a,{href:"https://discord.gg/fleekxyz",children:"our community Discord"})," for any updates."]}),"\n",(0,s.jsx)(r.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function p(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(u,{...e})}):u(e)}},8432:(e,n,t)=>{t.d(n,{ZP:()=>o});var s=t(5893),i=t(1151);function r(e){const n={admonition:"admonition",code:"code",p:"p",pre:"pre",strong:"strong",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["We recommend creating a ",(0,s.jsx)(n.code,{children:"non-root"})," user with administrative privileges. It'll allow us to install any system requirements."]}),"\n",(0,s.jsxs)(n.p,{children:["You can create a new user and add to the ",(0,s.jsx)(n.strong,{children:"sudo"})," group by running:"]}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["For our example, we'll be using the name ",(0,s.jsx)(n.code,{children:"lgtn"})," but you can pick whichever you'd like. If you already have a ",(0,s.jsx)(n.strong,{children:"sudoer"})," account, you can skip this step."]})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo adduser lgtn\n"})}),"\n",(0,s.jsxs)(n.p,{children:["After completing the ",(0,s.jsx)(n.code,{children:"adduser"})," steps, execute the ",(0,s.jsx)(n.code,{children:"usermod"})," to add the ",(0,s.jsx)(n.code,{children:"user"})," to the ",(0,s.jsx)(n.strong,{children:"sudo"})," group, as follows:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo usermod -aG sudo lgtn\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Switch to the new ",(0,s.jsx)(n.strong,{children:"user"})," by using the command:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"su lgtn\n"})}),"\n",(0,s.jsx)(n.p,{children:"Change the directory to the new user's home, as follows:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"cd /home/lgtn\n"})})]})}function o(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(r,{...e})}):r(e)}},1586:(e,n,t)=>{t.d(n,{ZP:()=>o});var s=t(5893),i=t(1151);function r(e){const n={a:"a",admonition:"admonition",code:"code",p:"p",pre:"pre",strong:"strong",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["In the ",(0,s.jsx)(n.code,{children:"/home//.lightning/config.toml"})," you'll find some and more of the following:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-toml",children:'[BLANK]\n\n[application]\ndb_path = "~/.lightning/data/app_db"\n\n[consensus]\nstore_path = "~/.lightning/data/narwhal_store"\n\n[fsstore]\nroot = "~/.lightning/blockstore"\n\n[resolver]\nstore_path = "~/.lightning/data/resolver_store"\n\n[signer]\nconsensus_key_path = "~/.lightning/keystore/consensus.pem"\nnode_key_path = "~/.lightning/keystore/node.pem"\n'})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["The configuration properties and values presented above are a shorter version of what you'll find on your ",(0,s.jsx)(n.strong,{children:"configuration.toml"}),". We keep it short to make it easier to follow, do not copy and paste."]})}),"\n",(0,s.jsxs)(n.p,{children:["Find and replace all instances of ~ in the config file ",(0,s.jsx)(n.code,{children:"/home//.lightning/config.toml"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["Here's an example of how to do it using ",(0,s.jsx)(n.strong,{children:"sed"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:'sed -i "s|~/.lightning|/home//.lightning|g" "/home//.lightning/config.toml"\n'})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["Replace the ",(0,s.jsx)(n.code,{children:""})," with your username. For example, if you have followed the recommendation to ",(0,s.jsx)(n.a,{href:"/docs/node/install#create-a-user",children:"create a user"})," it would look like ",(0,s.jsx)(n.code,{children:"/home/lgtn/.lightning/config.toml"})," for the username ",(0,s.jsx)(n.strong,{children:"lgtn"}),"."]})}),"\n",(0,s.jsxs)(n.p,{children:["For example, if your username is ",(0,s.jsx)(n.code,{children:"lgtn"})," that'd look like this:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:'sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Once modified, you can run a ",(0,s.jsx)(n.code,{children:"cat"})," to see the content of the files to confirm it has been updated."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"cat /home/lgtn/.lightning/config.toml\n"})}),"\n",(0,s.jsxs)(n.p,{children:["For our example where we opted in for the username ",(0,s.jsx)(n.code,{children:"lgtn"})," that would look like:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-toml",children:'[BLANK]\n\n[application]\ndb_path = "~/.lightning/data/app_db"\n\n[consensus]\nstore_path = "~/.lightning/data/narwhal_store"\n\n[fsstore]\nroot = "~/.lightning/blockstore"\n\n[resolver]\nstore_path = "~/.lightning/data/resolver_store"\n\n[signer]\nconsensus_key_path = "~/.lightning/keystore/consensus.pem"\nnode_key_path = "~/.lightning/keystore/node.pem"\n'})}),"\n",(0,s.jsx)(n.admonition,{title:"Warning",type:"caution",children:(0,s.jsx)(n.p,{children:"Bear in mind that we are keeping the content of the file short to make it easier to read and follow. The content of your configuration file should look slightly different, amongst these it should contain other properties and values. You should not copy and replace the content of your files with the ones presented here."})})]})}function o(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(r,{...e})}):r(e)}},3872:(e,n,t)=>{t.d(n,{Z:()=>i});t(7294);var s=t(5893);const i=e=>{let{image:n,name:t,title:i,url:r,communityMember:o=!1}=e;return(0,s.jsx)("section",{className:"author_card",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"avatar",children:(0,s.jsx)("a",{href:r,target:"_blank",alt:t,children:(0,s.jsx)("img",{src:n,alt:t})})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"name",children:(0,s.jsx)("a",{href:r,target:"_blank",alt:t,children:t})}),(0,s.jsx)("span",{className:"title",children:i}),(0,s.jsxs)("span",{className:"discord",children:[o?"Join our community on":"Got questions? Find us on"," ",(0,s.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},9548:(e,n,t)=>{t.d(n,{Z:()=>s});const s=t.p+"assets/images/transfering-setup-ownership-e59591d6c2b6023384e94dfa4873964a.png"},2867:(e,n,t)=>{t.d(n,{Z:()=>s});const s=t.p+"assets/images/transfering-setup-ownership-e59591d6c2b6023384e94dfa4873964a.png"},1151:(e,n,t)=>{t.d(n,{Z:()=>l,a:()=>o});var s=t(7294);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 l(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)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[9854],{884:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>h,default:()=>p,frontMatter:()=>a,metadata:()=>d,toc:()=>g});var s=t(5893),i=t(1151),r=t(3872),o=t(8432),l=t(1586);const a={template:"post",draft:!1,hide_title:!0,title:"Transfering setup ownership",slug:"transfering-setup-ownership",image:"./assets/transfering-setup-ownership.png?202311181223",date:new Date("2023-09-12T23:00:00.000Z"),description:"A step-by-step guide to transfer the ownership of the Fleek Network Lightning CLI and service setup",category:"Tutorial",tags:["transfer","ownership","guide","setup","configuration"]},h=void 0,d={id:"Node Operators/transfering-setup-ownership",title:"Transfering setup ownership",description:"A step-by-step guide to transfer the ownership of the Fleek Network Lightning CLI and service setup",source:"@site/guides/Node Operators/transfering-setup-ownership.md",sourceDirName:"Node Operators",slug:"/Node Operators/transfering-setup-ownership",permalink:"/guides/Node Operators/transfering-setup-ownership",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/guides/Node Operators/transfering-setup-ownership.md",tags:[{label:"transfer",permalink:"/guides/tags/transfer"},{label:"ownership",permalink:"/guides/tags/ownership"},{label:"guide",permalink:"/guides/tags/guide"},{label:"setup",permalink:"/guides/tags/setup"},{label:"configuration",permalink:"/guides/tags/configuration"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{template:"post",draft:!1,hide_title:!0,title:"Transfering setup ownership",slug:"transfering-setup-ownership",image:"./assets/transfering-setup-ownership.png?202311181223",date:"2023-09-12T23:00:00.000Z",description:"A step-by-step guide to transfer the ownership of the Fleek Network Lightning CLI and service setup",category:"Tutorial",tags:["transfer","ownership","guide","setup","configuration"]},sidebar:"defaultSidebar",previous:{title:"Running a node in Docker",permalink:"/guides/Node Operators/running-a-node-in-docker"},next:{title:"Updating Lightning",permalink:"/guides/Node Operators/updating-lightning"}},c={image:t(9548).Z},g=[{value:"TL;DR",id:"tldr",level:2},{value:"Introduction",id:"introduction",level:2},{value:"Pre-requisites",id:"pre-requisites",level:2},{value:"Ownership of Lightning CLI files",id:"ownership-of-lightning-cli-files",level:2},{value:"Systemd Service",id:"systemd-service",level:2},{value:"Stop the service",id:"stop-the-service",level:2},{value:"Clear the .lightning data",id:"clear-the-lightning-data",level:2},{value:"Create a user",id:"create-a-user",level:2},{value:"Move lightning system and source code directory to user's home",id:"move-lightning-system-and-source-code-directory-to-users-home",level:2},{value:"1) Move the /root/.lightning directory from one user to the other",id:"1-move-the-rootlightning-directory-from-one-user-to-the-other",level:3},{value:"2) Move the /root/fleek-network directory from one user to the other",id:"2-move-the-rootfleek-network-directory-from-one-user-to-the-other",level:3},{value:"3) Confirm move by finding both directories",id:"3-confirm-move-by-finding-both-directories",level:3},{value:"Change ownership of files",id:"change-ownership-of-files",level:2},{value:"The lgtn symbolic link (symlink)",id:"the-lgtn-symbolic-link-symlink",level:2},{value:"Update the Systemd service unit",id:"update-the-systemd-service-unit",level:2},{value:"Update the config.toml with user-preferred file locations",id:"update-the-configtoml-with-user-preferred-file-locations",level:2},{value:"Start the service",id:"start-the-service",level:2},{value:"Conclusion",id:"conclusion",level:2}];function u(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Transfering setup ownership",src:t(2867).Z+"",width:"1450",height:"816"})}),"\n","\n","\n",(0,s.jsx)(n.h2,{id:"tldr",children:"TL;DR"}),"\n",(0,s.jsxs)(n.admonition,{type:"tip",children:[(0,s.jsxs)(n.p,{children:["The step-by-step instructions provided in the guide should be simple to follow, but the process is also available as an automated script from our familiar ",(0,s.jsx)(n.a,{href:"https://github.com/fleek-network/get.fleek.network",children:"get.fleek.network"})," tool."]}),(0,s.jsx)(n.p,{children:"To use the automated script execute the following command in your server terminal and follow the instructions:"}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"curl -sS https://get.fleek.network/transfer_system_user_setup_ownership | bash\n"})}),(0,s.jsxs)(n.p,{children:["We try to make the auomated scripts as useful as possible, but it's impossible to fit every single use-case. So, if you find any isses or have feedback to help us improve ",(0,s.jsx)(n.a,{href:"https://discord.gg/fleekxyz",children:"message us through our Discord"}),"."]})]}),"\n",(0,s.jsx)(n.h2,{id:"introduction",children:"Introduction"}),"\n",(0,s.jsx)(n.p,{children:"Our Lightning CLI and Node process is run by a user, that has some sort of permissions\u2013some users run it as a super user (root) which is questionable as root privileges are not a necessary good. We'll look into how to create a user to manage and control the Fleek Network Lightning CLI and Systemd unit service. Also, presents the concept of file permissions and ownership which is crucial in preventing private or sensitive data from being exposed to dodgy actors."}),"\n",(0,s.jsx)(n.p,{children:"Let's discuss the topic and open up a few ideas to help us improve the security of our server."}),"\n",(0,s.jsx)(n.h2,{id:"pre-requisites",children:"Pre-requisites"}),"\n",(0,s.jsx)(n.p,{children:"To follow the guide, you will need the following:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Familiarity with the command-line interface"}),"\n",(0,s.jsx)(n.li,{children:"Have installed and set up the Lightning CLI and service"}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"ownership-of-lightning-cli-files",children:"Ownership of Lightning CLI files"}),"\n",(0,s.jsx)(n.p,{children:"The user who installs the Lightning CLI and sets the Service takes an important role that determines the location of the configuration files, the setup, and how the Systemd service is managed or controlled."}),"\n",(0,s.jsxs)(n.p,{children:["Our ",(0,s.jsx)(n.a,{href:"/docs/node/install",children:"install"})," document recommends creating a user and switching to the user to set up the service. You shouldn't want installed applications to run with elevated privileges. Applications are meant to be run with non-administrative privileges. If an application requires higher privileges, the administrator, such as a ",(0,s.jsx)(n.a,{href:"https://en.wikipedia.org/wiki/Sudo",children:"sudoer"})," should be able to elevate it. An application that has full access and control of a system can modify it in harmful ways, e.g. compromise the private keys."]}),"\n",(0,s.jsx)(n.p,{children:"For our guide, we'll illustrate the process of migration from a super user (root) to another user (sudo). The knowledge should be easily appliable for any other user-to-user migration. We stick with root user for simplicity and because that's the most common use case."}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["A reference document about ",(0,s.jsx)(n.a,{href:"/references/Lightning%20CLI/file-permissions-and-ownership",children:"File permissions and ownership"})," is available that explains how it works practically, by showcasing how the process can be started, how the node process locates the Keystore, etc."]})}),"\n",(0,s.jsx)(n.h2,{id:"systemd-service",children:"Systemd Service"}),"\n",(0,s.jsx)(n.p,{children:"In systemd, a unit refers to any resource that the system knows how to operate on and manage. This is the primary object that the systemd tools know how to deal with. These resources are defined using configuration files called unit files."}),"\n",(0,s.jsxs)(n.p,{children:["The recommended installation process features a ",(0,s.jsx)(n.a,{href:"https://www.freedesktop.org/software/systemd/man/systemd.service.html",children:"systemd.service"})," which is a resource that the system knows how to operate and manage by an administrator user."]}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsx)(n.p,{children:"When using a Systemd service to run a process, it operates comparably to running it directly. The key difference is that Systemd keeps track of all the processes and threads that are spawned. This means that when a service is stopped using systemctl, such as the Fleek Network Lightning Node service, all the child processes that were started by the service are also terminated. Additionally, by utilizing Systemd, a user can run the process in the background and configure it to start automatically on system startup."})}),"\n",(0,s.jsxs)(n.p,{children:["If you have followed the installation recommendations, find the systemd service unit in the location ",(0,s.jsx)(n.code,{children:"/etc/systemd/system/lightning.service"})," (we are using Ubuntu Linux as an example to keep it short)."]}),"\n",(0,s.jsxs)(n.p,{children:["Make sure that you have set up a ",(0,s.jsx)(n.a,{href:"/docs/node/install#systemd-service-setup",children:"Systemd unit service"}),", as recommended during the installation as this guide assumes you have one setup."]}),"\n",(0,s.jsx)(n.h2,{id:"stop-the-service",children:"Stop the service"}),"\n",(0,s.jsxs)(n.p,{children:["Before we proceed with any changes required for the migration, you'll have to stop the ",(0,s.jsx)(n.code,{children:"lightning.service"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"systemctl stop lightning\n"})}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsxs)(n.p,{children:["For this guide, we are assuming that you are migrating ownership from ",(0,s.jsx)(n.strong,{children:"root"})," to a ",(0,s.jsx)(n.strong,{children:"sudoer"})," user. If not, you might be required to elevate privileges as ",(0,s.jsx)(n.strong,{children:"sudo"}),"** where required. For example, ",(0,s.jsx)(n.code,{children:"sudo systemctl stop lightning"}),"."]})}),"\n",(0,s.jsx)(n.h2,{id:"clear-the-lightning-data",children:"Clear the .lightning data"}),"\n",(0,s.jsxs)(n.p,{children:["Run the following command to clear the ",(0,s.jsx)(n.code,{children:"/root/.lightning/data"}),", as it can be quite large, and we don't need to move it."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo rm -rf /root/.lightning/data\n"})}),"\n",(0,s.jsx)(n.h2,{id:"create-a-user",children:"Create a user"}),"\n",(0,s.jsx)(o.ZP,{}),"\n",(0,s.jsx)(n.h2,{id:"move-lightning-system-and-source-code-directory-to-users-home",children:"Move lightning system and source code directory to user's home"}),"\n",(0,s.jsx)(n.p,{children:"A user should've been created, added the user to the sudo group, switched to the user, and changed the directory to the user's home."}),"\n",(0,s.jsxs)(n.p,{children:["Run the command ",(0,s.jsx)(n.code,{children:"pwd"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"pwd\n"})}),"\n",(0,s.jsx)(n.p,{children:"The output would look like:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"/home/\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Given the username ",(0,s.jsx)(n.strong,{children:"lgtn"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"/home/lgtn\n"})}),"\n",(0,s.jsx)(n.p,{children:"You'll then move two directories:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["The ",(0,s.jsx)(n.code,{children:"/root/.lightning"})]}),"\n",(0,s.jsxs)(n.li,{children:["The source code under the parent ",(0,s.jsx)(n.code,{children:"/root/fleek-network"})]}),"\n"]}),"\n",(0,s.jsxs)(n.h3,{id:"1-move-the-rootlightning-directory-from-one-user-to-the-other",children:["1) Move the ",(0,s.jsx)(n.code,{children:"/root/.lightning"})," directory from one user to the other"]}),"\n",(0,s.jsxs)(n.p,{children:["For our demo, we have assumed ",(0,s.jsx)(n.strong,{children:"root"})," user to ",(0,s.jsx)(n.strong,{children:"sudoer"})," user named ",(0,s.jsx)(n.strong,{children:"lgtn"}),", thus that'll look like this:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo mv /root/.lightning /home/lgtn/\n"})}),"\n",(0,s.jsxs)(n.h3,{id:"2-move-the-rootfleek-network-directory-from-one-user-to-the-other",children:["2) Move the ",(0,s.jsx)(n.code,{children:"/root/fleek-network"})," directory from one user to the other"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo mv /root/fleek-network /home/lgtn/\n"})}),"\n",(0,s.jsx)(n.h3,{id:"3-confirm-move-by-finding-both-directories",children:"3) Confirm move by finding both directories"}),"\n",(0,s.jsxs)(n.p,{children:["In the user $HOME directory, you should be able to list the content of the directory and find the ",(0,s.jsx)(n.code,{children:".lightning"})," and ",(0,s.jsx)(n.code,{children:"fleek-network"})," directory."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"ls -la\n"})}),"\n",(0,s.jsx)(n.p,{children:"The output should be similar to the following."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"drwxr-x--- 6 lgtn lgtn 4096 Sep 12 13:51 .\ndrwxr-xr-x 3 root root 4096 Sep 11 12:28 ..\ndrwxrwxr-x 5 root root 4096 Sep 11 15:25 .lightning\ndrwxrwxr-x 3 root root 4096 Sep 11 12:28 fleek-network\n"})}),"\n",(0,s.jsx)(n.h2,{id:"change-ownership-of-files",children:"Change ownership of files"}),"\n",(0,s.jsxs)(n.p,{children:["Once the directories and files are moved, they should have the wrong ownership, which should be set to ",(0,s.jsxs)(n.strong,{children:["root",":root"]}),". We'll now have to change the ownership of the directories and files recursively."]}),"\n",(0,s.jsxs)(n.p,{children:["Change the ownership of ",(0,s.jsx)(n.code,{children:"/home/lgtn/.lightning"})," to the user ",(0,s.jsx)(n.strong,{children:"lgtn"})," as follows:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo chown -R lgtn:lgtn .lightning\n"})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["Make sure that you use the ",(0,s.jsx)(n.code,{children:"-R"})," flag to have the ownership changes applied to the parent, the child directories and all the files."]})}),"\n",(0,s.jsxs)(n.p,{children:["Change the ownership of ",(0,s.jsx)(n.code,{children:"/home/lgtn/fleek-network"})," to the user ",(0,s.jsx)(n.strong,{children:"lgtn"})," as follows:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo chown -R lgtn:lgtn fleek-network\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Once completed, if you list the content of the directory the ownership should have changed from ",(0,s.jsx)(n.code,{children:"root:root"})," to ",(0,s.jsx)(n.code,{children:"lgtn:lgtn"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"ls -la\n"})}),"\n",(0,s.jsx)(n.p,{children:"The output should be similar to the following."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"drwxr-x--- 6 lgtn lgtn 4096 Sep 12 13:51 .\ndrwxr-xr-x 3 root root 4096 Sep 11 12:28 ..\ndrwxrwxr-x 5 lgtn lgtn 4096 Sep 11 15:25 .lightning\ndrwxrwxr-x 3 lgtn lgtn 4096 Sep 11 12:28 fleek-network\n"})}),"\n",(0,s.jsxs)(n.admonition,{type:"tip",children:[(0,s.jsxs)(n.p,{children:["Remember that we are using ",(0,s.jsx)(n.strong,{children:"lgtn"})," for our demo. If you have opted for a different username, make sure you use the correct username. To find the username you are logged in with run the command:"]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"whoami\n"})}),(0,s.jsxs)(n.p,{children:["For our demo, we'll assume that you understand that ",(0,s.jsx)(n.strong,{children:"lgtn"})," is the user we opted in for our demo."]})]}),"\n",(0,s.jsx)(n.h2,{id:"the-lgtn-symbolic-link-symlink",children:"The lgtn symbolic link (symlink)"}),"\n",(0,s.jsxs)(n.p,{children:["We have the symbolic link that links the binary built from the source code, to the alias ",(0,s.jsx)(n.strong,{children:"lgtn"})," that's set under the ",(0,s.jsx)(n.code,{children:"/usr/local/bin/lgtn"})," pathname."]}),"\n",(0,s.jsx)(n.p,{children:"For example, you can find where that is linked to by running:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"ls -la $(which lgtn)\n"})}),"\n",(0,s.jsxs)(n.p,{children:["On the output below, we can see that the ",(0,s.jsx)(n.code,{children:"/usr/local/bin/lgtn"})," points to ",(0,s.jsx)(n.code,{children:"/root/fleek-network/lightning/target/release/lightning-node"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"lrwxrwxrwx 1 root root 64 Sep 11 15:48 /usr/local/bin/lgtn -> /root/fleek-network/lightning/target/release/lightning-node\n"})}),"\n",(0,s.jsxs)(n.p,{children:["The target base path is ",(0,s.jsx)(n.code,{children:"/root"}),", and we know that we've moved the source code directory to the user home ",(0,s.jsx)(n.code,{children:"/home/lgtn"}),". For this reason, we need to create a new symlink with the updated location of the binary file."]}),"\n",(0,s.jsx)(n.p,{children:"Unlink the symlink:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo unlink /usr/local/bin/lgtn\n"})}),"\n",(0,s.jsx)(n.p,{children:"Create the symlink:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:'sudo ln -s "/home/lgtn/fleek-network/lightning/target/release/lightning-node" /usr/local/bin/lgtn\n'})}),"\n",(0,s.jsx)(n.p,{children:"If successful, you should be able to execute the command:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"lgtn help\n"})}),"\n",(0,s.jsx)(n.p,{children:"The output should look similar to:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"Usage: lgtn [OPTIONS] \n\nCommands:\n run Start the node\n keys Handle keys\n print-config Print the loaded configuration\n help Print this message or the help of the given subcommand(s)\n\nOptions:\n -c, --config Path to the toml configuration file [default: ~/.lightning/config.toml]\n --with-mock-consensus Determines that we should be using the mock consensus backend\n -v... Increases the level of verbosity (the max level is -vvv)\n --log-location Print code location on console logs\n -h, --help Print help\n -V, --version Print version\n"})}),"\n",(0,s.jsx)(n.h2,{id:"update-the-systemd-service-unit",children:"Update the Systemd service unit"}),"\n",(0,s.jsx)(n.p,{children:"Open the file, its settings should be similar to the following:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"[Unit]\nDescription=Fleek Network Node lightning service\n\n[Service]\nType=simple\nMemoryHigh=32G\nRestartSec=15s\nRestart=always\nExecStart=lgtn -c /home//.lightning/config.toml run\nExecStop=killall -9 lgtn\nStandardOutput=append:/var/log/lightning/output.log\nStandardError=append:/var/log/lightning/diagnostic.log\nEnvironment=TMPDIR=/var/tmp\n\n[Install]\nWantedBy=multi-user.target\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Since we opted in for the username ",(0,s.jsx)(n.strong,{children:"lgtn"})," for our demo, replaced ",(0,s.jsx)(n.code,{children:""})," with ",(0,s.jsx)(n.code,{children:"lgtn"}),", and it would look like:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"[Unit]\nDescription=Fleek Network Node lightning service\n\n[Service]\nType=simple\nMemoryHigh=32G\nRestartSec=15s\nRestart=always\nExecStart=lgtn -c /home/lgtn/.lightning/config.toml run\nExecStop=killall -9 lgtn\nStandardOutput=append:/var/log/lightning/output.log\nStandardError=append:/var/log/lightning/diagnostic.log\nEnvironment=TMPDIR=/var/tmp\n\n[Install]\nWantedBy=multi-user.target\n"})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["Notice the ",(0,s.jsx)(n.code,{children:"ExecStart="})," which includes the flag ",(0,s.jsx)(n.code,{children:"-c"})," where the location of the user files is declared. Learn how to ",(0,s.jsx)(n.a,{href:"#update-the-configtoml-with-user-preferred-file-locations",children:"update the config.toml"})," to include the user-preferred file paths, e.g. declare the keystore pathname."]})}),"\n",(0,s.jsx)(n.p,{children:"Complete the step by reloading the daemon, to apply the newly created changes. You can do this by executing:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo systemctl daemon-reload\n"})}),"\n",(0,s.jsx)(n.h2,{id:"update-the-configtoml-with-user-preferred-file-locations",children:"Update the config.toml with user-preferred file locations"}),"\n",(0,s.jsxs)(n.p,{children:["Open the ",(0,s.jsx)(n.code,{children:"/home/lgtn/.lightning/config.toml"})," file in your favorite text editor."]}),"\n",(0,s.jsxs)(n.p,{children:["Replace every instance of ",(0,s.jsx)(n.code,{children:"~"})," (tilde) with the user's home path. We do this to ensure that every time we control the service via systemctl, the configuration file that tells which keystore to use is declared upfront regardless of running it as user or delegating to root with ",(0,s.jsx)(n.strong,{children:"sudo"}),". Learn more about ",(0,s.jsx)(n.a,{href:"/references/Lightning%20CLI/file-permissions-and-ownership",children:"file permissions and ownership"})," by reading the reference document."]}),"\n",(0,s.jsx)(l.ZP,{}),"\n",(0,s.jsx)(n.h2,{id:"start-the-service",children:"Start the service"}),"\n",(0,s.jsx)(n.p,{children:"At this stage, you should have migrated the essential files to the user home."}),"\n",(0,s.jsxs)(n.p,{children:["Ideally, you would now manage the service as the ",(0,s.jsx)(n.code,{children:"user"})," (as described in the ",(0,s.jsx)(n.a,{href:"/references/Systemd/user-service/",children:"user service reference"}),"). To keep our guide wider to all users, we'll prefix the commands with ",(0,s.jsx)(n.strong,{children:"sudo"}),", which elevates the permissions to ",(0,s.jsx)(n.strong,{children:"root"}),". But since we have provided the configuration file the ",(0,s.jsx)(n.code,{children:"-c"})," in our ",(0,s.jsx)(n.a,{href:"#systemd-service",children:"systemd service"}),", we'll have the user-preferred configuration options ruling."]}),"\n",(0,s.jsx)(n.p,{children:"Start the service by running the command:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo systemctl start lightning.service\n"})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["Find the timeline of events for the Lightning service by checking the log files. Learn about it in the section ",(0,s.jsx)(n.a,{href:"/docs/node/install#analyzing-log-messages",children:"Log Messages"}),"."]})}),"\n",(0,s.jsxs)(n.p,{children:["To learn more, visit the section ",(0,s.jsx)(n.a,{href:"/docs/node/install#use-systemctl-to-manage-systemd-service",children:"Use Systemctl to manage the Lightning Service"})]}),"\n",(0,s.jsx)(n.h2,{id:"conclusion",children:"Conclusion"}),"\n",(0,s.jsx)(n.p,{children:"We started by giving a brief introduction to ownership of the Lightning CLI files."}),"\n",(0,s.jsx)(n.p,{children:"Jumped through topics of Systemd service that helps the user manage the service in the Linux environment, which helps keep track of all the processes and threads that are spawned."}),"\n",(0,s.jsxs)(n.p,{children:["We've gone through the step-by-step process to migrate the Fleek Network CLI and Systemd service setup from one user to the other. To keep it short, we decided to go with the use-case of where the migration happens between a ",(0,s.jsx)(n.strong,{children:"root"})," user and a ",(0,s.jsx)(n.strong,{children:"sudoer"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["Discover more about the project by ",(0,s.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"watching/contributing on GitHub"}),", following us on ",(0,s.jsx)(n.a,{href:"https://twitter.com/fleek_net",children:"Twitter"}),", and joining ",(0,s.jsx)(n.a,{href:"https://discord.gg/fleekxyz",children:"our community Discord"})," for any updates."]}),"\n",(0,s.jsx)(r.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function p(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(u,{...e})}):u(e)}},8432:(e,n,t)=>{t.d(n,{ZP:()=>o});var s=t(5893),i=t(1151);function r(e){const n={admonition:"admonition",code:"code",p:"p",pre:"pre",strong:"strong",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["We recommend creating a ",(0,s.jsx)(n.code,{children:"non-root"})," user with administrative privileges. It'll allow us to install any system requirements."]}),"\n",(0,s.jsxs)(n.p,{children:["You can create a new user and add to the ",(0,s.jsx)(n.strong,{children:"sudo"})," group by running:"]}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["For our example, we'll be using the name ",(0,s.jsx)(n.code,{children:"lgtn"})," but you can pick whichever you'd like. If you already have a ",(0,s.jsx)(n.strong,{children:"sudoer"})," account, you can skip this step."]})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo adduser lgtn\n"})}),"\n",(0,s.jsxs)(n.p,{children:["After completing the ",(0,s.jsx)(n.code,{children:"adduser"})," steps, execute the ",(0,s.jsx)(n.code,{children:"usermod"})," to add the ",(0,s.jsx)(n.code,{children:"user"})," to the ",(0,s.jsx)(n.strong,{children:"sudo"})," group, as follows:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo usermod -aG sudo lgtn\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Switch to the new ",(0,s.jsx)(n.strong,{children:"user"})," by using the command:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"su lgtn\n"})}),"\n",(0,s.jsx)(n.p,{children:"Change the directory to the new user's home, as follows:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"cd /home/lgtn\n"})})]})}function o(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(r,{...e})}):r(e)}},1586:(e,n,t)=>{t.d(n,{ZP:()=>o});var s=t(5893),i=t(1151);function r(e){const n={a:"a",admonition:"admonition",code:"code",p:"p",pre:"pre",strong:"strong",...(0,i.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["In the ",(0,s.jsx)(n.code,{children:"/home//.lightning/config.toml"})," you'll find some and more of the following:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-toml",children:'[BLANK]\n\n[application]\ndb_path = "~/.lightning/data/app_db"\n\n[consensus]\nstore_path = "~/.lightning/data/narwhal_store"\n\n[fsstore]\nroot = "~/.lightning/blockstore"\n\n[resolver]\nstore_path = "~/.lightning/data/resolver_store"\n\n[signer]\nconsensus_key_path = "~/.lightning/keystore/consensus.pem"\nnode_key_path = "~/.lightning/keystore/node.pem"\n'})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["The configuration properties and values presented above are a shorter version of what you'll find on your ",(0,s.jsx)(n.strong,{children:"configuration.toml"}),". We keep it short to make it easier to follow, do not copy and paste."]})}),"\n",(0,s.jsxs)(n.p,{children:["Find and replace all instances of ~ in the config file ",(0,s.jsx)(n.code,{children:"/home//.lightning/config.toml"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["Here's an example of how to do it using ",(0,s.jsx)(n.strong,{children:"sed"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:'sed -i "s|~/.lightning|/home//.lightning|g" "/home//.lightning/config.toml"\n'})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["Replace the ",(0,s.jsx)(n.code,{children:""})," with your username. For example, if you have followed the recommendation to ",(0,s.jsx)(n.a,{href:"/docs/node/install#create-a-user",children:"create a user"})," it would look like ",(0,s.jsx)(n.code,{children:"/home/lgtn/.lightning/config.toml"})," for the username ",(0,s.jsx)(n.strong,{children:"lgtn"}),"."]})}),"\n",(0,s.jsxs)(n.p,{children:["For example, if your username is ",(0,s.jsx)(n.code,{children:"lgtn"})," that'd look like this:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:'sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Once modified, you can run a ",(0,s.jsx)(n.code,{children:"cat"})," to see the content of the files to confirm it has been updated."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"cat /home/lgtn/.lightning/config.toml\n"})}),"\n",(0,s.jsxs)(n.p,{children:["For our example where we opted in for the username ",(0,s.jsx)(n.code,{children:"lgtn"})," that would look like:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-toml",children:'[BLANK]\n\n[application]\ndb_path = "~/.lightning/data/app_db"\n\n[consensus]\nstore_path = "~/.lightning/data/narwhal_store"\n\n[fsstore]\nroot = "~/.lightning/blockstore"\n\n[resolver]\nstore_path = "~/.lightning/data/resolver_store"\n\n[signer]\nconsensus_key_path = "~/.lightning/keystore/consensus.pem"\nnode_key_path = "~/.lightning/keystore/node.pem"\n'})}),"\n",(0,s.jsx)(n.admonition,{title:"Warning",type:"caution",children:(0,s.jsx)(n.p,{children:"Bear in mind that we are keeping the content of the file short to make it easier to read and follow. The content of your configuration file should look slightly different, amongst these it should contain other properties and values. You should not copy and replace the content of your files with the ones presented here."})})]})}function o(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(r,{...e})}):r(e)}},3872:(e,n,t)=>{t.d(n,{Z:()=>i});t(7294);var s=t(5893);const i=e=>{let{image:n,name:t,title:i,url:r,communityMember:o=!1}=e;return(0,s.jsx)("section",{className:"author_card",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"avatar",children:(0,s.jsx)("a",{href:r,target:"_blank",alt:t,children:(0,s.jsx)("img",{src:n,alt:t})})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"name",children:(0,s.jsx)("a",{href:r,target:"_blank",alt:t,children:t})}),(0,s.jsx)("span",{className:"title",children:i}),(0,s.jsxs)("span",{className:"discord",children:[o?"Join our community on":"Got questions? Find us on"," ",(0,s.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},9548:(e,n,t)=>{t.d(n,{Z:()=>s});const s=t.p+"assets/images/transfering-setup-ownership-e59591d6c2b6023384e94dfa4873964a.png"},2867:(e,n,t)=>{t.d(n,{Z:()=>s});const s=t.p+"assets/images/transfering-setup-ownership-e59591d6c2b6023384e94dfa4873964a.png"},1151:(e,n,t)=>{t.d(n,{Z:()=>l,a:()=>o});var s=t(7294);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 l(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)}}}]); \ No newline at end of file diff --git a/assets/js/26b85cb6.e3c62538.js b/assets/js/26b85cb6.ce43f321.js similarity index 99% rename from assets/js/26b85cb6.e3c62538.js rename to assets/js/26b85cb6.ce43f321.js index 15b62d44c..83b0cf071 100644 --- a/assets/js/26b85cb6.e3c62538.js +++ b/assets/js/26b85cb6.ce43f321.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[7055],{1586:(e,n,t)=>{t.d(n,{ZP:()=>i});var o=t(5893),r=t(1151);function s(e){const n={a:"a",admonition:"admonition",code:"code",p:"p",pre:"pre",strong:"strong",...(0,r.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.p,{children:["In the ",(0,o.jsx)(n.code,{children:"/home//.lightning/config.toml"})," you'll find some and more of the following:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-toml",children:'[BLANK]\n\n[application]\ndb_path = "~/.lightning/data/app_db"\n\n[consensus]\nstore_path = "~/.lightning/data/narwhal_store"\n\n[fsstore]\nroot = "~/.lightning/blockstore"\n\n[resolver]\nstore_path = "~/.lightning/data/resolver_store"\n\n[signer]\nconsensus_key_path = "~/.lightning/keystore/consensus.pem"\nnode_key_path = "~/.lightning/keystore/node.pem"\n'})}),"\n",(0,o.jsx)(n.admonition,{type:"tip",children:(0,o.jsxs)(n.p,{children:["The configuration properties and values presented above are a shorter version of what you'll find on your ",(0,o.jsx)(n.strong,{children:"configuration.toml"}),". We keep it short to make it easier to follow, do not copy and paste."]})}),"\n",(0,o.jsxs)(n.p,{children:["Find and replace all instances of ~ in the config file ",(0,o.jsx)(n.code,{children:"/home//.lightning/config.toml"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["Here's an example of how to do it using ",(0,o.jsx)(n.strong,{children:"sed"}),":"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-sh",children:'sed -i "s|~/.lightning|/home//.lightning|g" "/home//.lightning/config.toml"\n'})}),"\n",(0,o.jsx)(n.admonition,{type:"tip",children:(0,o.jsxs)(n.p,{children:["Replace the ",(0,o.jsx)(n.code,{children:""})," with your username. For example, if you have followed the recommendation to ",(0,o.jsx)(n.a,{href:"/docs/node/install#create-a-user",children:"create a user"})," it would look like ",(0,o.jsx)(n.code,{children:"/home/lgtn/.lightning/config.toml"})," for the username ",(0,o.jsx)(n.strong,{children:"lgtn"}),"."]})}),"\n",(0,o.jsxs)(n.p,{children:["For example, if your username is ",(0,o.jsx)(n.code,{children:"lgtn"})," that'd look like this:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-sh",children:'sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"\n'})}),"\n",(0,o.jsxs)(n.p,{children:["Once modified, you can run a ",(0,o.jsx)(n.code,{children:"cat"})," to see the content of the files to confirm it has been updated."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-sh",children:"cat /home/lgtn/.lightning/config.toml\n"})}),"\n",(0,o.jsxs)(n.p,{children:["For our example where we opted in for the username ",(0,o.jsx)(n.code,{children:"lgtn"})," that would look like:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-toml",children:'[BLANK]\n\n[application]\ndb_path = "~/.lightning/data/app_db"\n\n[consensus]\nstore_path = "~/.lightning/data/narwhal_store"\n\n[fsstore]\nroot = "~/.lightning/blockstore"\n\n[resolver]\nstore_path = "~/.lightning/data/resolver_store"\n\n[signer]\nconsensus_key_path = "~/.lightning/keystore/consensus.pem"\nnode_key_path = "~/.lightning/keystore/node.pem"\n'})}),"\n",(0,o.jsx)(n.admonition,{title:"Warning",type:"caution",children:(0,o.jsx)(n.p,{children:"Bear in mind that we are keeping the content of the file short to make it easier to read and follow. The content of your configuration file should look slightly different, amongst these it should contain other properties and values. You should not copy and replace the content of your files with the ones presented here."})})]})}function i(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(s,{...e})}):s(e)}},5979:(e,n,t)=>{t.d(n,{ZP:()=>i});var o=t(5893),r=t(1151);function s(e){const n={a:"a",admonition:"admonition",code:"code",li:"li",ol:"ol",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.p,{children:["You can restore the keystore (Public Keys) by copying the directory to the ",(0,o.jsx)(n.code,{children:"~/.lightning"})," directory."]}),"\n",(0,o.jsx)(n.p,{children:"Let's assume that you know where your backup directory or files are located. To keep our instructions easy to follow, let's say that:"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["The keystore and files are located under the hypothetical location ",(0,o.jsx)(n.code,{children:"/my-keystore-backup"})]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["The files in the ",(0,o.jsx)(n.code,{children:"/my-keystore-backup"})," are the following:"]}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"/my-keystore-backup\n\u251c\u2500\u2500 consensus.pem\n\u2514\u2500\u2500 node.pem\n\n1 directory, 2 files\n"})}),"\n",(0,o.jsx)(n.p,{children:"Considering the above for our example, you would have to run the following command:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"mv /my-keystore-backup /home//.lightning/keystore\n"})}),"\n",(0,o.jsx)(n.admonition,{type:"tip",children:(0,o.jsxs)(n.p,{children:["Remember to replace the ",(0,o.jsx)(n.code,{children:""})," with the correct username for the setup. For example, if you have installed the Fleek Network with the username ",(0,o.jsx)(n.code,{children:"lgtn"})," that would be ",(0,o.jsx)(n.code,{children:"/home/lgtn/.lightning/keystore"}),"."]})}),"\n",(0,o.jsxs)(n.p,{children:["Once moved, remember to start the service, you can learn how to manage the service by reading the section ",(0,o.jsx)(n.a,{href:"/docs/node/systemd-service",children:"Systemd Service"}),"."]})]})}function i(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(s,{...e})}):s(e)}},6172:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>h,default:()=>u,frontMatter:()=>a,metadata:()=>c,toc:()=>g});var o=t(5893),r=t(1151),s=t(3872),i=t(1586),l=t(5979);const a={title:"Restore the keystore",slug:"restore-the-keystore",hide_title:!0,tags:["references","help","keystore","backup","restore"]},h=void 0,c={id:"Lightning CLI/restore-keystore",title:"Restore the keystore",description:"The security of the private key is the responsibility of the user. Unfortunately, the Fleek Network team and any others are unable to help regain access to private key if lost or failed to secure them. The private keys are the user responsibility. The Fleek Network team doesn't endorse any methods of encryption and storage, the methods described here are for educational purposes only.",source:"@site/references/Lightning CLI/restore-keystore.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/restore-the-keystore",permalink:"/references/Lightning CLI/restore-the-keystore",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/restore-keystore.md",tags:[{label:"references",permalink:"/references/tags/references"},{label:"help",permalink:"/references/tags/help"},{label:"keystore",permalink:"/references/tags/keystore"},{label:"backup",permalink:"/references/tags/backup"},{label:"restore",permalink:"/references/tags/restore"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Restore the keystore",slug:"restore-the-keystore",hide_title:!0,tags:["references","help","keystore","backup","restore"]},sidebar:"defaultSidebar",previous:{title:"Permission denied (os error 13)",permalink:"/references/Lightning CLI/permission-denied-os-error-13"},next:{title:"Uninstall Lightning Node",permalink:"/references/Lightning CLI/uninstall-lightning-node"}},d={},g=[{value:"Switch user",id:"switch-user",level:2},{value:"Change directory to user home",id:"change-directory-to-user-home",level:2},{value:"Clear the config.toml",id:"clear-the-configtoml",level:2},{value:"Create a new config.toml",id:"create-a-new-configtoml",level:2},{value:"Update the config.toml with user home path",id:"update-the-configtoml-with-user-home-path",level:2},{value:"Restoring the keystore",id:"restoring-the-keystore",level:2}];function p(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.admonition,{type:"caution",children:(0,o.jsx)(n.p,{children:"The security of the private key is the responsibility of the user. Unfortunately, the Fleek Network team and any others are unable to help regain access to private key if lost or failed to secure them. The private keys are the user responsibility. The Fleek Network team doesn't endorse any methods of encryption and storage, the methods described here are for educational purposes only."})}),"\n",(0,o.jsx)(n.h2,{id:"switch-user",children:"Switch user"}),"\n",(0,o.jsxs)(n.p,{children:["Switch to the correct username you have used to install and set up the Fleek Network Lightning. For example, let's say that the username is ",(0,o.jsx)(n.code,{children:"lgtn"}),". The command you'd have to run would be:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"su lgtn\n"})}),"\n",(0,o.jsx)(n.h2,{id:"change-directory-to-user-home",children:"Change directory to user home"}),"\n",(0,o.jsxs)(n.p,{children:["Change directory to the user you have used to install and set up the Fleek Network Lightning. For example, if you have used the username ",(0,o.jsx)(n.code,{children:"lgtn"})," the command would be:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"cd $HOME\n"})}),"\n",(0,o.jsx)(n.p,{children:"In other words:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"cd /home/lgtn\n"})}),"\n",(0,o.jsx)(n.h2,{id:"clear-the-configtoml",children:"Clear the config.toml"}),"\n",(0,o.jsxs)(n.p,{children:["You should can delete, backup or move the ",(0,o.jsx)(n.code,{children:"config.toml"})," file in order to reset it."]}),"\n",(0,o.jsx)(n.p,{children:"It might be necessary to, if your configuration, e.g. is corrupted, or you want to reset it for any other reason."}),"\n",(0,o.jsx)(n.p,{children:"To move or backup, run:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"mv ~/.lightning/config.toml ~/.lightning/config.toml.backup\n"})}),"\n",(0,o.jsx)(n.p,{children:"If you don't have a use-case for the backup, delete the file. To delete, run the command:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"rm ~/.lightning/config.toml\n"})}),"\n",(0,o.jsx)(n.admonition,{title:"warning",type:"caution",children:(0,o.jsxs)(n.p,{children:["You should have switched to the correct username. If you haven't done it, when stating ",(0,o.jsx)(n.code,{children:"~"})," that will refer to the current username home, which can be anything other than the correct username! Make sure you have switched to the correct username used during the installation and set up of Fleek Network Lightning to avoid confusion and issues."]})}),"\n",(0,o.jsx)(n.h2,{id:"create-a-new-configtoml",children:"Create a new config.toml"}),"\n",(0,o.jsx)(n.p,{children:"A new configuration file can be created by running the following command:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"lgtn print-config --default > ~/.lightning/config.toml\n"})}),"\n",(0,o.jsx)(n.h2,{id:"update-the-configtoml-with-user-home-path",children:"Update the config.toml with user home path"}),"\n",(0,o.jsx)(i.ZP,{}),"\n",(0,o.jsx)(n.h2,{id:"restoring-the-keystore",children:"Restoring the keystore"}),"\n",(0,o.jsx)(l.ZP,{}),"\n",(0,o.jsxs)(n.p,{children:["For a more in depth or step-by-step instructions read the guide ",(0,o.jsx)(n.a,{href:"/guides/Node%20Operators/managing-the-keystore",children:"managing the keystore"}),"."]}),"\n",(0,o.jsx)(s.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function u(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(p,{...e})}):p(e)}},3872:(e,n,t)=>{t.d(n,{Z:()=>r});t(7294);var o=t(5893);const r=e=>{let{image:n,name:t,title:r,url:s,communityMember:i=!1}=e;return(0,o.jsx)("section",{className:"author_card",children:(0,o.jsxs)("div",{children:[(0,o.jsx)("span",{className:"avatar",children:(0,o.jsx)("a",{href:s,target:"_blank",alt:t,children:(0,o.jsx)("img",{src:n,alt:t})})}),(0,o.jsxs)("div",{children:[(0,o.jsx)("span",{className:"name",children:(0,o.jsx)("a",{href:s,target:"_blank",alt:t,children:t})}),(0,o.jsx)("span",{className:"title",children:r}),(0,o.jsxs)("span",{className:"discord",children:[i?"Join our community on":"Got questions? Find us on"," ",(0,o.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,t)=>{t.d(n,{Z:()=>l,a:()=>i});var o=t(7294);const r={},s=o.createContext(r);function i(e){const n=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),o.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[7055],{1586:(e,n,t)=>{t.d(n,{ZP:()=>i});var o=t(5893),r=t(1151);function s(e){const n={a:"a",admonition:"admonition",code:"code",p:"p",pre:"pre",strong:"strong",...(0,r.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.p,{children:["In the ",(0,o.jsx)(n.code,{children:"/home//.lightning/config.toml"})," you'll find some and more of the following:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-toml",children:'[BLANK]\n\n[application]\ndb_path = "~/.lightning/data/app_db"\n\n[consensus]\nstore_path = "~/.lightning/data/narwhal_store"\n\n[fsstore]\nroot = "~/.lightning/blockstore"\n\n[resolver]\nstore_path = "~/.lightning/data/resolver_store"\n\n[signer]\nconsensus_key_path = "~/.lightning/keystore/consensus.pem"\nnode_key_path = "~/.lightning/keystore/node.pem"\n'})}),"\n",(0,o.jsx)(n.admonition,{type:"tip",children:(0,o.jsxs)(n.p,{children:["The configuration properties and values presented above are a shorter version of what you'll find on your ",(0,o.jsx)(n.strong,{children:"configuration.toml"}),". We keep it short to make it easier to follow, do not copy and paste."]})}),"\n",(0,o.jsxs)(n.p,{children:["Find and replace all instances of ~ in the config file ",(0,o.jsx)(n.code,{children:"/home//.lightning/config.toml"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["Here's an example of how to do it using ",(0,o.jsx)(n.strong,{children:"sed"}),":"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-sh",children:'sed -i "s|~/.lightning|/home//.lightning|g" "/home//.lightning/config.toml"\n'})}),"\n",(0,o.jsx)(n.admonition,{type:"tip",children:(0,o.jsxs)(n.p,{children:["Replace the ",(0,o.jsx)(n.code,{children:""})," with your username. For example, if you have followed the recommendation to ",(0,o.jsx)(n.a,{href:"/docs/node/install#create-a-user",children:"create a user"})," it would look like ",(0,o.jsx)(n.code,{children:"/home/lgtn/.lightning/config.toml"})," for the username ",(0,o.jsx)(n.strong,{children:"lgtn"}),"."]})}),"\n",(0,o.jsxs)(n.p,{children:["For example, if your username is ",(0,o.jsx)(n.code,{children:"lgtn"})," that'd look like this:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-sh",children:'sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"\n'})}),"\n",(0,o.jsxs)(n.p,{children:["Once modified, you can run a ",(0,o.jsx)(n.code,{children:"cat"})," to see the content of the files to confirm it has been updated."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-sh",children:"cat /home/lgtn/.lightning/config.toml\n"})}),"\n",(0,o.jsxs)(n.p,{children:["For our example where we opted in for the username ",(0,o.jsx)(n.code,{children:"lgtn"})," that would look like:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-toml",children:'[BLANK]\n\n[application]\ndb_path = "~/.lightning/data/app_db"\n\n[consensus]\nstore_path = "~/.lightning/data/narwhal_store"\n\n[fsstore]\nroot = "~/.lightning/blockstore"\n\n[resolver]\nstore_path = "~/.lightning/data/resolver_store"\n\n[signer]\nconsensus_key_path = "~/.lightning/keystore/consensus.pem"\nnode_key_path = "~/.lightning/keystore/node.pem"\n'})}),"\n",(0,o.jsx)(n.admonition,{title:"Warning",type:"caution",children:(0,o.jsx)(n.p,{children:"Bear in mind that we are keeping the content of the file short to make it easier to read and follow. The content of your configuration file should look slightly different, amongst these it should contain other properties and values. You should not copy and replace the content of your files with the ones presented here."})})]})}function i(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(s,{...e})}):s(e)}},5979:(e,n,t)=>{t.d(n,{ZP:()=>i});var o=t(5893),r=t(1151);function s(e){const n={a:"a",admonition:"admonition",code:"code",li:"li",ol:"ol",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.p,{children:["You can restore the keystore (Public Keys) by copying the directory to the ",(0,o.jsx)(n.code,{children:"~/.lightning"})," directory."]}),"\n",(0,o.jsx)(n.p,{children:"Let's assume that you know where your backup directory or files are located. To keep our instructions easy to follow, let's say that:"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["The keystore and files are located under the hypothetical location ",(0,o.jsx)(n.code,{children:"/my-keystore-backup"})]}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["The files in the ",(0,o.jsx)(n.code,{children:"/my-keystore-backup"})," are the following:"]}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"/my-keystore-backup\n\u251c\u2500\u2500 consensus.pem\n\u2514\u2500\u2500 node.pem\n\n1 directory, 2 files\n"})}),"\n",(0,o.jsx)(n.p,{children:"Considering the above for our example, you would have to run the following command:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"mv /my-keystore-backup /home//.lightning/keystore\n"})}),"\n",(0,o.jsx)(n.admonition,{type:"tip",children:(0,o.jsxs)(n.p,{children:["Remember to replace the ",(0,o.jsx)(n.code,{children:""})," with the correct username for the setup. For example, if you have installed the Fleek Network with the username ",(0,o.jsx)(n.code,{children:"lgtn"})," that would be ",(0,o.jsx)(n.code,{children:"/home/lgtn/.lightning/keystore"}),"."]})}),"\n",(0,o.jsxs)(n.p,{children:["Once moved, remember to start the service, you can learn how to manage the service by reading the section ",(0,o.jsx)(n.a,{href:"/docs/node/systemd-service",children:"Systemd Service"}),"."]})]})}function i(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(s,{...e})}):s(e)}},6172:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>h,default:()=>u,frontMatter:()=>a,metadata:()=>c,toc:()=>g});var o=t(5893),r=t(1151),s=t(3872),i=t(1586),l=t(5979);const a={title:"Restore the keystore",slug:"restore-the-keystore",hide_title:!0,tags:["references","help","keystore","backup","restore"]},h=void 0,c={id:"Lightning CLI/restore-keystore",title:"Restore the keystore",description:"The security of the private key is the responsibility of the user. Unfortunately, the Fleek Network team and any others are unable to help regain access to private key if lost or failed to secure them. The private keys are the user responsibility. The Fleek Network team doesn't endorse any methods of encryption and storage, the methods described here are for educational purposes only.",source:"@site/references/Lightning CLI/restore-keystore.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/restore-the-keystore",permalink:"/references/Lightning CLI/restore-the-keystore",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/restore-keystore.md",tags:[{label:"references",permalink:"/references/tags/references"},{label:"help",permalink:"/references/tags/help"},{label:"keystore",permalink:"/references/tags/keystore"},{label:"backup",permalink:"/references/tags/backup"},{label:"restore",permalink:"/references/tags/restore"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Restore the keystore",slug:"restore-the-keystore",hide_title:!0,tags:["references","help","keystore","backup","restore"]},sidebar:"defaultSidebar",previous:{title:"Permission denied (os error 13)",permalink:"/references/Lightning CLI/permission-denied-os-error-13"},next:{title:"Uninstall Lightning Node",permalink:"/references/Lightning CLI/uninstall-lightning-node"}},d={},g=[{value:"Switch user",id:"switch-user",level:2},{value:"Change directory to user home",id:"change-directory-to-user-home",level:2},{value:"Clear the config.toml",id:"clear-the-configtoml",level:2},{value:"Create a new config.toml",id:"create-a-new-configtoml",level:2},{value:"Update the config.toml with user home path",id:"update-the-configtoml-with-user-home-path",level:2},{value:"Restoring the keystore",id:"restoring-the-keystore",level:2}];function p(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.admonition,{type:"caution",children:(0,o.jsx)(n.p,{children:"The security of the private key is the responsibility of the user. Unfortunately, the Fleek Network team and any others are unable to help regain access to private key if lost or failed to secure them. The private keys are the user responsibility. The Fleek Network team doesn't endorse any methods of encryption and storage, the methods described here are for educational purposes only."})}),"\n",(0,o.jsx)(n.h2,{id:"switch-user",children:"Switch user"}),"\n",(0,o.jsxs)(n.p,{children:["Switch to the correct username you have used to install and set up the Fleek Network Lightning. For example, let's say that the username is ",(0,o.jsx)(n.code,{children:"lgtn"}),". The command you'd have to run would be:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"su lgtn\n"})}),"\n",(0,o.jsx)(n.h2,{id:"change-directory-to-user-home",children:"Change directory to user home"}),"\n",(0,o.jsxs)(n.p,{children:["Change directory to the user you have used to install and set up the Fleek Network Lightning. For example, if you have used the username ",(0,o.jsx)(n.code,{children:"lgtn"})," the command would be:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"cd $HOME\n"})}),"\n",(0,o.jsx)(n.p,{children:"In other words:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"cd /home/lgtn\n"})}),"\n",(0,o.jsx)(n.h2,{id:"clear-the-configtoml",children:"Clear the config.toml"}),"\n",(0,o.jsxs)(n.p,{children:["You should can delete, backup or move the ",(0,o.jsx)(n.code,{children:"config.toml"})," file in order to reset it."]}),"\n",(0,o.jsx)(n.p,{children:"It might be necessary to, if your configuration, e.g. is corrupted, or you want to reset it for any other reason."}),"\n",(0,o.jsx)(n.p,{children:"To move or backup, run:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"mv ~/.lightning/config.toml ~/.lightning/config.toml.backup\n"})}),"\n",(0,o.jsx)(n.p,{children:"If you don't have a use-case for the backup, delete the file. To delete, run the command:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"rm ~/.lightning/config.toml\n"})}),"\n",(0,o.jsx)(n.admonition,{title:"warning",type:"caution",children:(0,o.jsxs)(n.p,{children:["You should have switched to the correct username. If you haven't done it, when stating ",(0,o.jsx)(n.code,{children:"~"})," that will refer to the current username home, which can be anything other than the correct username! Make sure you have switched to the correct username used during the installation and set up of Fleek Network Lightning to avoid confusion and issues."]})}),"\n",(0,o.jsx)(n.h2,{id:"create-a-new-configtoml",children:"Create a new config.toml"}),"\n",(0,o.jsx)(n.p,{children:"A new configuration file can be created by running the following command:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"lgtn print-config --default > ~/.lightning/config.toml\n"})}),"\n",(0,o.jsx)(n.h2,{id:"update-the-configtoml-with-user-home-path",children:"Update the config.toml with user home path"}),"\n",(0,o.jsx)(i.ZP,{}),"\n",(0,o.jsx)(n.h2,{id:"restoring-the-keystore",children:"Restoring the keystore"}),"\n",(0,o.jsx)(l.ZP,{}),"\n",(0,o.jsxs)(n.p,{children:["For a more in depth or step-by-step instructions read the guide ",(0,o.jsx)(n.a,{href:"/guides/Node%20Operators/managing-the-keystore",children:"managing the keystore"}),"."]}),"\n",(0,o.jsx)(s.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function u(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(p,{...e})}):p(e)}},3872:(e,n,t)=>{t.d(n,{Z:()=>r});t(7294);var o=t(5893);const r=e=>{let{image:n,name:t,title:r,url:s,communityMember:i=!1}=e;return(0,o.jsx)("section",{className:"author_card",children:(0,o.jsxs)("div",{children:[(0,o.jsx)("span",{className:"avatar",children:(0,o.jsx)("a",{href:s,target:"_blank",alt:t,children:(0,o.jsx)("img",{src:n,alt:t})})}),(0,o.jsxs)("div",{children:[(0,o.jsx)("span",{className:"name",children:(0,o.jsx)("a",{href:s,target:"_blank",alt:t,children:t})}),(0,o.jsx)("span",{className:"title",children:r}),(0,o.jsxs)("span",{className:"discord",children:[i?"Join our community on":"Got questions? Find us on"," ",(0,o.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,t)=>{t.d(n,{Z:()=>l,a:()=>i});var o=t(7294);const r={},s=o.createContext(r);function i(e){const n=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),o.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/2730e145.8d0f5101.js b/assets/js/2730e145.bb1da416.js similarity index 99% rename from assets/js/2730e145.8d0f5101.js rename to assets/js/2730e145.bb1da416.js index d42562105..3fae59ae0 100644 --- a/assets/js/2730e145.8d0f5101.js +++ b/assets/js/2730e145.bb1da416.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[7147],{5450:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>m,frontMatter:()=>o,metadata:()=>d,toc:()=>l});var r=i(5893),s=i(1151),t=i(3872);const o={title:"Permission denied (os error 13)",slug:"permission-denied-os-error-13",hide_title:!0,tags:["permissions"]},a=void 0,d={id:"Lightning CLI/permission-denied-os-error-13",title:"Permission denied (os error 13)",description:"Ownership and file permissions",source:"@site/references/Lightning CLI/permission-denied-os-error-13.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/permission-denied-os-error-13",permalink:"/references/Lightning CLI/permission-denied-os-error-13",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/permission-denied-os-error-13.md",tags:[{label:"permissions",permalink:"/references/tags/permissions"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Permission denied (os error 13)",slug:"permission-denied-os-error-13",hide_title:!0,tags:["permissions"]},sidebar:"defaultSidebar",previous:{title:"Node secret key does not exist",permalink:"/references/Lightning CLI/node-secret-key-does-not-exist"},next:{title:"Restore the keystore",permalink:"/references/Lightning CLI/restore-the-keystore"}},c={},l=[{value:"Ownership and file permissions",id:"ownership-and-file-permissions",level:2},{value:"Override the TMPDIR",id:"override-the-tmpdir",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h2,{id:"ownership-and-file-permissions",children:"Ownership and file permissions"}),"\n",(0,r.jsxs)(n.p,{children:["When running the Lightning CLI, the user who's in control can delegate to ",(0,r.jsx)(n.strong,{children:"root"})," via ",(0,r.jsx)(n.strong,{children:"sudo"}),". Depending on how the Fleek Networking Lightning CLI was installed, this might cause some confusion, which is better explained by reading the reference ",(0,r.jsx)(n.a,{href:"/references/Lightning%20CLI/keys-not-found",children:"Keys not found"}),", which illustrates a situation where a user gets an error message about the wrong location of a system path (keystore)."]}),"\n",(0,r.jsxs)(n.p,{children:["Some reasons why the ",(0,r.jsx)(n.code,{children:"Permission denied (os error 13)"})," might occur are related to:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["The Fleek Network Lightning CLI process trying to write to a ",(0,r.jsx)(n.code,{children:".lightning"})," stored in a non permitted location"]}),"\n",(0,r.jsxs)(n.li,{children:["The Fleek Network Lightning CLI process trying to write to ",(0,r.jsx)(n.code,{children:"/tmp"})]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["The most common issue can be fixed by reading the section ",(0,r.jsx)(n.a,{href:"#override-the-tmpdir",children:"Override the TMPDIR"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"override-the-tmpdir",children:"Override the TMPDIR"}),"\n",(0,r.jsx)(n.p,{children:"The Fleek Network Lightning process requires writing to a temporary directory. As the process requires permissions, this might fail as demonstrated by some of the output logs we have below."}),"\n",(0,r.jsx)(n.p,{children:"a) A permission denied error message"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"Permission denied (os error 13)\n"})}),"\n",(0,r.jsx)(n.p,{children:"b) Rust panic error message which includes a permission denied"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 13, kind: PermissionDenied, message: \"Permission denied\" }', core/node/src/cli.rs:181:18\nnote: run with RUST_BACKTRACE=1 environment variable to display a backtrace\nthread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 13, kind: PermissionDenied, message: \"Permission denied\" }', core/node/src/cli.rs:181:18\nnote: run with RUST_BACKTRACE=1 environment variable to display a backtrace\nthread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 13, kind: PermissionDenied, message: \"Permission denied\" }', core/node/src/cli.rs:181:18\nnote: run with RUST_BACKTRACE=1 environment variable to display a backtrace\nthread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 13, kind: PermissionDenied, message: \"Permission denied\" }', core/node/src/cli.rs:181:18\nnote: run with RUST_BACKTRACE=1 environment variable to display a backtrace\nthread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 13, kind: PermissionDenied, message: \"Permission denied\" }', core/node/src/cli.rs:181:18\nnote: run with RUST_BACKTRACE=1 environment variable to display a backtrace\n"})}),"\n",(0,r.jsx)(n.p,{children:"c) A trace showing the path where this has failed"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:'[00007fcbe168e764] openat(AT_FDCWD, "/tmp/lightning.log", O_WRONLY|O_CREAT|O_APPEND|O_CLOEXEC, 0666) = -1 EACCES (Permission denied)\n[00007fcbe168ea6f] write(2, "thread \'", 8thread \') = 8\n[00007fcbe168ea6f] write(2, "main", 4main) = 4\n[00007fcbe168ea6f] write(2, "\' panicked at \'", 15\' panicked at \') = 15\n[00007fcbe168ea6f] write(2, "called `Result::unwrap()` on an "..., 114called `Result::unwrap()` on an `Err` value: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }) = 114\n[00007fcbe168ea6f] write(2, "\', ", 3\', ) = 3\n'})}),"\n",(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"/tmp"})," directory should have wide permissions for all applications, but to mitigate any permission issues the user can override the system environment ",(0,r.jsx)(n.code,{children:"TMPDIR"}),". For example, the ",(0,r.jsx)(n.code,{children:"installer"})," and ",(0,r.jsx)(n.code,{children:"update"})," scripts override ",(0,r.jsx)(n.code,{children:"TMPDIR"})," environment variable to ",(0,r.jsx)(n.code,{children:"/var/tmp"})," setting it in the service unit ",(0,r.jsx)(n.code,{children:"Environment="}),"."]})}),"\n",(0,r.jsxs)(n.p,{children:["The Lightning CLI process is aware of the environment variable TMPDIR, which the operators can override as discussed in the reference for ",(0,r.jsx)(n.a,{href:"/references/Lightning%20CLI/update-cli-from-source-code/#update-the-systemd-service-unit",children:"Update the System service unit"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["In short, it requires you to include a ",(0,r.jsx)(n.code,{children:"Environment="})," value of ",(0,r.jsx)(n.code,{children:"TMPDIR=/var/tmp"})," as follows:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"[Service]\n...\nStandardOutput=append:/var/log/lightning/output.log\nStandardError=append:/var/log/lightning/diagnostic.log\nEnvironment=TMPDIR=/var/tmp\n"})}),"\n",(0,r.jsx)(n.admonition,{title:"attention",type:"caution",children:(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"/etc/systemd/system/lightning.service"})," service unit file presented here is a shorter version for simplicity. Do not replace your service unit file with the shorter content version presented here."]})}),"\n",(0,r.jsx)(t.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function m(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},3872:(e,n,i)=>{i.d(n,{Z:()=>s});i(7294);var r=i(5893);const s=e=>{let{image:n,name:i,title:s,url:t,communityMember:o=!1}=e;return(0,r.jsx)("section",{className:"author_card",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"avatar",children:(0,r.jsx)("a",{href:t,target:"_blank",alt:i,children:(0,r.jsx)("img",{src:n,alt:i})})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"name",children:(0,r.jsx)("a",{href:t,target:"_blank",alt:i,children:i})}),(0,r.jsx)("span",{className:"title",children:s}),(0,r.jsxs)("span",{className:"discord",children:[o?"Join our community on":"Got questions? Find us on"," ",(0,r.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,i)=>{i.d(n,{Z:()=>a,a:()=>o});var r=i(7294);const s={},t=r.createContext(s);function o(e){const n=r.useContext(t);return r.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(s):e.components||s:o(e.components),r.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[7147],{5450:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>m,frontMatter:()=>o,metadata:()=>d,toc:()=>l});var r=i(5893),s=i(1151),t=i(3872);const o={title:"Permission denied (os error 13)",slug:"permission-denied-os-error-13",hide_title:!0,tags:["permissions"]},a=void 0,d={id:"Lightning CLI/permission-denied-os-error-13",title:"Permission denied (os error 13)",description:"Ownership and file permissions",source:"@site/references/Lightning CLI/permission-denied-os-error-13.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/permission-denied-os-error-13",permalink:"/references/Lightning CLI/permission-denied-os-error-13",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/permission-denied-os-error-13.md",tags:[{label:"permissions",permalink:"/references/tags/permissions"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Permission denied (os error 13)",slug:"permission-denied-os-error-13",hide_title:!0,tags:["permissions"]},sidebar:"defaultSidebar",previous:{title:"Node secret key does not exist",permalink:"/references/Lightning CLI/node-secret-key-does-not-exist"},next:{title:"Restore the keystore",permalink:"/references/Lightning CLI/restore-the-keystore"}},c={},l=[{value:"Ownership and file permissions",id:"ownership-and-file-permissions",level:2},{value:"Override the TMPDIR",id:"override-the-tmpdir",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h2,{id:"ownership-and-file-permissions",children:"Ownership and file permissions"}),"\n",(0,r.jsxs)(n.p,{children:["When running the Lightning CLI, the user who's in control can delegate to ",(0,r.jsx)(n.strong,{children:"root"})," via ",(0,r.jsx)(n.strong,{children:"sudo"}),". Depending on how the Fleek Networking Lightning CLI was installed, this might cause some confusion, which is better explained by reading the reference ",(0,r.jsx)(n.a,{href:"/references/Lightning%20CLI/keys-not-found",children:"Keys not found"}),", which illustrates a situation where a user gets an error message about the wrong location of a system path (keystore)."]}),"\n",(0,r.jsxs)(n.p,{children:["Some reasons why the ",(0,r.jsx)(n.code,{children:"Permission denied (os error 13)"})," might occur are related to:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["The Fleek Network Lightning CLI process trying to write to a ",(0,r.jsx)(n.code,{children:".lightning"})," stored in a non permitted location"]}),"\n",(0,r.jsxs)(n.li,{children:["The Fleek Network Lightning CLI process trying to write to ",(0,r.jsx)(n.code,{children:"/tmp"})]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["The most common issue can be fixed by reading the section ",(0,r.jsx)(n.a,{href:"#override-the-tmpdir",children:"Override the TMPDIR"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"override-the-tmpdir",children:"Override the TMPDIR"}),"\n",(0,r.jsx)(n.p,{children:"The Fleek Network Lightning process requires writing to a temporary directory. As the process requires permissions, this might fail as demonstrated by some of the output logs we have below."}),"\n",(0,r.jsx)(n.p,{children:"a) A permission denied error message"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"Permission denied (os error 13)\n"})}),"\n",(0,r.jsx)(n.p,{children:"b) Rust panic error message which includes a permission denied"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 13, kind: PermissionDenied, message: \"Permission denied\" }', core/node/src/cli.rs:181:18\nnote: run with RUST_BACKTRACE=1 environment variable to display a backtrace\nthread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 13, kind: PermissionDenied, message: \"Permission denied\" }', core/node/src/cli.rs:181:18\nnote: run with RUST_BACKTRACE=1 environment variable to display a backtrace\nthread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 13, kind: PermissionDenied, message: \"Permission denied\" }', core/node/src/cli.rs:181:18\nnote: run with RUST_BACKTRACE=1 environment variable to display a backtrace\nthread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 13, kind: PermissionDenied, message: \"Permission denied\" }', core/node/src/cli.rs:181:18\nnote: run with RUST_BACKTRACE=1 environment variable to display a backtrace\nthread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 13, kind: PermissionDenied, message: \"Permission denied\" }', core/node/src/cli.rs:181:18\nnote: run with RUST_BACKTRACE=1 environment variable to display a backtrace\n"})}),"\n",(0,r.jsx)(n.p,{children:"c) A trace showing the path where this has failed"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:'[00007fcbe168e764] openat(AT_FDCWD, "/tmp/lightning.log", O_WRONLY|O_CREAT|O_APPEND|O_CLOEXEC, 0666) = -1 EACCES (Permission denied)\n[00007fcbe168ea6f] write(2, "thread \'", 8thread \') = 8\n[00007fcbe168ea6f] write(2, "main", 4main) = 4\n[00007fcbe168ea6f] write(2, "\' panicked at \'", 15\' panicked at \') = 15\n[00007fcbe168ea6f] write(2, "called `Result::unwrap()` on an "..., 114called `Result::unwrap()` on an `Err` value: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }) = 114\n[00007fcbe168ea6f] write(2, "\', ", 3\', ) = 3\n'})}),"\n",(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"/tmp"})," directory should have wide permissions for all applications, but to mitigate any permission issues the user can override the system environment ",(0,r.jsx)(n.code,{children:"TMPDIR"}),". For example, the ",(0,r.jsx)(n.code,{children:"installer"})," and ",(0,r.jsx)(n.code,{children:"update"})," scripts override ",(0,r.jsx)(n.code,{children:"TMPDIR"})," environment variable to ",(0,r.jsx)(n.code,{children:"/var/tmp"})," setting it in the service unit ",(0,r.jsx)(n.code,{children:"Environment="}),"."]})}),"\n",(0,r.jsxs)(n.p,{children:["The Lightning CLI process is aware of the environment variable TMPDIR, which the operators can override as discussed in the reference for ",(0,r.jsx)(n.a,{href:"/references/Lightning%20CLI/update-cli-from-source-code/#update-the-systemd-service-unit",children:"Update the System service unit"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["In short, it requires you to include a ",(0,r.jsx)(n.code,{children:"Environment="})," value of ",(0,r.jsx)(n.code,{children:"TMPDIR=/var/tmp"})," as follows:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"[Service]\n...\nStandardOutput=append:/var/log/lightning/output.log\nStandardError=append:/var/log/lightning/diagnostic.log\nEnvironment=TMPDIR=/var/tmp\n"})}),"\n",(0,r.jsx)(n.admonition,{title:"attention",type:"caution",children:(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"/etc/systemd/system/lightning.service"})," service unit file presented here is a shorter version for simplicity. Do not replace your service unit file with the shorter content version presented here."]})}),"\n",(0,r.jsx)(t.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function m(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},3872:(e,n,i)=>{i.d(n,{Z:()=>s});i(7294);var r=i(5893);const s=e=>{let{image:n,name:i,title:s,url:t,communityMember:o=!1}=e;return(0,r.jsx)("section",{className:"author_card",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"avatar",children:(0,r.jsx)("a",{href:t,target:"_blank",alt:i,children:(0,r.jsx)("img",{src:n,alt:i})})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"name",children:(0,r.jsx)("a",{href:t,target:"_blank",alt:i,children:i})}),(0,r.jsx)("span",{className:"title",children:s}),(0,r.jsxs)("span",{className:"discord",children:[o?"Join our community on":"Got questions? Find us on"," ",(0,r.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,i)=>{i.d(n,{Z:()=>a,a:()=>o});var r=i(7294);const s={},t=r.createContext(s);function o(e){const n=r.useContext(t);return r.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(s):e.components||s:o(e.components),r.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/29b62a39.9656dae3.js b/assets/js/29b62a39.0506449b.js similarity index 97% rename from assets/js/29b62a39.9656dae3.js rename to assets/js/29b62a39.0506449b.js index 5e0e1f377..d6c5dbf19 100644 --- a/assets/js/29b62a39.9656dae3.js +++ b/assets/js/29b62a39.0506449b.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[1498],{181:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>r,default:()=>p,frontMatter:()=>a,metadata:()=>d,toc:()=>u});var n=s(5893),i=s(1151);const o=s.p+"assets/images/banner-guides-cd76f6e8aac3594bb5d072a564e0e277.png",a={title:"About guides",hide_title:!0,sidebar_position:1,tags:["Guides","Help","Fleek Network"]},r=void 0,d={id:"index",title:"About guides",description:"The guides provide step-by-step instructions and descriptions to help understand how and why you'd have to do or execute certain commands or processes.",source:"@site/guides/index.md",sourceDirName:".",slug:"/",permalink:"/guides/",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/guides/index.md",tags:[{label:"Guides",permalink:"/guides/tags/guides"},{label:"Help",permalink:"/guides/tags/help"},{label:"Fleek Network",permalink:"/guides/tags/fleek-network"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",sidebarPosition:1,frontMatter:{title:"About guides",hide_title:!0,sidebar_position:1,tags:["Guides","Help","Fleek Network"]},sidebar:"defaultSidebar",next:{title:"Getting Started",permalink:"/guides/Node Operators/getting-started"}},c={},u=[];function l(e){const t={a:"a",p:"p",...(0,i.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("img",{className:"banner",src:o}),"\n",(0,n.jsx)(t.p,{children:"The guides provide step-by-step instructions and descriptions to help understand how and why you'd have to do or execute certain commands or processes."}),"\n",(0,n.jsxs)(t.p,{children:["It differs from the ",(0,n.jsx)(t.a,{href:"/references",children:"references"})," documentation which serves as a quick direct breakdown of commands and processes without much explanation, as the name implies."]}),"\n",(0,n.jsx)(t.p,{children:"To start, find guides by consulting the available categories to locate the content on the sidebar. Our guides are also available as a result when using the search feature located at the very top of the documentation site."})]})}function p(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(l,{...e})}):l(e)}},1151:(e,t,s)=>{s.d(t,{Z:()=>r,a:()=>a});var n=s(7294);const i={},o=n.createContext(i);function a(e){const t=n.useContext(o);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),n.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[1498],{181:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>r,default:()=>p,frontMatter:()=>a,metadata:()=>d,toc:()=>u});var n=s(5893),i=s(1151);const o=s.p+"assets/images/banner-guides-cd76f6e8aac3594bb5d072a564e0e277.png",a={title:"About guides",hide_title:!0,sidebar_position:1,tags:["Guides","Help","Fleek Network"]},r=void 0,d={id:"index",title:"About guides",description:"The guides provide step-by-step instructions and descriptions to help understand how and why you'd have to do or execute certain commands or processes.",source:"@site/guides/index.md",sourceDirName:".",slug:"/",permalink:"/guides/",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/guides/index.md",tags:[{label:"Guides",permalink:"/guides/tags/guides"},{label:"Help",permalink:"/guides/tags/help"},{label:"Fleek Network",permalink:"/guides/tags/fleek-network"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",sidebarPosition:1,frontMatter:{title:"About guides",hide_title:!0,sidebar_position:1,tags:["Guides","Help","Fleek Network"]},sidebar:"defaultSidebar",next:{title:"Getting Started",permalink:"/guides/Node Operators/getting-started"}},c={},u=[];function l(e){const t={a:"a",p:"p",...(0,i.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("img",{className:"banner",src:o}),"\n",(0,n.jsx)(t.p,{children:"The guides provide step-by-step instructions and descriptions to help understand how and why you'd have to do or execute certain commands or processes."}),"\n",(0,n.jsxs)(t.p,{children:["It differs from the ",(0,n.jsx)(t.a,{href:"/references",children:"references"})," documentation which serves as a quick direct breakdown of commands and processes without much explanation, as the name implies."]}),"\n",(0,n.jsx)(t.p,{children:"To start, find guides by consulting the available categories to locate the content on the sidebar. Our guides are also available as a result when using the search feature located at the very top of the documentation site."})]})}function p(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(l,{...e})}):l(e)}},1151:(e,t,s)=>{s.d(t,{Z:()=>r,a:()=>a});var n=s(7294);const i={},o=n.createContext(i);function a(e){const t=n.useContext(o);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),n.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/29b83576.206a0fc3.js b/assets/js/29b83576.5c190c9d.js similarity index 99% rename from assets/js/29b83576.206a0fc3.js rename to assets/js/29b83576.5c190c9d.js index d907bca0f..78faa6338 100644 --- a/assets/js/29b83576.206a0fc3.js +++ b/assets/js/29b83576.5c190c9d.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[1510],{7003:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>g,frontMatter:()=>o,metadata:()=>l,toc:()=>h});var r=t(5893),s=t(1151),i=t(3872);const o={title:"Backing up the keystore",slug:"backing-up-the-keystore",hide_title:!0,tags:["references","help","keystore","backup","restore"]},a=void 0,l={id:"Lightning CLI/keystore-backup",title:"Backing up the keystore",description:"The security of the private key is the responsibility of the user. Unfortunately, the Fleek Network team and any others are unable to help regain access to private key if lost or failed to secure them. The private keys are the user responsibility. The Fleek Network team doesn't endorse any methods of encryption and storage, the methods described here are for educational purposes only.",source:"@site/references/Lightning CLI/keystore-backup.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/backing-up-the-keystore",permalink:"/references/Lightning CLI/backing-up-the-keystore",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/keystore-backup.md",tags:[{label:"references",permalink:"/references/tags/references"},{label:"help",permalink:"/references/tags/help"},{label:"keystore",permalink:"/references/tags/keystore"},{label:"backup",permalink:"/references/tags/backup"},{label:"restore",permalink:"/references/tags/restore"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Backing up the keystore",slug:"backing-up-the-keystore",hide_title:!0,tags:["references","help","keystore","backup","restore"]},sidebar:"defaultSidebar",previous:{title:"Keys not found",permalink:"/references/Lightning CLI/keys-not-found"},next:{title:"Node secret key does not exist",permalink:"/references/Lightning CLI/node-secret-key-does-not-exist"}},c={},h=[{value:"Keystore pathname",id:"keystore-pathname",level:2},{value:"Configuration file settings",id:"configuration-file-settings",level:2},{value:"Loading the configuration file on runtime",id:"loading-the-configuration-file-on-runtime",level:2},{value:"Low security backup",id:"low-security-backup",level:2},{value:"Higher security",id:"higher-security",level:2}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,s.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.admonition,{type:"caution",children:(0,r.jsx)(n.p,{children:"The security of the private key is the responsibility of the user. Unfortunately, the Fleek Network team and any others are unable to help regain access to private key if lost or failed to secure them. The private keys are the user responsibility. The Fleek Network team doesn't endorse any methods of encryption and storage, the methods described here are for educational purposes only."})}),"\n",(0,r.jsx)(n.h2,{id:"keystore-pathname",children:"Keystore pathname"}),"\n",(0,r.jsxs)(n.p,{children:["The default location for the keystore is in the user home. The $HOME or ",(0,r.jsx)(n.code,{children:"~"})," refers to the user home, as such consider the logged-in username."]}),"\n",(0,r.jsx)(n.p,{children:"To Check the user you are logged in with:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"whoami\n"})}),"\n",(0,r.jsx)(n.p,{children:"The default location for the keystore is:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"$HOME/.lightning/keystore\n"})}),"\n",(0,r.jsx)(n.h2,{id:"configuration-file-settings",children:"Configuration file settings"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"config.toml"})," should have some and more of the following properties and values that are used to locate crucial files, such as the consensus and node keys of the keystore."]}),"\n",(0,r.jsxs)(n.p,{children:["Here's an incomplete example of how the ",(0,r.jsx)(n.code,{children:"config.toml"})," looks like:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:'[BLANK]\n...\n\n[application]\ndb_path = "~/.lightning/data/app_db"\n...\n\n[consensus]\nstore_path = "~/.lightning/data/narwhal_store"\n...\n\n[fsstore]\nroot = "~/.lightning/blockstore"\n...\n\n[resolver]\nstore_path = "~/.lightning/data/resolver_store"\n...\n\n[signer]\nconsensus_key_path = "~/.lightning/keystore/consensus.pem"\nnode_key_path = "~/.lightning/keystore/node.pem"\n...\n'})}),"\n",(0,r.jsxs)(n.p,{children:["If you've followed the installation recommendations, it's very likely that you'll have the username path defined at the base of the pathnames declared in the properties, such as the following except instead of ",(0,r.jsx)(n.code,{children:""})," you'll have your username:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:'[signer]\nconsensus_key_path = "/home//.lightning/keystore/consensus.pem"\nnode_key_path = "/home//.lightning/keystore/node.pem"\n'})}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"config.toml"})," if loaded on Lightning node process runtime, will pick the desired paths declared in the file."]}),"\n",(0,r.jsx)(n.h2,{id:"loading-the-configuration-file-on-runtime",children:"Loading the configuration file on runtime"}),"\n",(0,r.jsxs)(n.p,{children:["Use the configuration flag ",(0,r.jsx)(n.code,{children:"-c"})," to pass the configuration ",(0,r.jsx)(n.code,{children:"config.toml"})," path:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"lgtn -c /home//.lightning/config.toml run\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Replace the ",(0,r.jsx)(n.code,{children:""})," with the correct username, where the config is located."]}),"\n",(0,r.jsxs)(n.p,{children:["Executing the subcommand ",(0,r.jsx)(n.code,{children:"run"})," without the configuration flag ",(0,r.jsx)(n.code,{children:"-c"}),", doesn't mean that it'll locate the desired ",(0,r.jsx)(n.code,{children:"config.toml"}),", as it'll default to ",(0,r.jsx)(n.code,{children:"$HOME/.lightning/config.toml"}),", e.g. if you were logged in with ",(0,r.jsx)(n.strong,{children:"root"}),", that'd be ",(0,r.jsx)(n.code,{children:"/root/.lightning/config.toml"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"low-security-backup",children:"Low security backup"}),"\n",(0,r.jsxs)(n.p,{children:["To zip and encrypt the ",(0,r.jsx)(n.code,{children:"$HOME/.lightning/keystore"})," directory run:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"# It'll prompt for password (remember)\nzip --encrypt -r keystore.zip.enc $HOME/.lightning/keystore\n"})}),"\n",(0,r.jsxs)(n.p,{children:["To unzip and decrypt the ",(0,r.jsx)(n.code,{children:"keystore.zip.enc"}),", you'd run:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"# It'll prompt for password (recall)\nunzip keystore.zip.enc -d $HOME/.lightning/keystore\n"})}),"\n",(0,r.jsx)(n.h2,{id:"higher-security",children:"Higher security"}),"\n",(0,r.jsxs)(n.p,{children:["Create a ",(0,r.jsx)(n.code,{children:"tarbar"})," by executing:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:'tar -cf "keystore.tar" $HOME/.lightning/keystore\n'})}),"\n",(0,r.jsx)(n.p,{children:"The encryption command is:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"sudo gpg -a --symmetric --cipher-algo AES256 keystore.tar\n"})}),"\n",(0,r.jsxs)(n.p,{children:["To decrypt the ",(0,r.jsx)(n.code,{children:"keystore.tar.asc"})," file, enter:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"sudo gpg -a --output keystore.tar --decrypt keystore.tar.asc\n"})}),"\n",(0,r.jsx)(n.p,{children:"Create a temporary directory to extract the tar archive with the original full pathname."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"mkdir $HOME/tar_keystore_extract\n"})}),"\n",(0,r.jsx)(n.p,{children:"Now, run the command to extract to the target directory, as follows:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"tar -xf keystore.tar -C $HOME/tar_keystore_extract\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Locate the extracted files in ",(0,r.jsx)(n.code,{children:"$HOME/tar_keystore_extract"}),", which should look like ",(0,r.jsx)(n.code,{children:"$HOME/tar_keystore/home//.lightning/keystore"})]}),"\n",(0,r.jsxs)(n.p,{children:["For a more in depth or step-by-step instructions read the guide ",(0,r.jsx)(n.a,{href:"/guides/Node%20Operators/managing-the-keystore",children:"managing the keystore"}),"."]}),"\n",(0,r.jsx)(i.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function g(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},3872:(e,n,t)=>{t.d(n,{Z:()=>s});t(7294);var r=t(5893);const s=e=>{let{image:n,name:t,title:s,url:i,communityMember:o=!1}=e;return(0,r.jsx)("section",{className:"author_card",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"avatar",children:(0,r.jsx)("a",{href:i,target:"_blank",alt:t,children:(0,r.jsx)("img",{src:n,alt:t})})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"name",children:(0,r.jsx)("a",{href:i,target:"_blank",alt:t,children:t})}),(0,r.jsx)("span",{className:"title",children:s}),(0,r.jsxs)("span",{className:"discord",children:[o?"Join our community on":"Got questions? Find us on"," ",(0,r.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>o});var r=t(7294);const s={},i=r.createContext(s);function o(e){const n=r.useContext(i);return r.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(s):e.components||s:o(e.components),r.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[1510],{7003:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>g,frontMatter:()=>o,metadata:()=>l,toc:()=>h});var r=t(5893),s=t(1151),i=t(3872);const o={title:"Backing up the keystore",slug:"backing-up-the-keystore",hide_title:!0,tags:["references","help","keystore","backup","restore"]},a=void 0,l={id:"Lightning CLI/keystore-backup",title:"Backing up the keystore",description:"The security of the private key is the responsibility of the user. Unfortunately, the Fleek Network team and any others are unable to help regain access to private key if lost or failed to secure them. The private keys are the user responsibility. The Fleek Network team doesn't endorse any methods of encryption and storage, the methods described here are for educational purposes only.",source:"@site/references/Lightning CLI/keystore-backup.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/backing-up-the-keystore",permalink:"/references/Lightning CLI/backing-up-the-keystore",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/keystore-backup.md",tags:[{label:"references",permalink:"/references/tags/references"},{label:"help",permalink:"/references/tags/help"},{label:"keystore",permalink:"/references/tags/keystore"},{label:"backup",permalink:"/references/tags/backup"},{label:"restore",permalink:"/references/tags/restore"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Backing up the keystore",slug:"backing-up-the-keystore",hide_title:!0,tags:["references","help","keystore","backup","restore"]},sidebar:"defaultSidebar",previous:{title:"Keys not found",permalink:"/references/Lightning CLI/keys-not-found"},next:{title:"Node secret key does not exist",permalink:"/references/Lightning CLI/node-secret-key-does-not-exist"}},c={},h=[{value:"Keystore pathname",id:"keystore-pathname",level:2},{value:"Configuration file settings",id:"configuration-file-settings",level:2},{value:"Loading the configuration file on runtime",id:"loading-the-configuration-file-on-runtime",level:2},{value:"Low security backup",id:"low-security-backup",level:2},{value:"Higher security",id:"higher-security",level:2}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,s.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.admonition,{type:"caution",children:(0,r.jsx)(n.p,{children:"The security of the private key is the responsibility of the user. Unfortunately, the Fleek Network team and any others are unable to help regain access to private key if lost or failed to secure them. The private keys are the user responsibility. The Fleek Network team doesn't endorse any methods of encryption and storage, the methods described here are for educational purposes only."})}),"\n",(0,r.jsx)(n.h2,{id:"keystore-pathname",children:"Keystore pathname"}),"\n",(0,r.jsxs)(n.p,{children:["The default location for the keystore is in the user home. The $HOME or ",(0,r.jsx)(n.code,{children:"~"})," refers to the user home, as such consider the logged-in username."]}),"\n",(0,r.jsx)(n.p,{children:"To Check the user you are logged in with:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"whoami\n"})}),"\n",(0,r.jsx)(n.p,{children:"The default location for the keystore is:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"$HOME/.lightning/keystore\n"})}),"\n",(0,r.jsx)(n.h2,{id:"configuration-file-settings",children:"Configuration file settings"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"config.toml"})," should have some and more of the following properties and values that are used to locate crucial files, such as the consensus and node keys of the keystore."]}),"\n",(0,r.jsxs)(n.p,{children:["Here's an incomplete example of how the ",(0,r.jsx)(n.code,{children:"config.toml"})," looks like:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:'[BLANK]\n...\n\n[application]\ndb_path = "~/.lightning/data/app_db"\n...\n\n[consensus]\nstore_path = "~/.lightning/data/narwhal_store"\n...\n\n[fsstore]\nroot = "~/.lightning/blockstore"\n...\n\n[resolver]\nstore_path = "~/.lightning/data/resolver_store"\n...\n\n[signer]\nconsensus_key_path = "~/.lightning/keystore/consensus.pem"\nnode_key_path = "~/.lightning/keystore/node.pem"\n...\n'})}),"\n",(0,r.jsxs)(n.p,{children:["If you've followed the installation recommendations, it's very likely that you'll have the username path defined at the base of the pathnames declared in the properties, such as the following except instead of ",(0,r.jsx)(n.code,{children:""})," you'll have your username:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:'[signer]\nconsensus_key_path = "/home//.lightning/keystore/consensus.pem"\nnode_key_path = "/home//.lightning/keystore/node.pem"\n'})}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"config.toml"})," if loaded on Lightning node process runtime, will pick the desired paths declared in the file."]}),"\n",(0,r.jsx)(n.h2,{id:"loading-the-configuration-file-on-runtime",children:"Loading the configuration file on runtime"}),"\n",(0,r.jsxs)(n.p,{children:["Use the configuration flag ",(0,r.jsx)(n.code,{children:"-c"})," to pass the configuration ",(0,r.jsx)(n.code,{children:"config.toml"})," path:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"lgtn -c /home//.lightning/config.toml run\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Replace the ",(0,r.jsx)(n.code,{children:""})," with the correct username, where the config is located."]}),"\n",(0,r.jsxs)(n.p,{children:["Executing the subcommand ",(0,r.jsx)(n.code,{children:"run"})," without the configuration flag ",(0,r.jsx)(n.code,{children:"-c"}),", doesn't mean that it'll locate the desired ",(0,r.jsx)(n.code,{children:"config.toml"}),", as it'll default to ",(0,r.jsx)(n.code,{children:"$HOME/.lightning/config.toml"}),", e.g. if you were logged in with ",(0,r.jsx)(n.strong,{children:"root"}),", that'd be ",(0,r.jsx)(n.code,{children:"/root/.lightning/config.toml"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"low-security-backup",children:"Low security backup"}),"\n",(0,r.jsxs)(n.p,{children:["To zip and encrypt the ",(0,r.jsx)(n.code,{children:"$HOME/.lightning/keystore"})," directory run:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"# It'll prompt for password (remember)\nzip --encrypt -r keystore.zip.enc $HOME/.lightning/keystore\n"})}),"\n",(0,r.jsxs)(n.p,{children:["To unzip and decrypt the ",(0,r.jsx)(n.code,{children:"keystore.zip.enc"}),", you'd run:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"# It'll prompt for password (recall)\nunzip keystore.zip.enc -d $HOME/.lightning/keystore\n"})}),"\n",(0,r.jsx)(n.h2,{id:"higher-security",children:"Higher security"}),"\n",(0,r.jsxs)(n.p,{children:["Create a ",(0,r.jsx)(n.code,{children:"tarbar"})," by executing:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:'tar -cf "keystore.tar" $HOME/.lightning/keystore\n'})}),"\n",(0,r.jsx)(n.p,{children:"The encryption command is:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"sudo gpg -a --symmetric --cipher-algo AES256 keystore.tar\n"})}),"\n",(0,r.jsxs)(n.p,{children:["To decrypt the ",(0,r.jsx)(n.code,{children:"keystore.tar.asc"})," file, enter:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"sudo gpg -a --output keystore.tar --decrypt keystore.tar.asc\n"})}),"\n",(0,r.jsx)(n.p,{children:"Create a temporary directory to extract the tar archive with the original full pathname."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"mkdir $HOME/tar_keystore_extract\n"})}),"\n",(0,r.jsx)(n.p,{children:"Now, run the command to extract to the target directory, as follows:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"tar -xf keystore.tar -C $HOME/tar_keystore_extract\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Locate the extracted files in ",(0,r.jsx)(n.code,{children:"$HOME/tar_keystore_extract"}),", which should look like ",(0,r.jsx)(n.code,{children:"$HOME/tar_keystore/home//.lightning/keystore"})]}),"\n",(0,r.jsxs)(n.p,{children:["For a more in depth or step-by-step instructions read the guide ",(0,r.jsx)(n.a,{href:"/guides/Node%20Operators/managing-the-keystore",children:"managing the keystore"}),"."]}),"\n",(0,r.jsx)(i.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function g(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},3872:(e,n,t)=>{t.d(n,{Z:()=>s});t(7294);var r=t(5893);const s=e=>{let{image:n,name:t,title:s,url:i,communityMember:o=!1}=e;return(0,r.jsx)("section",{className:"author_card",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"avatar",children:(0,r.jsx)("a",{href:i,target:"_blank",alt:t,children:(0,r.jsx)("img",{src:n,alt:t})})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"name",children:(0,r.jsx)("a",{href:i,target:"_blank",alt:t,children:t})}),(0,r.jsx)("span",{className:"title",children:s}),(0,r.jsxs)("span",{className:"discord",children:[o?"Join our community on":"Got questions? Find us on"," ",(0,r.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>o});var r=t(7294);const s={},i=r.createContext(s);function o(e){const n=r.useContext(i);return r.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(s):e.components||s:o(e.components),r.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/40aeb86f.e83f7f09.js b/assets/js/40aeb86f.fb8fbab3.js similarity index 99% rename from assets/js/40aeb86f.e83f7f09.js rename to assets/js/40aeb86f.fb8fbab3.js index 1107e2ef1..da39c926b 100644 --- a/assets/js/40aeb86f.e83f7f09.js +++ b/assets/js/40aeb86f.fb8fbab3.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[4402],{1586:(e,n,t)=>{t.d(n,{ZP:()=>r});var s=t(5893),o=t(1151);function i(e){const n={a:"a",admonition:"admonition",code:"code",p:"p",pre:"pre",strong:"strong",...(0,o.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["In the ",(0,s.jsx)(n.code,{children:"/home//.lightning/config.toml"})," you'll find some and more of the following:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-toml",children:'[BLANK]\n\n[application]\ndb_path = "~/.lightning/data/app_db"\n\n[consensus]\nstore_path = "~/.lightning/data/narwhal_store"\n\n[fsstore]\nroot = "~/.lightning/blockstore"\n\n[resolver]\nstore_path = "~/.lightning/data/resolver_store"\n\n[signer]\nconsensus_key_path = "~/.lightning/keystore/consensus.pem"\nnode_key_path = "~/.lightning/keystore/node.pem"\n'})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["The configuration properties and values presented above are a shorter version of what you'll find on your ",(0,s.jsx)(n.strong,{children:"configuration.toml"}),". We keep it short to make it easier to follow, do not copy and paste."]})}),"\n",(0,s.jsxs)(n.p,{children:["Find and replace all instances of ~ in the config file ",(0,s.jsx)(n.code,{children:"/home//.lightning/config.toml"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["Here's an example of how to do it using ",(0,s.jsx)(n.strong,{children:"sed"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:'sed -i "s|~/.lightning|/home//.lightning|g" "/home//.lightning/config.toml"\n'})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["Replace the ",(0,s.jsx)(n.code,{children:""})," with your username. For example, if you have followed the recommendation to ",(0,s.jsx)(n.a,{href:"/docs/node/install#create-a-user",children:"create a user"})," it would look like ",(0,s.jsx)(n.code,{children:"/home/lgtn/.lightning/config.toml"})," for the username ",(0,s.jsx)(n.strong,{children:"lgtn"}),"."]})}),"\n",(0,s.jsxs)(n.p,{children:["For example, if your username is ",(0,s.jsx)(n.code,{children:"lgtn"})," that'd look like this:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:'sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Once modified, you can run a ",(0,s.jsx)(n.code,{children:"cat"})," to see the content of the files to confirm it has been updated."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"cat /home/lgtn/.lightning/config.toml\n"})}),"\n",(0,s.jsxs)(n.p,{children:["For our example where we opted in for the username ",(0,s.jsx)(n.code,{children:"lgtn"})," that would look like:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-toml",children:'[BLANK]\n\n[application]\ndb_path = "~/.lightning/data/app_db"\n\n[consensus]\nstore_path = "~/.lightning/data/narwhal_store"\n\n[fsstore]\nroot = "~/.lightning/blockstore"\n\n[resolver]\nstore_path = "~/.lightning/data/resolver_store"\n\n[signer]\nconsensus_key_path = "~/.lightning/keystore/consensus.pem"\nnode_key_path = "~/.lightning/keystore/node.pem"\n'})}),"\n",(0,s.jsx)(n.admonition,{title:"Warning",type:"caution",children:(0,s.jsx)(n.p,{children:"Bear in mind that we are keeping the content of the file short to make it easier to read and follow. The content of your configuration file should look slightly different, amongst these it should contain other properties and values. You should not copy and replace the content of your files with the ones presented here."})})]})}function r(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},1761:(e,n,t)=>{t.d(n,{ZP:()=>r});var s=t(5893),o=t(1151);function i(e){const n={admonition:"admonition",code:"code",p:"p",strong:"strong",...(0,o.a)(),...e.components};return(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsxs)(n.p,{children:["The flag ",(0,s.jsx)(n.code,{children:"-c"})," in the ",(0,s.jsx)(n.code,{children:"lightning.service"})," ",(0,s.jsx)(n.strong,{children:"ExecStart"}),", is to provide the toml configuration file path e.g. defaults to ",(0,s.jsx)(n.code,{children:"~/.lightning/config.toml"}),". This is to avoid the path being determined dynamically (given path base ~ or $HOME), as users might control the systemctl service as a ",(0,s.jsx)(n.strong,{children:"user"})," or ",(0,s.jsx)(n.strong,{children:"sudoer"}),". For example, a ",(0,s.jsx)(n.strong,{children:"sudoer"})," would have the ",(0,s.jsx)(n.strong,{children:"configuration"})," set to ",(0,s.jsx)(n.code,{children:"/root/.lightning/config.toml"})," or ",(0,s.jsx)(n.code,{children:"/home/username/.lightning/config.toml"})," depending on using ",(0,s.jsx)(n.strong,{children:"sudo"})," which might cause some confusion to some users."]})})}function r(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},4405:(e,n,t)=>{t.d(n,{ZP:()=>r});var s=t(5893),o=t(1151);function i(e){const n={a:"a",admonition:"admonition",code:"code",p:"p",pre:"pre",...(0,o.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["You should be following the ",(0,s.jsx)(n.a,{href:"/docs/node/install#create-a-user-1",children:"create a user"})," recommendation. For our example, we have the username ",(0,s.jsx)(n.code,{children:"lgtn"}),"."]}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["If you have chosen a different username, replace ",(0,s.jsx)(n.code,{children:"lgtn"})," by the correct username you have selected."]})}),"\n",(0,s.jsxs)(n.p,{children:["In the ",(0,s.jsx)(n.code,{children:"config.toml"})," you'll find some and more of the following:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-toml",children:'[BLANK]\n\n[application]\ndb_path = "~/.lightning/data/app_db"\n\n[consensus]\nstore_path = "~/.lightning/data/narwhal_store"\n\n[fsstore]\nroot = "~/.lightning/blockstore"\n\n[resolver]\nstore_path = "~/.lightning/data/resolver_store"\n\n[signer]\nconsensus_key_path = "~/.lightning/keystore/consensus.pem"\nnode_key_path = "~/.lightning/keystore/node.pem"\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Find and replace all instances of ",(0,s.jsx)(n.code,{children:"~"})," in the config file ",(0,s.jsx)(n.code,{children:"/home/lgtn/.lightning/config.toml"}),". Here's an example using ",(0,s.jsx)(n.code,{children:"sed"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:'sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"\n'})}),"\n",(0,s.jsx)(n.admonition,{type:"caution",children:(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"config.toml"})," example below is a shorter version of what you'll encounter, yours might look different. We do this to keep the guide simple to read. Do not copy and replace with the version demonstrated here."]})}),"\n",(0,s.jsxs)(n.p,{children:["Once changed, all the instances of ",(0,s.jsx)(n.code,{children:"~/"})," should be replaced by your user path e.g. ",(0,s.jsx)(n.code,{children:"/home/lgtn/"}),". For our example, the output would look like the following:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-toml",children:'[BLANK]\n\n[application]\ndb_path = "/home/lgtn/.lightning/data/app_db"\n\n[consensus]\nstore_path = "/home/lgtn/.lightning/data/narwhal_store"\n\n[fsstore]\nroot = "/home/lgtn/.lightning/blockstore"\n\n[resolver]\nstore_path = "/home/lgtn/.lightning/data/resolver_store"\n\n[signer]\nconsensus_key_path = "/home/lgtn/.lightning/keystore/consensus.pem"\nnode_key_path = "/home/lgtn/.lightning/keystore/node.pem"\n'})})]})}function r(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},2382:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>g,contentTitle:()=>h,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>u});var s=t(5893),o=t(1151),i=t(3872),r=t(4405),l=t(1761),a=t(1586);const c={title:"Update CLI from source code",slug:"update-cli-from-source-code",hide_title:!0,tags:["references","help","update","upgrade","fix"]},h=void 0,d={id:"Lightning CLI/update-cli-from-source-code",title:"Update CLI from source code",description:"Although the step-by-step instructions described here are simple to follow, this process is available as an automated script. To use it execute the following command in your server terminal and follow the instructions:",source:"@site/references/Lightning CLI/update-cli-from-source-code.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/update-cli-from-source-code",permalink:"/references/Lightning CLI/update-cli-from-source-code",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/update-cli-from-source-code.md",tags:[{label:"references",permalink:"/references/tags/references"},{label:"help",permalink:"/references/tags/help"},{label:"update",permalink:"/references/tags/update"},{label:"upgrade",permalink:"/references/tags/upgrade"},{label:"fix",permalink:"/references/tags/fix"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Update CLI from source code",slug:"update-cli-from-source-code",hide_title:!0,tags:["references","help","update","upgrade","fix"]},sidebar:"defaultSidebar",previous:{title:"Uninstall Lightning Node",permalink:"/references/Lightning CLI/uninstall-lightning-node"},next:{title:"Service keeps running after shutdown",permalink:"/references/Systemd/service-keeps-running-after-shutdown"}},g={},u=[{value:"Switch to the installation user",id:"switch-to-the-installation-user",level:2},{value:"Change directory to the source code",id:"change-directory-to-the-source-code",level:2},{value:"Checkout to branch",id:"checkout-to-branch",level:2},{value:"Pull the latest changes",id:"pull-the-latest-changes",level:2},{value:"Build binary from the source",id:"build-binary-from-the-source",level:2},{value:"Update the symlink",id:"update-the-symlink",level:2},{value:"Set user path in config.toml",id:"set-user-path-in-configtoml",level:2},{value:"Update the systemd service unit",id:"update-the-systemd-service-unit",level:2},{value:"Clear the data",id:"clear-the-data",level:2},{value:"Update the config.toml",id:"update-the-configtoml",level:2},{value:"Update the config.toml with user home path",id:"update-the-configtoml-with-user-home-path",level:2},{value:"Restart the service",id:"restart-the-service",level:2},{value:"Health checkup",id:"health-checkup",level:2}];function p(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,o.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.admonition,{type:"tip",children:[(0,s.jsx)(n.p,{children:"Although the step-by-step instructions described here are simple to follow, this process is available as an automated script. To use it execute the following command in your server terminal and follow the instructions:"}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"curl -sS https://get.fleek.network/update | bash\n"})})]}),"\n",(0,s.jsx)(n.h2,{id:"switch-to-the-installation-user",children:"Switch to the installation user"}),"\n",(0,s.jsx)(n.p,{children:"Switch to the username you've used throughout the installation process."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"su \n"})}),"\n",(0,s.jsxs)(n.p,{children:["For example, if you used the username ",(0,s.jsx)(n.code,{children:"lgtn"})," it'll look like the following command:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"su lgtn\n"})}),"\n",(0,s.jsx)(n.h2,{id:"change-directory-to-the-source-code",children:"Change directory to the source code"}),"\n",(0,s.jsxs)(n.p,{children:["If you have installed it via the recommended process or instructions, then the default location where the ",(0,s.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"source code"})," is stored is ",(0,s.jsx)(n.code,{children:"~/fleek-network/lightning"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"cd ~/fleek-network/lightning\n"})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["Notice that we use ",(0,s.jsx)(n.code,{children:"~"}),", which refers to ",(0,s.jsx)(n.code,{children:"$HOME"}),". You must use the username used for the installation process. For example, on ",(0,s.jsx)(n.a,{href:"/docs/node/requirements#server",children:"Ubuntu"})," if you use the username ",(0,s.jsx)(n.code,{children:"lgtn"}),", the pathname for ",(0,s.jsx)(n.code,{children:"$HOME"})," is ",(0,s.jsx)(n.code,{children:"/home/lgtn"}),"."]})}),"\n",(0,s.jsx)(n.h2,{id:"checkout-to-branch",children:"Checkout to branch"}),"\n",(0,s.jsxs)(n.p,{children:["Make sure that you are checked in to the correct branch. For the current testnet phase that'd be ",(0,s.jsx)(n.code,{children:"testnet-alpha-1"}),". If you use any other branch name, your node will not function correctly. Use the branch name ",(0,s.jsx)(n.code,{children:"testnet-alpha-1"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"git checkout testnet-alpha-1\n"})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["We try to update our documentation promptly but sometimes are a bit behind on any changes we might make in real-time. If you find any typos, such as the wrong branch name, help us by letting us know! Find us in Fleek Network section of our ",(0,s.jsx)(n.a,{href:"https://discord.gg/fleekxyz",children:"Discord"}),"."]})}),"\n",(0,s.jsx)(n.h2,{id:"pull-the-latest-changes",children:"Pull the latest changes"}),"\n",(0,s.jsxs)(n.p,{children:["Before make sure that you stash or clear any changes you may have in the working directory, as otherwise, ",(0,s.jsx)(n.code,{children:"git"})," will let you know about local changes\u2013if you'd like to learn more about it read the ",(0,s.jsx)(n.a,{href:"https://git-scm.com/docs/git-stash",children:"git stash document"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["A quick way to clean is to ",(0,s.jsx)(n.code,{children:"stash"})," the changes, for example:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"git stash \n"})}),"\n",(0,s.jsxs)(n.p,{children:["To pull the latest changes use the ",(0,s.jsx)(n.code,{children:"git pull"})," command, as follows:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"git pull origin testnet-alpha-1\n"})}),"\n",(0,s.jsx)(n.p,{children:"Alternatively, to have to stash and pull, you can reset the repository to the origin."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"git fetch origin testnet-alpha-1\ngit reset --hard origin/testnet-alpha-1\ngit clean -f\n"})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["We are using the branch named ",(0,s.jsx)(n.code,{children:"testnet-alpha-1"}),", which is specific to the early testnet launch. Change to the correct branch name according to needs. For example, in the future the mainnet version will go on branch name ",(0,s.jsx)(n.code,{children:"main"}),"."]})}),"\n",(0,s.jsx)(n.h2,{id:"build-binary-from-the-source",children:"Build binary from the source"}),"\n",(0,s.jsx)(n.p,{children:"To build the binary from the source code, we execute the cargo build command:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"cargo +stable build --release\n"})}),"\n",(0,s.jsx)(n.h2,{id:"update-the-symlink",children:"Update the symlink"}),"\n",(0,s.jsx)(n.p,{children:"Start by removing the existing one:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:'sudo rm -f "/usr/local/bin/lgtn"\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Create a new symlink that links the new build binary to ",(0,s.jsx)(n.code,{children:"/usr/local/bin/lgtn"}),", as follows:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo ln -s ~/fleek-network/lightning/target/release/lightning-node /usr/local/bin/lgtn\n"})}),"\n",(0,s.jsx)(n.h2,{id:"set-user-path-in-configtoml",children:"Set user path in config.toml"}),"\n",(0,s.jsx)(r.ZP,{}),"\n",(0,s.jsx)(n.h2,{id:"update-the-systemd-service-unit",children:"Update the systemd service unit"}),"\n",(0,s.jsxs)(n.p,{children:["Open and edit the ",(0,s.jsx)(n.code,{children:"/etc/systemd/system/lightning.service"})," file."]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Replace ",(0,s.jsx)(n.code,{children:""})," with the username. For example, in the ",(0,s.jsx)(n.a,{href:"/docs/node/install#create-a-user",children:"documentation"})," we use the username ",(0,s.jsx)(n.code,{children:"lgtn"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Make sure that the ",(0,s.jsx)(n.code,{children:"ExecStart"})," is set correctly"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"[Unit]\nDescription=Fleek Network Node lightning service\n\n[Service]\nType=simple\nMemoryHigh=32G\nRestartSec=15s\nRestart=always\nExecStart=lgtn -c /home//.lightning/config.toml -vv run\nStandardOutput=append:/var/log/lightning/output.log\nStandardError=append:/var/log/lightning/diagnostic.log\nEnvironment=TMPDIR=/var/tmp\n\n[Install]\nWantedBy=multi-user.target\n"})}),"\n",(0,s.jsx)(l.ZP,{}),"\n",(0,s.jsx)(n.p,{children:"When complete make sure the file is saved. Followed by a systemctl daemon reload:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo systemctl daemon-reload\n"})}),"\n",(0,s.jsx)(n.h2,{id:"clear-the-data",children:"Clear the data"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"rm -rf ~/.lightning/data\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Depending on how you control the system, this might need ",(0,s.jsx)(n.strong,{children:"sudo"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo rm -rf ~/.lightning/data\n"})}),"\n",(0,s.jsxs)(n.h2,{id:"update-the-configtoml",children:["Update the ",(0,s.jsx)(n.code,{children:"config.toml"})]}),"\n",(0,s.jsxs)(n.p,{children:["Remove the ",(0,s.jsx)(n.code,{children:"~/.lightning/config.toml"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"rm ~/.lightning/config.toml\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Create a new ",(0,s.jsx)(n.code,{children:"config.toml"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"lgtn print-config --default > ~/.lightning/config.toml\n"})}),"\n",(0,s.jsxs)(n.h2,{id:"update-the-configtoml-with-user-home-path",children:["Update the ",(0,s.jsx)(n.code,{children:"config.toml"})," with user home path"]}),"\n",(0,s.jsx)(a.ZP,{}),"\n",(0,s.jsx)(n.h2,{id:"restart-the-service",children:"Restart the service"}),"\n",(0,s.jsxs)(n.p,{children:["Once the cargo build process is completed, you have to restart the service. We're assuming you are using non-root user as ",(0,s.jsx)(n.a,{href:"/docs/node/install#create-a-user",children:"recommended"}),", you won't use ",(0,s.jsx)(n.strong,{children:"sudo"})," to start the service. The command will look as follows:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo systemctl restart lightning\n"})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["If you have installed the Fleek Network lightning manually, the ",(0,s.jsx)(n.a,{href:"/docs/node/install#systemd-service-setup",children:"installation instructions"})," recommended setting up a systemd service for the Fleek Network process. If you haven't, you're advised to check the instructions provided."]})}),"\n",(0,s.jsx)(n.h2,{id:"health-checkup",children:"Health checkup"}),"\n",(0,s.jsx)(n.p,{children:"Do a quick health check by running:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:'curl -w "\\p" localhost:4230/health\n'})}),"\n",(0,s.jsxs)(n.p,{children:["If successful, you should get the response ",(0,s.jsx)(n.code,{children:"running and staked"}),", as follows:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"running and staked\n"})}),"\n",(0,s.jsx)(i.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function m(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},3872:(e,n,t)=>{t.d(n,{Z:()=>o});t(7294);var s=t(5893);const o=e=>{let{image:n,name:t,title:o,url:i,communityMember:r=!1}=e;return(0,s.jsx)("section",{className:"author_card",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"avatar",children:(0,s.jsx)("a",{href:i,target:"_blank",alt:t,children:(0,s.jsx)("img",{src:n,alt:t})})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"name",children:(0,s.jsx)("a",{href:i,target:"_blank",alt:t,children:t})}),(0,s.jsx)("span",{className:"title",children:o}),(0,s.jsxs)("span",{className:"discord",children:[r?"Join our community on":"Got questions? Find us on"," ",(0,s.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,t)=>{t.d(n,{Z:()=>l,a:()=>r});var s=t(7294);const o={},i=s.createContext(o);function r(e){const n=s.useContext(i);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),s.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[4402],{1586:(e,n,t)=>{t.d(n,{ZP:()=>r});var s=t(5893),o=t(1151);function i(e){const n={a:"a",admonition:"admonition",code:"code",p:"p",pre:"pre",strong:"strong",...(0,o.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["In the ",(0,s.jsx)(n.code,{children:"/home//.lightning/config.toml"})," you'll find some and more of the following:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-toml",children:'[BLANK]\n\n[application]\ndb_path = "~/.lightning/data/app_db"\n\n[consensus]\nstore_path = "~/.lightning/data/narwhal_store"\n\n[fsstore]\nroot = "~/.lightning/blockstore"\n\n[resolver]\nstore_path = "~/.lightning/data/resolver_store"\n\n[signer]\nconsensus_key_path = "~/.lightning/keystore/consensus.pem"\nnode_key_path = "~/.lightning/keystore/node.pem"\n'})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["The configuration properties and values presented above are a shorter version of what you'll find on your ",(0,s.jsx)(n.strong,{children:"configuration.toml"}),". We keep it short to make it easier to follow, do not copy and paste."]})}),"\n",(0,s.jsxs)(n.p,{children:["Find and replace all instances of ~ in the config file ",(0,s.jsx)(n.code,{children:"/home//.lightning/config.toml"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["Here's an example of how to do it using ",(0,s.jsx)(n.strong,{children:"sed"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:'sed -i "s|~/.lightning|/home//.lightning|g" "/home//.lightning/config.toml"\n'})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["Replace the ",(0,s.jsx)(n.code,{children:""})," with your username. For example, if you have followed the recommendation to ",(0,s.jsx)(n.a,{href:"/docs/node/install#create-a-user",children:"create a user"})," it would look like ",(0,s.jsx)(n.code,{children:"/home/lgtn/.lightning/config.toml"})," for the username ",(0,s.jsx)(n.strong,{children:"lgtn"}),"."]})}),"\n",(0,s.jsxs)(n.p,{children:["For example, if your username is ",(0,s.jsx)(n.code,{children:"lgtn"})," that'd look like this:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:'sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Once modified, you can run a ",(0,s.jsx)(n.code,{children:"cat"})," to see the content of the files to confirm it has been updated."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"cat /home/lgtn/.lightning/config.toml\n"})}),"\n",(0,s.jsxs)(n.p,{children:["For our example where we opted in for the username ",(0,s.jsx)(n.code,{children:"lgtn"})," that would look like:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-toml",children:'[BLANK]\n\n[application]\ndb_path = "~/.lightning/data/app_db"\n\n[consensus]\nstore_path = "~/.lightning/data/narwhal_store"\n\n[fsstore]\nroot = "~/.lightning/blockstore"\n\n[resolver]\nstore_path = "~/.lightning/data/resolver_store"\n\n[signer]\nconsensus_key_path = "~/.lightning/keystore/consensus.pem"\nnode_key_path = "~/.lightning/keystore/node.pem"\n'})}),"\n",(0,s.jsx)(n.admonition,{title:"Warning",type:"caution",children:(0,s.jsx)(n.p,{children:"Bear in mind that we are keeping the content of the file short to make it easier to read and follow. The content of your configuration file should look slightly different, amongst these it should contain other properties and values. You should not copy and replace the content of your files with the ones presented here."})})]})}function r(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},1761:(e,n,t)=>{t.d(n,{ZP:()=>r});var s=t(5893),o=t(1151);function i(e){const n={admonition:"admonition",code:"code",p:"p",strong:"strong",...(0,o.a)(),...e.components};return(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsxs)(n.p,{children:["The flag ",(0,s.jsx)(n.code,{children:"-c"})," in the ",(0,s.jsx)(n.code,{children:"lightning.service"})," ",(0,s.jsx)(n.strong,{children:"ExecStart"}),", is to provide the toml configuration file path e.g. defaults to ",(0,s.jsx)(n.code,{children:"~/.lightning/config.toml"}),". This is to avoid the path being determined dynamically (given path base ~ or $HOME), as users might control the systemctl service as a ",(0,s.jsx)(n.strong,{children:"user"})," or ",(0,s.jsx)(n.strong,{children:"sudoer"}),". For example, a ",(0,s.jsx)(n.strong,{children:"sudoer"})," would have the ",(0,s.jsx)(n.strong,{children:"configuration"})," set to ",(0,s.jsx)(n.code,{children:"/root/.lightning/config.toml"})," or ",(0,s.jsx)(n.code,{children:"/home/username/.lightning/config.toml"})," depending on using ",(0,s.jsx)(n.strong,{children:"sudo"})," which might cause some confusion to some users."]})})}function r(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},4405:(e,n,t)=>{t.d(n,{ZP:()=>r});var s=t(5893),o=t(1151);function i(e){const n={a:"a",admonition:"admonition",code:"code",p:"p",pre:"pre",...(0,o.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["You should be following the ",(0,s.jsx)(n.a,{href:"/docs/node/install#create-a-user-1",children:"create a user"})," recommendation. For our example, we have the username ",(0,s.jsx)(n.code,{children:"lgtn"}),"."]}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["If you have chosen a different username, replace ",(0,s.jsx)(n.code,{children:"lgtn"})," by the correct username you have selected."]})}),"\n",(0,s.jsxs)(n.p,{children:["In the ",(0,s.jsx)(n.code,{children:"config.toml"})," you'll find some and more of the following:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-toml",children:'[BLANK]\n\n[application]\ndb_path = "~/.lightning/data/app_db"\n\n[consensus]\nstore_path = "~/.lightning/data/narwhal_store"\n\n[fsstore]\nroot = "~/.lightning/blockstore"\n\n[resolver]\nstore_path = "~/.lightning/data/resolver_store"\n\n[signer]\nconsensus_key_path = "~/.lightning/keystore/consensus.pem"\nnode_key_path = "~/.lightning/keystore/node.pem"\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Find and replace all instances of ",(0,s.jsx)(n.code,{children:"~"})," in the config file ",(0,s.jsx)(n.code,{children:"/home/lgtn/.lightning/config.toml"}),". Here's an example using ",(0,s.jsx)(n.code,{children:"sed"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:'sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"\n'})}),"\n",(0,s.jsx)(n.admonition,{type:"caution",children:(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"config.toml"})," example below is a shorter version of what you'll encounter, yours might look different. We do this to keep the guide simple to read. Do not copy and replace with the version demonstrated here."]})}),"\n",(0,s.jsxs)(n.p,{children:["Once changed, all the instances of ",(0,s.jsx)(n.code,{children:"~/"})," should be replaced by your user path e.g. ",(0,s.jsx)(n.code,{children:"/home/lgtn/"}),". For our example, the output would look like the following:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-toml",children:'[BLANK]\n\n[application]\ndb_path = "/home/lgtn/.lightning/data/app_db"\n\n[consensus]\nstore_path = "/home/lgtn/.lightning/data/narwhal_store"\n\n[fsstore]\nroot = "/home/lgtn/.lightning/blockstore"\n\n[resolver]\nstore_path = "/home/lgtn/.lightning/data/resolver_store"\n\n[signer]\nconsensus_key_path = "/home/lgtn/.lightning/keystore/consensus.pem"\nnode_key_path = "/home/lgtn/.lightning/keystore/node.pem"\n'})})]})}function r(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(i,{...e})}):i(e)}},2382:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>g,contentTitle:()=>h,default:()=>m,frontMatter:()=>c,metadata:()=>d,toc:()=>u});var s=t(5893),o=t(1151),i=t(3872),r=t(4405),l=t(1761),a=t(1586);const c={title:"Update CLI from source code",slug:"update-cli-from-source-code",hide_title:!0,tags:["references","help","update","upgrade","fix"]},h=void 0,d={id:"Lightning CLI/update-cli-from-source-code",title:"Update CLI from source code",description:"Although the step-by-step instructions described here are simple to follow, this process is available as an automated script. To use it execute the following command in your server terminal and follow the instructions:",source:"@site/references/Lightning CLI/update-cli-from-source-code.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/update-cli-from-source-code",permalink:"/references/Lightning CLI/update-cli-from-source-code",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/update-cli-from-source-code.md",tags:[{label:"references",permalink:"/references/tags/references"},{label:"help",permalink:"/references/tags/help"},{label:"update",permalink:"/references/tags/update"},{label:"upgrade",permalink:"/references/tags/upgrade"},{label:"fix",permalink:"/references/tags/fix"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Update CLI from source code",slug:"update-cli-from-source-code",hide_title:!0,tags:["references","help","update","upgrade","fix"]},sidebar:"defaultSidebar",previous:{title:"Uninstall Lightning Node",permalink:"/references/Lightning CLI/uninstall-lightning-node"},next:{title:"Service keeps running after shutdown",permalink:"/references/Systemd/service-keeps-running-after-shutdown"}},g={},u=[{value:"Switch to the installation user",id:"switch-to-the-installation-user",level:2},{value:"Change directory to the source code",id:"change-directory-to-the-source-code",level:2},{value:"Checkout to branch",id:"checkout-to-branch",level:2},{value:"Pull the latest changes",id:"pull-the-latest-changes",level:2},{value:"Build binary from the source",id:"build-binary-from-the-source",level:2},{value:"Update the symlink",id:"update-the-symlink",level:2},{value:"Set user path in config.toml",id:"set-user-path-in-configtoml",level:2},{value:"Update the systemd service unit",id:"update-the-systemd-service-unit",level:2},{value:"Clear the data",id:"clear-the-data",level:2},{value:"Update the config.toml",id:"update-the-configtoml",level:2},{value:"Update the config.toml with user home path",id:"update-the-configtoml-with-user-home-path",level:2},{value:"Restart the service",id:"restart-the-service",level:2},{value:"Health checkup",id:"health-checkup",level:2}];function p(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,o.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.admonition,{type:"tip",children:[(0,s.jsx)(n.p,{children:"Although the step-by-step instructions described here are simple to follow, this process is available as an automated script. To use it execute the following command in your server terminal and follow the instructions:"}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"curl -sS https://get.fleek.network/update | bash\n"})})]}),"\n",(0,s.jsx)(n.h2,{id:"switch-to-the-installation-user",children:"Switch to the installation user"}),"\n",(0,s.jsx)(n.p,{children:"Switch to the username you've used throughout the installation process."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"su \n"})}),"\n",(0,s.jsxs)(n.p,{children:["For example, if you used the username ",(0,s.jsx)(n.code,{children:"lgtn"})," it'll look like the following command:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"su lgtn\n"})}),"\n",(0,s.jsx)(n.h2,{id:"change-directory-to-the-source-code",children:"Change directory to the source code"}),"\n",(0,s.jsxs)(n.p,{children:["If you have installed it via the recommended process or instructions, then the default location where the ",(0,s.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"source code"})," is stored is ",(0,s.jsx)(n.code,{children:"~/fleek-network/lightning"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"cd ~/fleek-network/lightning\n"})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["Notice that we use ",(0,s.jsx)(n.code,{children:"~"}),", which refers to ",(0,s.jsx)(n.code,{children:"$HOME"}),". You must use the username used for the installation process. For example, on ",(0,s.jsx)(n.a,{href:"/docs/node/requirements#server",children:"Ubuntu"})," if you use the username ",(0,s.jsx)(n.code,{children:"lgtn"}),", the pathname for ",(0,s.jsx)(n.code,{children:"$HOME"})," is ",(0,s.jsx)(n.code,{children:"/home/lgtn"}),"."]})}),"\n",(0,s.jsx)(n.h2,{id:"checkout-to-branch",children:"Checkout to branch"}),"\n",(0,s.jsxs)(n.p,{children:["Make sure that you are checked in to the correct branch. For the current testnet phase that'd be ",(0,s.jsx)(n.code,{children:"testnet-alpha-1"}),". If you use any other branch name, your node will not function correctly. Use the branch name ",(0,s.jsx)(n.code,{children:"testnet-alpha-1"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"git checkout testnet-alpha-1\n"})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["We try to update our documentation promptly but sometimes are a bit behind on any changes we might make in real-time. If you find any typos, such as the wrong branch name, help us by letting us know! Find us in Fleek Network section of our ",(0,s.jsx)(n.a,{href:"https://discord.gg/fleekxyz",children:"Discord"}),"."]})}),"\n",(0,s.jsx)(n.h2,{id:"pull-the-latest-changes",children:"Pull the latest changes"}),"\n",(0,s.jsxs)(n.p,{children:["Before make sure that you stash or clear any changes you may have in the working directory, as otherwise, ",(0,s.jsx)(n.code,{children:"git"})," will let you know about local changes\u2013if you'd like to learn more about it read the ",(0,s.jsx)(n.a,{href:"https://git-scm.com/docs/git-stash",children:"git stash document"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["A quick way to clean is to ",(0,s.jsx)(n.code,{children:"stash"})," the changes, for example:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"git stash \n"})}),"\n",(0,s.jsxs)(n.p,{children:["To pull the latest changes use the ",(0,s.jsx)(n.code,{children:"git pull"})," command, as follows:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"git pull origin testnet-alpha-1\n"})}),"\n",(0,s.jsx)(n.p,{children:"Alternatively, to have to stash and pull, you can reset the repository to the origin."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"git fetch origin testnet-alpha-1\ngit reset --hard origin/testnet-alpha-1\ngit clean -f\n"})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["We are using the branch named ",(0,s.jsx)(n.code,{children:"testnet-alpha-1"}),", which is specific to the early testnet launch. Change to the correct branch name according to needs. For example, in the future the mainnet version will go on branch name ",(0,s.jsx)(n.code,{children:"main"}),"."]})}),"\n",(0,s.jsx)(n.h2,{id:"build-binary-from-the-source",children:"Build binary from the source"}),"\n",(0,s.jsx)(n.p,{children:"To build the binary from the source code, we execute the cargo build command:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"cargo +stable build --release\n"})}),"\n",(0,s.jsx)(n.h2,{id:"update-the-symlink",children:"Update the symlink"}),"\n",(0,s.jsx)(n.p,{children:"Start by removing the existing one:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:'sudo rm -f "/usr/local/bin/lgtn"\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Create a new symlink that links the new build binary to ",(0,s.jsx)(n.code,{children:"/usr/local/bin/lgtn"}),", as follows:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo ln -s ~/fleek-network/lightning/target/release/lightning-node /usr/local/bin/lgtn\n"})}),"\n",(0,s.jsx)(n.h2,{id:"set-user-path-in-configtoml",children:"Set user path in config.toml"}),"\n",(0,s.jsx)(r.ZP,{}),"\n",(0,s.jsx)(n.h2,{id:"update-the-systemd-service-unit",children:"Update the systemd service unit"}),"\n",(0,s.jsxs)(n.p,{children:["Open and edit the ",(0,s.jsx)(n.code,{children:"/etc/systemd/system/lightning.service"})," file."]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Replace ",(0,s.jsx)(n.code,{children:""})," with the username. For example, in the ",(0,s.jsx)(n.a,{href:"/docs/node/install#create-a-user",children:"documentation"})," we use the username ",(0,s.jsx)(n.code,{children:"lgtn"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Make sure that the ",(0,s.jsx)(n.code,{children:"ExecStart"})," is set correctly"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"[Unit]\nDescription=Fleek Network Node lightning service\n\n[Service]\nType=simple\nMemoryHigh=32G\nRestartSec=15s\nRestart=always\nExecStart=lgtn -c /home//.lightning/config.toml -vv run\nStandardOutput=append:/var/log/lightning/output.log\nStandardError=append:/var/log/lightning/diagnostic.log\nEnvironment=TMPDIR=/var/tmp\n\n[Install]\nWantedBy=multi-user.target\n"})}),"\n",(0,s.jsx)(l.ZP,{}),"\n",(0,s.jsx)(n.p,{children:"When complete make sure the file is saved. Followed by a systemctl daemon reload:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo systemctl daemon-reload\n"})}),"\n",(0,s.jsx)(n.h2,{id:"clear-the-data",children:"Clear the data"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"rm -rf ~/.lightning/data\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Depending on how you control the system, this might need ",(0,s.jsx)(n.strong,{children:"sudo"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo rm -rf ~/.lightning/data\n"})}),"\n",(0,s.jsxs)(n.h2,{id:"update-the-configtoml",children:["Update the ",(0,s.jsx)(n.code,{children:"config.toml"})]}),"\n",(0,s.jsxs)(n.p,{children:["Remove the ",(0,s.jsx)(n.code,{children:"~/.lightning/config.toml"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"rm ~/.lightning/config.toml\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Create a new ",(0,s.jsx)(n.code,{children:"config.toml"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"lgtn print-config --default > ~/.lightning/config.toml\n"})}),"\n",(0,s.jsxs)(n.h2,{id:"update-the-configtoml-with-user-home-path",children:["Update the ",(0,s.jsx)(n.code,{children:"config.toml"})," with user home path"]}),"\n",(0,s.jsx)(a.ZP,{}),"\n",(0,s.jsx)(n.h2,{id:"restart-the-service",children:"Restart the service"}),"\n",(0,s.jsxs)(n.p,{children:["Once the cargo build process is completed, you have to restart the service. We're assuming you are using non-root user as ",(0,s.jsx)(n.a,{href:"/docs/node/install#create-a-user",children:"recommended"}),", you won't use ",(0,s.jsx)(n.strong,{children:"sudo"})," to start the service. The command will look as follows:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"sudo systemctl restart lightning\n"})}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["If you have installed the Fleek Network lightning manually, the ",(0,s.jsx)(n.a,{href:"/docs/node/install#systemd-service-setup",children:"installation instructions"})," recommended setting up a systemd service for the Fleek Network process. If you haven't, you're advised to check the instructions provided."]})}),"\n",(0,s.jsx)(n.h2,{id:"health-checkup",children:"Health checkup"}),"\n",(0,s.jsx)(n.p,{children:"Do a quick health check by running:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:'curl -w "\\p" localhost:4230/health\n'})}),"\n",(0,s.jsxs)(n.p,{children:["If successful, you should get the response ",(0,s.jsx)(n.code,{children:"running and staked"}),", as follows:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sh",children:"running and staked\n"})}),"\n",(0,s.jsx)(i.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function m(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},3872:(e,n,t)=>{t.d(n,{Z:()=>o});t(7294);var s=t(5893);const o=e=>{let{image:n,name:t,title:o,url:i,communityMember:r=!1}=e;return(0,s.jsx)("section",{className:"author_card",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"avatar",children:(0,s.jsx)("a",{href:i,target:"_blank",alt:t,children:(0,s.jsx)("img",{src:n,alt:t})})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"name",children:(0,s.jsx)("a",{href:i,target:"_blank",alt:t,children:t})}),(0,s.jsx)("span",{className:"title",children:o}),(0,s.jsxs)("span",{className:"discord",children:[r?"Join our community on":"Got questions? Find us on"," ",(0,s.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,t)=>{t.d(n,{Z:()=>l,a:()=>r});var s=t(7294);const o={},i=s.createContext(o);function r(e){const n=s.useContext(i);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),s.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/445e9e2a.78f6bd50.js b/assets/js/445e9e2a.75edfd31.js similarity index 98% rename from assets/js/445e9e2a.78f6bd50.js rename to assets/js/445e9e2a.75edfd31.js index 7f97001ca..5335a6d48 100644 --- a/assets/js/445e9e2a.78f6bd50.js +++ b/assets/js/445e9e2a.75edfd31.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[8578],{1478:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>g,frontMatter:()=>r,metadata:()=>d,toc:()=>c});var n=s(5893),i=s(1151),o=s(3872);const r={title:"Node secret key does not exist",slug:"node-secret-key-does-not-exist",hide_title:!0,tags:["keystore","lost keys","ownership","file permissions"]},a=void 0,d={id:"Lightning CLI/node-secret-key-does-not-exist",title:"Node secret key does not exist",description:"Node secret key does not exist",source:"@site/references/Lightning CLI/node-secret-key-does-not-exist.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/node-secret-key-does-not-exist",permalink:"/references/Lightning CLI/node-secret-key-does-not-exist",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/node-secret-key-does-not-exist.md",tags:[{label:"keystore",permalink:"/references/tags/keystore"},{label:"lost keys",permalink:"/references/tags/lost-keys"},{label:"ownership",permalink:"/references/tags/ownership"},{label:"file permissions",permalink:"/references/tags/file-permissions"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Node secret key does not exist",slug:"node-secret-key-does-not-exist",hide_title:!0,tags:["keystore","lost keys","ownership","file permissions"]},sidebar:"defaultSidebar",previous:{title:"Backing up the keystore",permalink:"/references/Lightning CLI/backing-up-the-keystore"},next:{title:"Permission denied (os error 13)",permalink:"/references/Lightning CLI/permission-denied-os-error-13"}},l={},c=[{value:"Node secret key does not exist",id:"node-secret-key-does-not-exist",level:2}];function h(e){const t={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h2,{id:"node-secret-key-does-not-exist",children:"Node secret key does not exist"}),"\n",(0,n.jsx)(t.p,{children:'When watching the Fleek Network Lightning service log output, you find the "Node secret key does not exist" message as follows:'}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-sh",children:"Error: Could not start the node.\n\nCaused by:\n Node Initialization failed: InitializationFailed(Tag as SignerInterface>, Node secret key does not exist. Use the CLI to generate keys.)\n"})}),"\n",(0,n.jsxs)(t.p,{children:["Edit the ",(0,n.jsx)(t.code,{children:"~/.lightning/config.toml"})," to include the full location for the PEM files. For example, let's say that it's located under ",(0,n.jsx)(t.code,{children:"/home/skywalker"})," that'd look like:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{children:'[signer]\nconsensus_key_path = "/home/skywalker/.lightning/keystore/consensus.pem"\nnode_key_path = "/home/skywalker/.lightning/keystore/node.pem"\n'})}),"\n",(0,n.jsxs)(t.p,{children:["To learn more about how file permissions and ownership work, you're advised to read the reference document ",(0,n.jsx)(t.a,{href:"/references/Lightning%20CLI/file-permissions-and-ownership",children:"here"}),"."]}),"\n",(0,n.jsx)(o.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function g(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},3872:(e,t,s)=>{s.d(t,{Z:()=>i});s(7294);var n=s(5893);const i=e=>{let{image:t,name:s,title:i,url:o,communityMember:r=!1}=e;return(0,n.jsx)("section",{className:"author_card",children:(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"avatar",children:(0,n.jsx)("a",{href:o,target:"_blank",alt:s,children:(0,n.jsx)("img",{src:t,alt:s})})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"name",children:(0,n.jsx)("a",{href:o,target:"_blank",alt:s,children:s})}),(0,n.jsx)("span",{className:"title",children:i}),(0,n.jsxs)("span",{className:"discord",children:[r?"Join our community on":"Got questions? Find us on"," ",(0,n.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,t,s)=>{s.d(t,{Z:()=>a,a:()=>r});var n=s(7294);const i={},o=n.createContext(i);function r(e){const t=n.useContext(o);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),n.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[8578],{1478:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>g,frontMatter:()=>r,metadata:()=>d,toc:()=>c});var n=s(5893),i=s(1151),o=s(3872);const r={title:"Node secret key does not exist",slug:"node-secret-key-does-not-exist",hide_title:!0,tags:["keystore","lost keys","ownership","file permissions"]},a=void 0,d={id:"Lightning CLI/node-secret-key-does-not-exist",title:"Node secret key does not exist",description:"Node secret key does not exist",source:"@site/references/Lightning CLI/node-secret-key-does-not-exist.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/node-secret-key-does-not-exist",permalink:"/references/Lightning CLI/node-secret-key-does-not-exist",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/node-secret-key-does-not-exist.md",tags:[{label:"keystore",permalink:"/references/tags/keystore"},{label:"lost keys",permalink:"/references/tags/lost-keys"},{label:"ownership",permalink:"/references/tags/ownership"},{label:"file permissions",permalink:"/references/tags/file-permissions"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Node secret key does not exist",slug:"node-secret-key-does-not-exist",hide_title:!0,tags:["keystore","lost keys","ownership","file permissions"]},sidebar:"defaultSidebar",previous:{title:"Backing up the keystore",permalink:"/references/Lightning CLI/backing-up-the-keystore"},next:{title:"Permission denied (os error 13)",permalink:"/references/Lightning CLI/permission-denied-os-error-13"}},l={},c=[{value:"Node secret key does not exist",id:"node-secret-key-does-not-exist",level:2}];function h(e){const t={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h2,{id:"node-secret-key-does-not-exist",children:"Node secret key does not exist"}),"\n",(0,n.jsx)(t.p,{children:'When watching the Fleek Network Lightning service log output, you find the "Node secret key does not exist" message as follows:'}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-sh",children:"Error: Could not start the node.\n\nCaused by:\n Node Initialization failed: InitializationFailed(Tag as SignerInterface>, Node secret key does not exist. Use the CLI to generate keys.)\n"})}),"\n",(0,n.jsxs)(t.p,{children:["Edit the ",(0,n.jsx)(t.code,{children:"~/.lightning/config.toml"})," to include the full location for the PEM files. For example, let's say that it's located under ",(0,n.jsx)(t.code,{children:"/home/skywalker"})," that'd look like:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{children:'[signer]\nconsensus_key_path = "/home/skywalker/.lightning/keystore/consensus.pem"\nnode_key_path = "/home/skywalker/.lightning/keystore/node.pem"\n'})}),"\n",(0,n.jsxs)(t.p,{children:["To learn more about how file permissions and ownership work, you're advised to read the reference document ",(0,n.jsx)(t.a,{href:"/references/Lightning%20CLI/file-permissions-and-ownership",children:"here"}),"."]}),"\n",(0,n.jsx)(o.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function g(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},3872:(e,t,s)=>{s.d(t,{Z:()=>i});s(7294);var n=s(5893);const i=e=>{let{image:t,name:s,title:i,url:o,communityMember:r=!1}=e;return(0,n.jsx)("section",{className:"author_card",children:(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"avatar",children:(0,n.jsx)("a",{href:o,target:"_blank",alt:s,children:(0,n.jsx)("img",{src:t,alt:s})})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"name",children:(0,n.jsx)("a",{href:o,target:"_blank",alt:s,children:s})}),(0,n.jsx)("span",{className:"title",children:i}),(0,n.jsxs)("span",{className:"discord",children:[r?"Join our community on":"Got questions? Find us on"," ",(0,n.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,t,s)=>{s.d(t,{Z:()=>a,a:()=>r});var n=s(7294);const i={},o=n.createContext(i);function r(e){const t=n.useContext(o);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),n.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/4c9535f7.976271fb.js b/assets/js/4c9535f7.b28d2cb1.js similarity index 99% rename from assets/js/4c9535f7.976271fb.js rename to assets/js/4c9535f7.b28d2cb1.js index 5544e9fc5..466e17015 100644 --- a/assets/js/4c9535f7.976271fb.js +++ b/assets/js/4c9535f7.b28d2cb1.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[6296],{9237:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>d,default:()=>p,frontMatter:()=>c,metadata:()=>l,toc:()=>u});var i=t(5893),r=t(1151),o=t(3872),s=t(3183),a=t(8432);const c={title:"Running a node in Docker",hide_title:!0,slug:"running-a-node-in-docker",image:"./assets/running-a-node-in-docker.png?202311181211",date:new Date("2023-09-18T17:00:00.000Z"),description:"A guide on how to run Fleek Network's node in a Docker container",category:"Tutorial",tags:["guide","docker","container"]},d=void 0,l={id:"Node Operators/running-a-node-in-docker",title:"Running a node in Docker",description:"A guide on how to run Fleek Network's node in a Docker container",source:"@site/guides/Node Operators/running-a-node-in-docker.md",sourceDirName:"Node Operators",slug:"/Node Operators/running-a-node-in-docker",permalink:"/guides/Node Operators/running-a-node-in-docker",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/guides/Node Operators/running-a-node-in-docker.md",tags:[{label:"guide",permalink:"/guides/tags/guide"},{label:"docker",permalink:"/guides/tags/docker"},{label:"container",permalink:"/guides/tags/container"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Running a node in Docker",hide_title:!0,slug:"running-a-node-in-docker",image:"./assets/running-a-node-in-docker.png?202311181211",date:"2023-09-18T17:00:00.000Z",description:"A guide on how to run Fleek Network's node in a Docker container",category:"Tutorial",tags:["guide","docker","container"]},sidebar:"defaultSidebar",previous:{title:"Managing the keystore",permalink:"/guides/Node Operators/managing-the-keystore"},next:{title:"Transfering setup ownership",permalink:"/guides/Node Operators/transfering-setup-ownership"}},h={image:t(3451).Z},u=[{value:"Introduction",id:"introduction",level:2},{value:"Pre-requisites",id:"pre-requisites",level:2},{value:"For the impatient",id:"for-the-impatient",level:2},{value:"Pull and run image",id:"pull-and-run-image",level:3},{value:"Setup",id:"setup",level:2},{value:"Requirements",id:"requirements",level:3},{value:"Create a user",id:"create-a-user",level:3},{value:"Lightning CLI source code",id:"lightning-cli-source-code",level:3},{value:"Change directory to Lightning source code",id:"change-directory-to-lightning-source-code",level:3},{value:"Install Docker",id:"install-docker",level:3},{value:"Create the Docker image",id:"create-the-docker-image",level:3},{value:"Build the Docker image",id:"build-the-docker-image",level:3},{value:"Docker Container",id:"docker-container",level:2},{value:"Generate keys",id:"generate-keys",level:2},{value:"Run the Docker Container as Systemd Service",id:"run-the-docker-container-as-systemd-service",level:2},{value:"Create the Systemd Service Unit",id:"create-the-systemd-service-unit",level:3},{value:"Viewing logs",id:"viewing-logs",level:2},{value:"Conclusion",id:"conclusion",level:2}];function g(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Running a node in Docker",src:t(8597).Z+"",width:"1450",height:"816"})}),"\n","\n","\n",(0,i.jsx)(n.h2,{id:"introduction",children:"Introduction"}),"\n",(0,i.jsxs)(n.p,{children:["Our ",(0,i.jsx)(n.a,{href:"https://www.docker.com/",children:"Docker"})," ",(0,i.jsx)(n.a,{href:"https://docs.docker.com/engine/reference/commandline/images/",children:"image"})," provides all the requirements to have Fleek Network running quickly and the following guide will provide you a quick reference to get you started with Docker."]}),"\n",(0,i.jsxs)(n.p,{children:["Alternatively, if you need a deep dive into Docker, check the official getting started ",(0,i.jsx)(n.a,{href:"https://docs.docker.com/get-started/",children:"here"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["TL;DR If you have Docker experience then you'll find our ",(0,i.jsx)(n.a,{href:"#for-the-impatient",children:"for the impatient"})," sufficient to get started."]}),"\n",(0,i.jsx)(n.h2,{id:"pre-requisites",children:"Pre-requisites"}),"\n",(0,i.jsx)(n.p,{children:"To follow the guide, you will need the following:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Familiarity with the command-line interface"}),"\n",(0,i.jsx)(n.li,{children:"Git"}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"for-the-impatient",children:"For the impatient"}),"\n",(0,i.jsxs)(n.p,{children:["Building a Docker image requires some effort and some of our users might find it easier to pull our ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning/pkgs/container/lightning",children:"latest image"})," for quick access to Lightning CLI, which doesn't require them to build from source."]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["The Docker Container image for Lightning is located at ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning/pkgs/container/lightning",children:"https://github.com/fleek-network/lightning/pkgs/container/lightning"}),"."]})}),"\n",(0,i.jsx)(n.h3,{id:"pull-and-run-image",children:"Pull and run image"}),"\n",(0,i.jsx)(n.p,{children:"You can pull and run the Lightning pre-built Docker image from our GitHub and run the Docker container quickly by executing the following command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo docker run \\\n -p 4200-4299:4200-4299 \\\n -p 4300-4399:4300-4399 \\\n --mount type=bind,source=$HOME/.lightning,target=/home/lgtn/.lightning \\\n --mount type=bind,source=/var/tmp,target=/var/tmp \\\n --name lightning-node \\\n -it ghcr.io/fleek-network/lightning:latest\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsxs)(n.p,{children:["Keys have to be generated when launching the service. On Docker run, if the ",(0,i.jsx)(n.a,{href:"/guides/Node%20Operators/managing-the-keystore",children:"keystore"})," is not found, the keys are automatically generated and stored in the Docker host's ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/keystore"})," directory. To learn more about how to manage the keystore, visit the ",(0,i.jsx)(n.a,{href:"/guides/Node%20Operators/managing-the-keystore",children:"managing keystore"})," section."]})}),"\n",(0,i.jsx)(n.admonition,{title:"warning",type:"caution",children:(0,i.jsxs)(n.p,{children:["The Docker image is tied to a CPU architecture, make sure that you have verified the ",(0,i.jsx)(n.a,{href:"/docs/node/requirements#specs",children:"required"})," specifications to run the container successfully."]})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["The command has a list of ports ",(0,i.jsx)(n.code,{children:"-p"})," values that map ports in the container on the Docker host. While we try to keep the information across our documentation in sync with the latest changes or requirements e.g. port number changes, make sure that you check the section ",(0,i.jsx)(n.a,{href:"/docs/node/requirements#ports",children:"ports"})," to find the latest updates."]})}),"\n",(0,i.jsx)(n.h2,{id:"setup",children:"Setup"}),"\n",(0,i.jsx)(n.h3,{id:"requirements",children:"Requirements"}),"\n",(0,i.jsx)(n.p,{children:"To follow the guide successfully, a good amount of memory and disk space is necessary to run Docker. The main reason for our use-case is that your host machine requires a generous amount of memory and disk space, for the containers."}),"\n",(0,i.jsxs)(n.p,{children:["For this guide, we used a server with the 4vCPU, 32\xa0GB ram memory and 20 GB disk space specifications. Learn more about the recommended specifications ",(0,i.jsx)(n.a,{href:"/docs/node/requirements",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"create-a-user",children:"Create a user"}),"\n",(0,i.jsx)(a.ZP,{}),"\n",(0,i.jsx)(n.h3,{id:"lightning-cli-source-code",children:"Lightning CLI source code"}),"\n",(0,i.jsxs)(n.p,{children:["Start by cloning the repository located at ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"https://github.com/fleek-network/lightning"}),"."]}),"\n",(0,i.jsx)(s.ZP,{}),"\n",(0,i.jsx)(n.h3,{id:"change-directory-to-lightning-source-code",children:"Change directory to Lightning source code"}),"\n",(0,i.jsxs)(n.p,{children:["If you have cloned the project correctly, you should ",(0,i.jsx)(n.code,{children:"change directory"})," to the project source code directory which by default is ",(0,i.jsx)(n.code,{children:"~/fleek-network/lightning"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"cd ~/fleek-network/lightning\n"})}),"\n",(0,i.jsxs)(n.p,{children:["At time of writing, this is how the project root looks like (e.g. use the ",(0,i.jsx)(n.a,{href:"https://en.wikipedia.org/wiki/Ls",children:"ls"})," to see the list):"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:".\n\u251c\u2500\u2500 CODE_OF_CONDUCT.md\n\u251c\u2500\u2500 CONTRIBUTING.md\n\u251c\u2500\u2500 Cargo.lock\n\u251c\u2500\u2500 Cargo.toml\n\u251c\u2500\u2500 Dockerfile\n\u251c\u2500\u2500 LICENSE\n\u251c\u2500\u2500 README.md\n\u251c\u2500\u2500 codecov.yml\n\u251c\u2500\u2500 core\n\u251c\u2500\u2500 docs\n\u251c\u2500\u2500 etc\n\u251c\u2500\u2500 lib\n\u251c\u2500\u2500 rust-toolchain\n\u251c\u2500\u2500 rustfmt.toml\n\u251c\u2500\u2500 services\n\u2514\u2500\u2500 target\n"})}),"\n",(0,i.jsx)(n.h3,{id:"install-docker",children:"Install Docker"}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["To keep our guide short, we're using Ubuntu Linux. You'll have to make the required tweaks for your preferred Linux Distro. Find the list of support operating systems ",(0,i.jsx)(n.a,{href:"/docs/node/requirements#server",children:"here"}),"."]})}),"\n",(0,i.jsx)(n.p,{children:"First, update the existing list of packages:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo apt update\n"})}),"\n",(0,i.jsx)(n.p,{children:"Next, install the required packages to let apt use packages over HTTPS:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo apt install apt-transport-https ca-certificates software-properties-common\n"})}),"\n",(0,i.jsx)(n.p,{children:"Add the GPG key for the official Docker repository to your system:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -\n"})}),"\n",(0,i.jsx)(n.p,{children:"Add the Docker repository to apt sources and update the package database with the Docker packages from the new added repository:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu jammy stable"\n'})}),"\n",(0,i.jsx)(n.p,{children:"Set to install from the Docker repo instead of the default Ubuntu repo:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"apt-cache policy docker-ce\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"docker-ce:\n Installed: (none)\n Candidate: 5:24.0.6-1~ubuntu.22.04~jammy\n Version table:\n 5:24.0.6-1~ubuntu.22.04~jammy 500\n 500 https://download.docker.com/linux/ubuntu jammy/stable amd64 Packages\n 5:24.0.6-1~ubuntu.22.04~jammy 500\n"})}),"\n",(0,i.jsx)(n.p,{children:"Finally, install Docker:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo apt install docker-ce\n"})}),"\n",(0,i.jsx)(n.p,{children:"Once complete you should be able to run it via the CLI, as such:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"docker -v\n"})}),"\n",(0,i.jsx)(n.p,{children:"Here's the output (versions might differ a bit from the time of writing):"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"Docker version 24.0.6, build ed223bc\n"})}),"\n",(0,i.jsx)(n.p,{children:"The following command's output will indicate if Docker's working correctly:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo docker run hello-world\n"})}),"\n",(0,i.jsx)(n.p,{children:"Here's an example of the output you'll find us \"Hello from Docker!\":"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'Hello from Docker!\nThis message shows that your installation appears to be working correctly.\n\nTo generate this message, Docker took the following steps:\n 1. The Docker client contacted the Docker daemon.\n 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.\n (amd64)\n 3. The Docker daemon created a new container from that image which runs the\n executable that produces the output you are currently reading.\n 4. The Docker daemon streamed that output to the Docker client, which sent it\n to your terminal.\n\nTo try something more ambitious, you can run an Ubuntu container with:\n $ docker run -it ubuntu bash\n\nShare images, automate workflows, and more with a free Docker ID:\n https://hub.docker.com/\n\nFor more examples and ideas, visit:\n https://docs.docker.com/get-started/\n'})}),"\n",(0,i.jsx)(n.p,{children:"Run all the commands above in your terminal, to confirm everything's working before proceeding to the next steps."}),"\n",(0,i.jsx)(n.h3,{id:"create-the-docker-image",children:"Create the Docker image"}),"\n",(0,i.jsx)(n.p,{children:"A Docker image is a read-only template with instructions for creating a Docker container, like a template. Docker images also act as a starting point when using Docker."}),"\n",(0,i.jsx)(n.p,{children:'The starting point for our use-case is a Dockerfile, where all those "template instructions" are declared.'}),"\n",(0,i.jsxs)(n.p,{children:["A ",(0,i.jsx)(n.a,{href:"https://raw.githubusercontent.com/fleek-network/lightning/main/Dockerfile",children:"Dockerfile"})," should exist in the repository source code, so make sure you have ",(0,i.jsx)(n.a,{href:"#change-directory-to-lightning-source-code",children:"change directory to the lightning source code"})," to find it."]}),"\n",(0,i.jsx)(n.h3,{id:"build-the-docker-image",children:"Build the Docker image"}),"\n",(0,i.jsxs)(n.p,{children:["Build the image named as ",(0,i.jsx)(n.code,{children:"lightning"})," from our Dockerfile:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo docker build -t lightning -f ./Dockerfile .\n"})}),"\n",(0,i.jsx)(n.p,{children:"The build process takes awhile, and you have to wait for completion."}),"\n",(0,i.jsx)(n.p,{children:"The output should be similar to:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"[+] Building 1.2s (16/16) FINISHED docker:default\n => [internal] load build definition from Dockerfile 0.0s\n => => transferring dockerfile: 990B 0.0s\n => [internal] load .dockerignore 0.0s\n => => transferring context: 2B 0.0s\n => [internal] load metadata for docker.io/library/debian:bullseye-slim 0.6s\n => [internal] load metadata for docker.io/library/rust:latest 0.9s\n => [stage-1 1/3] FROM docker.io/library/debian:bullseye-slim@sha256:3bc5e94a0e8329c102203c3f5f26fd67835f0c81633dd6949de0557867a87fac 0.0s\n => [builder 1/7] FROM docker.io/library/rust:latest@sha256:8a4ca3ca75afbc97bcf5362e9a694fe049d15734fbbaf82b8b7e224616c1254b 0.0s\n => [internal] load build context 0.3s\n => => transferring context: 948.93kB 0.3s\n => CACHED [stage-1 2/3] RUN DEBIAN_FRONTEND=noninteractive apt-get update -yq && DEBIAN_FRONTEND=noninteractive apt-get install -yq libs 0.0s\n => CACHED [builder 2/7] WORKDIR /lightning 0.0s\n => CACHED [builder 3/7] RUN apt-get update 0.0s\n => CACHED [builder 4/7] RUN apt-get install -y build-essential cmake clang pkg-config libssl-dev gcc protobuf-comp 0.0s\n => CACHED [builder 5/7] RUN --mount=type=cache,target=/usr/local/cargo/registry cargo install cargo-strip 0.0s\n => CACHED [builder 6/7] COPY . . 0.0s\n => CACHED [builder 7/7] RUN --mount=type=cache,target=/usr/local/cargo/registry --mount=type=cache,target=/lightning/target cargo buil 0.0s\n => CACHED [stage-1 3/3] COPY --from=builder /lightning/target/release/lightning-node /usr/local/bin/lgtn 0.0s\n => exporting to image 0.0s\n => => exporting layers 0.0s\n => => writing image sha256:e8e5ed19f59c3cc6a9add5bdb578c464904e9789d5f386cc4af81044c062d998 0.0s\n => => naming to docker.io/library/lightning\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["The Docker image is only required to be built once and/or, when changes are pulled from the remote repository, or specific versions you might be interested in. Otherwise, you're not required to build it every time to run the node. If you'd like to learn how to update the Lightning CLI, find our references ",(0,i.jsx)(n.a,{href:"/references/Lightning%20CLI/update-cli-from-source-code",children:"here"}),"."]})}),"\n",(0,i.jsx)(n.admonition,{type:"caution",children:(0,i.jsx)(n.p,{children:"If you don't update your source code and binary build often, you won't have the latest changes, which should happen frequently to take advantage of all the ongoing development. This is quite important to understand, as it causes confusion to some users. The Lightning application at time of writing does not update automatically."})}),"\n",(0,i.jsx)(n.h2,{id:"docker-container",children:"Docker Container"}),"\n",(0,i.jsxs)(n.p,{children:["A container is what's originated from the image we discussed in the section ",(0,i.jsx)(n.a,{href:"#build-the-docker-image",children:"build the docker image"}),", it is a run-able instance of an image. We can create, start, stop, move, or delete a container using the Docker API or CLI."]}),"\n",(0,i.jsx)(n.p,{children:"Following up, we'll learn how to run the Docker container that includes our Lightning CLI program, built from our Dockerfile."}),"\n",(0,i.jsxs)(n.p,{children:["Once the ",(0,i.jsx)(n.a,{href:"#build-the-docker-image",children:"Docker image"})," is ready, run the container based on the image ",(0,i.jsx)(n.code,{children:"lightning"}),". Effectively running the Fleek Network Lightning node process:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo docker run \\\n -p 4200-4299:4200-4299 \\\n -p 4300-4399:4300-4399 \\\n --mount type=bind,source=$HOME/.lightning,target=/home/lgtn/.lightning \\\n --mount type=bind,source=/var/tmp,target=/var/tmp \\\n --name lightning-node \\\n -it ghcr.io/fleek-network/lightning:latest\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["Notice that the command arguments we pass are for the flag's ",(0,i.jsx)(n.code,{children:"-p"})," port numbers, ",(0,i.jsx)(n.code,{children:"-v"})," to bind mount a location in your host to a container path (useful to persist your configuration files, e.g. keystore), ",(0,i.jsx)(n.code,{children:"--name"})," to make it easier to identify, ",(0,i.jsx)(n.code,{children:"-it"})," to make it interactive (e.g. presents output to the terminal), and the image name we ",(0,i.jsx)(n.a,{href:"#build-the-docker-image",children:"built earlier"}),"."]})}),"\n",(0,i.jsx)(n.p,{children:'The output would look as the following, showing the error message "Node is not whitelisted" (this error message is due to the testnet phase that requires nodes to be whitelisted to run successfully):'}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"thread 'main' panicked at 'Node is not whitelisted. Please join the Fleek Discord to get invited.', core/cli/src/testnet_sync.rs:45:9\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n/root/init: line 7: 7 Aborted (core dumped) lgtn run\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Keys have to be generated when launching the service. On Docker run, if the ",(0,i.jsx)(n.a,{href:"/guides/Node%20Operators/managing-the-keystore",children:"keystore"})," is not found, the keys are automatically generated and stored in the Docker host's ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/keystore"})," directory."]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["Have in mind that the ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/config.toml"})," is where the keystore location paths are configured, which default value is in the user ",(0,i.jsx)(n.code,{children:"$HOME"})," path. The users who customize or modify the default location, need to apply the required customizations. To learn more about how to manage the keystore, visit the ",(0,i.jsx)(n.a,{href:"/guides/Node%20Operators/managing-the-keystore",children:"managing keystore"})," section."]})}),"\n",(0,i.jsx)(n.h2,{id:"generate-keys",children:"Generate keys"}),"\n",(0,i.jsxs)(n.p,{children:["Execute the ",(0,i.jsx)(n.code,{children:"keys generate"})," command on the container ",(0,i.jsx)(n.code,{children:"lightning-node"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo docker exec -it lightning-node lgtn keys generate\n"})}),"\n",(0,i.jsxs)(n.p,{children:["We've bound the host path ",(0,i.jsx)(n.code,{children:"~/.lightning"})," into the container ",(0,i.jsx)(n.code,{children:"/home/lgtn/.lightning"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["You can list the contents of the ",(0,i.jsx)(n.code,{children:"~/.lightning"}),", where you should find the ",(0,i.jsx)(n.code,{children:"config.toml"})," and ",(0,i.jsx)(n.code,{children:"keystore"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:".\n..\nconfig.toml\nkeystore\n"})}),"\n",(0,i.jsxs)(n.p,{children:["You only have to run the ",(0,i.jsx)(n.code,{children:"keys generate"})," once from your host."]}),"\n",(0,i.jsx)(n.p,{children:"Finally, you can start the Fleek Network node by running the command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo docker start lightning-node\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"lightning-node"})," is the name we provided on first run as described in ",(0,i.jsx)(n.a,{href:"#docker-container",children:"docker container"})," section. If you have set a different name, change accordingly."]})}),"\n",(0,i.jsx)(n.h2,{id:"run-the-docker-container-as-systemd-service",children:"Run the Docker Container as Systemd Service"}),"\n",(0,i.jsxs)(n.p,{children:["In this section we\u2019ll cover how to wrap a Docker Container as a Systemd Service without the need for third party tools or complex commands. Some reasons include, minimizing the dependency on the Docker Daemon as we can move to an ",(0,i.jsx)(n.a,{href:"https://opencontainers.org/",children:"OCI complaint solution"})," other that Docker at anytime, or the fact we recommend Systemd Service Units and Systemctl to control the Service in our ",(0,i.jsx)(n.a,{href:"/docs/node/install",children:"Native install"})," that most users are familiar. Our goal is to provide guidance to the widest audience possible, if you have other preferences on managing your service that is more fitting to your needs that's fine."]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["Docker recommends using their cross-platform built-in restart policy for running a Container as a Service. For that, configure your Docker service to ",(0,i.jsx)(n.a,{href:"https://docs.docker.com/install/linux/linux-postinstall/#configure-docker-to-start-on-boot",children:"start on system boot"}),"."]})}),"\n",(0,i.jsx)(n.p,{children:"Systemd was specifically developed to serve the purpose of stopping services, dependency checking and recovery of failed services. You can have your host start, stop, enable, check the status, and generally manage a container as a Systemd Service."}),"\n",(0,i.jsx)(n.h3,{id:"create-the-systemd-service-unit",children:"Create the Systemd Service Unit"}),"\n",(0,i.jsxs)(n.p,{children:["We are going to create the unit configuration file in the /etc/systemd/system/ directory. The Service Unit is going to be named as ",(0,i.jsx)(n.code,{children:"docker-lightning.service"}),". To create the file run the following command:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo touch /etc/systemd/system/docker-lightning.service\n"})}),"\n",(0,i.jsx)(n.p,{children:"Open the file in your favorite text editor and populate with the content found here:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"[Unit]\nDescription=Fleek Network Node lightning service\nAfter=docker.service\nRequires=docker.service\n\n[Service]\nRestart=always\nRestartSec=5\nTimeoutStartSec=0\nExecStartPre=-/usr/bin/docker kill lightning-node\nExecStartPre=-/usr/bin/docker rm lightning-node\nExecStartPre=/usr/bin/docker pull ghcr.io/fleek-network/lightning:latest\nExecStart=/usr/bin/docker run -p 4200-4299:4200-4299 -p 4300-4399:4300-4399 --mount type=bind,source=/home/skywalker/.lightning,target=/home/lgtn/.lightning --mount type=bind,source=/var/tmp,target=/var/tmp --name lightning-node ghcr.io/fleek-network/lightning:latest\nExecStop=/usr/bin/docker stop lightning-node\nStandardOutput=append:/var/log/lightning/output.log\nStandardError=append:/var/log/lightning/diagnostic.log\n\n[Install]\nWantedBy=multi-user.target\n"})}),"\n",(0,i.jsx)(n.p,{children:"Once the file is saved, change the file permissions by running the command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo chmod 644 /etc/systemd/system/docker-lightning.service\n"})}),"\n",(0,i.jsx)(n.p,{children:"Next, reload the Systemctl Daemon:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo systemctl daemon-reload\n"})}),"\n",(0,i.jsx)(n.p,{children:"Enable the service on startup when the system boots:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo systemctl enable docker-lightning.service\n"})}),"\n",(0,i.jsxs)(n.p,{children:["As a result, we are now able to run our containers as a Systemd service. For this, read the document ",(0,i.jsx)(n.a,{href:"/docs/node/install#use-systemctl-to-manage-systemd-service",children:"manage systemd service"})," to find more about how to control the service."]}),"\n",(0,i.jsx)(n.h2,{id:"viewing-logs",children:"Viewing logs"}),"\n",(0,i.jsx)(n.p,{children:"To view the logs of a Docker container in real time, use the following command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo docker logs -f lightning-node\n"})}),"\n",(0,i.jsxs)(n.p,{children:["If you have wrapped the ",(0,i.jsx)(n.a,{href:"#run-the-docker-container-as-systemd-service",children:"docker container as a systemd service"}),", you can use the same commands found when installed natively, such as:"]}),"\n",(0,i.jsx)(n.p,{children:"For standard output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"tail -f /var/log/lightning/output.log\n"})}),"\n",(0,i.jsx)(n.p,{children:"Or, the standard error:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"tail -f /var/log/lightning/diagnostic.log\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Learn more about how to ",(0,i.jsx)(n.a,{href:"/docs/node/analyzing-logs",children:"analyze log messages"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"conclusion",children:"Conclusion"}),"\n",(0,i.jsx)(n.p,{children:"Containers are a way to have a self-contained environment that includes all necessary dependencies, libraries, software, amongst others required to run an application."}),"\n",(0,i.jsxs)(n.p,{children:["Fleek Network's Lightning is developed with ",(0,i.jsx)(n.a,{href:"https://www.rust-lang.org/",children:"Rust"}),", a general-purpose programming language, that requires several dependencies and libraries to compile the project. Some of these libraries are not installed by default and require some troubleshooting for the end user. ",(0,i.jsx)(n.a,{href:"https://www.docker.com/",children:"Docker"})," provides us with containers, self-containing all the required libraries for the purpose of running Lightning, our application."]}),"\n",(0,i.jsxs)(n.p,{children:["We guided you through the initial installation steps, and how to build a ",(0,i.jsx)(n.a,{href:"https://www.docker.com/",children:"Docker"})," image, which then's used to Docker run a container. Plus, provided lower-level commands, to help you understand other present or advanced use-cases, and also at higher level, offerring simple utility methods."]}),"\n",(0,i.jsxs)(n.p,{children:["While we do our best to provide the clearest instructions, there's always space for improvement, therefore feel free to make any contributions by messaging us on our ",(0,i.jsx)(n.a,{href:"https://discord.gg/fleekxyz",children:"Discord"})," or by opening a ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network",children:"PR"})," in any of our repositories."]}),"\n",(0,i.jsxs)(n.p,{children:["Discover more about the project by ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"watching/contributing on Github"}),", following us on ",(0,i.jsx)(n.a,{href:"https://twitter.com/fleek_net",children:"Twitter"}),", and joining ",(0,i.jsx)(n.a,{href:"https://discord.gg/fleekxyz",children:"our community Discord"})," for all the best updates!"]}),"\n",(0,i.jsx)(o.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function p(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(g,{...e})}):g(e)}},8432:(e,n,t)=>{t.d(n,{ZP:()=>s});var i=t(5893),r=t(1151);function o(e){const n={admonition:"admonition",code:"code",p:"p",pre:"pre",strong:"strong",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["We recommend creating a ",(0,i.jsx)(n.code,{children:"non-root"})," user with administrative privileges. It'll allow us to install any system requirements."]}),"\n",(0,i.jsxs)(n.p,{children:["You can create a new user and add to the ",(0,i.jsx)(n.strong,{children:"sudo"})," group by running:"]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["For our example, we'll be using the name ",(0,i.jsx)(n.code,{children:"lgtn"})," but you can pick whichever you'd like. If you already have a ",(0,i.jsx)(n.strong,{children:"sudoer"})," account, you can skip this step."]})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo adduser lgtn\n"})}),"\n",(0,i.jsxs)(n.p,{children:["After completing the ",(0,i.jsx)(n.code,{children:"adduser"})," steps, execute the ",(0,i.jsx)(n.code,{children:"usermod"})," to add the ",(0,i.jsx)(n.code,{children:"user"})," to the ",(0,i.jsx)(n.strong,{children:"sudo"})," group, as follows:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo usermod -aG sudo lgtn\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Switch to the new ",(0,i.jsx)(n.strong,{children:"user"})," by using the command:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"su lgtn\n"})}),"\n",(0,i.jsx)(n.p,{children:"Change the directory to the new user's home, as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"cd /home/lgtn\n"})})]})}function s(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(o,{...e})}):o(e)}},3183:(e,n,t)=>{t.d(n,{ZP:()=>s});var i=t(5893),r=t(1151);function o(e){const n={a:"a",admonition:"admonition",code:"code",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.a)(),...e.components};return(0,i.jsxs)(n.admonition,{type:"tip",children:[(0,i.jsx)(n.p,{children:"You have several ways of doing this:"}),(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Clone via HTTPS"}),"\n",(0,i.jsx)(n.li,{children:"Clone via SSH"}),"\n",(0,i.jsx)(n.li,{children:"Download via Github CLI"}),"\n",(0,i.jsxs)(n.li,{children:["Download the ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning/archive/refs/heads/main.zip",children:"zip package"})," from the repository"]}),"\n"]}),(0,i.jsxs)(n.p,{children:["We recommend HTTPS because it is the easiest to set up in the wild, and by users who are new to all this.\nAlthough, we strongly recommend using an SSH connection when interacting with GitHub. If you are to this and are interested read more about it ",(0,i.jsx)(n.a,{href:"https://docs.github.com/en/authentication/connecting-to-github-with-ssh",children:"here"}),"."]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git clone -b testnet-alpha-1 https://github.com/fleek-network/lightning.git \n"})}),(0,i.jsxs)(n.p,{children:["At time of writing, we are checking the branch name ",(0,i.jsx)(n.code,{children:"testnet-alpha-1"})," that corresponds to the testnet phase.\nHere's an example of what it'd look like when sticking to the recommended path location:"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git clone -b testnet-alpha-1 https://github.com/fleek-network/lightning.git ~/fleek-network/lightning\n"})})]})}function s(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(o,{...e})}):o(e)}},3872:(e,n,t)=>{t.d(n,{Z:()=>r});t(7294);var i=t(5893);const r=e=>{let{image:n,name:t,title:r,url:o,communityMember:s=!1}=e;return(0,i.jsx)("section",{className:"author_card",children:(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"avatar",children:(0,i.jsx)("a",{href:o,target:"_blank",alt:t,children:(0,i.jsx)("img",{src:n,alt:t})})}),(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"name",children:(0,i.jsx)("a",{href:o,target:"_blank",alt:t,children:t})}),(0,i.jsx)("span",{className:"title",children:r}),(0,i.jsxs)("span",{className:"discord",children:[s?"Join our community on":"Got questions? Find us on"," ",(0,i.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},3451:(e,n,t)=>{t.d(n,{Z:()=>i});const i=t.p+"assets/images/running-a-node-in-docker-cc0a5b3fda558b4b6dd40022fe5dd09f.png"},8597:(e,n,t)=>{t.d(n,{Z:()=>i});const i=t.p+"assets/images/running-a-node-in-docker-cc0a5b3fda558b4b6dd40022fe5dd09f.png"},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>s});var i=t(7294);const r={},o=i.createContext(r);function s(e){const n=i.useContext(o);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(r):e.components||r:s(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[6296],{9237:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>d,default:()=>p,frontMatter:()=>c,metadata:()=>l,toc:()=>u});var i=t(5893),r=t(1151),o=t(3872),s=t(3183),a=t(8432);const c={title:"Running a node in Docker",hide_title:!0,slug:"running-a-node-in-docker",image:"./assets/running-a-node-in-docker.png?202311181211",date:new Date("2023-09-18T17:00:00.000Z"),description:"A guide on how to run Fleek Network's node in a Docker container",category:"Tutorial",tags:["guide","docker","container"]},d=void 0,l={id:"Node Operators/running-a-node-in-docker",title:"Running a node in Docker",description:"A guide on how to run Fleek Network's node in a Docker container",source:"@site/guides/Node Operators/running-a-node-in-docker.md",sourceDirName:"Node Operators",slug:"/Node Operators/running-a-node-in-docker",permalink:"/guides/Node Operators/running-a-node-in-docker",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/guides/Node Operators/running-a-node-in-docker.md",tags:[{label:"guide",permalink:"/guides/tags/guide"},{label:"docker",permalink:"/guides/tags/docker"},{label:"container",permalink:"/guides/tags/container"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Running a node in Docker",hide_title:!0,slug:"running-a-node-in-docker",image:"./assets/running-a-node-in-docker.png?202311181211",date:"2023-09-18T17:00:00.000Z",description:"A guide on how to run Fleek Network's node in a Docker container",category:"Tutorial",tags:["guide","docker","container"]},sidebar:"defaultSidebar",previous:{title:"Managing the keystore",permalink:"/guides/Node Operators/managing-the-keystore"},next:{title:"Transfering setup ownership",permalink:"/guides/Node Operators/transfering-setup-ownership"}},h={image:t(3451).Z},u=[{value:"Introduction",id:"introduction",level:2},{value:"Pre-requisites",id:"pre-requisites",level:2},{value:"For the impatient",id:"for-the-impatient",level:2},{value:"Pull and run image",id:"pull-and-run-image",level:3},{value:"Setup",id:"setup",level:2},{value:"Requirements",id:"requirements",level:3},{value:"Create a user",id:"create-a-user",level:3},{value:"Lightning CLI source code",id:"lightning-cli-source-code",level:3},{value:"Change directory to Lightning source code",id:"change-directory-to-lightning-source-code",level:3},{value:"Install Docker",id:"install-docker",level:3},{value:"Create the Docker image",id:"create-the-docker-image",level:3},{value:"Build the Docker image",id:"build-the-docker-image",level:3},{value:"Docker Container",id:"docker-container",level:2},{value:"Generate keys",id:"generate-keys",level:2},{value:"Run the Docker Container as Systemd Service",id:"run-the-docker-container-as-systemd-service",level:2},{value:"Create the Systemd Service Unit",id:"create-the-systemd-service-unit",level:3},{value:"Viewing logs",id:"viewing-logs",level:2},{value:"Conclusion",id:"conclusion",level:2}];function g(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Running a node in Docker",src:t(8597).Z+"",width:"1450",height:"816"})}),"\n","\n","\n",(0,i.jsx)(n.h2,{id:"introduction",children:"Introduction"}),"\n",(0,i.jsxs)(n.p,{children:["Our ",(0,i.jsx)(n.a,{href:"https://www.docker.com/",children:"Docker"})," ",(0,i.jsx)(n.a,{href:"https://docs.docker.com/engine/reference/commandline/images/",children:"image"})," provides all the requirements to have Fleek Network running quickly and the following guide will provide you a quick reference to get you started with Docker."]}),"\n",(0,i.jsxs)(n.p,{children:["Alternatively, if you need a deep dive into Docker, check the official getting started ",(0,i.jsx)(n.a,{href:"https://docs.docker.com/get-started/",children:"here"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["TL;DR If you have Docker experience then you'll find our ",(0,i.jsx)(n.a,{href:"#for-the-impatient",children:"for the impatient"})," sufficient to get started."]}),"\n",(0,i.jsx)(n.h2,{id:"pre-requisites",children:"Pre-requisites"}),"\n",(0,i.jsx)(n.p,{children:"To follow the guide, you will need the following:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Familiarity with the command-line interface"}),"\n",(0,i.jsx)(n.li,{children:"Git"}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"for-the-impatient",children:"For the impatient"}),"\n",(0,i.jsxs)(n.p,{children:["Building a Docker image requires some effort and some of our users might find it easier to pull our ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning/pkgs/container/lightning",children:"latest image"})," for quick access to Lightning CLI, which doesn't require them to build from source."]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["The Docker Container image for Lightning is located at ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning/pkgs/container/lightning",children:"https://github.com/fleek-network/lightning/pkgs/container/lightning"}),"."]})}),"\n",(0,i.jsx)(n.h3,{id:"pull-and-run-image",children:"Pull and run image"}),"\n",(0,i.jsx)(n.p,{children:"You can pull and run the Lightning pre-built Docker image from our GitHub and run the Docker container quickly by executing the following command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo docker run \\\n -p 4200-4299:4200-4299 \\\n -p 4300-4399:4300-4399 \\\n --mount type=bind,source=$HOME/.lightning,target=/home/lgtn/.lightning \\\n --mount type=bind,source=/var/tmp,target=/var/tmp \\\n --name lightning-node \\\n -it ghcr.io/fleek-network/lightning:latest\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsxs)(n.p,{children:["Keys have to be generated when launching the service. On Docker run, if the ",(0,i.jsx)(n.a,{href:"/guides/Node%20Operators/managing-the-keystore",children:"keystore"})," is not found, the keys are automatically generated and stored in the Docker host's ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/keystore"})," directory. To learn more about how to manage the keystore, visit the ",(0,i.jsx)(n.a,{href:"/guides/Node%20Operators/managing-the-keystore",children:"managing keystore"})," section."]})}),"\n",(0,i.jsx)(n.admonition,{title:"warning",type:"caution",children:(0,i.jsxs)(n.p,{children:["The Docker image is tied to a CPU architecture, make sure that you have verified the ",(0,i.jsx)(n.a,{href:"/docs/node/requirements#specs",children:"required"})," specifications to run the container successfully."]})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["The command has a list of ports ",(0,i.jsx)(n.code,{children:"-p"})," values that map ports in the container on the Docker host. While we try to keep the information across our documentation in sync with the latest changes or requirements e.g. port number changes, make sure that you check the section ",(0,i.jsx)(n.a,{href:"/docs/node/requirements#ports",children:"ports"})," to find the latest updates."]})}),"\n",(0,i.jsx)(n.h2,{id:"setup",children:"Setup"}),"\n",(0,i.jsx)(n.h3,{id:"requirements",children:"Requirements"}),"\n",(0,i.jsx)(n.p,{children:"To follow the guide successfully, a good amount of memory and disk space is necessary to run Docker. The main reason for our use-case is that your host machine requires a generous amount of memory and disk space, for the containers."}),"\n",(0,i.jsxs)(n.p,{children:["For this guide, we used a server with the 4vCPU, 32\xa0GB ram memory and 20 GB disk space specifications. Learn more about the recommended specifications ",(0,i.jsx)(n.a,{href:"/docs/node/requirements",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"create-a-user",children:"Create a user"}),"\n",(0,i.jsx)(a.ZP,{}),"\n",(0,i.jsx)(n.h3,{id:"lightning-cli-source-code",children:"Lightning CLI source code"}),"\n",(0,i.jsxs)(n.p,{children:["Start by cloning the repository located at ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"https://github.com/fleek-network/lightning"}),"."]}),"\n",(0,i.jsx)(s.ZP,{}),"\n",(0,i.jsx)(n.h3,{id:"change-directory-to-lightning-source-code",children:"Change directory to Lightning source code"}),"\n",(0,i.jsxs)(n.p,{children:["If you have cloned the project correctly, you should ",(0,i.jsx)(n.code,{children:"change directory"})," to the project source code directory which by default is ",(0,i.jsx)(n.code,{children:"~/fleek-network/lightning"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"cd ~/fleek-network/lightning\n"})}),"\n",(0,i.jsxs)(n.p,{children:["At time of writing, this is how the project root looks like (e.g. use the ",(0,i.jsx)(n.a,{href:"https://en.wikipedia.org/wiki/Ls",children:"ls"})," to see the list):"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:".\n\u251c\u2500\u2500 CODE_OF_CONDUCT.md\n\u251c\u2500\u2500 CONTRIBUTING.md\n\u251c\u2500\u2500 Cargo.lock\n\u251c\u2500\u2500 Cargo.toml\n\u251c\u2500\u2500 Dockerfile\n\u251c\u2500\u2500 LICENSE\n\u251c\u2500\u2500 README.md\n\u251c\u2500\u2500 codecov.yml\n\u251c\u2500\u2500 core\n\u251c\u2500\u2500 docs\n\u251c\u2500\u2500 etc\n\u251c\u2500\u2500 lib\n\u251c\u2500\u2500 rust-toolchain\n\u251c\u2500\u2500 rustfmt.toml\n\u251c\u2500\u2500 services\n\u2514\u2500\u2500 target\n"})}),"\n",(0,i.jsx)(n.h3,{id:"install-docker",children:"Install Docker"}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["To keep our guide short, we're using Ubuntu Linux. You'll have to make the required tweaks for your preferred Linux Distro. Find the list of support operating systems ",(0,i.jsx)(n.a,{href:"/docs/node/requirements#server",children:"here"}),"."]})}),"\n",(0,i.jsx)(n.p,{children:"First, update the existing list of packages:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo apt update\n"})}),"\n",(0,i.jsx)(n.p,{children:"Next, install the required packages to let apt use packages over HTTPS:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo apt install apt-transport-https ca-certificates software-properties-common\n"})}),"\n",(0,i.jsx)(n.p,{children:"Add the GPG key for the official Docker repository to your system:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -\n"})}),"\n",(0,i.jsx)(n.p,{children:"Add the Docker repository to apt sources and update the package database with the Docker packages from the new added repository:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu jammy stable"\n'})}),"\n",(0,i.jsx)(n.p,{children:"Set to install from the Docker repo instead of the default Ubuntu repo:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"apt-cache policy docker-ce\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"docker-ce:\n Installed: (none)\n Candidate: 5:24.0.6-1~ubuntu.22.04~jammy\n Version table:\n 5:24.0.6-1~ubuntu.22.04~jammy 500\n 500 https://download.docker.com/linux/ubuntu jammy/stable amd64 Packages\n 5:24.0.6-1~ubuntu.22.04~jammy 500\n"})}),"\n",(0,i.jsx)(n.p,{children:"Finally, install Docker:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo apt install docker-ce\n"})}),"\n",(0,i.jsx)(n.p,{children:"Once complete you should be able to run it via the CLI, as such:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"docker -v\n"})}),"\n",(0,i.jsx)(n.p,{children:"Here's the output (versions might differ a bit from the time of writing):"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"Docker version 24.0.6, build ed223bc\n"})}),"\n",(0,i.jsx)(n.p,{children:"The following command's output will indicate if Docker's working correctly:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo docker run hello-world\n"})}),"\n",(0,i.jsx)(n.p,{children:"Here's an example of the output you'll find us \"Hello from Docker!\":"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'Hello from Docker!\nThis message shows that your installation appears to be working correctly.\n\nTo generate this message, Docker took the following steps:\n 1. The Docker client contacted the Docker daemon.\n 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.\n (amd64)\n 3. The Docker daemon created a new container from that image which runs the\n executable that produces the output you are currently reading.\n 4. The Docker daemon streamed that output to the Docker client, which sent it\n to your terminal.\n\nTo try something more ambitious, you can run an Ubuntu container with:\n $ docker run -it ubuntu bash\n\nShare images, automate workflows, and more with a free Docker ID:\n https://hub.docker.com/\n\nFor more examples and ideas, visit:\n https://docs.docker.com/get-started/\n'})}),"\n",(0,i.jsx)(n.p,{children:"Run all the commands above in your terminal, to confirm everything's working before proceeding to the next steps."}),"\n",(0,i.jsx)(n.h3,{id:"create-the-docker-image",children:"Create the Docker image"}),"\n",(0,i.jsx)(n.p,{children:"A Docker image is a read-only template with instructions for creating a Docker container, like a template. Docker images also act as a starting point when using Docker."}),"\n",(0,i.jsx)(n.p,{children:'The starting point for our use-case is a Dockerfile, where all those "template instructions" are declared.'}),"\n",(0,i.jsxs)(n.p,{children:["A ",(0,i.jsx)(n.a,{href:"https://raw.githubusercontent.com/fleek-network/lightning/main/Dockerfile",children:"Dockerfile"})," should exist in the repository source code, so make sure you have ",(0,i.jsx)(n.a,{href:"#change-directory-to-lightning-source-code",children:"change directory to the lightning source code"})," to find it."]}),"\n",(0,i.jsx)(n.h3,{id:"build-the-docker-image",children:"Build the Docker image"}),"\n",(0,i.jsxs)(n.p,{children:["Build the image named as ",(0,i.jsx)(n.code,{children:"lightning"})," from our Dockerfile:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo docker build -t lightning -f ./Dockerfile .\n"})}),"\n",(0,i.jsx)(n.p,{children:"The build process takes awhile, and you have to wait for completion."}),"\n",(0,i.jsx)(n.p,{children:"The output should be similar to:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"[+] Building 1.2s (16/16) FINISHED docker:default\n => [internal] load build definition from Dockerfile 0.0s\n => => transferring dockerfile: 990B 0.0s\n => [internal] load .dockerignore 0.0s\n => => transferring context: 2B 0.0s\n => [internal] load metadata for docker.io/library/debian:bullseye-slim 0.6s\n => [internal] load metadata for docker.io/library/rust:latest 0.9s\n => [stage-1 1/3] FROM docker.io/library/debian:bullseye-slim@sha256:3bc5e94a0e8329c102203c3f5f26fd67835f0c81633dd6949de0557867a87fac 0.0s\n => [builder 1/7] FROM docker.io/library/rust:latest@sha256:8a4ca3ca75afbc97bcf5362e9a694fe049d15734fbbaf82b8b7e224616c1254b 0.0s\n => [internal] load build context 0.3s\n => => transferring context: 948.93kB 0.3s\n => CACHED [stage-1 2/3] RUN DEBIAN_FRONTEND=noninteractive apt-get update -yq && DEBIAN_FRONTEND=noninteractive apt-get install -yq libs 0.0s\n => CACHED [builder 2/7] WORKDIR /lightning 0.0s\n => CACHED [builder 3/7] RUN apt-get update 0.0s\n => CACHED [builder 4/7] RUN apt-get install -y build-essential cmake clang pkg-config libssl-dev gcc protobuf-comp 0.0s\n => CACHED [builder 5/7] RUN --mount=type=cache,target=/usr/local/cargo/registry cargo install cargo-strip 0.0s\n => CACHED [builder 6/7] COPY . . 0.0s\n => CACHED [builder 7/7] RUN --mount=type=cache,target=/usr/local/cargo/registry --mount=type=cache,target=/lightning/target cargo buil 0.0s\n => CACHED [stage-1 3/3] COPY --from=builder /lightning/target/release/lightning-node /usr/local/bin/lgtn 0.0s\n => exporting to image 0.0s\n => => exporting layers 0.0s\n => => writing image sha256:e8e5ed19f59c3cc6a9add5bdb578c464904e9789d5f386cc4af81044c062d998 0.0s\n => => naming to docker.io/library/lightning\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["The Docker image is only required to be built once and/or, when changes are pulled from the remote repository, or specific versions you might be interested in. Otherwise, you're not required to build it every time to run the node. If you'd like to learn how to update the Lightning CLI, find our references ",(0,i.jsx)(n.a,{href:"/references/Lightning%20CLI/update-cli-from-source-code",children:"here"}),"."]})}),"\n",(0,i.jsx)(n.admonition,{type:"caution",children:(0,i.jsx)(n.p,{children:"If you don't update your source code and binary build often, you won't have the latest changes, which should happen frequently to take advantage of all the ongoing development. This is quite important to understand, as it causes confusion to some users. The Lightning application at time of writing does not update automatically."})}),"\n",(0,i.jsx)(n.h2,{id:"docker-container",children:"Docker Container"}),"\n",(0,i.jsxs)(n.p,{children:["A container is what's originated from the image we discussed in the section ",(0,i.jsx)(n.a,{href:"#build-the-docker-image",children:"build the docker image"}),", it is a run-able instance of an image. We can create, start, stop, move, or delete a container using the Docker API or CLI."]}),"\n",(0,i.jsx)(n.p,{children:"Following up, we'll learn how to run the Docker container that includes our Lightning CLI program, built from our Dockerfile."}),"\n",(0,i.jsxs)(n.p,{children:["Once the ",(0,i.jsx)(n.a,{href:"#build-the-docker-image",children:"Docker image"})," is ready, run the container based on the image ",(0,i.jsx)(n.code,{children:"lightning"}),". Effectively running the Fleek Network Lightning node process:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo docker run \\\n -p 4200-4299:4200-4299 \\\n -p 4300-4399:4300-4399 \\\n --mount type=bind,source=$HOME/.lightning,target=/home/lgtn/.lightning \\\n --mount type=bind,source=/var/tmp,target=/var/tmp \\\n --name lightning-node \\\n -it ghcr.io/fleek-network/lightning:latest\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["Notice that the command arguments we pass are for the flag's ",(0,i.jsx)(n.code,{children:"-p"})," port numbers, ",(0,i.jsx)(n.code,{children:"-v"})," to bind mount a location in your host to a container path (useful to persist your configuration files, e.g. keystore), ",(0,i.jsx)(n.code,{children:"--name"})," to make it easier to identify, ",(0,i.jsx)(n.code,{children:"-it"})," to make it interactive (e.g. presents output to the terminal), and the image name we ",(0,i.jsx)(n.a,{href:"#build-the-docker-image",children:"built earlier"}),"."]})}),"\n",(0,i.jsx)(n.p,{children:'The output would look as the following, showing the error message "Node is not whitelisted" (this error message is due to the testnet phase that requires nodes to be whitelisted to run successfully):'}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"thread 'main' panicked at 'Node is not whitelisted. Please join the Fleek Discord to get invited.', core/cli/src/testnet_sync.rs:45:9\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n/root/init: line 7: 7 Aborted (core dumped) lgtn run\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Keys have to be generated when launching the service. On Docker run, if the ",(0,i.jsx)(n.a,{href:"/guides/Node%20Operators/managing-the-keystore",children:"keystore"})," is not found, the keys are automatically generated and stored in the Docker host's ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/keystore"})," directory."]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["Have in mind that the ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/config.toml"})," is where the keystore location paths are configured, which default value is in the user ",(0,i.jsx)(n.code,{children:"$HOME"})," path. The users who customize or modify the default location, need to apply the required customizations. To learn more about how to manage the keystore, visit the ",(0,i.jsx)(n.a,{href:"/guides/Node%20Operators/managing-the-keystore",children:"managing keystore"})," section."]})}),"\n",(0,i.jsx)(n.h2,{id:"generate-keys",children:"Generate keys"}),"\n",(0,i.jsxs)(n.p,{children:["Execute the ",(0,i.jsx)(n.code,{children:"keys generate"})," command on the container ",(0,i.jsx)(n.code,{children:"lightning-node"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo docker exec -it lightning-node lgtn keys generate\n"})}),"\n",(0,i.jsxs)(n.p,{children:["We've bound the host path ",(0,i.jsx)(n.code,{children:"~/.lightning"})," into the container ",(0,i.jsx)(n.code,{children:"/home/lgtn/.lightning"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["You can list the contents of the ",(0,i.jsx)(n.code,{children:"~/.lightning"}),", where you should find the ",(0,i.jsx)(n.code,{children:"config.toml"})," and ",(0,i.jsx)(n.code,{children:"keystore"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:".\n..\nconfig.toml\nkeystore\n"})}),"\n",(0,i.jsxs)(n.p,{children:["You only have to run the ",(0,i.jsx)(n.code,{children:"keys generate"})," once from your host."]}),"\n",(0,i.jsx)(n.p,{children:"Finally, you can start the Fleek Network node by running the command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo docker start lightning-node\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"lightning-node"})," is the name we provided on first run as described in ",(0,i.jsx)(n.a,{href:"#docker-container",children:"docker container"})," section. If you have set a different name, change accordingly."]})}),"\n",(0,i.jsx)(n.h2,{id:"run-the-docker-container-as-systemd-service",children:"Run the Docker Container as Systemd Service"}),"\n",(0,i.jsxs)(n.p,{children:["In this section we\u2019ll cover how to wrap a Docker Container as a Systemd Service without the need for third party tools or complex commands. Some reasons include, minimizing the dependency on the Docker Daemon as we can move to an ",(0,i.jsx)(n.a,{href:"https://opencontainers.org/",children:"OCI complaint solution"})," other that Docker at anytime, or the fact we recommend Systemd Service Units and Systemctl to control the Service in our ",(0,i.jsx)(n.a,{href:"/docs/node/install",children:"Native install"})," that most users are familiar. Our goal is to provide guidance to the widest audience possible, if you have other preferences on managing your service that is more fitting to your needs that's fine."]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["Docker recommends using their cross-platform built-in restart policy for running a Container as a Service. For that, configure your Docker service to ",(0,i.jsx)(n.a,{href:"https://docs.docker.com/install/linux/linux-postinstall/#configure-docker-to-start-on-boot",children:"start on system boot"}),"."]})}),"\n",(0,i.jsx)(n.p,{children:"Systemd was specifically developed to serve the purpose of stopping services, dependency checking and recovery of failed services. You can have your host start, stop, enable, check the status, and generally manage a container as a Systemd Service."}),"\n",(0,i.jsx)(n.h3,{id:"create-the-systemd-service-unit",children:"Create the Systemd Service Unit"}),"\n",(0,i.jsxs)(n.p,{children:["We are going to create the unit configuration file in the /etc/systemd/system/ directory. The Service Unit is going to be named as ",(0,i.jsx)(n.code,{children:"docker-lightning.service"}),". To create the file run the following command:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo touch /etc/systemd/system/docker-lightning.service\n"})}),"\n",(0,i.jsx)(n.p,{children:"Open the file in your favorite text editor and populate with the content found here:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"[Unit]\nDescription=Fleek Network Node lightning service\nAfter=docker.service\nRequires=docker.service\n\n[Service]\nRestart=always\nRestartSec=5\nTimeoutStartSec=0\nExecStartPre=-/usr/bin/docker kill lightning-node\nExecStartPre=-/usr/bin/docker rm lightning-node\nExecStartPre=/usr/bin/docker pull ghcr.io/fleek-network/lightning:latest\nExecStart=/usr/bin/docker run -p 4200-4299:4200-4299 -p 4300-4399:4300-4399 --mount type=bind,source=/home/skywalker/.lightning,target=/home/lgtn/.lightning --mount type=bind,source=/var/tmp,target=/var/tmp --name lightning-node ghcr.io/fleek-network/lightning:latest\nExecStop=/usr/bin/docker stop lightning-node\nStandardOutput=append:/var/log/lightning/output.log\nStandardError=append:/var/log/lightning/diagnostic.log\n\n[Install]\nWantedBy=multi-user.target\n"})}),"\n",(0,i.jsx)(n.p,{children:"Once the file is saved, change the file permissions by running the command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo chmod 644 /etc/systemd/system/docker-lightning.service\n"})}),"\n",(0,i.jsx)(n.p,{children:"Next, reload the Systemctl Daemon:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo systemctl daemon-reload\n"})}),"\n",(0,i.jsx)(n.p,{children:"Enable the service on startup when the system boots:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo systemctl enable docker-lightning.service\n"})}),"\n",(0,i.jsxs)(n.p,{children:["As a result, we are now able to run our containers as a Systemd service. For this, read the document ",(0,i.jsx)(n.a,{href:"/docs/node/install#use-systemctl-to-manage-systemd-service",children:"manage systemd service"})," to find more about how to control the service."]}),"\n",(0,i.jsx)(n.h2,{id:"viewing-logs",children:"Viewing logs"}),"\n",(0,i.jsx)(n.p,{children:"To view the logs of a Docker container in real time, use the following command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo docker logs -f lightning-node\n"})}),"\n",(0,i.jsxs)(n.p,{children:["If you have wrapped the ",(0,i.jsx)(n.a,{href:"#run-the-docker-container-as-systemd-service",children:"docker container as a systemd service"}),", you can use the same commands found when installed natively, such as:"]}),"\n",(0,i.jsx)(n.p,{children:"For standard output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"tail -f /var/log/lightning/output.log\n"})}),"\n",(0,i.jsx)(n.p,{children:"Or, the standard error:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"tail -f /var/log/lightning/diagnostic.log\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Learn more about how to ",(0,i.jsx)(n.a,{href:"/docs/node/analyzing-logs",children:"analyze log messages"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"conclusion",children:"Conclusion"}),"\n",(0,i.jsx)(n.p,{children:"Containers are a way to have a self-contained environment that includes all necessary dependencies, libraries, software, amongst others required to run an application."}),"\n",(0,i.jsxs)(n.p,{children:["Fleek Network's Lightning is developed with ",(0,i.jsx)(n.a,{href:"https://www.rust-lang.org/",children:"Rust"}),", a general-purpose programming language, that requires several dependencies and libraries to compile the project. Some of these libraries are not installed by default and require some troubleshooting for the end user. ",(0,i.jsx)(n.a,{href:"https://www.docker.com/",children:"Docker"})," provides us with containers, self-containing all the required libraries for the purpose of running Lightning, our application."]}),"\n",(0,i.jsxs)(n.p,{children:["We guided you through the initial installation steps, and how to build a ",(0,i.jsx)(n.a,{href:"https://www.docker.com/",children:"Docker"})," image, which then's used to Docker run a container. Plus, provided lower-level commands, to help you understand other present or advanced use-cases, and also at higher level, offerring simple utility methods."]}),"\n",(0,i.jsxs)(n.p,{children:["While we do our best to provide the clearest instructions, there's always space for improvement, therefore feel free to make any contributions by messaging us on our ",(0,i.jsx)(n.a,{href:"https://discord.gg/fleekxyz",children:"Discord"})," or by opening a ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network",children:"PR"})," in any of our repositories."]}),"\n",(0,i.jsxs)(n.p,{children:["Discover more about the project by ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"watching/contributing on Github"}),", following us on ",(0,i.jsx)(n.a,{href:"https://twitter.com/fleek_net",children:"Twitter"}),", and joining ",(0,i.jsx)(n.a,{href:"https://discord.gg/fleekxyz",children:"our community Discord"})," for all the best updates!"]}),"\n",(0,i.jsx)(o.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function p(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(g,{...e})}):g(e)}},8432:(e,n,t)=>{t.d(n,{ZP:()=>s});var i=t(5893),r=t(1151);function o(e){const n={admonition:"admonition",code:"code",p:"p",pre:"pre",strong:"strong",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["We recommend creating a ",(0,i.jsx)(n.code,{children:"non-root"})," user with administrative privileges. It'll allow us to install any system requirements."]}),"\n",(0,i.jsxs)(n.p,{children:["You can create a new user and add to the ",(0,i.jsx)(n.strong,{children:"sudo"})," group by running:"]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["For our example, we'll be using the name ",(0,i.jsx)(n.code,{children:"lgtn"})," but you can pick whichever you'd like. If you already have a ",(0,i.jsx)(n.strong,{children:"sudoer"})," account, you can skip this step."]})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo adduser lgtn\n"})}),"\n",(0,i.jsxs)(n.p,{children:["After completing the ",(0,i.jsx)(n.code,{children:"adduser"})," steps, execute the ",(0,i.jsx)(n.code,{children:"usermod"})," to add the ",(0,i.jsx)(n.code,{children:"user"})," to the ",(0,i.jsx)(n.strong,{children:"sudo"})," group, as follows:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo usermod -aG sudo lgtn\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Switch to the new ",(0,i.jsx)(n.strong,{children:"user"})," by using the command:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"su lgtn\n"})}),"\n",(0,i.jsx)(n.p,{children:"Change the directory to the new user's home, as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"cd /home/lgtn\n"})})]})}function s(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(o,{...e})}):o(e)}},3183:(e,n,t)=>{t.d(n,{ZP:()=>s});var i=t(5893),r=t(1151);function o(e){const n={a:"a",admonition:"admonition",code:"code",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.a)(),...e.components};return(0,i.jsxs)(n.admonition,{type:"tip",children:[(0,i.jsx)(n.p,{children:"You have several ways of doing this:"}),(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Clone via HTTPS"}),"\n",(0,i.jsx)(n.li,{children:"Clone via SSH"}),"\n",(0,i.jsx)(n.li,{children:"Download via Github CLI"}),"\n",(0,i.jsxs)(n.li,{children:["Download the ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning/archive/refs/heads/main.zip",children:"zip package"})," from the repository"]}),"\n"]}),(0,i.jsxs)(n.p,{children:["We recommend HTTPS because it is the easiest to set up in the wild, and by users who are new to all this.\nAlthough, we strongly recommend using an SSH connection when interacting with GitHub. If you are to this and are interested read more about it ",(0,i.jsx)(n.a,{href:"https://docs.github.com/en/authentication/connecting-to-github-with-ssh",children:"here"}),"."]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git clone -b testnet-alpha-1 https://github.com/fleek-network/lightning.git \n"})}),(0,i.jsxs)(n.p,{children:["At time of writing, we are checking the branch name ",(0,i.jsx)(n.code,{children:"testnet-alpha-1"})," that corresponds to the testnet phase.\nHere's an example of what it'd look like when sticking to the recommended path location:"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git clone -b testnet-alpha-1 https://github.com/fleek-network/lightning.git ~/fleek-network/lightning\n"})})]})}function s(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(o,{...e})}):o(e)}},3872:(e,n,t)=>{t.d(n,{Z:()=>r});t(7294);var i=t(5893);const r=e=>{let{image:n,name:t,title:r,url:o,communityMember:s=!1}=e;return(0,i.jsx)("section",{className:"author_card",children:(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"avatar",children:(0,i.jsx)("a",{href:o,target:"_blank",alt:t,children:(0,i.jsx)("img",{src:n,alt:t})})}),(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"name",children:(0,i.jsx)("a",{href:o,target:"_blank",alt:t,children:t})}),(0,i.jsx)("span",{className:"title",children:r}),(0,i.jsxs)("span",{className:"discord",children:[s?"Join our community on":"Got questions? Find us on"," ",(0,i.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},3451:(e,n,t)=>{t.d(n,{Z:()=>i});const i=t.p+"assets/images/running-a-node-in-docker-cc0a5b3fda558b4b6dd40022fe5dd09f.png"},8597:(e,n,t)=>{t.d(n,{Z:()=>i});const i=t.p+"assets/images/running-a-node-in-docker-cc0a5b3fda558b4b6dd40022fe5dd09f.png"},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>s});var i=t(7294);const r={},o=i.createContext(r);function s(e){const n=i.useContext(o);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(r):e.components||r:s(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/4d7007b2.4793a897.js b/assets/js/4d7007b2.ccd7536a.js similarity index 97% rename from assets/js/4d7007b2.4793a897.js rename to assets/js/4d7007b2.ccd7536a.js index 2eed0ba3b..253b8df7a 100644 --- a/assets/js/4d7007b2.4793a897.js +++ b/assets/js/4d7007b2.ccd7536a.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[6272],{2482:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>a,default:()=>u,frontMatter:()=>i,metadata:()=>c,toc:()=>l});var r=n(5893),s=n(1151);const o=n.p+"assets/images/banner-references-a0368a847f1d60e338779105f44a9e9a.png",i={title:"About references",hide_title:!0,sidebar_position:1,tags:["References","Help"]},a=void 0,c={id:"index",title:"About references",description:"The references provide concise instructions to interface with the system, broken down into commands or small pieces for quick reference.",source:"@site/references/index.md",sourceDirName:".",slug:"/",permalink:"/references/",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/index.md",tags:[{label:"References",permalink:"/references/tags/references"},{label:"Help",permalink:"/references/tags/help"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",sidebarPosition:1,frontMatter:{title:"About references",hide_title:!0,sidebar_position:1,tags:["References","Help"]},sidebar:"defaultSidebar",next:{title:"Build and run in Docker",permalink:"/references/Docker/build-and-run-in-docker"}},d={},l=[];function f(e){const t={a:"a",p:"p",...(0,s.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("img",{className:"banner",src:o}),"\n",(0,r.jsx)(t.p,{children:"The references provide concise instructions to interface with the system, broken down into commands or small pieces for quick reference."}),"\n",(0,r.jsxs)(t.p,{children:["It differs from ",(0,r.jsx)(t.a,{href:"/guides",children:"Guides"})," which is more descriptive or verbose when providing instructions and how-to's."]}),"\n",(0,r.jsx)(t.p,{children:"To start, find references by consulting the available categories to locate the appropriate content on the sidebar. Our references are also available as a result when using the search feature located at the very top of the documentation site."})]})}function u(e={}){const{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(f,{...e})}):f(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>a,a:()=>i});var r=n(7294);const s={},o=r.createContext(s);function i(e){const t=r.useContext(o);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),r.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[6272],{2482:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>a,default:()=>u,frontMatter:()=>i,metadata:()=>c,toc:()=>l});var r=n(5893),s=n(1151);const o=n.p+"assets/images/banner-references-a0368a847f1d60e338779105f44a9e9a.png",i={title:"About references",hide_title:!0,sidebar_position:1,tags:["References","Help"]},a=void 0,c={id:"index",title:"About references",description:"The references provide concise instructions to interface with the system, broken down into commands or small pieces for quick reference.",source:"@site/references/index.md",sourceDirName:".",slug:"/",permalink:"/references/",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/index.md",tags:[{label:"References",permalink:"/references/tags/references"},{label:"Help",permalink:"/references/tags/help"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",sidebarPosition:1,frontMatter:{title:"About references",hide_title:!0,sidebar_position:1,tags:["References","Help"]},sidebar:"defaultSidebar",next:{title:"Build and run in Docker",permalink:"/references/Docker/build-and-run-in-docker"}},d={},l=[];function f(e){const t={a:"a",p:"p",...(0,s.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("img",{className:"banner",src:o}),"\n",(0,r.jsx)(t.p,{children:"The references provide concise instructions to interface with the system, broken down into commands or small pieces for quick reference."}),"\n",(0,r.jsxs)(t.p,{children:["It differs from ",(0,r.jsx)(t.a,{href:"/guides",children:"Guides"})," which is more descriptive or verbose when providing instructions and how-to's."]}),"\n",(0,r.jsx)(t.p,{children:"To start, find references by consulting the available categories to locate the appropriate content on the sidebar. Our references are also available as a result when using the search feature located at the very top of the documentation site."})]})}function u(e={}){const{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(f,{...e})}):f(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>a,a:()=>i});var r=n(7294);const s={},o=r.createContext(s);function i(e){const t=r.useContext(o);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),r.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5437f376.c427c81a.js b/assets/js/5437f376.b41bacab.js similarity index 99% rename from assets/js/5437f376.c427c81a.js rename to assets/js/5437f376.b41bacab.js index 5fa1e176d..fd01e5485 100644 --- a/assets/js/5437f376.c427c81a.js +++ b/assets/js/5437f376.b41bacab.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[909],{3616:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>h,default:()=>u,frontMatter:()=>a,metadata:()=>l,toc:()=>c});var i=t(5893),s=t(1151),r=t(3872),o=t(5979);const a={title:"Managing the keystore",hide_title:!0,slug:"managing-the-keystore",date:new Date("2023-11-14T12:00:00.000Z"),image:"./assets/managing-the-keystore.png?202311181211",description:"The following will guide you through some of the fundamentals to help understand how to manage the key store at the very basics, and help you persist the key store identity, in any supported system you\u2019re migrating to",category:"Tutorial",tags:["guide","keystore","public keys","private keys","keys"]},h=void 0,l={id:"Node Operators/managing-the-keystore",title:"Managing the keystore",description:"The following will guide you through some of the fundamentals to help understand how to manage the key store at the very basics, and help you persist the key store identity, in any supported system you\u2019re migrating to",source:"@site/guides/Node Operators/managing-the-keystore.md",sourceDirName:"Node Operators",slug:"/Node Operators/managing-the-keystore",permalink:"/guides/Node Operators/managing-the-keystore",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/guides/Node Operators/managing-the-keystore.md",tags:[{label:"guide",permalink:"/guides/tags/guide"},{label:"keystore",permalink:"/guides/tags/keystore"},{label:"public keys",permalink:"/guides/tags/public-keys"},{label:"private keys",permalink:"/guides/tags/private-keys"},{label:"keys",permalink:"/guides/tags/keys"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Managing the keystore",hide_title:!0,slug:"managing-the-keystore",date:"2023-11-14T12:00:00.000Z",image:"./assets/managing-the-keystore.png?202311181211",description:"The following will guide you through some of the fundamentals to help understand how to manage the key store at the very basics, and help you persist the key store identity, in any supported system you\u2019re migrating to",category:"Tutorial",tags:["guide","keystore","public keys","private keys","keys"]},sidebar:"defaultSidebar",previous:{title:"How to manage log files",permalink:"/guides/Node Operators/how-to-manage-log-files"},next:{title:"Running a node in Docker",permalink:"/guides/Node Operators/running-a-node-in-docker"}},d={image:t(4110).Z},c=[{value:"Introduction",id:"introduction",level:2},{value:"Pre-requisites",id:"pre-requisites",level:2},{value:"Configuration file",id:"configuration-file",level:2},{value:"Locating the file",id:"locating-the-file",level:3},{value:"Configuration sections",id:"configuration-sections",level:3},{value:"Type of keys",id:"type-of-keys",level:3},{value:"Key privacy",id:"key-privacy",level:3},{value:"Identity selection",id:"identity-selection",level:3},{value:"Backing up the keystore",id:"backing-up-the-keystore",level:2},{value:"Lower security",id:"lower-security",level:3},{value:"Higher security",id:"higher-security",level:3},{value:"Storage",id:"storage",level:3},{value:"Loading keys on runtime",id:"loading-keys-on-runtime",level:2},{value:"Restoring the keystore",id:"restoring-the-keystore",level:2},{value:"Conclusion",id:"conclusion",level:2}];function p(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Managing the keystore",src:t(4350).Z+"",width:"1450",height:"816"})}),"\n","\n","\n",(0,i.jsx)(n.h2,{id:"introduction",children:"Introduction"}),"\n",(0,i.jsx)(n.p,{children:"Fleek Network incentivizes participation by rewarding its node providers. A node is identifiable by an identity, which the reward mechanism uses to identify the node to reward it."}),"\n",(0,i.jsx)(n.admonition,{type:"info",children:(0,i.jsxs)(n.p,{children:["At time of writing the rewards mechanism hasn't yet been introduced, read the ",(0,i.jsx)(n.a,{href:"https://blog.fleek.network/post/fleek-network-testnet-plans",children:"testnet plans"})," to get a high level perspective over the plans. A token and economics paper should be released in the future."]})}),"\n",(0,i.jsxs)(n.p,{children:["We'll use the term identity to describe the key store declared in the configuration, in our case ",(0,i.jsx)(n.a,{href:"https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail",children:"PEM"})," files. The content of the PEM files and the file itself should be kept secret."]}),"\n",(0,i.jsxs)(n.p,{children:["The key store is in the file system and the location is defined in the Fleek Network ",(0,i.jsx)(n.code,{children:"~/.lightning/config.toml"}),", as a private key stored in an identity named PEM file (by default ",(0,i.jsx)(n.code,{children:"consensus.pem"})," and ",(0,i.jsx)(n.code,{children:"node.pem"}),"). It's essential to understand this, as you may want to copy the identity to a new server setup, to persist the identity accross to the new server setup."]}),"\n",(0,i.jsx)(n.admonition,{type:"caution",children:(0,i.jsx)(n.p,{children:"Security is achieved by issuing users private cryptographic keys. Only the holder of the private key has access to sensitive information, such as an identity, which relates to reputation, rewards, etc. The security of the private key is the responsibility of the user. Unfortunately, Fleek Network is unable to help you regain access to your private key if you've lost or failed to secure it. The private keys are your responsibility."})}),"\n",(0,i.jsxs)(n.p,{children:["The following will guide you through some of the fundamentals to help understand how to manage the key store at the very basics, and help you persist the key store identity, in any ",(0,i.jsx)(n.a,{href:"/docs/node/requirements#server",children:"supported system"})," you're migrating to."]}),"\n",(0,i.jsx)(n.h2,{id:"pre-requisites",children:"Pre-requisites"}),"\n",(0,i.jsx)(n.p,{children:"To follow the guide, you will need the following:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Familiarity with the command-line interface"}),"\n",(0,i.jsxs)(n.li,{children:["A basic understanding of ",(0,i.jsx)(n.a,{href:"https://en.wikipedia.org/wiki/Public-key_cryptography",children:"how public key cryptography works"})]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"configuration-file",children:"Configuration file"}),"\n",(0,i.jsx)(n.h3,{id:"locating-the-file",children:"Locating the file"}),"\n",(0,i.jsxs)(n.p,{children:["The Lightning CLI has a configuration file in the home directory of the user, which by default is located in the path ",(0,i.jsx)(n.code,{children:"$HOME/.lightning"})," or ",(0,i.jsx)(n.code,{children:"~/.lightning"})," under the name ",(0,i.jsx)(n.code,{children:"config.toml"}),". It's generally described as ",(0,i.jsx)(n.code,{children:"~/.lightning/config.toml"}),"."]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["The tilde in ",(0,i.jsx)(n.code,{children:"~/.lightning"})," represents ",(0,i.jsx)(n.code,{children:"$HOME"})," which is simpler, but we'll use ",(0,i.jsx)(n.code,{children:"$HOME"})," to make it easy to follow."]})}),"\n",(0,i.jsxs)(n.p,{children:["If you're following the install recommendations you should be logged in with a ",(0,i.jsx)(n.strong,{children:"sudoer"})," account. For our guide, let's imagine that the ",(0,i.jsx)(n.strong,{children:"sudoer"})," username we are logged in with is ",(0,i.jsx)(n.strong,{children:"lgtn"}),"."]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["The word ",(0,i.jsx)(n.strong,{children:"sudo"}),' is the abbreviation of the term "super user do". As the name suggests, it is the privilege that a super user, such as an administrator has to do whatever it wants in the system. A super user can be an administrator, like the ',(0,i.jsx)(n.strong,{children:"root"})," or what we described here as a user in the group ",(0,i.jsx)(n.strong,{children:"sudo"})," aka ",(0,i.jsx)(n.strong,{children:"sudoer"}),"."]})}),"\n",(0,i.jsx)(n.p,{children:"If you are logged in with a username, that'd be:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"/home//.lightning/config.toml\n"})}),"\n",(0,i.jsxs)(n.p,{children:["For our example for user ",(0,i.jsx)(n.code,{children:"lgtn"})," that is:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"/home/lgtn/.lightning/config.toml\n"})}),"\n",(0,i.jsxs)(n.p,{children:["If you log in with another user, let's say ",(0,i.jsx)(n.code,{children:"fleek"})," it'd be:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"/home/fleek/.lightning/config.toml\n"})}),"\n",(0,i.jsx)(n.p,{children:"At any time, you can check which user you are logged in with by running the command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"whoami\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Here's an example of our user ",(0,i.jsx)(n.code,{children:"lgtn"}),", which for the command above outputs:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"lgtn\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["To switch to a particular user, you can run the command ",(0,i.jsx)(n.code,{children:"su "})," e.g. for the user ",(0,i.jsx)(n.strong,{children:"lgtn"})," we would execute the command ",(0,i.jsx)(n.code,{children:"su lgtn"}),"."]})}),"\n",(0,i.jsxs)(n.p,{children:["Now that you know where to locate the configuration file for any given user you are logged in with, learn about the ",(0,i.jsx)(n.a,{href:"#configuration-sections",children:"Configuration sections"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"configuration-sections",children:"Configuration sections"}),"\n",(0,i.jsxs)(n.p,{children:["The Fleek Network node configuration settings are located in the path ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/config.toml"}),", and it's organized by configuration sections."]}),"\n",(0,i.jsx)(n.p,{children:"At the time of writing, we have a TOML file with sections. Here are some examples amongst others:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"application"}),"\n",(0,i.jsx)(n.li,{children:"origin-ipfs"}),"\n",(0,i.jsx)(n.li,{children:"rpc"}),"\n",(0,i.jsx)(n.li,{children:"signer"}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["Each of the sections holds several property names and values. If you are accustomed to the ",(0,i.jsx)(n.a,{href:"https://en.wikipedia.org/wiki/JSON",children:"JSON"})," or ",(0,i.jsx)(n.a,{href:"https://en.wikipedia.org/wiki/YAML",children:"YAML"})," formats, you'll find the TOML format a bit similar (if you'd like to learn more about the TOML file format, read about it ",(0,i.jsx)(n.a,{href:"https://toml.io/en/",children:"here"}),")."]}),"\n",(0,i.jsx)(n.p,{children:"By default, and at time of writing the Lightning CLI configuration file (config.toml) is similar to:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'[BLANK]\n\n[application]\ndb_path = "/home/lgtn/.lightning/data/app_db"\nmode = "Prod"\nstorage = "RocksDb"\ntestnet = true\n\n[blockserver]\naddress = "0.0.0.0:4211"\n\n[broadcast]\naddress = "0.0.0.0:4200"\n\n[consensus]\nstore_path = "/home/lgtn/.lightning/data/narwhal_store"\n\n[dht]\naddress = "0.0.0.0:8101"\nbootstrappers = []\n\n[fetcher]\n\n[fsstore]\nroot = "/home/lgtn/.lightning/blockstore"\n\n[[handshake.transport]]\nsignal_address = "0.0.0.0:4210"\ntype = "WebRTC"\n\n[[handshake.worker]]\ntype = "AsyncWorker"\n\n[[handshake.worker]]\ntype = "AsyncWorker"\n\n[[handshake.worker]]\ntype = "AsyncWorker"\n\n[[handshake.worker]]\ntype = "AsyncWorker"\n\n[[origin-ipfs.gateways]]\nauthority = "ipfs.io"\nprotocol = "Https"\n\n[[origin-ipfs.gateways]]\nauthority = "fleek.ipfs.io"\nprotocol = "Https"\n\n[[origin-ipfs.gateways]]\nauthority = "ipfs.runfission.com"\nprotocol = "Https"\n\n[rep-collector]\nreporter_buffer_size = 5\n\n[resolver]\nstore_path = "/home/lgtn/.lightning/data/resolver_store"\n\n[rpc]\naddr = "0.0.0.0"\nport = 4230\n\n[service-executor]\nservices = [0, 1]\n\n[signer]\nconsensus_key_path = "/home/lgtn/.lightning/keystore/consensus.pem"\nnode_key_path = "/home/lgtn/.lightning/keystore/node.pem"\n\n[topology]\ntesting_min_nodes = 9\ntesting_target_k = 8\n'})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsx)(n.p,{children:"Beware that the configuration file might look a bit different depending on the version you're running and the current development features in place by the Fleek Network core team. You shouldn't copy the example above and replace with yours, as this only servers for illustrative purposes."})}),"\n",(0,i.jsx)(n.p,{children:"Some advanced use cases might require dealing with the host and port number binding, depending on the service provider's needs and customization. We'll keep things simple and assume the default settings."}),"\n",(0,i.jsxs)(n.p,{children:["In this guide, we are interested in the ",(0,i.jsx)(n.code,{children:"[signer]"})," section settings for the ",(0,i.jsx)(n.code,{children:"consensus_key_path"})," and ",(0,i.jsx)(n.code,{children:"node_key_path"})," which by default is set to ",(0,i.jsx)(n.code,{children:"~/.lightning/keystore"}),"."]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["The identity is a text description for the Keystore and at the time of writing we have not yet implemented multiple identity management via the CLI. Thereupon, the identity value serves to find the filename match in the ",(0,i.jsx)(n.code,{children:"keystore_path"}),". This might change as we progress with development. Check the ",(0,i.jsx)(n.a,{href:"#identity-selection",children:"Identity selection"})," to learn more about it!"]})}),"\n",(0,i.jsx)(n.h3,{id:"type-of-keys",children:"Type of keys"}),"\n",(0,i.jsxs)(n.p,{children:["There are three types of keys related to the identity of a node and the account ownership. The keys are based in public-key cryptography, or asymmetric cryptography where each key pair consists of a public key and a corresponding private key. The keys are described in the section ",(0,i.jsx)(n.a,{href:"/docs/learn/the-network/#identity-on-the-fleek-network",children:"identity on the Fleek Network"})," as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["A Node key (ConsensusPublicKey) is ",(0,i.jsx)(n.a,{href:"https://electriccoin.co/blog/new-snark-curve/",children:"BLS12-381"})," which facilitates the consensus algorithm or persistence of state, resilience and fault tolerance. Has multi-signature support, the ability to aggregate many signatures into one used for consensus committee when signing certificates"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["A Node Networking key (NodePublicKey) is ",(0,i.jsx)(n.a,{href:"https://en.wikipedia.org/wiki/EdDSA",children:"Ed25519"})," used for the speed and performance of the network communications"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Account Owner keys are based on ",(0,i.jsx)(n.a,{href:"https://www.secg.org/sec2-v2.pdf",children:"secp256k1"}),", which corresponds to an Ethereum Address"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"For instance, a public key is open to anybody to see, and it represents a unique node identifier in the Fleek Network, a bit like a passport number. On the other hand, the private key is secret, and the operator is responsible to store it privately."}),"\n",(0,i.jsx)(n.p,{children:"The Fleek Network relies on cryptography, thus the Fleek Network team and anybody can access, compromise or manipulate the secrets of an identity. On the other hand, the public key can be used by anyone, Fleek Network included, to identify a node or send rewards to the address without jeopardizing identity security."}),"\n",(0,i.jsxs)(n.p,{children:["To learn more about the identities on the Fleek Network ",(0,i.jsx)(n.a,{href:"/docs/learn/the-network/#identity-on-the-fleek-network",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"key-privacy",children:"Key privacy"}),"\n",(0,i.jsx)(n.p,{children:"If you don\u2019t keep your private keys secret, you'll have your node compromised."}),"\n",(0,i.jsx)(n.p,{children:"Here are a few examples of what you should not do:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Share the ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/keystore"})," directory file content publicly"]}),"\n",(0,i.jsxs)(n.li,{children:["Track the ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/keystore"})," directory files in a version control repository e.g. git"]}),"\n",(0,i.jsxs)(n.li,{children:['Have poor "rights" permissions in UNIX systems e.g. everyone can read, delete, modify ',(0,i.jsx)(n.code,{children:"$HOME/.lightning"})]}),"\n",(0,i.jsx)(n.li,{children:"Allow anyone to access the node provider physically without any access control to the operating and file systems e.g. a VPS provider"}),"\n",(0,i.jsxs)(n.li,{children:["Get rid of a hard drive unformatted or blind erased by selling to somebody or dumping in the bin, which contains ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/keystore"})]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"There are many other ways of getting compromised, but hopefully, the ones put above give you a good starter into the subject."}),"\n",(0,i.jsx)(n.p,{children:"Remember, the node provider is the only one responsible when managing the key store. Neither Fleek Network nor the most sophisticated AI system presently can compromise the cryptography in use to help you out. You are fully responsible for securing and retaining your private keys."}),"\n",(0,i.jsx)(n.h3,{id:"identity-selection",children:"Identity selection"}),"\n",(0,i.jsx)(n.p,{children:"Multiple identity management is yet to be implemented but in any case, some users might find it trivial to keep multiple identities and switch between them referencing them by name. The following section is not advocating this approach but sharing some approaches that can help certain use-cases."}),"\n",(0,i.jsxs)(n.p,{children:["Let's suppose that we've recently moved to a new server setup and copied our previous server keystore keys as ",(0,i.jsx)(n.code,{children:"consensus.pem"})," and ",(0,i.jsx)(n.code,{children:"node.pem"})," and renamed the ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/keystore/*.pem"})," to ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/keystore/new-*.pem"}),"."]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["We are using a wildcard ",(0,i.jsx)(n.code,{children:"*"})," to reduce verbosity. The wildcard means as replacement for all the filenames encountered in the path and extension without having to name them individually as we know they are ",(0,i.jsx)(n.code,{children:"consensus.pem"})," and ",(0,i.jsx)(n.code,{children:"node.pem"}),"."]})}),"\n",(0,i.jsxs)(n.p,{children:["To illustrate this scenario, here's an example of how our ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/keystore"})," directory could look like:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:".\n\u251c\u2500\u2500 new-consensus.pem\n\u251c\u2500\u2500 new-node.pem\n\u2514\u2500\u2500 old-consensus.pem\n\u2514\u2500\u2500 old-node.pem\n\n0 directories, 4 file\n"})}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"old-*.pem"})," files are the original key store and ",(0,i.jsx)(n.code,{children:"new-*.pem"})," could correspond to the new identity created while setting up the node in the new server."]}),"\n",(0,i.jsxs)(n.p,{children:["Since we have ",(0,i.jsx)(n.code,{children:"[signer]"})," set to the default values, in particular:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-toml",children:'[signer]\nconsensus_key_path = "/home/lgtn/.lightning/keystore/consensus.pem"\nnode_key_path = "/home/lgtn/.lightning/keystore/node.pem"\n'})}),"\n",(0,i.jsxs)(n.p,{children:["We'd be required to change and switch to the preferred keys. The identity is switch to the provided values once the node is restarted. Thus, we can switch to any identity by changing the ",(0,i.jsx)(n.code,{children:"[signer]"})," ",(0,i.jsx)(n.code,{children:"consensus_key_path"})," and ",(0,i.jsx)(n.code,{children:"node_key_path"})," pathname values anytime as long we restart the server successfully."]}),"\n",(0,i.jsx)(n.p,{children:"To verify which keys are loaded by the Lightning CLI run the command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"lgtn keys show\n"})}),"\n",(0,i.jsx)(n.p,{children:"You'd find the public keys in the output, which can be used for comparision and should be different everytime the configuration changes and reloaded. Here's an example of the output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"Node Public Key: RwPpr35H5AAfWwSDFxwYuJv5TA8PWUd2pdBg+UKsORc=\nConsensus Public Key: s36g09qQzaaOJxi0UZDRCXj3HUUWjaGiYrQV6Ylo9Ih6jMvrnxM5s1OpBnsEj5R1AVYcuxlnVR+oyEjgJ3WpI5LOHSN1Q6Zur33vka3IachBEIKIbsiXMJW16vu4n4bG\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsx)(n.p,{children:"The PEM files can be named as you wish, but by default we like to keep it sound to avoid confusion and make it as clear as possible."})}),"\n",(0,i.jsx)(n.h2,{id:"backing-up-the-keystore",children:"Backing up the keystore"}),"\n",(0,i.jsx)(n.p,{children:"When dealing with Fleek Network it's crucial to always be aware of the identity. You should backup private keys in case the unexpected happens, as it's impossible to recover the identity in any other way, including the core team, any other person or system."}),"\n",(0,i.jsxs)(n.p,{children:["Backing up your keystore pem files are crucial to ensure the safety and accessibility of your identity on the Fleek Network. For example, if your ",(0,i.jsx)(n.code,{children:"$HOME/.lightning"})," is deleted you'll still be able to restore it if you have backed it up properly."]}),"\n",(0,i.jsx)(n.p,{children:"There are many ways to make identity backups, each with its own benefits and drawbacks. At risk of oversimplifying, we'll focus on a simple manual approach to expose some principles you should have awareness."}),"\n",(0,i.jsx)(n.admonition,{type:"caution",children:(0,i.jsx)(n.p,{children:"The security is never stronger than its weakest link, and it is very likely that the weakest link is not the method itself. It's pointless to encrypt the backup archive with sophisticated methods when the passphrase is weak or of an easy guess."})}),"\n",(0,i.jsx)(n.p,{children:"None of the methods described here are being endorsed by the Fleek Network team use the knowledge provided here for educational purposes only and at your own risk."}),"\n",(0,i.jsx)(n.h3,{id:"lower-security",children:"Lower security"}),"\n",(0,i.jsx)(n.p,{children:"If you opt for the lowest level of security, you can use zip and unzip. The man page of zip described the encryption algorithm used to be weaker than PGP."}),"\n",(0,i.jsxs)(n.p,{children:["To zip and encrypto the ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/keystore"})," directory run:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"# It'll prompt for password (remember)\nzip --encrypt -r keystore.zip.enc $HOME/.lightning/keystore\n"})}),"\n",(0,i.jsxs)(n.p,{children:["To unzip and decrypt the ",(0,i.jsx)(n.code,{children:"keystore.zip.enc"}),", you'd run:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"# It'll prompt for password (recall)\nunzip keystore.zip.enc -d $HOME/.lightning/keystore\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["We provide the unzip destiny target to the flag ",(0,i.jsx)(n.code,{children:"-d"}),". The unzip process outputs the files onto the desired location ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/keystore"}),", thus overriding any contents. If you have any files in the destiny target directory it'll be overriden, effectively replacing with the output of the unzipped directory content, so make sure you backup any files as required."]})}),"\n",(0,i.jsx)(n.h3,{id:"higher-security",children:"Higher security"}),"\n",(0,i.jsxs)(n.p,{children:["Create a ",(0,i.jsx)(n.code,{children:"Tar"})," archive, which will contain the target directory, files and the Tar stores all of the relative paths in the tarball itself."]}),"\n",(0,i.jsxs)(n.p,{children:["Create a ",(0,i.jsx)(n.code,{children:"tarbar"})," by executing:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'tar -cf "keystore.tar" $HOME/.lightning/keystore\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"keystore.tar"})," should be in the current work directory."]}),"\n",(0,i.jsxs)(n.p,{children:["Use ",(0,i.jsx)(n.code,{children:"gpg"})," with the ",(0,i.jsx)(n.a,{href:"https://www.gnupg.org/gph/en/manual/x110.html",children:"symmetric option"}),", it creates the keys for that file and request a password to protect them. If you are familiar with asymmetric ",(0,i.jsx)(n.code,{children:"gpg"}),", it's similar, but it's not signed with your public key or such."]}),"\n",(0,i.jsx)(n.p,{children:"The encryption command is:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo gpg -a --symmetric --cipher-algo AES256 keystore.tar\n"})}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"keystore.tar.asc"})," should be in the current work directory."]}),"\n",(0,i.jsxs)(n.p,{children:["To decrypt the ",(0,i.jsx)(n.code,{children:"keystore.tar.asc"})," file, enter:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo gpg -a --output keystore.tar --decrypt keystore.tar.asc\n"})}),"\n",(0,i.jsxs)(n.p,{children:["To extract the ",(0,i.jsx)(n.code,{children:"keystore.tar"})," is simple, but be aware that it unarchives with the original directory structure, which might be a bit confusing. So, we'll create a new temporary directory for our example that will use to extract to."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"mkdir $HOME/tar_keystore_extract\n"})}),"\n",(0,i.jsx)(n.p,{children:"Now, run the command to extract to the target directory, as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"tar -xf keystore.tar -C $HOME/tar_keystore_extract\n"})}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"/home//.lightning/keystore"})," should be in the ",(0,i.jsx)(n.code,{children:"tar_keystore_extract"})," directory where you'll find the PEM files."]}),"\n",(0,i.jsx)(n.h3,{id:"storage",children:"Storage"}),"\n",(0,i.jsx)(n.p,{children:"The backup archive should only be accessible by yourself. If you decided to store it in a cloud storage provider, be aware of increased security risks. Cloud storage is convenient, but it ultimately puts data into the hands of others. If you're not particularly concerned, or have confidence about the encryption of the files, then that's at your own risk. But it's recommended to store in a physical hard drive that remains disconnected from computers and network devices."}),"\n",(0,i.jsx)(n.admonition,{type:"caution",children:(0,i.jsx)(n.p,{children:"If you use cloud storage to store your sensitive data, encryption should be your first line of defense. Encrypting files before uploading them to the cloud is crucial to reduce others from accessing information without your permissions and knowledge."})}),"\n",(0,i.jsx)(n.p,{children:"Remember that the security of the private key is the responsibility of the user. Unfortunately, the Fleek Network team and any others are unable to help regain access to private key if lost or failed to secure them. The private keys are the user responsibility. The Fleek Network team doesn't endorse any methods of encryption and storage, the methods described here are for educational purposes only."}),"\n",(0,i.jsx)(n.h2,{id:"loading-keys-on-runtime",children:"Loading keys on runtime"}),"\n",(0,i.jsxs)(n.p,{children:["As described in the section ",(0,i.jsx)(n.a,{href:"#configuration-file",children:"configuration files"})," the default location of the ",(0,i.jsx)(n.code,{children:".lightning"})," system configuration directory is ",(0,i.jsx)(n.code,{children:"$HOME/.lightning"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/config.toml"})," holds the information of where the Lightning CLI node process should pull the keystore pem files. The location of the pem files can be placed anywhere the node process has permissions to read."]}),"\n",(0,i.jsxs)(n.p,{children:["When unarchiving the backup files, the keystore directory or pem files should be placed in the directory declared in the ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/config.toml"}),". That is if the location is the one specified on the runtime\u2013the command declared to launch and run the lightning service, that has the optional ",(0,i.jsx)(n.code,{children:"-c"})," configuration flag that takes any custom location which overrides the default ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/config.toml"}),"."]}),"\n",(0,i.jsxs)(n.admonition,{type:"caution",children:[(0,i.jsxs)(n.p,{children:["On runtime, the Lightning service can have specified a configuration file in any readable location. If a configuration pathname isn't passed, it'll default to the ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/config.toml"}),". It's important to understand this to avoid confusion."]}),(0,i.jsx)(n.p,{children:"The service that starts with:"}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"lgtn -c /root/custom-configuration.toml run\n"})}),(0,i.jsx)(n.p,{children:"Can have complete different settings from any of the following:"}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"lgtn -c /home/lgtn/.lightning/config.toml run\n"})}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"lgtn -c ~/.lightning/config.toml run\n"})}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"lgtn run\n"})}),(0,i.jsx)(n.p,{children:"Due to the fact that any of the fails above might contain different settings declared in the file body."})]}),"\n",(0,i.jsx)(n.p,{children:"For instance, we can imagine a scenario where our service is started with the command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"lgtn -c /home/lgtn/.lightning/config.toml run\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Where the ",(0,i.jsx)(n.code,{children:"keystore"})," is placed under the parent directory ",(0,i.jsx)(n.code,{children:"/home/lgtn/.lightning/"}),". Resulting in the configuration file have the following settings for the hypothetical username ",(0,i.jsx)(n.code,{children:"lgtn"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'[signer]\nconsensus_key_path = "/home/lgtn/.lightning/keystore/consensus.pem"\nnode_key_path = "/home/lgtn/.lightning/keystore/node.pem"\n'})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["On the ",(0,i.jsx)(n.a,{href:"/docs/node/install",children:"install instructions"})," provided by the documentation, a ",(0,i.jsx)(n.a,{href:"/docs/node/install#systemd-service-setup",children:"Systemd service unit"})," is recommended to allow the user control the Lightning service via systemctl. The Systemd service unit file should contain the recommended usage of ",(0,i.jsx)(n.code,{children:"-c"})," configuration. If you have followed the recommendations it should be familiar."]})}),"\n",(0,i.jsx)(n.h2,{id:"restoring-the-keystore",children:"Restoring the keystore"}),"\n",(0,i.jsx)(o.ZP,{}),"\n",(0,i.jsx)(n.h2,{id:"conclusion",children:"Conclusion"}),"\n",(0,i.jsx)(n.p,{children:"We've walked through most basics of where the configuration file is located, the configuration settings we use to set up and run the node, the different configuration sections we have, and most importantly the identity section."}),"\n",(0,i.jsxs)(n.p,{children:["Additionally, a brief guide on the ",(0,i.jsx)(n.a,{href:"#identity",children:"identity"}),", more specifically an introduction to the ",(0,i.jsx)(n.a,{href:"#type-of-keys",children:"type of keys"})," and ",(0,i.jsx)(n.a,{href:"#key-privacy",children:"key privacy"}),", which we find important to understand for anyone seriously interested in running a node by hinting into some system administration and security principles."]}),"\n",(0,i.jsx)(n.p,{children:"Separately, at risk of oversimpliying provided a brief introduction into the backup of the keystore directory."}),"\n",(0,i.jsx)(n.p,{children:"In the future, we'll introduce more advanced topics that will help you improve the knowledge you get from this, but we are glad that you followed this guide and got some comprehension to help you manage the key store."}),"\n",(0,i.jsxs)(n.p,{children:["While we do our best to provide the clearest instructions, there's always space for improvement, therefore feel free to make any contributions by messaging us on our ",(0,i.jsx)(n.a,{href:"https://discord.gg/fleekxyz",children:"Discord"})," or by opening a ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network",children:"PR"})," in any of our repositories."]}),"\n",(0,i.jsxs)(n.p,{children:["Discover more about the project by ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"watching/contributing on Github"}),", following us on ",(0,i.jsx)(n.a,{href:"https://twitter.com/fleek_net",children:"Twitter"}),", and joining ",(0,i.jsx)(n.a,{href:"https://discord.gg/fleekxyz",children:"our community Discord"})," for all the best updates!"]}),"\n",(0,i.jsx)(r.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function u(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(p,{...e})}):p(e)}},5979:(e,n,t)=>{t.d(n,{ZP:()=>o});var i=t(5893),s=t(1151);function r(e){const n={a:"a",admonition:"admonition",code:"code",li:"li",ol:"ol",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["You can restore the keystore (Public Keys) by copying the directory to the ",(0,i.jsx)(n.code,{children:"~/.lightning"})," directory."]}),"\n",(0,i.jsx)(n.p,{children:"Let's assume that you know where your backup directory or files are located. To keep our instructions easy to follow, let's say that:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["The keystore and files are located under the hypothetical location ",(0,i.jsx)(n.code,{children:"/my-keystore-backup"})]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["The files in the ",(0,i.jsx)(n.code,{children:"/my-keystore-backup"})," are the following:"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"/my-keystore-backup\n\u251c\u2500\u2500 consensus.pem\n\u2514\u2500\u2500 node.pem\n\n1 directory, 2 files\n"})}),"\n",(0,i.jsx)(n.p,{children:"Considering the above for our example, you would have to run the following command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"mv /my-keystore-backup /home//.lightning/keystore\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["Remember to replace the ",(0,i.jsx)(n.code,{children:""})," with the correct username for the setup. For example, if you have installed the Fleek Network with the username ",(0,i.jsx)(n.code,{children:"lgtn"})," that would be ",(0,i.jsx)(n.code,{children:"/home/lgtn/.lightning/keystore"}),"."]})}),"\n",(0,i.jsxs)(n.p,{children:["Once moved, remember to start the service, you can learn how to manage the service by reading the section ",(0,i.jsx)(n.a,{href:"/docs/node/systemd-service",children:"Systemd Service"}),"."]})]})}function o(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(r,{...e})}):r(e)}},3872:(e,n,t)=>{t.d(n,{Z:()=>s});t(7294);var i=t(5893);const s=e=>{let{image:n,name:t,title:s,url:r,communityMember:o=!1}=e;return(0,i.jsx)("section",{className:"author_card",children:(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"avatar",children:(0,i.jsx)("a",{href:r,target:"_blank",alt:t,children:(0,i.jsx)("img",{src:n,alt:t})})}),(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"name",children:(0,i.jsx)("a",{href:r,target:"_blank",alt:t,children:t})}),(0,i.jsx)("span",{className:"title",children:s}),(0,i.jsxs)("span",{className:"discord",children:[o?"Join our community on":"Got questions? Find us on"," ",(0,i.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},4110:(e,n,t)=>{t.d(n,{Z:()=>i});const i=t.p+"assets/images/managing-the-keystore-fe4cdb19d2f59c54bcf864b0e069b535.png"},4350:(e,n,t)=>{t.d(n,{Z:()=>i});const i=t.p+"assets/images/managing-the-keystore-fe4cdb19d2f59c54bcf864b0e069b535.png"},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>o});var i=t(7294);const s={},r=i.createContext(s);function o(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(s):e.components||s:o(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[909],{3616:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>h,default:()=>u,frontMatter:()=>a,metadata:()=>l,toc:()=>c});var i=t(5893),s=t(1151),r=t(3872),o=t(5979);const a={title:"Managing the keystore",hide_title:!0,slug:"managing-the-keystore",date:new Date("2023-11-14T12:00:00.000Z"),image:"./assets/managing-the-keystore.png?202311181211",description:"The following will guide you through some of the fundamentals to help understand how to manage the key store at the very basics, and help you persist the key store identity, in any supported system you\u2019re migrating to",category:"Tutorial",tags:["guide","keystore","public keys","private keys","keys"]},h=void 0,l={id:"Node Operators/managing-the-keystore",title:"Managing the keystore",description:"The following will guide you through some of the fundamentals to help understand how to manage the key store at the very basics, and help you persist the key store identity, in any supported system you\u2019re migrating to",source:"@site/guides/Node Operators/managing-the-keystore.md",sourceDirName:"Node Operators",slug:"/Node Operators/managing-the-keystore",permalink:"/guides/Node Operators/managing-the-keystore",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/guides/Node Operators/managing-the-keystore.md",tags:[{label:"guide",permalink:"/guides/tags/guide"},{label:"keystore",permalink:"/guides/tags/keystore"},{label:"public keys",permalink:"/guides/tags/public-keys"},{label:"private keys",permalink:"/guides/tags/private-keys"},{label:"keys",permalink:"/guides/tags/keys"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Managing the keystore",hide_title:!0,slug:"managing-the-keystore",date:"2023-11-14T12:00:00.000Z",image:"./assets/managing-the-keystore.png?202311181211",description:"The following will guide you through some of the fundamentals to help understand how to manage the key store at the very basics, and help you persist the key store identity, in any supported system you\u2019re migrating to",category:"Tutorial",tags:["guide","keystore","public keys","private keys","keys"]},sidebar:"defaultSidebar",previous:{title:"How to manage log files",permalink:"/guides/Node Operators/how-to-manage-log-files"},next:{title:"Running a node in Docker",permalink:"/guides/Node Operators/running-a-node-in-docker"}},d={image:t(4110).Z},c=[{value:"Introduction",id:"introduction",level:2},{value:"Pre-requisites",id:"pre-requisites",level:2},{value:"Configuration file",id:"configuration-file",level:2},{value:"Locating the file",id:"locating-the-file",level:3},{value:"Configuration sections",id:"configuration-sections",level:3},{value:"Type of keys",id:"type-of-keys",level:3},{value:"Key privacy",id:"key-privacy",level:3},{value:"Identity selection",id:"identity-selection",level:3},{value:"Backing up the keystore",id:"backing-up-the-keystore",level:2},{value:"Lower security",id:"lower-security",level:3},{value:"Higher security",id:"higher-security",level:3},{value:"Storage",id:"storage",level:3},{value:"Loading keys on runtime",id:"loading-keys-on-runtime",level:2},{value:"Restoring the keystore",id:"restoring-the-keystore",level:2},{value:"Conclusion",id:"conclusion",level:2}];function p(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Managing the keystore",src:t(4350).Z+"",width:"1450",height:"816"})}),"\n","\n","\n",(0,i.jsx)(n.h2,{id:"introduction",children:"Introduction"}),"\n",(0,i.jsx)(n.p,{children:"Fleek Network incentivizes participation by rewarding its node providers. A node is identifiable by an identity, which the reward mechanism uses to identify the node to reward it."}),"\n",(0,i.jsx)(n.admonition,{type:"info",children:(0,i.jsxs)(n.p,{children:["At time of writing the rewards mechanism hasn't yet been introduced, read the ",(0,i.jsx)(n.a,{href:"https://blog.fleek.network/post/fleek-network-testnet-plans",children:"testnet plans"})," to get a high level perspective over the plans. A token and economics paper should be released in the future."]})}),"\n",(0,i.jsxs)(n.p,{children:["We'll use the term identity to describe the key store declared in the configuration, in our case ",(0,i.jsx)(n.a,{href:"https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail",children:"PEM"})," files. The content of the PEM files and the file itself should be kept secret."]}),"\n",(0,i.jsxs)(n.p,{children:["The key store is in the file system and the location is defined in the Fleek Network ",(0,i.jsx)(n.code,{children:"~/.lightning/config.toml"}),", as a private key stored in an identity named PEM file (by default ",(0,i.jsx)(n.code,{children:"consensus.pem"})," and ",(0,i.jsx)(n.code,{children:"node.pem"}),"). It's essential to understand this, as you may want to copy the identity to a new server setup, to persist the identity accross to the new server setup."]}),"\n",(0,i.jsx)(n.admonition,{type:"caution",children:(0,i.jsx)(n.p,{children:"Security is achieved by issuing users private cryptographic keys. Only the holder of the private key has access to sensitive information, such as an identity, which relates to reputation, rewards, etc. The security of the private key is the responsibility of the user. Unfortunately, Fleek Network is unable to help you regain access to your private key if you've lost or failed to secure it. The private keys are your responsibility."})}),"\n",(0,i.jsxs)(n.p,{children:["The following will guide you through some of the fundamentals to help understand how to manage the key store at the very basics, and help you persist the key store identity, in any ",(0,i.jsx)(n.a,{href:"/docs/node/requirements#server",children:"supported system"})," you're migrating to."]}),"\n",(0,i.jsx)(n.h2,{id:"pre-requisites",children:"Pre-requisites"}),"\n",(0,i.jsx)(n.p,{children:"To follow the guide, you will need the following:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Familiarity with the command-line interface"}),"\n",(0,i.jsxs)(n.li,{children:["A basic understanding of ",(0,i.jsx)(n.a,{href:"https://en.wikipedia.org/wiki/Public-key_cryptography",children:"how public key cryptography works"})]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"configuration-file",children:"Configuration file"}),"\n",(0,i.jsx)(n.h3,{id:"locating-the-file",children:"Locating the file"}),"\n",(0,i.jsxs)(n.p,{children:["The Lightning CLI has a configuration file in the home directory of the user, which by default is located in the path ",(0,i.jsx)(n.code,{children:"$HOME/.lightning"})," or ",(0,i.jsx)(n.code,{children:"~/.lightning"})," under the name ",(0,i.jsx)(n.code,{children:"config.toml"}),". It's generally described as ",(0,i.jsx)(n.code,{children:"~/.lightning/config.toml"}),"."]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["The tilde in ",(0,i.jsx)(n.code,{children:"~/.lightning"})," represents ",(0,i.jsx)(n.code,{children:"$HOME"})," which is simpler, but we'll use ",(0,i.jsx)(n.code,{children:"$HOME"})," to make it easy to follow."]})}),"\n",(0,i.jsxs)(n.p,{children:["If you're following the install recommendations you should be logged in with a ",(0,i.jsx)(n.strong,{children:"sudoer"})," account. For our guide, let's imagine that the ",(0,i.jsx)(n.strong,{children:"sudoer"})," username we are logged in with is ",(0,i.jsx)(n.strong,{children:"lgtn"}),"."]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["The word ",(0,i.jsx)(n.strong,{children:"sudo"}),' is the abbreviation of the term "super user do". As the name suggests, it is the privilege that a super user, such as an administrator has to do whatever it wants in the system. A super user can be an administrator, like the ',(0,i.jsx)(n.strong,{children:"root"})," or what we described here as a user in the group ",(0,i.jsx)(n.strong,{children:"sudo"})," aka ",(0,i.jsx)(n.strong,{children:"sudoer"}),"."]})}),"\n",(0,i.jsx)(n.p,{children:"If you are logged in with a username, that'd be:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"/home//.lightning/config.toml\n"})}),"\n",(0,i.jsxs)(n.p,{children:["For our example for user ",(0,i.jsx)(n.code,{children:"lgtn"})," that is:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"/home/lgtn/.lightning/config.toml\n"})}),"\n",(0,i.jsxs)(n.p,{children:["If you log in with another user, let's say ",(0,i.jsx)(n.code,{children:"fleek"})," it'd be:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"/home/fleek/.lightning/config.toml\n"})}),"\n",(0,i.jsx)(n.p,{children:"At any time, you can check which user you are logged in with by running the command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"whoami\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Here's an example of our user ",(0,i.jsx)(n.code,{children:"lgtn"}),", which for the command above outputs:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"lgtn\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["To switch to a particular user, you can run the command ",(0,i.jsx)(n.code,{children:"su "})," e.g. for the user ",(0,i.jsx)(n.strong,{children:"lgtn"})," we would execute the command ",(0,i.jsx)(n.code,{children:"su lgtn"}),"."]})}),"\n",(0,i.jsxs)(n.p,{children:["Now that you know where to locate the configuration file for any given user you are logged in with, learn about the ",(0,i.jsx)(n.a,{href:"#configuration-sections",children:"Configuration sections"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"configuration-sections",children:"Configuration sections"}),"\n",(0,i.jsxs)(n.p,{children:["The Fleek Network node configuration settings are located in the path ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/config.toml"}),", and it's organized by configuration sections."]}),"\n",(0,i.jsx)(n.p,{children:"At the time of writing, we have a TOML file with sections. Here are some examples amongst others:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"application"}),"\n",(0,i.jsx)(n.li,{children:"origin-ipfs"}),"\n",(0,i.jsx)(n.li,{children:"rpc"}),"\n",(0,i.jsx)(n.li,{children:"signer"}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["Each of the sections holds several property names and values. If you are accustomed to the ",(0,i.jsx)(n.a,{href:"https://en.wikipedia.org/wiki/JSON",children:"JSON"})," or ",(0,i.jsx)(n.a,{href:"https://en.wikipedia.org/wiki/YAML",children:"YAML"})," formats, you'll find the TOML format a bit similar (if you'd like to learn more about the TOML file format, read about it ",(0,i.jsx)(n.a,{href:"https://toml.io/en/",children:"here"}),")."]}),"\n",(0,i.jsx)(n.p,{children:"By default, and at time of writing the Lightning CLI configuration file (config.toml) is similar to:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'[BLANK]\n\n[application]\ndb_path = "/home/lgtn/.lightning/data/app_db"\nmode = "Prod"\nstorage = "RocksDb"\ntestnet = true\n\n[blockserver]\naddress = "0.0.0.0:4211"\n\n[broadcast]\naddress = "0.0.0.0:4200"\n\n[consensus]\nstore_path = "/home/lgtn/.lightning/data/narwhal_store"\n\n[dht]\naddress = "0.0.0.0:8101"\nbootstrappers = []\n\n[fetcher]\n\n[fsstore]\nroot = "/home/lgtn/.lightning/blockstore"\n\n[[handshake.transport]]\nsignal_address = "0.0.0.0:4210"\ntype = "WebRTC"\n\n[[handshake.worker]]\ntype = "AsyncWorker"\n\n[[handshake.worker]]\ntype = "AsyncWorker"\n\n[[handshake.worker]]\ntype = "AsyncWorker"\n\n[[handshake.worker]]\ntype = "AsyncWorker"\n\n[[origin-ipfs.gateways]]\nauthority = "ipfs.io"\nprotocol = "Https"\n\n[[origin-ipfs.gateways]]\nauthority = "fleek.ipfs.io"\nprotocol = "Https"\n\n[[origin-ipfs.gateways]]\nauthority = "ipfs.runfission.com"\nprotocol = "Https"\n\n[rep-collector]\nreporter_buffer_size = 5\n\n[resolver]\nstore_path = "/home/lgtn/.lightning/data/resolver_store"\n\n[rpc]\naddr = "0.0.0.0"\nport = 4230\n\n[service-executor]\nservices = [0, 1]\n\n[signer]\nconsensus_key_path = "/home/lgtn/.lightning/keystore/consensus.pem"\nnode_key_path = "/home/lgtn/.lightning/keystore/node.pem"\n\n[topology]\ntesting_min_nodes = 9\ntesting_target_k = 8\n'})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsx)(n.p,{children:"Beware that the configuration file might look a bit different depending on the version you're running and the current development features in place by the Fleek Network core team. You shouldn't copy the example above and replace with yours, as this only servers for illustrative purposes."})}),"\n",(0,i.jsx)(n.p,{children:"Some advanced use cases might require dealing with the host and port number binding, depending on the service provider's needs and customization. We'll keep things simple and assume the default settings."}),"\n",(0,i.jsxs)(n.p,{children:["In this guide, we are interested in the ",(0,i.jsx)(n.code,{children:"[signer]"})," section settings for the ",(0,i.jsx)(n.code,{children:"consensus_key_path"})," and ",(0,i.jsx)(n.code,{children:"node_key_path"})," which by default is set to ",(0,i.jsx)(n.code,{children:"~/.lightning/keystore"}),"."]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["The identity is a text description for the Keystore and at the time of writing we have not yet implemented multiple identity management via the CLI. Thereupon, the identity value serves to find the filename match in the ",(0,i.jsx)(n.code,{children:"keystore_path"}),". This might change as we progress with development. Check the ",(0,i.jsx)(n.a,{href:"#identity-selection",children:"Identity selection"})," to learn more about it!"]})}),"\n",(0,i.jsx)(n.h3,{id:"type-of-keys",children:"Type of keys"}),"\n",(0,i.jsxs)(n.p,{children:["There are three types of keys related to the identity of a node and the account ownership. The keys are based in public-key cryptography, or asymmetric cryptography where each key pair consists of a public key and a corresponding private key. The keys are described in the section ",(0,i.jsx)(n.a,{href:"/docs/learn/the-network/#identity-on-the-fleek-network",children:"identity on the Fleek Network"})," as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["A Node key (ConsensusPublicKey) is ",(0,i.jsx)(n.a,{href:"https://electriccoin.co/blog/new-snark-curve/",children:"BLS12-381"})," which facilitates the consensus algorithm or persistence of state, resilience and fault tolerance. Has multi-signature support, the ability to aggregate many signatures into one used for consensus committee when signing certificates"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["A Node Networking key (NodePublicKey) is ",(0,i.jsx)(n.a,{href:"https://en.wikipedia.org/wiki/EdDSA",children:"Ed25519"})," used for the speed and performance of the network communications"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Account Owner keys are based on ",(0,i.jsx)(n.a,{href:"https://www.secg.org/sec2-v2.pdf",children:"secp256k1"}),", which corresponds to an Ethereum Address"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"For instance, a public key is open to anybody to see, and it represents a unique node identifier in the Fleek Network, a bit like a passport number. On the other hand, the private key is secret, and the operator is responsible to store it privately."}),"\n",(0,i.jsx)(n.p,{children:"The Fleek Network relies on cryptography, thus the Fleek Network team and anybody can access, compromise or manipulate the secrets of an identity. On the other hand, the public key can be used by anyone, Fleek Network included, to identify a node or send rewards to the address without jeopardizing identity security."}),"\n",(0,i.jsxs)(n.p,{children:["To learn more about the identities on the Fleek Network ",(0,i.jsx)(n.a,{href:"/docs/learn/the-network/#identity-on-the-fleek-network",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"key-privacy",children:"Key privacy"}),"\n",(0,i.jsx)(n.p,{children:"If you don\u2019t keep your private keys secret, you'll have your node compromised."}),"\n",(0,i.jsx)(n.p,{children:"Here are a few examples of what you should not do:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Share the ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/keystore"})," directory file content publicly"]}),"\n",(0,i.jsxs)(n.li,{children:["Track the ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/keystore"})," directory files in a version control repository e.g. git"]}),"\n",(0,i.jsxs)(n.li,{children:['Have poor "rights" permissions in UNIX systems e.g. everyone can read, delete, modify ',(0,i.jsx)(n.code,{children:"$HOME/.lightning"})]}),"\n",(0,i.jsx)(n.li,{children:"Allow anyone to access the node provider physically without any access control to the operating and file systems e.g. a VPS provider"}),"\n",(0,i.jsxs)(n.li,{children:["Get rid of a hard drive unformatted or blind erased by selling to somebody or dumping in the bin, which contains ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/keystore"})]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"There are many other ways of getting compromised, but hopefully, the ones put above give you a good starter into the subject."}),"\n",(0,i.jsx)(n.p,{children:"Remember, the node provider is the only one responsible when managing the key store. Neither Fleek Network nor the most sophisticated AI system presently can compromise the cryptography in use to help you out. You are fully responsible for securing and retaining your private keys."}),"\n",(0,i.jsx)(n.h3,{id:"identity-selection",children:"Identity selection"}),"\n",(0,i.jsx)(n.p,{children:"Multiple identity management is yet to be implemented but in any case, some users might find it trivial to keep multiple identities and switch between them referencing them by name. The following section is not advocating this approach but sharing some approaches that can help certain use-cases."}),"\n",(0,i.jsxs)(n.p,{children:["Let's suppose that we've recently moved to a new server setup and copied our previous server keystore keys as ",(0,i.jsx)(n.code,{children:"consensus.pem"})," and ",(0,i.jsx)(n.code,{children:"node.pem"})," and renamed the ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/keystore/*.pem"})," to ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/keystore/new-*.pem"}),"."]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["We are using a wildcard ",(0,i.jsx)(n.code,{children:"*"})," to reduce verbosity. The wildcard means as replacement for all the filenames encountered in the path and extension without having to name them individually as we know they are ",(0,i.jsx)(n.code,{children:"consensus.pem"})," and ",(0,i.jsx)(n.code,{children:"node.pem"}),"."]})}),"\n",(0,i.jsxs)(n.p,{children:["To illustrate this scenario, here's an example of how our ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/keystore"})," directory could look like:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:".\n\u251c\u2500\u2500 new-consensus.pem\n\u251c\u2500\u2500 new-node.pem\n\u2514\u2500\u2500 old-consensus.pem\n\u2514\u2500\u2500 old-node.pem\n\n0 directories, 4 file\n"})}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"old-*.pem"})," files are the original key store and ",(0,i.jsx)(n.code,{children:"new-*.pem"})," could correspond to the new identity created while setting up the node in the new server."]}),"\n",(0,i.jsxs)(n.p,{children:["Since we have ",(0,i.jsx)(n.code,{children:"[signer]"})," set to the default values, in particular:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-toml",children:'[signer]\nconsensus_key_path = "/home/lgtn/.lightning/keystore/consensus.pem"\nnode_key_path = "/home/lgtn/.lightning/keystore/node.pem"\n'})}),"\n",(0,i.jsxs)(n.p,{children:["We'd be required to change and switch to the preferred keys. The identity is switch to the provided values once the node is restarted. Thus, we can switch to any identity by changing the ",(0,i.jsx)(n.code,{children:"[signer]"})," ",(0,i.jsx)(n.code,{children:"consensus_key_path"})," and ",(0,i.jsx)(n.code,{children:"node_key_path"})," pathname values anytime as long we restart the server successfully."]}),"\n",(0,i.jsx)(n.p,{children:"To verify which keys are loaded by the Lightning CLI run the command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"lgtn keys show\n"})}),"\n",(0,i.jsx)(n.p,{children:"You'd find the public keys in the output, which can be used for comparision and should be different everytime the configuration changes and reloaded. Here's an example of the output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"Node Public Key: RwPpr35H5AAfWwSDFxwYuJv5TA8PWUd2pdBg+UKsORc=\nConsensus Public Key: s36g09qQzaaOJxi0UZDRCXj3HUUWjaGiYrQV6Ylo9Ih6jMvrnxM5s1OpBnsEj5R1AVYcuxlnVR+oyEjgJ3WpI5LOHSN1Q6Zur33vka3IachBEIKIbsiXMJW16vu4n4bG\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsx)(n.p,{children:"The PEM files can be named as you wish, but by default we like to keep it sound to avoid confusion and make it as clear as possible."})}),"\n",(0,i.jsx)(n.h2,{id:"backing-up-the-keystore",children:"Backing up the keystore"}),"\n",(0,i.jsx)(n.p,{children:"When dealing with Fleek Network it's crucial to always be aware of the identity. You should backup private keys in case the unexpected happens, as it's impossible to recover the identity in any other way, including the core team, any other person or system."}),"\n",(0,i.jsxs)(n.p,{children:["Backing up your keystore pem files are crucial to ensure the safety and accessibility of your identity on the Fleek Network. For example, if your ",(0,i.jsx)(n.code,{children:"$HOME/.lightning"})," is deleted you'll still be able to restore it if you have backed it up properly."]}),"\n",(0,i.jsx)(n.p,{children:"There are many ways to make identity backups, each with its own benefits and drawbacks. At risk of oversimplifying, we'll focus on a simple manual approach to expose some principles you should have awareness."}),"\n",(0,i.jsx)(n.admonition,{type:"caution",children:(0,i.jsx)(n.p,{children:"The security is never stronger than its weakest link, and it is very likely that the weakest link is not the method itself. It's pointless to encrypt the backup archive with sophisticated methods when the passphrase is weak or of an easy guess."})}),"\n",(0,i.jsx)(n.p,{children:"None of the methods described here are being endorsed by the Fleek Network team use the knowledge provided here for educational purposes only and at your own risk."}),"\n",(0,i.jsx)(n.h3,{id:"lower-security",children:"Lower security"}),"\n",(0,i.jsx)(n.p,{children:"If you opt for the lowest level of security, you can use zip and unzip. The man page of zip described the encryption algorithm used to be weaker than PGP."}),"\n",(0,i.jsxs)(n.p,{children:["To zip and encrypto the ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/keystore"})," directory run:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"# It'll prompt for password (remember)\nzip --encrypt -r keystore.zip.enc $HOME/.lightning/keystore\n"})}),"\n",(0,i.jsxs)(n.p,{children:["To unzip and decrypt the ",(0,i.jsx)(n.code,{children:"keystore.zip.enc"}),", you'd run:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"# It'll prompt for password (recall)\nunzip keystore.zip.enc -d $HOME/.lightning/keystore\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["We provide the unzip destiny target to the flag ",(0,i.jsx)(n.code,{children:"-d"}),". The unzip process outputs the files onto the desired location ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/keystore"}),", thus overriding any contents. If you have any files in the destiny target directory it'll be overriden, effectively replacing with the output of the unzipped directory content, so make sure you backup any files as required."]})}),"\n",(0,i.jsx)(n.h3,{id:"higher-security",children:"Higher security"}),"\n",(0,i.jsxs)(n.p,{children:["Create a ",(0,i.jsx)(n.code,{children:"Tar"})," archive, which will contain the target directory, files and the Tar stores all of the relative paths in the tarball itself."]}),"\n",(0,i.jsxs)(n.p,{children:["Create a ",(0,i.jsx)(n.code,{children:"tarbar"})," by executing:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'tar -cf "keystore.tar" $HOME/.lightning/keystore\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"keystore.tar"})," should be in the current work directory."]}),"\n",(0,i.jsxs)(n.p,{children:["Use ",(0,i.jsx)(n.code,{children:"gpg"})," with the ",(0,i.jsx)(n.a,{href:"https://www.gnupg.org/gph/en/manual/x110.html",children:"symmetric option"}),", it creates the keys for that file and request a password to protect them. If you are familiar with asymmetric ",(0,i.jsx)(n.code,{children:"gpg"}),", it's similar, but it's not signed with your public key or such."]}),"\n",(0,i.jsx)(n.p,{children:"The encryption command is:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo gpg -a --symmetric --cipher-algo AES256 keystore.tar\n"})}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"keystore.tar.asc"})," should be in the current work directory."]}),"\n",(0,i.jsxs)(n.p,{children:["To decrypt the ",(0,i.jsx)(n.code,{children:"keystore.tar.asc"})," file, enter:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo gpg -a --output keystore.tar --decrypt keystore.tar.asc\n"})}),"\n",(0,i.jsxs)(n.p,{children:["To extract the ",(0,i.jsx)(n.code,{children:"keystore.tar"})," is simple, but be aware that it unarchives with the original directory structure, which might be a bit confusing. So, we'll create a new temporary directory for our example that will use to extract to."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"mkdir $HOME/tar_keystore_extract\n"})}),"\n",(0,i.jsx)(n.p,{children:"Now, run the command to extract to the target directory, as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"tar -xf keystore.tar -C $HOME/tar_keystore_extract\n"})}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"/home//.lightning/keystore"})," should be in the ",(0,i.jsx)(n.code,{children:"tar_keystore_extract"})," directory where you'll find the PEM files."]}),"\n",(0,i.jsx)(n.h3,{id:"storage",children:"Storage"}),"\n",(0,i.jsx)(n.p,{children:"The backup archive should only be accessible by yourself. If you decided to store it in a cloud storage provider, be aware of increased security risks. Cloud storage is convenient, but it ultimately puts data into the hands of others. If you're not particularly concerned, or have confidence about the encryption of the files, then that's at your own risk. But it's recommended to store in a physical hard drive that remains disconnected from computers and network devices."}),"\n",(0,i.jsx)(n.admonition,{type:"caution",children:(0,i.jsx)(n.p,{children:"If you use cloud storage to store your sensitive data, encryption should be your first line of defense. Encrypting files before uploading them to the cloud is crucial to reduce others from accessing information without your permissions and knowledge."})}),"\n",(0,i.jsx)(n.p,{children:"Remember that the security of the private key is the responsibility of the user. Unfortunately, the Fleek Network team and any others are unable to help regain access to private key if lost or failed to secure them. The private keys are the user responsibility. The Fleek Network team doesn't endorse any methods of encryption and storage, the methods described here are for educational purposes only."}),"\n",(0,i.jsx)(n.h2,{id:"loading-keys-on-runtime",children:"Loading keys on runtime"}),"\n",(0,i.jsxs)(n.p,{children:["As described in the section ",(0,i.jsx)(n.a,{href:"#configuration-file",children:"configuration files"})," the default location of the ",(0,i.jsx)(n.code,{children:".lightning"})," system configuration directory is ",(0,i.jsx)(n.code,{children:"$HOME/.lightning"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/config.toml"})," holds the information of where the Lightning CLI node process should pull the keystore pem files. The location of the pem files can be placed anywhere the node process has permissions to read."]}),"\n",(0,i.jsxs)(n.p,{children:["When unarchiving the backup files, the keystore directory or pem files should be placed in the directory declared in the ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/config.toml"}),". That is if the location is the one specified on the runtime\u2013the command declared to launch and run the lightning service, that has the optional ",(0,i.jsx)(n.code,{children:"-c"})," configuration flag that takes any custom location which overrides the default ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/config.toml"}),"."]}),"\n",(0,i.jsxs)(n.admonition,{type:"caution",children:[(0,i.jsxs)(n.p,{children:["On runtime, the Lightning service can have specified a configuration file in any readable location. If a configuration pathname isn't passed, it'll default to the ",(0,i.jsx)(n.code,{children:"$HOME/.lightning/config.toml"}),". It's important to understand this to avoid confusion."]}),(0,i.jsx)(n.p,{children:"The service that starts with:"}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"lgtn -c /root/custom-configuration.toml run\n"})}),(0,i.jsx)(n.p,{children:"Can have complete different settings from any of the following:"}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"lgtn -c /home/lgtn/.lightning/config.toml run\n"})}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"lgtn -c ~/.lightning/config.toml run\n"})}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"lgtn run\n"})}),(0,i.jsx)(n.p,{children:"Due to the fact that any of the fails above might contain different settings declared in the file body."})]}),"\n",(0,i.jsx)(n.p,{children:"For instance, we can imagine a scenario where our service is started with the command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"lgtn -c /home/lgtn/.lightning/config.toml run\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Where the ",(0,i.jsx)(n.code,{children:"keystore"})," is placed under the parent directory ",(0,i.jsx)(n.code,{children:"/home/lgtn/.lightning/"}),". Resulting in the configuration file have the following settings for the hypothetical username ",(0,i.jsx)(n.code,{children:"lgtn"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'[signer]\nconsensus_key_path = "/home/lgtn/.lightning/keystore/consensus.pem"\nnode_key_path = "/home/lgtn/.lightning/keystore/node.pem"\n'})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["On the ",(0,i.jsx)(n.a,{href:"/docs/node/install",children:"install instructions"})," provided by the documentation, a ",(0,i.jsx)(n.a,{href:"/docs/node/install#systemd-service-setup",children:"Systemd service unit"})," is recommended to allow the user control the Lightning service via systemctl. The Systemd service unit file should contain the recommended usage of ",(0,i.jsx)(n.code,{children:"-c"})," configuration. If you have followed the recommendations it should be familiar."]})}),"\n",(0,i.jsx)(n.h2,{id:"restoring-the-keystore",children:"Restoring the keystore"}),"\n",(0,i.jsx)(o.ZP,{}),"\n",(0,i.jsx)(n.h2,{id:"conclusion",children:"Conclusion"}),"\n",(0,i.jsx)(n.p,{children:"We've walked through most basics of where the configuration file is located, the configuration settings we use to set up and run the node, the different configuration sections we have, and most importantly the identity section."}),"\n",(0,i.jsxs)(n.p,{children:["Additionally, a brief guide on the ",(0,i.jsx)(n.a,{href:"#identity",children:"identity"}),", more specifically an introduction to the ",(0,i.jsx)(n.a,{href:"#type-of-keys",children:"type of keys"})," and ",(0,i.jsx)(n.a,{href:"#key-privacy",children:"key privacy"}),", which we find important to understand for anyone seriously interested in running a node by hinting into some system administration and security principles."]}),"\n",(0,i.jsx)(n.p,{children:"Separately, at risk of oversimpliying provided a brief introduction into the backup of the keystore directory."}),"\n",(0,i.jsx)(n.p,{children:"In the future, we'll introduce more advanced topics that will help you improve the knowledge you get from this, but we are glad that you followed this guide and got some comprehension to help you manage the key store."}),"\n",(0,i.jsxs)(n.p,{children:["While we do our best to provide the clearest instructions, there's always space for improvement, therefore feel free to make any contributions by messaging us on our ",(0,i.jsx)(n.a,{href:"https://discord.gg/fleekxyz",children:"Discord"})," or by opening a ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network",children:"PR"})," in any of our repositories."]}),"\n",(0,i.jsxs)(n.p,{children:["Discover more about the project by ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"watching/contributing on Github"}),", following us on ",(0,i.jsx)(n.a,{href:"https://twitter.com/fleek_net",children:"Twitter"}),", and joining ",(0,i.jsx)(n.a,{href:"https://discord.gg/fleekxyz",children:"our community Discord"})," for all the best updates!"]}),"\n",(0,i.jsx)(r.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function u(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(p,{...e})}):p(e)}},5979:(e,n,t)=>{t.d(n,{ZP:()=>o});var i=t(5893),s=t(1151);function r(e){const n={a:"a",admonition:"admonition",code:"code",li:"li",ol:"ol",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["You can restore the keystore (Public Keys) by copying the directory to the ",(0,i.jsx)(n.code,{children:"~/.lightning"})," directory."]}),"\n",(0,i.jsx)(n.p,{children:"Let's assume that you know where your backup directory or files are located. To keep our instructions easy to follow, let's say that:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["The keystore and files are located under the hypothetical location ",(0,i.jsx)(n.code,{children:"/my-keystore-backup"})]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["The files in the ",(0,i.jsx)(n.code,{children:"/my-keystore-backup"})," are the following:"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"/my-keystore-backup\n\u251c\u2500\u2500 consensus.pem\n\u2514\u2500\u2500 node.pem\n\n1 directory, 2 files\n"})}),"\n",(0,i.jsx)(n.p,{children:"Considering the above for our example, you would have to run the following command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"mv /my-keystore-backup /home//.lightning/keystore\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["Remember to replace the ",(0,i.jsx)(n.code,{children:""})," with the correct username for the setup. For example, if you have installed the Fleek Network with the username ",(0,i.jsx)(n.code,{children:"lgtn"})," that would be ",(0,i.jsx)(n.code,{children:"/home/lgtn/.lightning/keystore"}),"."]})}),"\n",(0,i.jsxs)(n.p,{children:["Once moved, remember to start the service, you can learn how to manage the service by reading the section ",(0,i.jsx)(n.a,{href:"/docs/node/systemd-service",children:"Systemd Service"}),"."]})]})}function o(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(r,{...e})}):r(e)}},3872:(e,n,t)=>{t.d(n,{Z:()=>s});t(7294);var i=t(5893);const s=e=>{let{image:n,name:t,title:s,url:r,communityMember:o=!1}=e;return(0,i.jsx)("section",{className:"author_card",children:(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"avatar",children:(0,i.jsx)("a",{href:r,target:"_blank",alt:t,children:(0,i.jsx)("img",{src:n,alt:t})})}),(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"name",children:(0,i.jsx)("a",{href:r,target:"_blank",alt:t,children:t})}),(0,i.jsx)("span",{className:"title",children:s}),(0,i.jsxs)("span",{className:"discord",children:[o?"Join our community on":"Got questions? Find us on"," ",(0,i.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},4110:(e,n,t)=>{t.d(n,{Z:()=>i});const i=t.p+"assets/images/managing-the-keystore-fe4cdb19d2f59c54bcf864b0e069b535.png"},4350:(e,n,t)=>{t.d(n,{Z:()=>i});const i=t.p+"assets/images/managing-the-keystore-fe4cdb19d2f59c54bcf864b0e069b535.png"},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>o});var i=t(7294);const s={},r=i.createContext(s);function o(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(s):e.components||s:o(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/581d5240.a3a8d383.js b/assets/js/581d5240.a3a8d383.js deleted file mode 100644 index 662754c9d..000000000 --- a/assets/js/581d5240.a3a8d383.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[5318],{4798:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>h,contentTitle:()=>r,default:()=>u,frontMatter:()=>c,metadata:()=>i,toc:()=>l});var a=n(5893),s=n(1151),o=n(3872);const c={title:"Health check",slug:"health-check",hide_title:!0,tags:["healthcheck","verification","node status"]},r=void 0,i={id:"node/health-check",title:"Health check",description:"TL;DR: Run the command",source:"@site/docs/node/health-check.md",sourceDirName:"node",slug:"/node/health-check",permalink:"/docs/node/health-check",draft:!1,unlisted:!1,tags:[{label:"healthcheck",permalink:"/docs/tags/healthcheck"},{label:"verification",permalink:"/docs/tags/verification"},{label:"node status",permalink:"/docs/tags/node-status"}],version:"current",frontMatter:{title:"Health check",slug:"health-check",hide_title:!0,tags:["healthcheck","verification","node status"]},sidebar:"docs",previous:{title:"Install",permalink:"/docs/node/install"},next:{title:"Analyzing logs",permalink:"/docs/node/analyzing-logs"}},h={},l=[{value:"TL;DR: Run the command",id:"tldr-run-the-command",level:2},{value:"Overview",id:"overview",level:2},{value:"What's a node health check?",id:"whats-a-node-health-check",level:2},{value:"Quick health check",id:"quick-health-check",level:2},{value:"JSON-RPC Health check",id:"json-rpc-health-check",level:2}];function d(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.h2,{id:"tldr-run-the-command",children:"TL;DR: Run the command"}),"\n",(0,a.jsx)(t.p,{children:"A script is available to do and provide a health check overview:"}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-sh",children:"curl -sS https://get.fleek.network/healthcheck | bash\n"})}),"\n",(0,a.jsx)(t.h2,{id:"overview",children:"Overview"}),"\n",(0,a.jsx)(t.p,{children:"In network applications, a health check is a process of verifying the overall health and availability of a service. It usually involves sending a request to a specific endpoint of a service and receiving a response indicating the status. The response includes information about the status of the service, or any errors or warnings if not healthy. This helps developers, node operators, and system administrators identify and resolve issues that may affect the network, node performance and availability."}),"\n",(0,a.jsx)(t.p,{children:"A Node operator or system administrator can communicate with the node to confirm the status at any time."}),"\n",(0,a.jsx)(t.admonition,{type:"tip",children:(0,a.jsx)(t.p,{children:"We're using cURL, for the examples, thus make sure that you have it installed on your operating system."})}),"\n",(0,a.jsx)(t.h2,{id:"whats-a-node-health-check",children:"What's a node health check?"}),"\n",(0,a.jsx)(t.p,{children:"A Node health check is exactly what it sounds like, a way of checking the health status of a Fleek Network node."}),"\n",(0,a.jsx)(t.p,{children:"A Node operator can do a health check (as it's common among system operators worth their title) to get feedback and see if the resource is operating successfully. It's a good practice for a Node operator to do it frequently, as otherwise there'd be no way of knowing whether the Node is running. For example, some advanced operators automate this process by using cronjobs and getting reports via email, etc."}),"\n",(0,a.jsx)(t.p,{children:"Health checks are valuable and a must for all the Node operators, as they are incentivized to participate in the network by making their resources available which the reward mechanism evaluates."}),"\n",(0,a.jsx)(t.p,{children:"Rewards are only a given for good behavior and thus an unhealthy Node or bad management can cause disappointment. A decentralized and permissionless network, which is beyond anyone's control (us included) requires some education by the users."}),"\n",(0,a.jsx)(t.p,{children:"A system can be highly customizable and understanding some basics can help you achieve success as a node operator, resource health checking is important."}),"\n",(0,a.jsx)(t.p,{children:"Fleek Network depends on the Node operator's success, thus we try to keep things simple and try to motivate you to learn for the network's overall health. That's what a Node health check is about, your contribution!"}),"\n",(0,a.jsx)(t.h2,{id:"quick-health-check",children:"Quick health check"}),"\n",(0,a.jsxs)(t.p,{children:["Run a quick health check by sending a GET request to ",(0,a.jsx)(t.code,{children:"/health"})," endpoint of RPC on ",(0,a.jsx)(t.a,{href:"/docs/node/requirements#ports",children:"port"})," 4230."]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-sh",children:'curl -w "\\n" localhost:4230/health\n'})}),"\n",(0,a.jsxs)(t.p,{children:["If successful, you should get the response ",(0,a.jsx)(t.code,{children:"running and staked"}),", as follows:"]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-sh",children:"running and staked\n"})}),"\n",(0,a.jsx)(t.p,{children:"If you get an error, then it means that your node is not healthy."}),"\n",(0,a.jsx)(t.h2,{id:"json-rpc-health-check",children:"JSON-RPC Health check"}),"\n",(0,a.jsxs)(t.p,{children:["We'll send a request to the JSON RPC ",(0,a.jsx)(t.code,{children:"flk_ping"})," method. Execute the following command:"]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-sh",children:'curl -X POST -H "Content-Type: application/json" -d \'{\n "jsonrpc": "2.0",\n "method": "flk_ping",\n "params": [],\n "id": 1\n }\' localhost:4230/rpc/v0\n'})}),"\n",(0,a.jsxs)(t.p,{children:["If the request is successful, you should get the result ",(0,a.jsx)(t.code,{children:"pong"})," as follows:"]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-sh",children:'{\n "jsonrpc": "2.0",\n "result": "pong",\n "id": 1\n}\n'})}),"\n",(0,a.jsx)(t.p,{children:"Any other response, such as errors determine that the node is not healthy."}),"\n",(0,a.jsx)(o.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function u(e={}){const{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},3872:(e,t,n)=>{n.d(t,{Z:()=>s});n(7294);var a=n(5893);const s=e=>{let{image:t,name:n,title:s,url:o,communityMember:c=!1}=e;return(0,a.jsx)("section",{className:"author_card",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"avatar",children:(0,a.jsx)("a",{href:o,target:"_blank",alt:n,children:(0,a.jsx)("img",{src:t,alt:n})})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"name",children:(0,a.jsx)("a",{href:o,target:"_blank",alt:n,children:n})}),(0,a.jsx)("span",{className:"title",children:s}),(0,a.jsxs)("span",{className:"discord",children:[c?"Join our community on":"Got questions? Find us on"," ",(0,a.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,t,n)=>{n.d(t,{Z:()=>r,a:()=>c});var a=n(7294);const s={},o=a.createContext(s);function c(e){const t=a.useContext(o);return a.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:c(e.components),a.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/581d5240.b939f2e4.js b/assets/js/581d5240.b939f2e4.js new file mode 100644 index 000000000..b1c85ea70 --- /dev/null +++ b/assets/js/581d5240.b939f2e4.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[5318],{4798:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>u,frontMatter:()=>r,metadata:()=>h,toc:()=>l});var s=n(5893),o=n(1151),a=n(3872);const r={title:"Health check",slug:"health-check",hide_title:!0,tags:["healthcheck","verification","node status"]},i=void 0,h={id:"node/health-check",title:"Health check",description:"TL;DR: Run the command",source:"@site/docs/node/health-check.md",sourceDirName:"node",slug:"/node/health-check",permalink:"/docs/node/health-check",draft:!1,unlisted:!1,tags:[{label:"healthcheck",permalink:"/docs/tags/healthcheck"},{label:"verification",permalink:"/docs/tags/verification"},{label:"node status",permalink:"/docs/tags/node-status"}],version:"current",frontMatter:{title:"Health check",slug:"health-check",hide_title:!0,tags:["healthcheck","verification","node status"]},sidebar:"docs",previous:{title:"Install",permalink:"/docs/node/install"},next:{title:"Analyzing logs",permalink:"/docs/node/analyzing-logs"}},c={},l=[{value:"TL;DR: Run the command",id:"tldr-run-the-command",level:2},{value:"Overview",id:"overview",level:2},{value:"What's a node health check?",id:"whats-a-node-health-check",level:2},{value:"The host address",id:"the-host-address",level:2},{value:"Communication ports",id:"communication-ports",level:2},{value:"Quick health check",id:"quick-health-check",level:2},{value:"JSON-RPC Health check",id:"json-rpc-health-check",level:2}];function d(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,o.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h2,{id:"tldr-run-the-command",children:"TL;DR: Run the command"}),"\n",(0,s.jsx)(t.p,{children:"A script is available to do and provide a health check overview:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-sh",children:"curl -sS https://get.fleek.network/healthcheck | bash\n"})}),"\n",(0,s.jsx)(t.h2,{id:"overview",children:"Overview"}),"\n",(0,s.jsx)(t.p,{children:"In network applications, a health check is a process of verifying the overall health and availability of a service. It usually involves sending a request to a specific endpoint of a service and receiving a response indicating the status. The response includes information about the status of the service, or any errors or warnings if not healthy. This helps developers, node operators, and system administrators identify and resolve issues that may affect the network, node performance and availability."}),"\n",(0,s.jsx)(t.p,{children:"A Node operator or system administrator can communicate with the node to confirm the status at any time."}),"\n",(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsx)(t.p,{children:"We're using cURL, for the examples, thus make sure that you have it installed on your operating system."})}),"\n",(0,s.jsx)(t.h2,{id:"whats-a-node-health-check",children:"What's a node health check?"}),"\n",(0,s.jsx)(t.p,{children:"A Node health check is exactly what it sounds like, a way of checking the health status of a Fleek Network node."}),"\n",(0,s.jsx)(t.p,{children:"A Node operator can do a health check (as it's common among system operators worth their title) to get feedback and see if the resource is operating successfully. It's a good practice for a Node operator to do it frequently, as otherwise there'd be no way of knowing whether the Node is running. For example, some advanced operators automate this process by using cronjobs and getting reports via email, etc."}),"\n",(0,s.jsx)(t.p,{children:"Health checks are valuable and a must for all the Node operators, as they are incentivized to participate in the network by making their resources available which the reward mechanism evaluates."}),"\n",(0,s.jsx)(t.p,{children:"Rewards are only a given for good behavior and thus an unhealthy Node or bad management can cause disappointment. A decentralized and permissionless network, which is beyond anyone's control (us included) requires some education by the users."}),"\n",(0,s.jsx)(t.p,{children:"A system can be highly customizable and understanding some basics can help you achieve success as a node operator, resource health checking is important."}),"\n",(0,s.jsx)(t.p,{children:"Fleek Network depends on the Node operator's success, thus we try to keep things simple and try to motivate you to learn for the network's overall health. That's what a Node health check is about, your contribution!"}),"\n",(0,s.jsx)(t.h2,{id:"the-host-address",children:"The host address"}),"\n",(0,s.jsxs)(t.p,{children:["When a Fleek Network Node is initialized, the address which is bound to is ",(0,s.jsx)(t.code,{children:"0.0.0.0"}),", meaning that the service is listening to all the host-configured network interfaces, such as ",(0,s.jsx)(t.code,{children:"127.0.0.1"}),"."]}),"\n",(0,s.jsx)(t.p,{children:"Any traffic sent to an addressable interface that hits the correct endpoint or port number should have a response by the node. Of course, bear in mind that your system should not have any form of firewall or blockers configured."}),"\n",(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"127.0.0.1"})," is generally the IP address assigned to the ",(0,s.jsx)(t.strong,{children:"loopback"})," or local-only interface, which is a mock network adapter that only allows communication within the same host."]})}),"\n",(0,s.jsx)(t.h2,{id:"communication-ports",children:"Communication ports"}),"\n",(0,s.jsx)(t.p,{children:"To communicate, the Node uses TCP and UDP (retransmission of lost data packets is only possible with TCP, for example, when we download a file from the internet through our browsers we expect a complete file, no bits should be missing, TCP ensures that the data is received correctly, data is not missing and is in order)."}),"\n",(0,s.jsx)(t.p,{children:"The ports should be available and free in the host for other services to operate via the communication ports. Make sure you don't have blockers, such as a Firewall, or forget to expose them in Docker, or on your custom setup. If that's the case open up your firewall, and if needed a port-forward, if docker doesn't do that for you."}),"\n",(0,s.jsxs)(t.p,{children:["To learn more, read the section ",(0,s.jsx)(t.a,{href:"/docs/node/requirements#ports",children:"ports"}),"."]}),"\n",(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsx)(t.p,{children:"Remember, the Node won't be able to respond if the ports are blocked. This might be quite difficult to troubleshoot, so make sure you have control over your system permissions to guarantee a successful node operation."})}),"\n",(0,s.jsx)(t.h2,{id:"quick-health-check",children:"Quick health check"}),"\n",(0,s.jsxs)(t.p,{children:["Run a quick health check by sending a GET request to ",(0,s.jsx)(t.code,{children:"/health"})," endpoint of RPC on ",(0,s.jsx)(t.a,{href:"/docs/node/requirements#ports",children:"port"})," 4230."]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-sh",children:'curl -w "\\n" localhost:4230/health\n'})}),"\n",(0,s.jsxs)(t.p,{children:["If successful, you should get the response ",(0,s.jsx)(t.code,{children:"running and staked"}),", as follows:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-sh",children:"running and staked\n"})}),"\n",(0,s.jsx)(t.p,{children:"If you get an error, then it means that your node is not healthy."}),"\n",(0,s.jsx)(t.h2,{id:"json-rpc-health-check",children:"JSON-RPC Health check"}),"\n",(0,s.jsxs)(t.p,{children:["We'll send a request to the JSON RPC ",(0,s.jsx)(t.code,{children:"flk_ping"})," method. Execute the following command:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-sh",children:'curl -X POST -H "Content-Type: application/json" -d \'{\n "jsonrpc": "2.0",\n "method": "flk_ping",\n "params": [],\n "id": 1\n }\' localhost:4230/rpc/v0\n'})}),"\n",(0,s.jsxs)(t.p,{children:["If the request is successful, you should get the result ",(0,s.jsx)(t.code,{children:"pong"})," as follows:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-sh",children:'{\n "jsonrpc": "2.0",\n "result": "pong",\n "id": 1\n}\n'})}),"\n",(0,s.jsx)(t.p,{children:"Any other response, such as errors determine that the node is not healthy."}),"\n",(0,s.jsx)(a.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function u(e={}){const{wrapper:t}={...(0,o.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},3872:(e,t,n)=>{n.d(t,{Z:()=>o});n(7294);var s=n(5893);const o=e=>{let{image:t,name:n,title:o,url:a,communityMember:r=!1}=e;return(0,s.jsx)("section",{className:"author_card",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"avatar",children:(0,s.jsx)("a",{href:a,target:"_blank",alt:n,children:(0,s.jsx)("img",{src:t,alt:n})})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"name",children:(0,s.jsx)("a",{href:a,target:"_blank",alt:n,children:n})}),(0,s.jsx)("span",{className:"title",children:o}),(0,s.jsxs)("span",{className:"discord",children:[r?"Join our community on":"Got questions? Find us on"," ",(0,s.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,t,n)=>{n.d(t,{Z:()=>i,a:()=>r});var s=n(7294);const o={},a=s.createContext(o);function r(e){const t=s.useContext(a);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function i(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),s.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5b6134d1.06ced3d2.js b/assets/js/5b6134d1.a04643f6.js similarity index 99% rename from assets/js/5b6134d1.06ced3d2.js rename to assets/js/5b6134d1.a04643f6.js index 8f25a00b8..09950fc82 100644 --- a/assets/js/5b6134d1.06ced3d2.js +++ b/assets/js/5b6134d1.a04643f6.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[9752],{1586:(e,n,s)=>{s.d(n,{ZP:()=>o});var t=s(5893),i=s(1151);function r(e){const n={a:"a",admonition:"admonition",code:"code",p:"p",pre:"pre",strong:"strong",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["In the ",(0,t.jsx)(n.code,{children:"/home//.lightning/config.toml"})," you'll find some and more of the following:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-toml",children:'[BLANK]\n\n[application]\ndb_path = "~/.lightning/data/app_db"\n\n[consensus]\nstore_path = "~/.lightning/data/narwhal_store"\n\n[fsstore]\nroot = "~/.lightning/blockstore"\n\n[resolver]\nstore_path = "~/.lightning/data/resolver_store"\n\n[signer]\nconsensus_key_path = "~/.lightning/keystore/consensus.pem"\nnode_key_path = "~/.lightning/keystore/node.pem"\n'})}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["The configuration properties and values presented above are a shorter version of what you'll find on your ",(0,t.jsx)(n.strong,{children:"configuration.toml"}),". We keep it short to make it easier to follow, do not copy and paste."]})}),"\n",(0,t.jsxs)(n.p,{children:["Find and replace all instances of ~ in the config file ",(0,t.jsx)(n.code,{children:"/home//.lightning/config.toml"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["Here's an example of how to do it using ",(0,t.jsx)(n.strong,{children:"sed"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:'sed -i "s|~/.lightning|/home//.lightning|g" "/home//.lightning/config.toml"\n'})}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["Replace the ",(0,t.jsx)(n.code,{children:""})," with your username. For example, if you have followed the recommendation to ",(0,t.jsx)(n.a,{href:"/docs/node/install#create-a-user",children:"create a user"})," it would look like ",(0,t.jsx)(n.code,{children:"/home/lgtn/.lightning/config.toml"})," for the username ",(0,t.jsx)(n.strong,{children:"lgtn"}),"."]})}),"\n",(0,t.jsxs)(n.p,{children:["For example, if your username is ",(0,t.jsx)(n.code,{children:"lgtn"})," that'd look like this:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:'sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Once modified, you can run a ",(0,t.jsx)(n.code,{children:"cat"})," to see the content of the files to confirm it has been updated."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"cat /home/lgtn/.lightning/config.toml\n"})}),"\n",(0,t.jsxs)(n.p,{children:["For our example where we opted in for the username ",(0,t.jsx)(n.code,{children:"lgtn"})," that would look like:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-toml",children:'[BLANK]\n\n[application]\ndb_path = "~/.lightning/data/app_db"\n\n[consensus]\nstore_path = "~/.lightning/data/narwhal_store"\n\n[fsstore]\nroot = "~/.lightning/blockstore"\n\n[resolver]\nstore_path = "~/.lightning/data/resolver_store"\n\n[signer]\nconsensus_key_path = "~/.lightning/keystore/consensus.pem"\nnode_key_path = "~/.lightning/keystore/node.pem"\n'})}),"\n",(0,t.jsx)(n.admonition,{title:"Warning",type:"caution",children:(0,t.jsx)(n.p,{children:"Bear in mind that we are keeping the content of the file short to make it easier to read and follow. The content of your configuration file should look slightly different, amongst these it should contain other properties and values. You should not copy and replace the content of your files with the ones presented here."})})]})}function o(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(r,{...e})}):r(e)}},2421:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>a,default:()=>p,frontMatter:()=>l,metadata:()=>h,toc:()=>c});var t=s(5893),i=s(1151),r=s(3872),o=s(1586);const l={title:"File permissions and Ownership",slug:"file-permissions-and-ownership",hide_title:!0,tags:["ownership","file permissions","sudoer","root"]},a=void 0,h={id:"Lightning CLI/file-permissions-and-ownership",title:"File permissions and Ownership",description:"Ownership",source:"@site/references/Lightning CLI/file-permissions-and-ownership.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/file-permissions-and-ownership",permalink:"/references/Lightning CLI/file-permissions-and-ownership",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/file-permissions-and-ownership.md",tags:[{label:"ownership",permalink:"/references/tags/ownership"},{label:"file permissions",permalink:"/references/tags/file-permissions"},{label:"sudoer",permalink:"/references/tags/sudoer"},{label:"root",permalink:"/references/tags/root"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"File permissions and Ownership",slug:"file-permissions-and-ownership",hide_title:!0,tags:["ownership","file permissions","sudoer","root"]},sidebar:"defaultSidebar",previous:{title:"Error linking with cc",permalink:"/references/Lightning CLI/error-linking-with-cc-failed-exist-status-1"},next:{title:"Frequently used commands for Native setup",permalink:"/references/Lightning CLI/frequently-used-commands-for-native-setup"}},d={},c=[{value:"Ownership",id:"ownership",level:2},{value:"Using sudo to delegate permissions",id:"using-sudo-to-delegate-permissions",level:2},{value:"User $HOME directory",id:"user-home-directory",level:2},{value:"Set the locations of the user paths",id:"set-the-locations-of-the-user-paths",level:2},{value:"Set the configuration flag -c on the service unit file",id:"set-the-configuration-flag--c-on-the-service-unit-file",level:2}];function g(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h2,{id:"ownership",children:"Ownership"}),"\n",(0,t.jsx)(n.p,{children:"The user who installs the Fleek Network Lightning CLI matters, as it can own or delegate ownership of the dependencies and applications being installed."}),"\n",(0,t.jsx)(n.p,{children:"For example, if you have followed the install document recommendations and have:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Created a user ",(0,t.jsx)(n.strong,{children:"lgtn"})]}),"\n",(0,t.jsxs)(n.li,{children:["Switched to the user ",(0,t.jsx)(n.strong,{children:"lgtn"})]}),"\n",(0,t.jsxs)(n.li,{children:["Executed the installation process as ",(0,t.jsx)(n.strong,{children:"lgtn"})]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"note",children:(0,t.jsxs)(n.p,{children:["The username can be anything, we are using the term ",(0,t.jsx)(n.strong,{children:"lgtn"})," as the example provided throughout our documentation. Select your username in accordance to your preferences."]})}),"\n",(0,t.jsx)(n.p,{children:"You'll find that it owns the following directories under the user home (/home/lgtn):"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"drwxr-x--- 6 lgtn lgtn 4096 Sep 12 10:27 .\ndrwxr-xr-x 3 root root 4096 Sep 11 12:28 ..\ndrwxrwxr-x 5 lgtn lgtn 4096 Sep 11 12:29 .cargo\ndrwxrwxr-x 5 lgtn lgtn 4096 Sep 11 15:25 .lightning\ndrwxrwxr-x 6 lgtn lgtn 4096 Sep 11 12:29 .rustup\ndrwxrwxr-x 3 lgtn lgtn 4096 Sep 11 12:28 fleek-network\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Above, we have the listing properties set as ",(0,t.jsx)(n.strong,{children:"drwxrwxr-x"})," and the ownership ",(0,t.jsxs)(n.strong,{children:["lgtn",":lgtn"]}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["On the other hand, if you have done the installation process as ",(0,t.jsx)(n.strong,{children:"root"})," superuser, you'll find that:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["The location of the directories and files goes under the ",(0,t.jsx)(n.code,{children:"/root"})," pathname"]}),"\n",(0,t.jsxs)(n.li,{children:["The ownership is set to ",(0,t.jsxs)(n.strong,{children:["root",":root"]})]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["Learn more about ",(0,t.jsx)(n.a,{href:"https://www.linuxfoundation.org/blog/blog/classic-sysadmin-understanding-linux-file-permissions",children:"file permissions"})," from the ",(0,t.jsx)(n.a,{href:"https://www.linuxfoundation.org/",children:"Linux Foundation"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["To learn more about file permission on Linux, read the ",(0,t.jsx)(n.a,{href:"https://www.linuxfoundation.org/blog/blog/classic-sysadmin-understanding-linux-file-permissions",children:"Understanding Linux File Permissions"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"using-sudo-to-delegate-permissions",children:"Using sudo to delegate permissions"}),"\n",(0,t.jsxs)(n.p,{children:["Consider file ownership and permissions to understand where the keystore is located. Take close attention when executing commands as an admin\u2013with or without ",(0,t.jsx)(n.strong,{children:"super user"})," (root) or ",(0,t.jsx)(n.strong,{children:"sudo"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["If a command is executed without ",(0,t.jsx)(n.strong,{children:"sudo"})," then the generated output goes onto the ",(0,t.jsx)(n.strong,{children:"user"})," home."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"lgtn keys generate\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Resulting in having the ",(0,t.jsx)(n.strong,{children:"keystore"})," saved onto ",(0,t.jsx)(n.code,{children:"/home/username/.lightning/keystore"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["On the other hand, if a command is executed with ",(0,t.jsx)(n.strong,{children:"sudo"})," then the generated output is delegated to ",(0,t.jsx)(n.strong,{children:"root"})," directory."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo lgtn keys generate\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Resulting in having the ",(0,t.jsx)(n.strong,{children:"keystore"})," saved onto ",(0,t.jsx)(n.code,{children:"/root/.lightning/keystore"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"user-home-directory",children:"User $HOME directory"}),"\n",(0,t.jsxs)(n.p,{children:["The home directory is a directory that contains the personal files of a particular user of the system. On Linux, the ",(0,t.jsx)(n.code,{children:"$HOME"})," environment variable is set by the login program, which sets the user `$HOME`` accordingly. A user's home goes by the username, the user who's logged in."]}),"\n",(0,t.jsx)(n.p,{children:"For this reason, a user can change to the home directory by executing:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"cd $HOME\n"})}),"\n",(0,t.jsxs)(n.p,{children:["A shorthand allows a user to refer to their home directory simply as ",(0,t.jsx)(n.code,{children:"~"})," (tilde), as follows:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"cd ~\n"})}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["We can find that the HOME or ~ (tilde) is highly dependent on the user who's logged in. Since we know that the user might delegate to ",(0,t.jsx)(n.strong,{children:"root"})," by the usage of ",(0,t.jsx)(n.strong,{children:"sudo"}),", this can help troubleshoot and explain the location of our files e.g. the keystore. In the section ",(0,t.jsx)(n.a,{href:"#set-the-locations-of-the-user-paths",children:"Set the locations of the user paths"}),", we learn how to define the location of our user configuration paths to avoid confusion. By doing it we ensure that when running the service, the service picks the correct configuration paths for our user."]})}),"\n",(0,t.jsxs)(n.p,{children:["To learn more about the user $HOME directory read the wikipedia ",(0,t.jsx)(n.a,{href:"https://en.wikipedia.org/wiki/Home_directory",children:"Home directory"})," document."]}),"\n",(0,t.jsx)(n.h2,{id:"set-the-locations-of-the-user-paths",children:"Set the locations of the user paths"}),"\n",(0,t.jsx)(o.ZP,{}),"\n",(0,t.jsx)(n.h2,{id:"set-the-configuration-flag--c-on-the-service-unit-file",children:"Set the configuration flag -c on the service unit file"}),"\n",(0,t.jsxs)(n.p,{children:["The following section assumes that a System service unit has been declared, and you're using systemctl to control the service, as described in our ",(0,t.jsx)(n.a,{href:"/docs/node/install#systemd-service-setup",children:"Systemd Service Setup"})," install section."]}),"\n",(0,t.jsxs)(n.p,{children:["Open and edit the ",(0,t.jsx)(n.strong,{children:"/etc/systemd/system/lightning.service"})," file."]}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Replace ",(0,t.jsx)(n.code,{children:""})," with YOUR username. For example, in the documentation we use the username ",(0,t.jsx)(n.strong,{children:"lgtn"}),", which means we'd replace ",(0,t.jsx)(n.code,{children:""})," with ",(0,t.jsx)(n.code,{children:"lgtn"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Make sure that the ExecStart is set correctly, including the ",(0,t.jsx)(n.code,{children:"-c"})]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"[Unit]\nDescription=Fleek Network Node lightning service\n\n[Service]\nType=simple\nMemoryHigh=32G\nRestartSec=15s\nRestart=always\nExecStart=lgtn -c /home//.lightning/config.toml run\nStandardOutput=append:/var/log/lightning/output.log\nStandardError=append:/var/log/lightning/diagnostic.log\nEnvironment=TMPDIR=/var/tmp\n\n[Install]\nWantedBy=multi-user.target\n"})}),"\n",(0,t.jsxs)(n.p,{children:["For our example, as the username ",(0,t.jsx)(n.strong,{children:"lgtn"})," it would look like:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"[Unit]\nDescription=Fleek Network Node lightning service\n\n[Service]\nType=simple\nMemoryHigh=32G\nRestartSec=15s\nRestart=always\nExecStart=lgtn -c /home/lgtn/.lightning/config.toml run\nStandardOutput=append:/var/log/lightning/output.log\nStandardError=append:/var/log/lightning/diagnostic.log\nEnvironment=/var/tmp\n\n[Install]\nWantedBy=multi-user.target\n"})}),"\n",(0,t.jsx)(n.p,{children:"When complete make sure the file is saved and the systemctl daemon is reloaded, as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl daemon-reload\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Consequently, when a user manages the service via the systemctl, the Lightning CLI process will read the configuration file settings provided above. It includes the location of the user preferences, such as the keystore location amongst others, preventing confusion regardless of ",(0,t.jsx)(n.strong,{children:"root"})," delegation."]}),"\n",(0,t.jsx)(r.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function p(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(g,{...e})}):g(e)}},3872:(e,n,s)=>{s.d(n,{Z:()=>i});s(7294);var t=s(5893);const i=e=>{let{image:n,name:s,title:i,url:r,communityMember:o=!1}=e;return(0,t.jsx)("section",{className:"author_card",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"avatar",children:(0,t.jsx)("a",{href:r,target:"_blank",alt:s,children:(0,t.jsx)("img",{src:n,alt:s})})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"name",children:(0,t.jsx)("a",{href:r,target:"_blank",alt:s,children:s})}),(0,t.jsx)("span",{className:"title",children:i}),(0,t.jsxs)("span",{className:"discord",children:[o?"Join our community on":"Got questions? Find us on"," ",(0,t.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,s)=>{s.d(n,{Z:()=>l,a:()=>o});var t=s(7294);const i={},r=t.createContext(i);function o(e){const n=t.useContext(r);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),t.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[9752],{1586:(e,n,s)=>{s.d(n,{ZP:()=>o});var t=s(5893),i=s(1151);function r(e){const n={a:"a",admonition:"admonition",code:"code",p:"p",pre:"pre",strong:"strong",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["In the ",(0,t.jsx)(n.code,{children:"/home//.lightning/config.toml"})," you'll find some and more of the following:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-toml",children:'[BLANK]\n\n[application]\ndb_path = "~/.lightning/data/app_db"\n\n[consensus]\nstore_path = "~/.lightning/data/narwhal_store"\n\n[fsstore]\nroot = "~/.lightning/blockstore"\n\n[resolver]\nstore_path = "~/.lightning/data/resolver_store"\n\n[signer]\nconsensus_key_path = "~/.lightning/keystore/consensus.pem"\nnode_key_path = "~/.lightning/keystore/node.pem"\n'})}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["The configuration properties and values presented above are a shorter version of what you'll find on your ",(0,t.jsx)(n.strong,{children:"configuration.toml"}),". We keep it short to make it easier to follow, do not copy and paste."]})}),"\n",(0,t.jsxs)(n.p,{children:["Find and replace all instances of ~ in the config file ",(0,t.jsx)(n.code,{children:"/home//.lightning/config.toml"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["Here's an example of how to do it using ",(0,t.jsx)(n.strong,{children:"sed"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:'sed -i "s|~/.lightning|/home//.lightning|g" "/home//.lightning/config.toml"\n'})}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["Replace the ",(0,t.jsx)(n.code,{children:""})," with your username. For example, if you have followed the recommendation to ",(0,t.jsx)(n.a,{href:"/docs/node/install#create-a-user",children:"create a user"})," it would look like ",(0,t.jsx)(n.code,{children:"/home/lgtn/.lightning/config.toml"})," for the username ",(0,t.jsx)(n.strong,{children:"lgtn"}),"."]})}),"\n",(0,t.jsxs)(n.p,{children:["For example, if your username is ",(0,t.jsx)(n.code,{children:"lgtn"})," that'd look like this:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:'sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Once modified, you can run a ",(0,t.jsx)(n.code,{children:"cat"})," to see the content of the files to confirm it has been updated."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"cat /home/lgtn/.lightning/config.toml\n"})}),"\n",(0,t.jsxs)(n.p,{children:["For our example where we opted in for the username ",(0,t.jsx)(n.code,{children:"lgtn"})," that would look like:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-toml",children:'[BLANK]\n\n[application]\ndb_path = "~/.lightning/data/app_db"\n\n[consensus]\nstore_path = "~/.lightning/data/narwhal_store"\n\n[fsstore]\nroot = "~/.lightning/blockstore"\n\n[resolver]\nstore_path = "~/.lightning/data/resolver_store"\n\n[signer]\nconsensus_key_path = "~/.lightning/keystore/consensus.pem"\nnode_key_path = "~/.lightning/keystore/node.pem"\n'})}),"\n",(0,t.jsx)(n.admonition,{title:"Warning",type:"caution",children:(0,t.jsx)(n.p,{children:"Bear in mind that we are keeping the content of the file short to make it easier to read and follow. The content of your configuration file should look slightly different, amongst these it should contain other properties and values. You should not copy and replace the content of your files with the ones presented here."})})]})}function o(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(r,{...e})}):r(e)}},2421:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>a,default:()=>p,frontMatter:()=>l,metadata:()=>h,toc:()=>c});var t=s(5893),i=s(1151),r=s(3872),o=s(1586);const l={title:"File permissions and Ownership",slug:"file-permissions-and-ownership",hide_title:!0,tags:["ownership","file permissions","sudoer","root"]},a=void 0,h={id:"Lightning CLI/file-permissions-and-ownership",title:"File permissions and Ownership",description:"Ownership",source:"@site/references/Lightning CLI/file-permissions-and-ownership.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/file-permissions-and-ownership",permalink:"/references/Lightning CLI/file-permissions-and-ownership",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/file-permissions-and-ownership.md",tags:[{label:"ownership",permalink:"/references/tags/ownership"},{label:"file permissions",permalink:"/references/tags/file-permissions"},{label:"sudoer",permalink:"/references/tags/sudoer"},{label:"root",permalink:"/references/tags/root"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"File permissions and Ownership",slug:"file-permissions-and-ownership",hide_title:!0,tags:["ownership","file permissions","sudoer","root"]},sidebar:"defaultSidebar",previous:{title:"Error linking with cc",permalink:"/references/Lightning CLI/error-linking-with-cc-failed-exist-status-1"},next:{title:"Frequently used commands for Native setup",permalink:"/references/Lightning CLI/frequently-used-commands-for-native-setup"}},d={},c=[{value:"Ownership",id:"ownership",level:2},{value:"Using sudo to delegate permissions",id:"using-sudo-to-delegate-permissions",level:2},{value:"User $HOME directory",id:"user-home-directory",level:2},{value:"Set the locations of the user paths",id:"set-the-locations-of-the-user-paths",level:2},{value:"Set the configuration flag -c on the service unit file",id:"set-the-configuration-flag--c-on-the-service-unit-file",level:2}];function g(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h2,{id:"ownership",children:"Ownership"}),"\n",(0,t.jsx)(n.p,{children:"The user who installs the Fleek Network Lightning CLI matters, as it can own or delegate ownership of the dependencies and applications being installed."}),"\n",(0,t.jsx)(n.p,{children:"For example, if you have followed the install document recommendations and have:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Created a user ",(0,t.jsx)(n.strong,{children:"lgtn"})]}),"\n",(0,t.jsxs)(n.li,{children:["Switched to the user ",(0,t.jsx)(n.strong,{children:"lgtn"})]}),"\n",(0,t.jsxs)(n.li,{children:["Executed the installation process as ",(0,t.jsx)(n.strong,{children:"lgtn"})]}),"\n"]}),"\n",(0,t.jsx)(n.admonition,{type:"note",children:(0,t.jsxs)(n.p,{children:["The username can be anything, we are using the term ",(0,t.jsx)(n.strong,{children:"lgtn"})," as the example provided throughout our documentation. Select your username in accordance to your preferences."]})}),"\n",(0,t.jsx)(n.p,{children:"You'll find that it owns the following directories under the user home (/home/lgtn):"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"drwxr-x--- 6 lgtn lgtn 4096 Sep 12 10:27 .\ndrwxr-xr-x 3 root root 4096 Sep 11 12:28 ..\ndrwxrwxr-x 5 lgtn lgtn 4096 Sep 11 12:29 .cargo\ndrwxrwxr-x 5 lgtn lgtn 4096 Sep 11 15:25 .lightning\ndrwxrwxr-x 6 lgtn lgtn 4096 Sep 11 12:29 .rustup\ndrwxrwxr-x 3 lgtn lgtn 4096 Sep 11 12:28 fleek-network\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Above, we have the listing properties set as ",(0,t.jsx)(n.strong,{children:"drwxrwxr-x"})," and the ownership ",(0,t.jsxs)(n.strong,{children:["lgtn",":lgtn"]}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["On the other hand, if you have done the installation process as ",(0,t.jsx)(n.strong,{children:"root"})," superuser, you'll find that:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["The location of the directories and files goes under the ",(0,t.jsx)(n.code,{children:"/root"})," pathname"]}),"\n",(0,t.jsxs)(n.li,{children:["The ownership is set to ",(0,t.jsxs)(n.strong,{children:["root",":root"]})]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["Learn more about ",(0,t.jsx)(n.a,{href:"https://www.linuxfoundation.org/blog/blog/classic-sysadmin-understanding-linux-file-permissions",children:"file permissions"})," from the ",(0,t.jsx)(n.a,{href:"https://www.linuxfoundation.org/",children:"Linux Foundation"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["To learn more about file permission on Linux, read the ",(0,t.jsx)(n.a,{href:"https://www.linuxfoundation.org/blog/blog/classic-sysadmin-understanding-linux-file-permissions",children:"Understanding Linux File Permissions"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"using-sudo-to-delegate-permissions",children:"Using sudo to delegate permissions"}),"\n",(0,t.jsxs)(n.p,{children:["Consider file ownership and permissions to understand where the keystore is located. Take close attention when executing commands as an admin\u2013with or without ",(0,t.jsx)(n.strong,{children:"super user"})," (root) or ",(0,t.jsx)(n.strong,{children:"sudo"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["If a command is executed without ",(0,t.jsx)(n.strong,{children:"sudo"})," then the generated output goes onto the ",(0,t.jsx)(n.strong,{children:"user"})," home."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"lgtn keys generate\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Resulting in having the ",(0,t.jsx)(n.strong,{children:"keystore"})," saved onto ",(0,t.jsx)(n.code,{children:"/home/username/.lightning/keystore"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["On the other hand, if a command is executed with ",(0,t.jsx)(n.strong,{children:"sudo"})," then the generated output is delegated to ",(0,t.jsx)(n.strong,{children:"root"})," directory."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo lgtn keys generate\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Resulting in having the ",(0,t.jsx)(n.strong,{children:"keystore"})," saved onto ",(0,t.jsx)(n.code,{children:"/root/.lightning/keystore"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"user-home-directory",children:"User $HOME directory"}),"\n",(0,t.jsxs)(n.p,{children:["The home directory is a directory that contains the personal files of a particular user of the system. On Linux, the ",(0,t.jsx)(n.code,{children:"$HOME"})," environment variable is set by the login program, which sets the user `$HOME`` accordingly. A user's home goes by the username, the user who's logged in."]}),"\n",(0,t.jsx)(n.p,{children:"For this reason, a user can change to the home directory by executing:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"cd $HOME\n"})}),"\n",(0,t.jsxs)(n.p,{children:["A shorthand allows a user to refer to their home directory simply as ",(0,t.jsx)(n.code,{children:"~"})," (tilde), as follows:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"cd ~\n"})}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["We can find that the HOME or ~ (tilde) is highly dependent on the user who's logged in. Since we know that the user might delegate to ",(0,t.jsx)(n.strong,{children:"root"})," by the usage of ",(0,t.jsx)(n.strong,{children:"sudo"}),", this can help troubleshoot and explain the location of our files e.g. the keystore. In the section ",(0,t.jsx)(n.a,{href:"#set-the-locations-of-the-user-paths",children:"Set the locations of the user paths"}),", we learn how to define the location of our user configuration paths to avoid confusion. By doing it we ensure that when running the service, the service picks the correct configuration paths for our user."]})}),"\n",(0,t.jsxs)(n.p,{children:["To learn more about the user $HOME directory read the wikipedia ",(0,t.jsx)(n.a,{href:"https://en.wikipedia.org/wiki/Home_directory",children:"Home directory"})," document."]}),"\n",(0,t.jsx)(n.h2,{id:"set-the-locations-of-the-user-paths",children:"Set the locations of the user paths"}),"\n",(0,t.jsx)(o.ZP,{}),"\n",(0,t.jsx)(n.h2,{id:"set-the-configuration-flag--c-on-the-service-unit-file",children:"Set the configuration flag -c on the service unit file"}),"\n",(0,t.jsxs)(n.p,{children:["The following section assumes that a System service unit has been declared, and you're using systemctl to control the service, as described in our ",(0,t.jsx)(n.a,{href:"/docs/node/install#systemd-service-setup",children:"Systemd Service Setup"})," install section."]}),"\n",(0,t.jsxs)(n.p,{children:["Open and edit the ",(0,t.jsx)(n.strong,{children:"/etc/systemd/system/lightning.service"})," file."]}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Replace ",(0,t.jsx)(n.code,{children:""})," with YOUR username. For example, in the documentation we use the username ",(0,t.jsx)(n.strong,{children:"lgtn"}),", which means we'd replace ",(0,t.jsx)(n.code,{children:""})," with ",(0,t.jsx)(n.code,{children:"lgtn"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Make sure that the ExecStart is set correctly, including the ",(0,t.jsx)(n.code,{children:"-c"})]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"[Unit]\nDescription=Fleek Network Node lightning service\n\n[Service]\nType=simple\nMemoryHigh=32G\nRestartSec=15s\nRestart=always\nExecStart=lgtn -c /home//.lightning/config.toml run\nStandardOutput=append:/var/log/lightning/output.log\nStandardError=append:/var/log/lightning/diagnostic.log\nEnvironment=TMPDIR=/var/tmp\n\n[Install]\nWantedBy=multi-user.target\n"})}),"\n",(0,t.jsxs)(n.p,{children:["For our example, as the username ",(0,t.jsx)(n.strong,{children:"lgtn"})," it would look like:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"[Unit]\nDescription=Fleek Network Node lightning service\n\n[Service]\nType=simple\nMemoryHigh=32G\nRestartSec=15s\nRestart=always\nExecStart=lgtn -c /home/lgtn/.lightning/config.toml run\nStandardOutput=append:/var/log/lightning/output.log\nStandardError=append:/var/log/lightning/diagnostic.log\nEnvironment=/var/tmp\n\n[Install]\nWantedBy=multi-user.target\n"})}),"\n",(0,t.jsx)(n.p,{children:"When complete make sure the file is saved and the systemctl daemon is reloaded, as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl daemon-reload\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Consequently, when a user manages the service via the systemctl, the Lightning CLI process will read the configuration file settings provided above. It includes the location of the user preferences, such as the keystore location amongst others, preventing confusion regardless of ",(0,t.jsx)(n.strong,{children:"root"})," delegation."]}),"\n",(0,t.jsx)(r.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function p(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(g,{...e})}):g(e)}},3872:(e,n,s)=>{s.d(n,{Z:()=>i});s(7294);var t=s(5893);const i=e=>{let{image:n,name:s,title:i,url:r,communityMember:o=!1}=e;return(0,t.jsx)("section",{className:"author_card",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"avatar",children:(0,t.jsx)("a",{href:r,target:"_blank",alt:s,children:(0,t.jsx)("img",{src:n,alt:s})})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"name",children:(0,t.jsx)("a",{href:r,target:"_blank",alt:s,children:s})}),(0,t.jsx)("span",{className:"title",children:i}),(0,t.jsxs)("span",{className:"discord",children:[o?"Join our community on":"Got questions? Find us on"," ",(0,t.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,s)=>{s.d(n,{Z:()=>l,a:()=>o});var t=s(7294);const i={},r=t.createContext(i);function o(e){const n=t.useContext(r);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),t.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5bc389a1.e6db2462.js b/assets/js/5bc389a1.ecf27a9a.js similarity index 99% rename from assets/js/5bc389a1.e6db2462.js rename to assets/js/5bc389a1.ecf27a9a.js index 18bfd1751..7bcf5c84f 100644 --- a/assets/js/5bc389a1.e6db2462.js +++ b/assets/js/5bc389a1.ecf27a9a.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[9829],{7631:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>c,default:()=>p,frontMatter:()=>l,metadata:()=>h,toc:()=>u});var i=t(5893),s=t(1151),o=t(3872);function r(e){const n={a:"a",admonition:"admonition",p:"p",...(0,s.a)(),...e.components};return(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsxs)(n.p,{children:["During testnet phase, you have to checkout to the testnet branch. For example, the first testnet branch name was ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning/tree/testnet-alpha-1",children:"testnet-alpha-1"})," that you would have to be checked in order to run a node successfully. A list of the active branches can be found at anytime in the GitHub repository ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning/branches",children:"active branches"}),". While we try our best to update documentation, guides, instructions or any other written content during development, there might be breaking changes that might take some time to reflect in our documents. To avoid disappointment, check into the correct branch or contribute by getting in touch with us, or sending a PR in the relevant context, thank you!"]})})}function a(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(r,{...e})}):r(e)}const l={title:"Updating Lightning",hide_title:!0,slug:"updating-lightning",date:new Date("2023-09-19T12:00:00.000Z"),image:"./assets/updating-lightning.png?202309191740",description:"A step-by-step guide to update the Lightning CLI from source code and Service setup",category:"Tutorial",tags:["update","rebuild","guide","setup","configuration"]},c=void 0,h={id:"Node Operators/updating-lightning",title:"Updating Lightning",description:"A step-by-step guide to update the Lightning CLI from source code and Service setup",source:"@site/guides/Node Operators/updating-lightning.md",sourceDirName:"Node Operators",slug:"/Node Operators/updating-lightning",permalink:"/guides/Node Operators/updating-lightning",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/guides/Node Operators/updating-lightning.md",tags:[{label:"update",permalink:"/guides/tags/update"},{label:"rebuild",permalink:"/guides/tags/rebuild"},{label:"guide",permalink:"/guides/tags/guide"},{label:"setup",permalink:"/guides/tags/setup"},{label:"configuration",permalink:"/guides/tags/configuration"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Updating Lightning",hide_title:!0,slug:"updating-lightning",date:"2023-09-19T12:00:00.000Z",image:"./assets/updating-lightning.png?202309191740",description:"A step-by-step guide to update the Lightning CLI from source code and Service setup",category:"Tutorial",tags:["update","rebuild","guide","setup","configuration"]},sidebar:"defaultSidebar",previous:{title:"Transfering setup ownership",permalink:"/guides/Node Operators/transfering-setup-ownership"}},d={image:t(1506).Z},u=[{value:"Introduction",id:"introduction",level:2},{value:"Pre-requisites",id:"pre-requisites",level:2},{value:"Pulling the latest changes",id:"pulling-the-latest-changes",level:2},{value:"Switch to installer username",id:"switch-to-installer-username",level:3},{value:"Change directory to the source code",id:"change-directory-to-the-source-code",level:3},{value:"Checkout to branch",id:"checkout-to-branch",level:3},{value:"Pull the latest changes",id:"pull-the-latest-changes",level:3},{value:"Build the binary from the source code",id:"build-the-binary-from-the-source-code",level:2},{value:"Checkup the symlink setup",id:"checkup-the-symlink-setup",level:2},{value:"Systemd service",id:"systemd-service",level:2},{value:"Verify the setup",id:"verify-the-setup",level:3},{value:"Launching the node as a systemd service",id:"launching-the-node-as-a-systemd-service",level:3},{value:"Health check",id:"health-check",level:2},{value:"Conclusion",id:"conclusion",level:2}];function g(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Update Lightning",src:t(2913).Z+"",width:"1450",height:"816"})}),"\n","\n","\n",(0,i.jsx)(n.h2,{id:"introduction",children:"Introduction"}),"\n",(0,i.jsx)(n.p,{children:"Fleek Network's Lightning source code is updated frequently and thus keeping up with changes can be a bit of a chore and especially difficult for users who are trying to have it compiled for the first time, or updating the Lightning CLI binary for their operating systems. While we should have stable releases in the future, at the current phase of development, there's a requirement to follow the contributions directly in the repository: checking in and out, the commits you're interested in running."}),"\n",(0,i.jsxs)(n.p,{children:["In the following guide, we\u2019ll have a simple look into how to pull changes and update Lightning CLI on Linux, which we stick with Ubuntu for simplicity but should be easily transferrable to your ",(0,i.jsx)(n.a,{href:"/docs/node/requirements#server",children:"supported OS"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"pre-requisites",children:"Pre-requisites"}),"\n",(0,i.jsx)(n.p,{children:"To follow the guide, you will need the following:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Familiarity with the command-line interface"}),"\n",(0,i.jsx)(n.li,{children:"Some experience with Git"}),"\n",(0,i.jsx)(n.li,{children:"Have installed and set up the Lightning CLI and service"}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"pulling-the-latest-changes",children:"Pulling the latest changes"}),"\n",(0,i.jsxs)(n.p,{children:["Check the latest contributions pushed to the Lightning CLI ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning/commits/main",children:"main branch"}),", it'll give you clarity on what's been committed into the source code. Therefore, find out about new features, fixes, improvements, etc by looking directly into the repository history."]}),"\n",(0,i.jsx)(n.h3,{id:"switch-to-installer-username",children:"Switch to installer username"}),"\n",(0,i.jsx)(n.p,{children:"First, switch to the username you've used to install and setup Fleek Network Lightning."}),"\n",(0,i.jsx)(n.p,{children:"To switch to the username you've used throughout the installation process do:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"su \n"})}),"\n",(0,i.jsxs)(n.p,{children:["For example, if you used the username ",(0,i.jsx)(n.code,{children:"lgtn"})," it'll look like the following command:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"su lgtn\n"})}),"\n",(0,i.jsx)(n.h3,{id:"change-directory-to-the-source-code",children:"Change directory to the source code"}),"\n",(0,i.jsxs)(n.p,{children:["Next, ",(0,i.jsx)(n.code,{children:"change directory"})," to the Lightning directory in your file system."]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["The tild ",(0,i.jsx)(n.code,{children:"~"})," means user $HOME, thus you have to be logged in with the correct user as requested in the ",(0,i.jsx)(n.a,{href:"#switch-to-installer-username",children:"installer username"})," step."]})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"cd \n"})}),"\n",(0,i.jsxs)(n.p,{children:["If you have installed it via the recommended instructions, then the default location where the ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"source code"})," is stored should be ",(0,i.jsx)(n.code,{children:"~/fleek-network/lightning"}),". Otherwise, if you opted-in for a custom location then look into your notes before proceeding."]}),"\n",(0,i.jsx)(n.p,{children:"For example, it'd look like the following command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"cd ~/fleek-network/lightning\n"})}),"\n",(0,i.jsx)(n.h3,{id:"checkout-to-branch",children:"Checkout to branch"}),"\n",(0,i.jsxs)(n.p,{children:["Make sure that you are checked in to the correct branch. For example, if that'd be the first testnet phase it'd be called ",(0,i.jsx)(n.code,{children:"testnet-alpha-1"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git checkout \n"})}),"\n",(0,i.jsxs)(n.p,{children:["Here's an example of how the command would look like for the main default branch with corresponding name ",(0,i.jsx)(n.code,{children:"main"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git checkout main\n"})}),"\n",(0,i.jsx)(a,{}),"\n",(0,i.jsxs)(n.p,{children:["Here's an example of how the command would look like for the branch name ",(0,i.jsx)(n.code,{children:"testnet-alpha-1"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git checkout testnet-alpha-1\n"})}),"\n",(0,i.jsx)(n.h3,{id:"pull-the-latest-changes",children:"Pull the latest changes"}),"\n",(0,i.jsx)(n.p,{children:"The syntax to pull the latest commits is the following:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git pull \n"})}),"\n",(0,i.jsxs)(n.p,{children:["The git pull command is used to fetch and merge changes from the remote repository to the local repository. Here we're pulling from remote named ",(0,i.jsx)(n.code,{children:"origin"})," and branch ",(0,i.jsx)(n.code,{children:"main"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git pull origin main\n"})}),"\n",(0,i.jsxs)(n.admonition,{type:"tip",children:[(0,i.jsxs)(n.p,{children:["If you've made any changes in the local repository directory, clear them to prevent being blocked. As ",(0,i.jsx)(n.code,{children:"git"})," is a ",(0,i.jsx)(n.code,{children:"version control"})," program that looks for changes and will ask you to do something about it to prevent losing data. Most readers can disregard changes if not contributing to the development by simply ",(0,i.jsx)(n.a,{href:"https://git-scm.com/docs/git-stash",children:"stashing"})," or resetting the changes."]}),(0,i.jsxs)(n.p,{children:["A quick way to clean is to ",(0,i.jsx)(n.code,{children:"stash"})," the changes, for example:"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git stash \n"})})]}),"\n",(0,i.jsx)(n.p,{children:"You can check yourself, as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git remote -v\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Our output clearly describes what ",(0,i.jsx)(n.code,{children:"origin"})," is tracking."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"origin\tgit@github.com:fleek-network/lightning.git (fetch)\norigin\tgit@github.com:fleek-network/lightning.git (push)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Alternatively, you can stash and pull, to reset the repository to the origin."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git fetch origin \ngit reset --hard origin/\ngit clean -f\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["With ",(0,i.jsx)(n.code,{children:"git"})," you can point to any point in the repository history, there might be lots of reasons you'd want to check into a certain commit or branch, e.g. if you encounter bugs and need to revert to a previous commit or version. That being said, we welcome all kinds of contributions, such as simply reporting bugs. To report issues in our repository visit the ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning/issues",children:"issues"})," page to help us improve."]})}),"\n",(0,i.jsx)(n.p,{children:"Here's the output we got after the git pull:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"remote: Enumerating objects: 437, done.\nremote: Counting objects: 100% (437/437), done.\nremote: Compressing objects: 100% (205/205), done.\nremote: Total 397 (delta 242), reused 334 (delta 181), pack-reused 0\nReceiving objects: 100% (397/397), 214.68 KiB | 4.77 MiB/s, done.\nResolving deltas: 100% (242/242), completed with 29 local objects.\nFrom https://github.com/fleek-network/lightning\n * branch main -> FETCH_HEAD\n 12b2647..998108d main -> origin/main\nUpdating 12b2647..998108d\nFast-forward\n .dockerignore | 6 -\n .gitignore | 2 +\n Cargo.lock | 782 +++++++----------------\n Cargo.toml | 2 +-\n core/application/src/state.rs | 12 +-\n core/cli/Cargo.toml | 47 ++\n core/cli/readme.md | 59 ++\n core/cli/src/args.rs | 63 ++\n core/cli/src/cli.rs | 136 ++++\n core/cli/src/commands/dev.rs | 112 ++++\n core/cli/src/commands/key.rs | 92 +++\n\n ...\n"})}),"\n",(0,i.jsx)(n.p,{children:"When your local version of the repository, is up-to-date with the remote repository, you'd get:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"From https://github.com/fleek-network/lightning\n * branch main -> FETCH_HEAD\nAlready up to date.\n"})}),"\n",(0,i.jsxs)(n.p,{children:['A "already up to date" message means that you have the latest version of the source code and can proceed with compiling the binary process from the source code to override the ',(0,i.jsx)(n.code,{children:"Lightning CLI"})," version you're on. You can also make any other setup changes that might find necessary. Some changes might be related to the recommended setup of Systemd Service that helps control the Fleek Network Lightning Node binary process, etc."]}),"\n",(0,i.jsx)(n.h2,{id:"build-the-binary-from-the-source-code",children:"Build the binary from the source code"}),"\n",(0,i.jsxs)(n.p,{children:["We're assuming that your system setup hasn't changed, such as Rust toolchain still being installed and setup correctly in the system and any other required dependencies. If you have made changes to your system and need to revisit the setup instructions, check our install document ",(0,i.jsx)(n.a,{href:"/docs/node/install",children:"here"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["First, switch the user and change directory to the Lightning directory in your file system as described in ",(0,i.jsx)(n.a,{href:"#switch-to-installer-username",children:"switch to installer username"})," ",(0,i.jsx)(n.a,{href:"#change-directory-to-the-source-code",children:"change directory to the source code"})," sections."]}),"\n",(0,i.jsx)(n.p,{children:"Recall the command from our install document or getting started guide? As you probably guessed, you need to execute the rust cargo build command. But firstly, we are going to clean and update the Rust package manager, as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"cargo clean\ncargo update\n"})}),"\n",(0,i.jsx)(n.p,{children:"Next, execute the build command to compile the Fleek Network Lightning CLI binary."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"cargo +stable build --release\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsx)(n.p,{children:"The build command uses the Rust compiler, which might take a while depending on how speedy the host machine is capable."})}),"\n",(0,i.jsx)(n.p,{children:"Once the Rust compiler completes, the generated binary will be available in the source code project directory."}),"\n",(0,i.jsxs)(n.p,{children:["If you have stick with the default recommendation, that'll be at ",(0,i.jsx)(n.code,{children:"~/fleek-network/lightning/target/release/lightning-node"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"checkup-the-symlink-setup",children:"Checkup the symlink setup"}),"\n",(0,i.jsxs)(n.p,{children:["During the original install and setup process, a symbolic link (symlink) was created linking the generated binary file located in ",(0,i.jsx)(n.code,{children:"~/fleek-network/lightning/target/release/lightning-node"})," to ",(0,i.jsx)(n.code,{children:"/usr/local/bin/lgtn"}),". By placing the symlink in the the default installation location of the user, the executable application is available globally as ",(0,i.jsx)(n.code,{children:"lgtn"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"You can see the full absolute path of the symlink and verify if setup correctly by running:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"readlink -f \n"})}),"\n",(0,i.jsxs)(n.p,{children:["If you have followed the recommended name, the symbolic link should be called ",(0,i.jsx)(n.code,{children:"lgtn"}),", short version for ",(0,i.jsx)(n.code,{children:"lightning"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"readlink -f lgtn\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Here's an example where we find the symlink ",(0,i.jsx)(n.code,{children:"lgtn"})," pointing to the absolute path where our source code and originated built binary is located, as described in the ",(0,i.jsx)(n.a,{href:"#build-the-binary-from-the-source-code",children:"build the binary from the source code"})," section."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"/home//fleek-network/lightning/target/release/lightning-node\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alternatively, you can use the ",(0,i.jsx)(n.code,{children:"ls"})," command to identify the symlink."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"ls -la $(which lgtn)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["If you find an error, it's very likely that a symlink is not setup. You can revisit the ",(0,i.jsx)(n.a,{href:"/docs/node/install",children:"installation"})," to learn, or execute the command to link the build binary to the user default install location:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'sudo ln -s "~/fleek-network/lightning/target/release/lightning-node" /usr/local/bin/lgtn\n'})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["Make sure that the paths provided to the command ",(0,i.jsx)(n.code,{children:"ln"})," are correct. If you are using customized pathnames or switched to a different username other than the one used for installation it has to change accordingly."]})}),"\n",(0,i.jsx)(n.h2,{id:"systemd-service",children:"Systemd service"}),"\n",(0,i.jsx)(n.p,{children:"It's highly recommended to use systemd to manage the Fleek Network service for node operators. Systemd is a system and service manager for Linux operating systems that provides a consistent way to manage system services across various distributions."}),"\n",(0,i.jsx)(n.h3,{id:"verify-the-setup",children:"Verify the setup"}),"\n",(0,i.jsxs)(n.p,{children:["The recommended setup is to wrap the Lightning binary process as a Systemd service, as instructed in the ",(0,i.jsx)(n.a,{href:"/docs/node/install",children:"install"})," section."]}),"\n",(0,i.jsxs)(n.p,{children:["If you have followed the recommendations, you should have the service file called ",(0,i.jsx)(n.code,{children:"ligthning.service"})," in the path ",(0,i.jsx)(n.code,{children:"/etc/systemd/system/lightning.service"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["The content of ",(0,i.jsx)(n.code,{children:"lightning.service"})," should have some or more of the following properties and values:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"[Unit]\nDescription=Fleek Network Node lightning service\n\n[Service]\nType=simple\nMemoryHigh=32G\nRestartSec=15s\nRestart=always\nExecStart=lgtn -c /home/lgtn/.lightning/config.toml -vv run\nStandardOutput=append:/var/log/lightning/output.log\nStandardError=append:/var/log/lightning/diagnostic.log\nEnvironment=TMPDIR=/var/tmp\n\n[Install]\nWantedBy=multi-user.target\n"})}),"\n",(0,i.jsx)(n.p,{children:"Every time the file is modified, the Systemd process should be reloaded. You can do this by executing:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo systemctl daemon-reload\n"})}),"\n",(0,i.jsxs)(n.p,{children:["To learn more about how to create a Systemd service read the ",(0,i.jsx)(n.a,{href:"/docs/node/install#manual-installation",children:"manual installation"})," document that illustrates the steps required in greater detail."]}),"\n",(0,i.jsx)(n.h3,{id:"launching-the-node-as-a-systemd-service",children:"Launching the node as a systemd service"}),"\n",(0,i.jsx)(n.p,{children:"After completing all the steps and checkups mentioned throughout the guide, you should have the Fleek Network Lightning Service ready to go."}),"\n",(0,i.jsx)(n.p,{children:"To launch the service, execute the following command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo systemctl start lightning.service\n"})}),"\n",(0,i.jsxs)(n.p,{children:["To learn more about how to use Systemctl to manage the Lightning service, read the document ",(0,i.jsx)(n.a,{href:"/docs/node/install#use-systemctl-to-manage-systemd-service",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"health-check",children:"Health check"}),"\n",(0,i.jsx)(n.p,{children:"First, complete all the steps and checkups mentioned throught the guide and once the Node process is running perform a health check."}),"\n",(0,i.jsxs)(n.p,{children:["To run a quick health checkup, send a GET request to ",(0,i.jsx)(n.code,{children:"/health"})," endpoint of the RPC on ",(0,i.jsx)(n.a,{href:"/docs/node/requirements#ports",children:"port"})," 4230."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'curl -w "\\n" localhost:4230/health\n'})}),"\n",(0,i.jsxs)(n.p,{children:["If successful, you should get the response ",(0,i.jsx)(n.code,{children:"running and staked"}),", as follows:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"running and staked\n"})}),"\n",(0,i.jsxs)(n.p,{children:["If you'd like to learn more about health check, visit the section ",(0,i.jsx)(n.a,{href:"/docs/node/health-check",children:"health check"})," of our documentation."]}),"\n",(0,i.jsx)(n.h2,{id:"conclusion",children:"Conclusion"}),"\n",(0,i.jsx)(n.p,{children:"The Fleek Network's Ursa CLI is in constant development, there are frequent changes that can introduce features, fixes, and performance improvements, but also breaking changes that in some cases require you to add, including new libraries or packages in your operating system."}),"\n",(0,i.jsx)(n.p,{children:"In the current phase of development, a proper software release cycle for the updates is still in development, thus we pick changes from the source repository to build the Lightning application."}),"\n",(0,i.jsx)(n.p,{children:"We have looked into how to pull the changes via Git, and discussed that contributions can introduce new requirements to the host operating system that leads to updates or changes in the documentation\u2013mentioning how hard it is to keep in sync. Explained how to look into the contributions to understand the nature of the change and get hints about new features."}),"\n",(0,i.jsx)(n.p,{children:"To complete, provided a step-by-step walkthrough the installation and setup process for the Fleek Network Lightning CLI and Systemd service."}),"\n",(0,i.jsxs)(n.p,{children:["Discover more about the project by ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"watching/contributing on GitHub"}),", following us on ",(0,i.jsx)(n.a,{href:"https://twitter.com/fleek_net",children:"Twitter"}),", and joining ",(0,i.jsx)(n.a,{href:"https://discord.gg/fleekxyz",children:"our community Discord"})," for any updates."]}),"\n",(0,i.jsx)(o.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function p(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(g,{...e})}):g(e)}},3872:(e,n,t)=>{t.d(n,{Z:()=>s});t(7294);var i=t(5893);const s=e=>{let{image:n,name:t,title:s,url:o,communityMember:r=!1}=e;return(0,i.jsx)("section",{className:"author_card",children:(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"avatar",children:(0,i.jsx)("a",{href:o,target:"_blank",alt:t,children:(0,i.jsx)("img",{src:n,alt:t})})}),(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"name",children:(0,i.jsx)("a",{href:o,target:"_blank",alt:t,children:t})}),(0,i.jsx)("span",{className:"title",children:s}),(0,i.jsxs)("span",{className:"discord",children:[r?"Join our community on":"Got questions? Find us on"," ",(0,i.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1506:(e,n,t)=>{t.d(n,{Z:()=>i});const i=t.p+"assets/images/updating-lightning-e5c2633345bdcc0db715dd87b269b25b.png"},2913:(e,n,t)=>{t.d(n,{Z:()=>i});const i=t.p+"assets/images/updating-lightning-e5c2633345bdcc0db715dd87b269b25b.png"},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>r});var i=t(7294);const s={},o=i.createContext(s);function r(e){const n=i.useContext(o);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(s):e.components||s:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[9829],{7631:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>c,default:()=>p,frontMatter:()=>l,metadata:()=>h,toc:()=>u});var i=t(5893),s=t(1151),o=t(3872);function r(e){const n={a:"a",admonition:"admonition",p:"p",...(0,s.a)(),...e.components};return(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsxs)(n.p,{children:["During testnet phase, you have to checkout to the testnet branch. For example, the first testnet branch name was ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning/tree/testnet-alpha-1",children:"testnet-alpha-1"})," that you would have to be checked in order to run a node successfully. A list of the active branches can be found at anytime in the GitHub repository ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning/branches",children:"active branches"}),". While we try our best to update documentation, guides, instructions or any other written content during development, there might be breaking changes that might take some time to reflect in our documents. To avoid disappointment, check into the correct branch or contribute by getting in touch with us, or sending a PR in the relevant context, thank you!"]})})}function a(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(r,{...e})}):r(e)}const l={title:"Updating Lightning",hide_title:!0,slug:"updating-lightning",date:new Date("2023-09-19T12:00:00.000Z"),image:"./assets/updating-lightning.png?202309191740",description:"A step-by-step guide to update the Lightning CLI from source code and Service setup",category:"Tutorial",tags:["update","rebuild","guide","setup","configuration"]},c=void 0,h={id:"Node Operators/updating-lightning",title:"Updating Lightning",description:"A step-by-step guide to update the Lightning CLI from source code and Service setup",source:"@site/guides/Node Operators/updating-lightning.md",sourceDirName:"Node Operators",slug:"/Node Operators/updating-lightning",permalink:"/guides/Node Operators/updating-lightning",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/guides/Node Operators/updating-lightning.md",tags:[{label:"update",permalink:"/guides/tags/update"},{label:"rebuild",permalink:"/guides/tags/rebuild"},{label:"guide",permalink:"/guides/tags/guide"},{label:"setup",permalink:"/guides/tags/setup"},{label:"configuration",permalink:"/guides/tags/configuration"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Updating Lightning",hide_title:!0,slug:"updating-lightning",date:"2023-09-19T12:00:00.000Z",image:"./assets/updating-lightning.png?202309191740",description:"A step-by-step guide to update the Lightning CLI from source code and Service setup",category:"Tutorial",tags:["update","rebuild","guide","setup","configuration"]},sidebar:"defaultSidebar",previous:{title:"Transfering setup ownership",permalink:"/guides/Node Operators/transfering-setup-ownership"}},d={image:t(1506).Z},u=[{value:"Introduction",id:"introduction",level:2},{value:"Pre-requisites",id:"pre-requisites",level:2},{value:"Pulling the latest changes",id:"pulling-the-latest-changes",level:2},{value:"Switch to installer username",id:"switch-to-installer-username",level:3},{value:"Change directory to the source code",id:"change-directory-to-the-source-code",level:3},{value:"Checkout to branch",id:"checkout-to-branch",level:3},{value:"Pull the latest changes",id:"pull-the-latest-changes",level:3},{value:"Build the binary from the source code",id:"build-the-binary-from-the-source-code",level:2},{value:"Checkup the symlink setup",id:"checkup-the-symlink-setup",level:2},{value:"Systemd service",id:"systemd-service",level:2},{value:"Verify the setup",id:"verify-the-setup",level:3},{value:"Launching the node as a systemd service",id:"launching-the-node-as-a-systemd-service",level:3},{value:"Health check",id:"health-check",level:2},{value:"Conclusion",id:"conclusion",level:2}];function g(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Update Lightning",src:t(2913).Z+"",width:"1450",height:"816"})}),"\n","\n","\n",(0,i.jsx)(n.h2,{id:"introduction",children:"Introduction"}),"\n",(0,i.jsx)(n.p,{children:"Fleek Network's Lightning source code is updated frequently and thus keeping up with changes can be a bit of a chore and especially difficult for users who are trying to have it compiled for the first time, or updating the Lightning CLI binary for their operating systems. While we should have stable releases in the future, at the current phase of development, there's a requirement to follow the contributions directly in the repository: checking in and out, the commits you're interested in running."}),"\n",(0,i.jsxs)(n.p,{children:["In the following guide, we\u2019ll have a simple look into how to pull changes and update Lightning CLI on Linux, which we stick with Ubuntu for simplicity but should be easily transferrable to your ",(0,i.jsx)(n.a,{href:"/docs/node/requirements#server",children:"supported OS"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"pre-requisites",children:"Pre-requisites"}),"\n",(0,i.jsx)(n.p,{children:"To follow the guide, you will need the following:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Familiarity with the command-line interface"}),"\n",(0,i.jsx)(n.li,{children:"Some experience with Git"}),"\n",(0,i.jsx)(n.li,{children:"Have installed and set up the Lightning CLI and service"}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"pulling-the-latest-changes",children:"Pulling the latest changes"}),"\n",(0,i.jsxs)(n.p,{children:["Check the latest contributions pushed to the Lightning CLI ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning/commits/main",children:"main branch"}),", it'll give you clarity on what's been committed into the source code. Therefore, find out about new features, fixes, improvements, etc by looking directly into the repository history."]}),"\n",(0,i.jsx)(n.h3,{id:"switch-to-installer-username",children:"Switch to installer username"}),"\n",(0,i.jsx)(n.p,{children:"First, switch to the username you've used to install and setup Fleek Network Lightning."}),"\n",(0,i.jsx)(n.p,{children:"To switch to the username you've used throughout the installation process do:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"su \n"})}),"\n",(0,i.jsxs)(n.p,{children:["For example, if you used the username ",(0,i.jsx)(n.code,{children:"lgtn"})," it'll look like the following command:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"su lgtn\n"})}),"\n",(0,i.jsx)(n.h3,{id:"change-directory-to-the-source-code",children:"Change directory to the source code"}),"\n",(0,i.jsxs)(n.p,{children:["Next, ",(0,i.jsx)(n.code,{children:"change directory"})," to the Lightning directory in your file system."]}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["The tild ",(0,i.jsx)(n.code,{children:"~"})," means user $HOME, thus you have to be logged in with the correct user as requested in the ",(0,i.jsx)(n.a,{href:"#switch-to-installer-username",children:"installer username"})," step."]})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"cd \n"})}),"\n",(0,i.jsxs)(n.p,{children:["If you have installed it via the recommended instructions, then the default location where the ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"source code"})," is stored should be ",(0,i.jsx)(n.code,{children:"~/fleek-network/lightning"}),". Otherwise, if you opted-in for a custom location then look into your notes before proceeding."]}),"\n",(0,i.jsx)(n.p,{children:"For example, it'd look like the following command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"cd ~/fleek-network/lightning\n"})}),"\n",(0,i.jsx)(n.h3,{id:"checkout-to-branch",children:"Checkout to branch"}),"\n",(0,i.jsxs)(n.p,{children:["Make sure that you are checked in to the correct branch. For example, if that'd be the first testnet phase it'd be called ",(0,i.jsx)(n.code,{children:"testnet-alpha-1"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git checkout \n"})}),"\n",(0,i.jsxs)(n.p,{children:["Here's an example of how the command would look like for the main default branch with corresponding name ",(0,i.jsx)(n.code,{children:"main"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git checkout main\n"})}),"\n",(0,i.jsx)(a,{}),"\n",(0,i.jsxs)(n.p,{children:["Here's an example of how the command would look like for the branch name ",(0,i.jsx)(n.code,{children:"testnet-alpha-1"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git checkout testnet-alpha-1\n"})}),"\n",(0,i.jsx)(n.h3,{id:"pull-the-latest-changes",children:"Pull the latest changes"}),"\n",(0,i.jsx)(n.p,{children:"The syntax to pull the latest commits is the following:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git pull \n"})}),"\n",(0,i.jsxs)(n.p,{children:["The git pull command is used to fetch and merge changes from the remote repository to the local repository. Here we're pulling from remote named ",(0,i.jsx)(n.code,{children:"origin"})," and branch ",(0,i.jsx)(n.code,{children:"main"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git pull origin main\n"})}),"\n",(0,i.jsxs)(n.admonition,{type:"tip",children:[(0,i.jsxs)(n.p,{children:["If you've made any changes in the local repository directory, clear them to prevent being blocked. As ",(0,i.jsx)(n.code,{children:"git"})," is a ",(0,i.jsx)(n.code,{children:"version control"})," program that looks for changes and will ask you to do something about it to prevent losing data. Most readers can disregard changes if not contributing to the development by simply ",(0,i.jsx)(n.a,{href:"https://git-scm.com/docs/git-stash",children:"stashing"})," or resetting the changes."]}),(0,i.jsxs)(n.p,{children:["A quick way to clean is to ",(0,i.jsx)(n.code,{children:"stash"})," the changes, for example:"]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git stash \n"})})]}),"\n",(0,i.jsx)(n.p,{children:"You can check yourself, as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git remote -v\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Our output clearly describes what ",(0,i.jsx)(n.code,{children:"origin"})," is tracking."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"origin\tgit@github.com:fleek-network/lightning.git (fetch)\norigin\tgit@github.com:fleek-network/lightning.git (push)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Alternatively, you can stash and pull, to reset the repository to the origin."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"git fetch origin \ngit reset --hard origin/\ngit clean -f\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["With ",(0,i.jsx)(n.code,{children:"git"})," you can point to any point in the repository history, there might be lots of reasons you'd want to check into a certain commit or branch, e.g. if you encounter bugs and need to revert to a previous commit or version. That being said, we welcome all kinds of contributions, such as simply reporting bugs. To report issues in our repository visit the ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning/issues",children:"issues"})," page to help us improve."]})}),"\n",(0,i.jsx)(n.p,{children:"Here's the output we got after the git pull:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"remote: Enumerating objects: 437, done.\nremote: Counting objects: 100% (437/437), done.\nremote: Compressing objects: 100% (205/205), done.\nremote: Total 397 (delta 242), reused 334 (delta 181), pack-reused 0\nReceiving objects: 100% (397/397), 214.68 KiB | 4.77 MiB/s, done.\nResolving deltas: 100% (242/242), completed with 29 local objects.\nFrom https://github.com/fleek-network/lightning\n * branch main -> FETCH_HEAD\n 12b2647..998108d main -> origin/main\nUpdating 12b2647..998108d\nFast-forward\n .dockerignore | 6 -\n .gitignore | 2 +\n Cargo.lock | 782 +++++++----------------\n Cargo.toml | 2 +-\n core/application/src/state.rs | 12 +-\n core/cli/Cargo.toml | 47 ++\n core/cli/readme.md | 59 ++\n core/cli/src/args.rs | 63 ++\n core/cli/src/cli.rs | 136 ++++\n core/cli/src/commands/dev.rs | 112 ++++\n core/cli/src/commands/key.rs | 92 +++\n\n ...\n"})}),"\n",(0,i.jsx)(n.p,{children:"When your local version of the repository, is up-to-date with the remote repository, you'd get:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"From https://github.com/fleek-network/lightning\n * branch main -> FETCH_HEAD\nAlready up to date.\n"})}),"\n",(0,i.jsxs)(n.p,{children:['A "already up to date" message means that you have the latest version of the source code and can proceed with compiling the binary process from the source code to override the ',(0,i.jsx)(n.code,{children:"Lightning CLI"})," version you're on. You can also make any other setup changes that might find necessary. Some changes might be related to the recommended setup of Systemd Service that helps control the Fleek Network Lightning Node binary process, etc."]}),"\n",(0,i.jsx)(n.h2,{id:"build-the-binary-from-the-source-code",children:"Build the binary from the source code"}),"\n",(0,i.jsxs)(n.p,{children:["We're assuming that your system setup hasn't changed, such as Rust toolchain still being installed and setup correctly in the system and any other required dependencies. If you have made changes to your system and need to revisit the setup instructions, check our install document ",(0,i.jsx)(n.a,{href:"/docs/node/install",children:"here"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["First, switch the user and change directory to the Lightning directory in your file system as described in ",(0,i.jsx)(n.a,{href:"#switch-to-installer-username",children:"switch to installer username"})," ",(0,i.jsx)(n.a,{href:"#change-directory-to-the-source-code",children:"change directory to the source code"})," sections."]}),"\n",(0,i.jsx)(n.p,{children:"Recall the command from our install document or getting started guide? As you probably guessed, you need to execute the rust cargo build command. But firstly, we are going to clean and update the Rust package manager, as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"cargo clean\ncargo update\n"})}),"\n",(0,i.jsx)(n.p,{children:"Next, execute the build command to compile the Fleek Network Lightning CLI binary."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"cargo +stable build --release\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsx)(n.p,{children:"The build command uses the Rust compiler, which might take a while depending on how speedy the host machine is capable."})}),"\n",(0,i.jsx)(n.p,{children:"Once the Rust compiler completes, the generated binary will be available in the source code project directory."}),"\n",(0,i.jsxs)(n.p,{children:["If you have stick with the default recommendation, that'll be at ",(0,i.jsx)(n.code,{children:"~/fleek-network/lightning/target/release/lightning-node"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"checkup-the-symlink-setup",children:"Checkup the symlink setup"}),"\n",(0,i.jsxs)(n.p,{children:["During the original install and setup process, a symbolic link (symlink) was created linking the generated binary file located in ",(0,i.jsx)(n.code,{children:"~/fleek-network/lightning/target/release/lightning-node"})," to ",(0,i.jsx)(n.code,{children:"/usr/local/bin/lgtn"}),". By placing the symlink in the the default installation location of the user, the executable application is available globally as ",(0,i.jsx)(n.code,{children:"lgtn"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"You can see the full absolute path of the symlink and verify if setup correctly by running:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"readlink -f \n"})}),"\n",(0,i.jsxs)(n.p,{children:["If you have followed the recommended name, the symbolic link should be called ",(0,i.jsx)(n.code,{children:"lgtn"}),", short version for ",(0,i.jsx)(n.code,{children:"lightning"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"readlink -f lgtn\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Here's an example where we find the symlink ",(0,i.jsx)(n.code,{children:"lgtn"})," pointing to the absolute path where our source code and originated built binary is located, as described in the ",(0,i.jsx)(n.a,{href:"#build-the-binary-from-the-source-code",children:"build the binary from the source code"})," section."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"/home//fleek-network/lightning/target/release/lightning-node\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alternatively, you can use the ",(0,i.jsx)(n.code,{children:"ls"})," command to identify the symlink."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"ls -la $(which lgtn)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["If you find an error, it's very likely that a symlink is not setup. You can revisit the ",(0,i.jsx)(n.a,{href:"/docs/node/install",children:"installation"})," to learn, or execute the command to link the build binary to the user default install location:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'sudo ln -s "~/fleek-network/lightning/target/release/lightning-node" /usr/local/bin/lgtn\n'})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["Make sure that the paths provided to the command ",(0,i.jsx)(n.code,{children:"ln"})," are correct. If you are using customized pathnames or switched to a different username other than the one used for installation it has to change accordingly."]})}),"\n",(0,i.jsx)(n.h2,{id:"systemd-service",children:"Systemd service"}),"\n",(0,i.jsx)(n.p,{children:"It's highly recommended to use systemd to manage the Fleek Network service for node operators. Systemd is a system and service manager for Linux operating systems that provides a consistent way to manage system services across various distributions."}),"\n",(0,i.jsx)(n.h3,{id:"verify-the-setup",children:"Verify the setup"}),"\n",(0,i.jsxs)(n.p,{children:["The recommended setup is to wrap the Lightning binary process as a Systemd service, as instructed in the ",(0,i.jsx)(n.a,{href:"/docs/node/install",children:"install"})," section."]}),"\n",(0,i.jsxs)(n.p,{children:["If you have followed the recommendations, you should have the service file called ",(0,i.jsx)(n.code,{children:"ligthning.service"})," in the path ",(0,i.jsx)(n.code,{children:"/etc/systemd/system/lightning.service"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["The content of ",(0,i.jsx)(n.code,{children:"lightning.service"})," should have some or more of the following properties and values:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"[Unit]\nDescription=Fleek Network Node lightning service\n\n[Service]\nType=simple\nMemoryHigh=32G\nRestartSec=15s\nRestart=always\nExecStart=lgtn -c /home/lgtn/.lightning/config.toml -vv run\nStandardOutput=append:/var/log/lightning/output.log\nStandardError=append:/var/log/lightning/diagnostic.log\nEnvironment=TMPDIR=/var/tmp\n\n[Install]\nWantedBy=multi-user.target\n"})}),"\n",(0,i.jsx)(n.p,{children:"Every time the file is modified, the Systemd process should be reloaded. You can do this by executing:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo systemctl daemon-reload\n"})}),"\n",(0,i.jsxs)(n.p,{children:["To learn more about how to create a Systemd service read the ",(0,i.jsx)(n.a,{href:"/docs/node/install#manual-installation",children:"manual installation"})," document that illustrates the steps required in greater detail."]}),"\n",(0,i.jsx)(n.h3,{id:"launching-the-node-as-a-systemd-service",children:"Launching the node as a systemd service"}),"\n",(0,i.jsx)(n.p,{children:"After completing all the steps and checkups mentioned throughout the guide, you should have the Fleek Network Lightning Service ready to go."}),"\n",(0,i.jsx)(n.p,{children:"To launch the service, execute the following command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo systemctl start lightning.service\n"})}),"\n",(0,i.jsxs)(n.p,{children:["To learn more about how to use Systemctl to manage the Lightning service, read the document ",(0,i.jsx)(n.a,{href:"/docs/node/install#use-systemctl-to-manage-systemd-service",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"health-check",children:"Health check"}),"\n",(0,i.jsx)(n.p,{children:"First, complete all the steps and checkups mentioned throught the guide and once the Node process is running perform a health check."}),"\n",(0,i.jsxs)(n.p,{children:["To run a quick health checkup, send a GET request to ",(0,i.jsx)(n.code,{children:"/health"})," endpoint of the RPC on ",(0,i.jsx)(n.a,{href:"/docs/node/requirements#ports",children:"port"})," 4230."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:'curl -w "\\n" localhost:4230/health\n'})}),"\n",(0,i.jsxs)(n.p,{children:["If successful, you should get the response ",(0,i.jsx)(n.code,{children:"running and staked"}),", as follows:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"running and staked\n"})}),"\n",(0,i.jsxs)(n.p,{children:["If you'd like to learn more about health check, visit the section ",(0,i.jsx)(n.a,{href:"/docs/node/health-check",children:"health check"})," of our documentation."]}),"\n",(0,i.jsx)(n.h2,{id:"conclusion",children:"Conclusion"}),"\n",(0,i.jsx)(n.p,{children:"The Fleek Network's Ursa CLI is in constant development, there are frequent changes that can introduce features, fixes, and performance improvements, but also breaking changes that in some cases require you to add, including new libraries or packages in your operating system."}),"\n",(0,i.jsx)(n.p,{children:"In the current phase of development, a proper software release cycle for the updates is still in development, thus we pick changes from the source repository to build the Lightning application."}),"\n",(0,i.jsx)(n.p,{children:"We have looked into how to pull the changes via Git, and discussed that contributions can introduce new requirements to the host operating system that leads to updates or changes in the documentation\u2013mentioning how hard it is to keep in sync. Explained how to look into the contributions to understand the nature of the change and get hints about new features."}),"\n",(0,i.jsx)(n.p,{children:"To complete, provided a step-by-step walkthrough the installation and setup process for the Fleek Network Lightning CLI and Systemd service."}),"\n",(0,i.jsxs)(n.p,{children:["Discover more about the project by ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"watching/contributing on GitHub"}),", following us on ",(0,i.jsx)(n.a,{href:"https://twitter.com/fleek_net",children:"Twitter"}),", and joining ",(0,i.jsx)(n.a,{href:"https://discord.gg/fleekxyz",children:"our community Discord"})," for any updates."]}),"\n",(0,i.jsx)(o.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function p(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(g,{...e})}):g(e)}},3872:(e,n,t)=>{t.d(n,{Z:()=>s});t(7294);var i=t(5893);const s=e=>{let{image:n,name:t,title:s,url:o,communityMember:r=!1}=e;return(0,i.jsx)("section",{className:"author_card",children:(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"avatar",children:(0,i.jsx)("a",{href:o,target:"_blank",alt:t,children:(0,i.jsx)("img",{src:n,alt:t})})}),(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"name",children:(0,i.jsx)("a",{href:o,target:"_blank",alt:t,children:t})}),(0,i.jsx)("span",{className:"title",children:s}),(0,i.jsxs)("span",{className:"discord",children:[r?"Join our community on":"Got questions? Find us on"," ",(0,i.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1506:(e,n,t)=>{t.d(n,{Z:()=>i});const i=t.p+"assets/images/updating-lightning-e5c2633345bdcc0db715dd87b269b25b.png"},2913:(e,n,t)=>{t.d(n,{Z:()=>i});const i=t.p+"assets/images/updating-lightning-e5c2633345bdcc0db715dd87b269b25b.png"},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>r});var i=t(7294);const s={},o=i.createContext(s);function r(e){const n=i.useContext(o);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(s):e.components||s:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/6be32138.e1014461.js b/assets/js/6be32138.075447c5.js similarity index 99% rename from assets/js/6be32138.e1014461.js rename to assets/js/6be32138.075447c5.js index fcb05f109..2a78de382 100644 --- a/assets/js/6be32138.e1014461.js +++ b/assets/js/6be32138.075447c5.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[3396],{3103:(e,t,i)=>{i.r(t),i.d(t,{assets:()=>l,contentTitle:()=>s,default:()=>d,frontMatter:()=>r,metadata:()=>a,toc:()=>c});var n=i(5893),o=i(1151);const r={title:"Bloom Filters and Cuckoo Filters for Cache Summarization",description:"Summary of our experiment informing whether or not we should replace our implementation of Counting Bloom filters with Cuckoo filters.",slug:"bloom-and-cuckoo-filters-for-cache-summarization",image:"./assets/bloom-cuckoo/bloom.png?202301181528",authors:{name:"Matthias Wright",title:"Software Engineer",url:"https://github.com/matthias-wright",image_url:"https://github.com/matthias-wright.png"},tags:["fleek network","blog","engineering","content routing"]},s=void 0,a={permalink:"/blog/bloom-and-cuckoo-filters-for-cache-summarization",source:"@site/blog/bloom-and-cuckoo-filters-for-cache-summarization.md",title:"Bloom Filters and Cuckoo Filters for Cache Summarization",description:"Summary of our experiment informing whether or not we should replace our implementation of Counting Bloom filters with Cuckoo filters.",date:"2023-11-07T18:40:34.000Z",formattedDate:"November 7, 2023",tags:[{label:"fleek network",permalink:"/blog/tags/fleek-network"},{label:"blog",permalink:"/blog/tags/blog"},{label:"engineering",permalink:"/blog/tags/engineering"},{label:"content routing",permalink:"/blog/tags/content-routing"}],readingTime:10.37,hasTruncateMarker:!0,authors:[{name:"Matthias Wright",title:"Software Engineer",url:"https://github.com/matthias-wright",image_url:"https://github.com/matthias-wright.png",imageURL:"https://github.com/matthias-wright.png"}],frontMatter:{title:"Bloom Filters and Cuckoo Filters for Cache Summarization",description:"Summary of our experiment informing whether or not we should replace our implementation of Counting Bloom filters with Cuckoo filters.",slug:"bloom-and-cuckoo-filters-for-cache-summarization",image:"./assets/bloom-cuckoo/bloom.png?202301181528",authors:{name:"Matthias Wright",title:"Software Engineer",url:"https://github.com/matthias-wright",image_url:"https://github.com/matthias-wright.png",imageURL:"https://github.com/matthias-wright.png"},tags:["fleek network","blog","engineering","content routing"]},unlisted:!1},l={image:i(9969).Z,authorsImageUrls:[void 0]},c=[{value:"Background",id:"background",level:2},{value:"Bloom Filters",id:"bloom-filters",level:2},{value:"Cuckoo Filters",id:"cuckoo-filters",level:2},{value:"Benchmarking",id:"benchmarking",level:2},{value:"Experimental Setup",id:"experimental-setup",level:2},{value:"Memory Footprint",id:"memory-footprint",level:2},{value:"Lookup Performance",id:"lookup-performance",level:2},{value:"Insertion Performance",id:"insertion-performance",level:2},{value:"Capacity and Scaling",id:"capacity-and-scaling",level:2},{value:"Other Filters",id:"other-filters",level:2},{value:"Conclusion",id:"conclusion",level:2},{value:"References",id:"references",level:3}];function h(e){const t={a:"a",blockquote:"blockquote",br:"br",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",ul:"ul",...(0,o.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.p,{children:"Disclaimer: This is not a general comparison between Bloom filters and Cuckoo filters. This blog post summarizes some of the experiments we conducted to decide whether or not we should replace our implementation of Counting Bloom filters with Cuckoo filters, for a specific use case."}),"\n",(0,n.jsx)(t.h2,{id:"background",children:"Background"}),"\n",(0,n.jsx)(t.p,{children:"Nodes on Fleek Network currently use Counting Bloom filters to summarize their cached content. These cache summaries are exchanged with other nodes in order to facilitate content routing."}),"\n",(0,n.jsx)(t.p,{children:"If a particular node does not store a requested piece of content, it can use the Bloom filters that it received from its peers to check if a peer stores the requested content."}),"\n",(0,n.jsx)(t.p,{children:"We are using Counting Bloom filters rather than regular Bloom filters because we need to be able to remove elements from the filter to support cache eviction."}),"\n",(0,n.jsx)(t.h2,{id:"bloom-filters",children:"Bloom Filters"}),"\n",(0,n.jsxs)(t.p,{children:["A Bloom filter is a space-efficient probabilistic data structure that can be used to perform approximate set membership queries.\nThe answer to an approximate set membership query is not ",(0,n.jsx)(t.code,{children:"no"})," or ",(0,n.jsx)(t.code,{children:"yes,"})," but rather ",(0,n.jsx)(t.code,{children:"no"})," or ",(0,n.jsx)(t.code,{children:"probably."})," This ",(0,n.jsx)(t.code,{children:"probably"})," is quantified with the false positive rate."]}),"\n",(0,n.jsxs)(t.p,{children:["One of the convenient features of Bloom filters is that they can be configured to have a specific false positive rate.\nOf course, there is a tradeoff here; the lower the false positive rate, the larger the memory footprint. Bloom filters support two operations: ",(0,n.jsx)(t.code,{children:"insert"})," and ",(0,n.jsx)(t.code,{children:"contains."})]}),"\n",(0,n.jsxs)(t.p,{children:["A Bloom filter is represented by an array of m bits together with k independent hash functions. To insert an element into the filter, it is hashed with each of the k hash functions.\nThe resulting hashes are interpreted as integers (modulo m) to obtain k array positions. The bits at these positions are then set to 1 (if there aren't already 1).",(0,n.jsx)(t.br,{}),"\n","To check whether or not an element is contained in the filter, the element is hashed k times with the different hash functions."]}),"\n",(0,n.jsx)(t.p,{children:"If all bits at the resulting array positions are 1, the element is assumed to be present. If any of the k bits are zero, we can be certain that the queried element is not present in the set."}),"\n",(0,n.jsx)(t.p,{children:"However, even if all bits are 1, it might still be the case that the bits were set by a combination of other elements. This is where the aforementioned false positive rate comes into play."}),"\n",(0,n.jsxs)(t.p,{children:["Since we also need a ",(0,n.jsx)(t.code,{children:"remove"})," operation for our use case, we have been using Counting Bloom filters, a variant of Bloom filters.\nCounting Bloom filters retain most of the properties that regular Bloom filters have. The ",(0,n.jsx)(t.code,{children:"remove"})," operation comes at the cost of an increased memory footprint."]}),"\n",(0,n.jsx)(t.p,{children:"Each position in the array is no longer a single bit but a group of bits representing a counter.\nWhenever an element is inserted into the filter, the counters for all k positions are incremented by 1. To remove an element, we decrement the counters."}),"\n",(0,n.jsx)(t.h2,{id:"cuckoo-filters",children:"Cuckoo Filters"}),"\n",(0,n.jsx)(t.p,{children:"Bloom filters are the most known members of a class of data structures called Approximate Membership Query Filters (AMQ Filters).\nA relatively recent addition to this class is the Cuckoo filter [1]. Cuckoo filters share many similarities with Bloom filters, especially Counting Bloom filters."}),"\n",(0,n.jsxs)(t.p,{children:["They are space-efficient and can be used for approximate set membership queries. Cuckoo filters also support the operations ",(0,n.jsx)(t.code,{children:"insert,"})," ",(0,n.jsx)(t.code,{children:"contains,"})," and ",(0,n.jsx)(t.code,{children:"remove,"})," and have configurable false positive rates."]}),"\n",(0,n.jsx)(t.p,{children:"Cuckoo filters are based on Cuckoo hash tables [2] and leverage an optimization called partial-key cuckoo hashing. A basic Cuckoo hash table consists of an array of buckets.\nWe determine two candidate buckets for each element using two different hash functions, h1 and h2."}),"\n",(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(t.code,{children:"contains"})," operation will check if either bucket contains the element.\nFor insertion, if either bucket is empty, the element will be inserted into the empty bucket."]}),"\n",(0,n.jsx)(t.p,{children:"If neither bucket is empty, one of the buckets is selected, and the existing element is removed and inserted into its alternate location.\nThis may trigger another relocation if the alternate location is not empty."}),"\n",(0,n.jsx)(t.p,{children:"Although the insertion operation may perform a sequence of relocations, the amortized runtime is O(1)."}),"\n",(0,n.jsx)(t.p,{children:"Most implementations of Cuckoo hash tables and, consequently, Cuckoo filters will use buckets that can hold multiple elements, as proposed in [3]."}),"\n",(0,n.jsx)(t.p,{children:"For Cuckoo filters, the hash table size is reduced by only storing fingerprints - a bit string calculated from an element's hash - rather than key-value pairs."}),"\n",(0,n.jsxs)(t.p,{children:["The fingerprint size is derived from the desired false positive rate.",(0,n.jsx)(t.br,{}),"\n","A problem that arises is that, to relocate existing fingerprints using the Cuckoo hashing approach described above, we need the original hash from which the fingerprint was derived."]}),"\n",(0,n.jsx)(t.p,{children:"Of course, we could store this hash somewhere, but the whole point of using fingerprints is to reduce the memory footprint of the filter."}),"\n",(0,n.jsxs)(t.p,{children:["The solution to this predicament is the aforementioned partial-key cuckoo hashing, a technique for determining an element's alternate location using only its fingerprint.",(0,n.jsx)(t.br,{}),"\n","For a given element x, the two candidate buckets are computed as follows:"]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{src:i(9440).Z+"",width:"1324",height:"194"})}),"\n",(0,n.jsx)(t.p,{children:"An important property of this technique is that h1(x) can also be computed from h2(x) and the fingerprint."}),"\n",(0,n.jsx)(t.h2,{id:"benchmarking",children:"Benchmarking"}),"\n",(0,n.jsx)(t.p,{children:"As this post mentioned, we are not aiming for a general comparison of Counting Bloom and Cuckoo filters."}),"\n",(0,n.jsx)(t.p,{children:"Instead, we want to determine which filter suits our specific use case better. The two main properties we are looking for are space efficiency and lookup performance."}),"\n",(0,n.jsx)(t.p,{children:"Space efficiency is important because nodes frequently update their cache and have to communicate these changes with their peers. These messages should take up as little bandwidth as possible."}),"\n",(0,n.jsx)(t.p,{children:"Lookup speed is also important because Fleek Network aims to serve user requests as quickly as possible. Checking whether a peer has some content stored in their cache summary should not be a bottleneck."}),"\n",(0,n.jsx)(t.h2,{id:"experimental-setup",children:"Experimental Setup"}),"\n",(0,n.jsxs)(t.p,{children:["We are using our own Counting Bloom filter ",(0,n.jsx)(t.a,{href:"https://github.com/fleek-network/ursa/blob/483f4d56cbaa5e83182454d2c1db6f6af7c54912/crates/ursa-network/src/utils/bloom_filter.rs#L11",children:"implementation"})," and ",(0,n.jsx)(t.a,{href:"https://github.com/sile/scalable_cuckoo_filter?gh",children:"scalable cuckoo filter"})," Cuckoo filter implementation in Rust, the ",(0,n.jsx)(t.a,{href:"https://github.com/efficient/cuckoofilter?gh",children:"original cuckoofilter"})," implementation is in C++. All experiments were performed on a Linux machine with 16 GB RAM and an Intel Core i7 (10th Gen). Whenever the experiment is probabilistic, we repeat the experiment 20 times and report the mean and standard deviation."]}),"\n",(0,n.jsx)(t.h2,{id:"memory-footprint",children:"Memory Footprint"}),"\n",(0,n.jsx)(t.p,{children:"For both Counting Bloom filters and Cuckoo filters, the memory footprint is determined by two factors: the filter's capacity and the desired false positive rate. In the first experiment, we examine the impact that\nthese factors have on the memory footprint."}),"\n",(0,n.jsx)(t.p,{children:"To this end, we fix the false positive rate and initialize the filters with capacities ranging from 100K to 1M. The result is shown in Fig. 1.\nThe size of Bloom filters scales linearly with the capacity. Cuckoo filters are more space-efficient. This result is consistent with the experiments reported in [1]."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{src:i(5441).Z+"",width:"640",height:"480"})}),"\n",(0,n.jsxs)(t.blockquote,{children:["\n",(0,n.jsx)(t.p,{children:"Figure 1: We fix the false positive rate and initialize the filters with capacities ranging from 100K to 1M. The y-axis shows the size of the filters in Megabytes."}),"\n"]}),"\n",(0,n.jsx)(t.p,{children:"Next, we fix the capacity and initialize the filters with false positive rates ranging from 0.0001 to 0.5. Fig. 2 shows that Cuckoo filters are more space-efficient."}),"\n",(0,n.jsx)(t.p,{children:"The gap between Counting Bloom filters and Cuckoo filters grows as the false positive rate decreases. This is also consistent with experiments in [1]."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{src:i(9844).Z+"",width:"640",height:"480"})}),"\n",(0,n.jsxs)(t.blockquote,{children:["\n",(0,n.jsx)(t.p,{children:"Figure 2: We fix the capacity and initialize the filters with false positive rates ranging from 0.0001 to 0.5. The y-axis shows the size of the filters in Megabytes."}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"lookup-performance",children:"Lookup Performance"}),"\n",(0,n.jsx)(t.p,{children:"We first add elements to both filters until the capacity is reached. We then measure the lookup performance for different ratios of positive and negative lookups."}),"\n",(0,n.jsx)(t.p,{children:"A positive lookup is for an existing element, and a negative lookup is for an element not contained in the filter. We perform 100K lookups for each ratio and report the average lookup duration and standard deviation."}),"\n",(0,n.jsx)(t.p,{children:"Fig. 3 shows the results. Bloom filters perform slightly better on average than Cuckoo filters. This result is inconsistent with [1],\nwhere Cuckoo filters were reported to have a better lookup performance than Bloom filters. It should be noted here that the authors in [1] use the original C++ Cuckoo filter implementation and their own unreleased Bloom filter implementation. In contrast, we use a Rust Cuckoo filter implementation and our Bloom filter implementation. We cannot easily determine the reason for this discrepancy."}),"\n",(0,n.jsx)(t.p,{children:"However, the performance difference is negligible."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{src:i(8915).Z+"",width:"640",height:"480"})}),"\n",(0,n.jsxs)(t.blockquote,{children:["\n",(0,n.jsx)(t.p,{children:"Figure 3: Lookup performance for different ratios of positive and negative lookups. For example, ratio 0.25 indicates that 25% of lookups are positive and 75% are negative.\nThe shaded region indicates the standard deviation."}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"insertion-performance",children:"Insertion Performance"}),"\n",(0,n.jsx)(t.p,{children:"Less critical than lookup performance but still important for our purposes is insertion performance. We measure how the insertion performance varies for different occupancy levels.\nFig. 4 shows the results. The insertion performance is constant across all levels of occupancy for Bloom filters."}),"\n",(0,n.jsx)(t.p,{children:"For Cuckoo filters, the performance decreases as the filter becomes fuller because more relocations are required. In Fig. 4, the performance for Bloom filters is not constant. It quickly increases and then remains constant. This can be explained by CPU caching."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{src:i(989).Z+"",width:"640",height:"480"})}),"\n",(0,n.jsxs)(t.blockquote,{children:["\n",(0,n.jsx)(t.p,{children:"Figure 4: Insertion performance for different occupancy levels. The shaded region indicates the standard deviation."}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"capacity-and-scaling",children:"Capacity and Scaling"}),"\n",(0,n.jsx)(t.p,{children:"We have mentioned the capacity of a filter several times now. An interesting case is what happens when a filter's capacity is exceeded.\nBloom filters and Cuckoo filters behave differently in this scenario."}),"\n",(0,n.jsxs)(t.p,{children:["For Bloom filters, the ",(0,n.jsx)(t.code,{children:"insertion"})," operation always succeeds. However, the false positive rate will rapidly increase as we exceed the filter's capacity. While Bloom filters fail silently, Cuckoo filters are more explicit. Most implementations have a maximum number of\nrelocations that will be performed for an insertion. The ",(0,n.jsx)(t.code,{children:"insertion"})," operation will return an error if more relocations are required."]}),"\n",(0,n.jsx)(t.p,{children:"For both filters, we can avoid this problem by simply initializing the filter with a sufficiently large capacity. However, this will increase the memory footprint of the filter."}),"\n",(0,n.jsx)(t.p,{children:"Furthermore, it is difficult to predict how many elements a node on Fleek Network will cache. It is also likely that the number of cached elements will greatly vary for different nodes."}),"\n",(0,n.jsx)(t.p,{children:"Fortunately, a variant of Bloom filters called Scalable Bloom Filters [4] can adapt dynamically to the number of elements stored while guaranteeing a maximum false positive rate."}),"\n",(0,n.jsx)(t.p,{children:"The proposed technique is also applicable to Cuckoo filters."}),"\n",(0,n.jsx)(t.h2,{id:"other-filters",children:"Other Filters"}),"\n",(0,n.jsx)(t.p,{children:"While we only looked at Bloom filters and Cuckoo filters, there are other AMQ filters that we want to mention here briefly:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:["\n",(0,n.jsx)(t.p,{children:"Quotient filters [5, 6]: Compact hash tables that support insertion, lookup, and deletion. Less space-efficient than Bloom filters and Cuckoo filters."}),"\n"]}),"\n",(0,n.jsxs)(t.li,{children:["\n",(0,n.jsx)(t.p,{children:"XOR filters [7]: More space-efficient than Bloom filters and Cuckoo filters. However, they are static, meaning the filter has to be rebuilt if additional elements are added."}),"\n"]}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"conclusion",children:"Conclusion"}),"\n",(0,n.jsx)(t.p,{children:"We examined whether Counting Bloom filters or Cuckoo filters are more suitable for summarizing caches on Fleek Network. Cuckoo filters are more space-efficient, especially for lower false positive rates. Bloom filters have a slightly better insertion and lookup performance for the implementations we tested."}),"\n",(0,n.jsx)(t.p,{children:"Both filters can be adapted to grow and shrink in size dynamically. Since the difference in insertion and lookup performance is negligible while Cuckoo filters are significantly more space-efficient, we favor Cuckoo filters for our use case."}),"\n",(0,n.jsx)(t.h3,{id:"references",children:"References"}),"\n",(0,n.jsx)(t.p,{children:"[1] Bin Fan, Dave G. Andersen, Michael Kaminsky, and Michael D. Mitzenmacher. Cuckoo Filter: Practically Better Than Bloom.\nIn Proceedings of the 10th ACM International Conference on emerging Networking Experiments and Technologies (CoNEXT 14). Association for Computing Machinery, New York, NY, USA, pp. 75-88, 2014."}),"\n",(0,n.jsx)(t.p,{children:"[2] Rasmus Pagha and Flemming Friche Rodler. Cuckoo hashing. Journal of Algorithms, 51(2), pp. 122-144, 2004."}),"\n",(0,n.jsx)(t.p,{children:"[3] Martin Dietzfelbinger and Christoph Weidling. Balanced Allocation and Dictionaries with Tightly Packed Constant Size Bins. Theoretical Computer Science, 380(1), pp. 47-68, 2007."}),"\n",(0,n.jsx)(t.p,{children:"[4] Paulo S. Almeida, Carlos Baquero, Nuno Pregui\xe7a, and David Hutchison. Scalable Bloom Filters. Information Processing Letters, 101(6), pp. 255-261, 2007."}),"\n",(0,n.jsx)(t.p,{children:"[5] John G. Cleary. Compact hash tables using bidirectional linear probing. IEEE Transactions on Computers. 33(9), pp. 828-834, 1984."}),"\n",(0,n.jsx)(t.p,{children:"[6] Anna Pagh, Rasmus Pagh, and S. Srinivasa Rao. An optimal Bloom filter replacement. Proceedings of the Sixteenth Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 823-829, 2005."}),"\n",(0,n.jsx)(t.p,{children:"[7] Thomas Mueller Graf and Daniel Lemire. Xor Filters: Faster and Smaller Than Bloom and Cuckoo Filters. ACM Journal of Experimental Algorithmics. 25, pp. 1-16, 2020."})]})}function d(e={}){const{wrapper:t}={...(0,o.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},9969:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/bloom-79da0db687b4fb2060758838b9c44513.png"},5441:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/capacity-size-5c2576bd69db0e5b510781e7cc1c5257.png"},9844:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/fp-rate-size-fbb54b2450b4a91e28c97d8adf0253e8.png"},989:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/insert-3ff48d4c63724adcf399f81b29607691.png"},8915:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/lookup-e36011237d8602b5f6c36fe5dd145bf5.png"},9440:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/math-formul-a247d4df475b26b1e7cbb2acfc0ab8c2.png"},1151:(e,t,i)=>{i.d(t,{Z:()=>a,a:()=>s});var n=i(7294);const o={},r=n.createContext(o);function s(e){const t=n.useContext(r);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),n.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[3396],{3103:(e,t,i)=>{i.r(t),i.d(t,{assets:()=>l,contentTitle:()=>s,default:()=>d,frontMatter:()=>r,metadata:()=>a,toc:()=>c});var n=i(5893),o=i(1151);const r={title:"Bloom Filters and Cuckoo Filters for Cache Summarization",description:"Summary of our experiment informing whether or not we should replace our implementation of Counting Bloom filters with Cuckoo filters.",slug:"bloom-and-cuckoo-filters-for-cache-summarization",image:"./assets/bloom-cuckoo/bloom.png?202301181528",authors:{name:"Matthias Wright",title:"Software Engineer",url:"https://github.com/matthias-wright",image_url:"https://github.com/matthias-wright.png"},tags:["fleek network","blog","engineering","content routing"]},s=void 0,a={permalink:"/blog/bloom-and-cuckoo-filters-for-cache-summarization",source:"@site/blog/bloom-and-cuckoo-filters-for-cache-summarization.md",title:"Bloom Filters and Cuckoo Filters for Cache Summarization",description:"Summary of our experiment informing whether or not we should replace our implementation of Counting Bloom filters with Cuckoo filters.",date:"2023-11-07T19:16:06.000Z",formattedDate:"November 7, 2023",tags:[{label:"fleek network",permalink:"/blog/tags/fleek-network"},{label:"blog",permalink:"/blog/tags/blog"},{label:"engineering",permalink:"/blog/tags/engineering"},{label:"content routing",permalink:"/blog/tags/content-routing"}],readingTime:10.37,hasTruncateMarker:!0,authors:[{name:"Matthias Wright",title:"Software Engineer",url:"https://github.com/matthias-wright",image_url:"https://github.com/matthias-wright.png",imageURL:"https://github.com/matthias-wright.png"}],frontMatter:{title:"Bloom Filters and Cuckoo Filters for Cache Summarization",description:"Summary of our experiment informing whether or not we should replace our implementation of Counting Bloom filters with Cuckoo filters.",slug:"bloom-and-cuckoo-filters-for-cache-summarization",image:"./assets/bloom-cuckoo/bloom.png?202301181528",authors:{name:"Matthias Wright",title:"Software Engineer",url:"https://github.com/matthias-wright",image_url:"https://github.com/matthias-wright.png",imageURL:"https://github.com/matthias-wright.png"},tags:["fleek network","blog","engineering","content routing"]},unlisted:!1},l={image:i(9969).Z,authorsImageUrls:[void 0]},c=[{value:"Background",id:"background",level:2},{value:"Bloom Filters",id:"bloom-filters",level:2},{value:"Cuckoo Filters",id:"cuckoo-filters",level:2},{value:"Benchmarking",id:"benchmarking",level:2},{value:"Experimental Setup",id:"experimental-setup",level:2},{value:"Memory Footprint",id:"memory-footprint",level:2},{value:"Lookup Performance",id:"lookup-performance",level:2},{value:"Insertion Performance",id:"insertion-performance",level:2},{value:"Capacity and Scaling",id:"capacity-and-scaling",level:2},{value:"Other Filters",id:"other-filters",level:2},{value:"Conclusion",id:"conclusion",level:2},{value:"References",id:"references",level:3}];function h(e){const t={a:"a",blockquote:"blockquote",br:"br",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",ul:"ul",...(0,o.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.p,{children:"Disclaimer: This is not a general comparison between Bloom filters and Cuckoo filters. This blog post summarizes some of the experiments we conducted to decide whether or not we should replace our implementation of Counting Bloom filters with Cuckoo filters, for a specific use case."}),"\n",(0,n.jsx)(t.h2,{id:"background",children:"Background"}),"\n",(0,n.jsx)(t.p,{children:"Nodes on Fleek Network currently use Counting Bloom filters to summarize their cached content. These cache summaries are exchanged with other nodes in order to facilitate content routing."}),"\n",(0,n.jsx)(t.p,{children:"If a particular node does not store a requested piece of content, it can use the Bloom filters that it received from its peers to check if a peer stores the requested content."}),"\n",(0,n.jsx)(t.p,{children:"We are using Counting Bloom filters rather than regular Bloom filters because we need to be able to remove elements from the filter to support cache eviction."}),"\n",(0,n.jsx)(t.h2,{id:"bloom-filters",children:"Bloom Filters"}),"\n",(0,n.jsxs)(t.p,{children:["A Bloom filter is a space-efficient probabilistic data structure that can be used to perform approximate set membership queries.\nThe answer to an approximate set membership query is not ",(0,n.jsx)(t.code,{children:"no"})," or ",(0,n.jsx)(t.code,{children:"yes,"})," but rather ",(0,n.jsx)(t.code,{children:"no"})," or ",(0,n.jsx)(t.code,{children:"probably."})," This ",(0,n.jsx)(t.code,{children:"probably"})," is quantified with the false positive rate."]}),"\n",(0,n.jsxs)(t.p,{children:["One of the convenient features of Bloom filters is that they can be configured to have a specific false positive rate.\nOf course, there is a tradeoff here; the lower the false positive rate, the larger the memory footprint. Bloom filters support two operations: ",(0,n.jsx)(t.code,{children:"insert"})," and ",(0,n.jsx)(t.code,{children:"contains."})]}),"\n",(0,n.jsxs)(t.p,{children:["A Bloom filter is represented by an array of m bits together with k independent hash functions. To insert an element into the filter, it is hashed with each of the k hash functions.\nThe resulting hashes are interpreted as integers (modulo m) to obtain k array positions. The bits at these positions are then set to 1 (if there aren't already 1).",(0,n.jsx)(t.br,{}),"\n","To check whether or not an element is contained in the filter, the element is hashed k times with the different hash functions."]}),"\n",(0,n.jsx)(t.p,{children:"If all bits at the resulting array positions are 1, the element is assumed to be present. If any of the k bits are zero, we can be certain that the queried element is not present in the set."}),"\n",(0,n.jsx)(t.p,{children:"However, even if all bits are 1, it might still be the case that the bits were set by a combination of other elements. This is where the aforementioned false positive rate comes into play."}),"\n",(0,n.jsxs)(t.p,{children:["Since we also need a ",(0,n.jsx)(t.code,{children:"remove"})," operation for our use case, we have been using Counting Bloom filters, a variant of Bloom filters.\nCounting Bloom filters retain most of the properties that regular Bloom filters have. The ",(0,n.jsx)(t.code,{children:"remove"})," operation comes at the cost of an increased memory footprint."]}),"\n",(0,n.jsx)(t.p,{children:"Each position in the array is no longer a single bit but a group of bits representing a counter.\nWhenever an element is inserted into the filter, the counters for all k positions are incremented by 1. To remove an element, we decrement the counters."}),"\n",(0,n.jsx)(t.h2,{id:"cuckoo-filters",children:"Cuckoo Filters"}),"\n",(0,n.jsx)(t.p,{children:"Bloom filters are the most known members of a class of data structures called Approximate Membership Query Filters (AMQ Filters).\nA relatively recent addition to this class is the Cuckoo filter [1]. Cuckoo filters share many similarities with Bloom filters, especially Counting Bloom filters."}),"\n",(0,n.jsxs)(t.p,{children:["They are space-efficient and can be used for approximate set membership queries. Cuckoo filters also support the operations ",(0,n.jsx)(t.code,{children:"insert,"})," ",(0,n.jsx)(t.code,{children:"contains,"})," and ",(0,n.jsx)(t.code,{children:"remove,"})," and have configurable false positive rates."]}),"\n",(0,n.jsx)(t.p,{children:"Cuckoo filters are based on Cuckoo hash tables [2] and leverage an optimization called partial-key cuckoo hashing. A basic Cuckoo hash table consists of an array of buckets.\nWe determine two candidate buckets for each element using two different hash functions, h1 and h2."}),"\n",(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(t.code,{children:"contains"})," operation will check if either bucket contains the element.\nFor insertion, if either bucket is empty, the element will be inserted into the empty bucket."]}),"\n",(0,n.jsx)(t.p,{children:"If neither bucket is empty, one of the buckets is selected, and the existing element is removed and inserted into its alternate location.\nThis may trigger another relocation if the alternate location is not empty."}),"\n",(0,n.jsx)(t.p,{children:"Although the insertion operation may perform a sequence of relocations, the amortized runtime is O(1)."}),"\n",(0,n.jsx)(t.p,{children:"Most implementations of Cuckoo hash tables and, consequently, Cuckoo filters will use buckets that can hold multiple elements, as proposed in [3]."}),"\n",(0,n.jsx)(t.p,{children:"For Cuckoo filters, the hash table size is reduced by only storing fingerprints - a bit string calculated from an element's hash - rather than key-value pairs."}),"\n",(0,n.jsxs)(t.p,{children:["The fingerprint size is derived from the desired false positive rate.",(0,n.jsx)(t.br,{}),"\n","A problem that arises is that, to relocate existing fingerprints using the Cuckoo hashing approach described above, we need the original hash from which the fingerprint was derived."]}),"\n",(0,n.jsx)(t.p,{children:"Of course, we could store this hash somewhere, but the whole point of using fingerprints is to reduce the memory footprint of the filter."}),"\n",(0,n.jsxs)(t.p,{children:["The solution to this predicament is the aforementioned partial-key cuckoo hashing, a technique for determining an element's alternate location using only its fingerprint.",(0,n.jsx)(t.br,{}),"\n","For a given element x, the two candidate buckets are computed as follows:"]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{src:i(9440).Z+"",width:"1324",height:"194"})}),"\n",(0,n.jsx)(t.p,{children:"An important property of this technique is that h1(x) can also be computed from h2(x) and the fingerprint."}),"\n",(0,n.jsx)(t.h2,{id:"benchmarking",children:"Benchmarking"}),"\n",(0,n.jsx)(t.p,{children:"As this post mentioned, we are not aiming for a general comparison of Counting Bloom and Cuckoo filters."}),"\n",(0,n.jsx)(t.p,{children:"Instead, we want to determine which filter suits our specific use case better. The two main properties we are looking for are space efficiency and lookup performance."}),"\n",(0,n.jsx)(t.p,{children:"Space efficiency is important because nodes frequently update their cache and have to communicate these changes with their peers. These messages should take up as little bandwidth as possible."}),"\n",(0,n.jsx)(t.p,{children:"Lookup speed is also important because Fleek Network aims to serve user requests as quickly as possible. Checking whether a peer has some content stored in their cache summary should not be a bottleneck."}),"\n",(0,n.jsx)(t.h2,{id:"experimental-setup",children:"Experimental Setup"}),"\n",(0,n.jsxs)(t.p,{children:["We are using our own Counting Bloom filter ",(0,n.jsx)(t.a,{href:"https://github.com/fleek-network/ursa/blob/483f4d56cbaa5e83182454d2c1db6f6af7c54912/crates/ursa-network/src/utils/bloom_filter.rs#L11",children:"implementation"})," and ",(0,n.jsx)(t.a,{href:"https://github.com/sile/scalable_cuckoo_filter?gh",children:"scalable cuckoo filter"})," Cuckoo filter implementation in Rust, the ",(0,n.jsx)(t.a,{href:"https://github.com/efficient/cuckoofilter?gh",children:"original cuckoofilter"})," implementation is in C++. All experiments were performed on a Linux machine with 16 GB RAM and an Intel Core i7 (10th Gen). Whenever the experiment is probabilistic, we repeat the experiment 20 times and report the mean and standard deviation."]}),"\n",(0,n.jsx)(t.h2,{id:"memory-footprint",children:"Memory Footprint"}),"\n",(0,n.jsx)(t.p,{children:"For both Counting Bloom filters and Cuckoo filters, the memory footprint is determined by two factors: the filter's capacity and the desired false positive rate. In the first experiment, we examine the impact that\nthese factors have on the memory footprint."}),"\n",(0,n.jsx)(t.p,{children:"To this end, we fix the false positive rate and initialize the filters with capacities ranging from 100K to 1M. The result is shown in Fig. 1.\nThe size of Bloom filters scales linearly with the capacity. Cuckoo filters are more space-efficient. This result is consistent with the experiments reported in [1]."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{src:i(5441).Z+"",width:"640",height:"480"})}),"\n",(0,n.jsxs)(t.blockquote,{children:["\n",(0,n.jsx)(t.p,{children:"Figure 1: We fix the false positive rate and initialize the filters with capacities ranging from 100K to 1M. The y-axis shows the size of the filters in Megabytes."}),"\n"]}),"\n",(0,n.jsx)(t.p,{children:"Next, we fix the capacity and initialize the filters with false positive rates ranging from 0.0001 to 0.5. Fig. 2 shows that Cuckoo filters are more space-efficient."}),"\n",(0,n.jsx)(t.p,{children:"The gap between Counting Bloom filters and Cuckoo filters grows as the false positive rate decreases. This is also consistent with experiments in [1]."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{src:i(9844).Z+"",width:"640",height:"480"})}),"\n",(0,n.jsxs)(t.blockquote,{children:["\n",(0,n.jsx)(t.p,{children:"Figure 2: We fix the capacity and initialize the filters with false positive rates ranging from 0.0001 to 0.5. The y-axis shows the size of the filters in Megabytes."}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"lookup-performance",children:"Lookup Performance"}),"\n",(0,n.jsx)(t.p,{children:"We first add elements to both filters until the capacity is reached. We then measure the lookup performance for different ratios of positive and negative lookups."}),"\n",(0,n.jsx)(t.p,{children:"A positive lookup is for an existing element, and a negative lookup is for an element not contained in the filter. We perform 100K lookups for each ratio and report the average lookup duration and standard deviation."}),"\n",(0,n.jsx)(t.p,{children:"Fig. 3 shows the results. Bloom filters perform slightly better on average than Cuckoo filters. This result is inconsistent with [1],\nwhere Cuckoo filters were reported to have a better lookup performance than Bloom filters. It should be noted here that the authors in [1] use the original C++ Cuckoo filter implementation and their own unreleased Bloom filter implementation. In contrast, we use a Rust Cuckoo filter implementation and our Bloom filter implementation. We cannot easily determine the reason for this discrepancy."}),"\n",(0,n.jsx)(t.p,{children:"However, the performance difference is negligible."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{src:i(8915).Z+"",width:"640",height:"480"})}),"\n",(0,n.jsxs)(t.blockquote,{children:["\n",(0,n.jsx)(t.p,{children:"Figure 3: Lookup performance for different ratios of positive and negative lookups. For example, ratio 0.25 indicates that 25% of lookups are positive and 75% are negative.\nThe shaded region indicates the standard deviation."}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"insertion-performance",children:"Insertion Performance"}),"\n",(0,n.jsx)(t.p,{children:"Less critical than lookup performance but still important for our purposes is insertion performance. We measure how the insertion performance varies for different occupancy levels.\nFig. 4 shows the results. The insertion performance is constant across all levels of occupancy for Bloom filters."}),"\n",(0,n.jsx)(t.p,{children:"For Cuckoo filters, the performance decreases as the filter becomes fuller because more relocations are required. In Fig. 4, the performance for Bloom filters is not constant. It quickly increases and then remains constant. This can be explained by CPU caching."}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{src:i(989).Z+"",width:"640",height:"480"})}),"\n",(0,n.jsxs)(t.blockquote,{children:["\n",(0,n.jsx)(t.p,{children:"Figure 4: Insertion performance for different occupancy levels. The shaded region indicates the standard deviation."}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"capacity-and-scaling",children:"Capacity and Scaling"}),"\n",(0,n.jsx)(t.p,{children:"We have mentioned the capacity of a filter several times now. An interesting case is what happens when a filter's capacity is exceeded.\nBloom filters and Cuckoo filters behave differently in this scenario."}),"\n",(0,n.jsxs)(t.p,{children:["For Bloom filters, the ",(0,n.jsx)(t.code,{children:"insertion"})," operation always succeeds. However, the false positive rate will rapidly increase as we exceed the filter's capacity. While Bloom filters fail silently, Cuckoo filters are more explicit. Most implementations have a maximum number of\nrelocations that will be performed for an insertion. The ",(0,n.jsx)(t.code,{children:"insertion"})," operation will return an error if more relocations are required."]}),"\n",(0,n.jsx)(t.p,{children:"For both filters, we can avoid this problem by simply initializing the filter with a sufficiently large capacity. However, this will increase the memory footprint of the filter."}),"\n",(0,n.jsx)(t.p,{children:"Furthermore, it is difficult to predict how many elements a node on Fleek Network will cache. It is also likely that the number of cached elements will greatly vary for different nodes."}),"\n",(0,n.jsx)(t.p,{children:"Fortunately, a variant of Bloom filters called Scalable Bloom Filters [4] can adapt dynamically to the number of elements stored while guaranteeing a maximum false positive rate."}),"\n",(0,n.jsx)(t.p,{children:"The proposed technique is also applicable to Cuckoo filters."}),"\n",(0,n.jsx)(t.h2,{id:"other-filters",children:"Other Filters"}),"\n",(0,n.jsx)(t.p,{children:"While we only looked at Bloom filters and Cuckoo filters, there are other AMQ filters that we want to mention here briefly:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:["\n",(0,n.jsx)(t.p,{children:"Quotient filters [5, 6]: Compact hash tables that support insertion, lookup, and deletion. Less space-efficient than Bloom filters and Cuckoo filters."}),"\n"]}),"\n",(0,n.jsxs)(t.li,{children:["\n",(0,n.jsx)(t.p,{children:"XOR filters [7]: More space-efficient than Bloom filters and Cuckoo filters. However, they are static, meaning the filter has to be rebuilt if additional elements are added."}),"\n"]}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"conclusion",children:"Conclusion"}),"\n",(0,n.jsx)(t.p,{children:"We examined whether Counting Bloom filters or Cuckoo filters are more suitable for summarizing caches on Fleek Network. Cuckoo filters are more space-efficient, especially for lower false positive rates. Bloom filters have a slightly better insertion and lookup performance for the implementations we tested."}),"\n",(0,n.jsx)(t.p,{children:"Both filters can be adapted to grow and shrink in size dynamically. Since the difference in insertion and lookup performance is negligible while Cuckoo filters are significantly more space-efficient, we favor Cuckoo filters for our use case."}),"\n",(0,n.jsx)(t.h3,{id:"references",children:"References"}),"\n",(0,n.jsx)(t.p,{children:"[1] Bin Fan, Dave G. Andersen, Michael Kaminsky, and Michael D. Mitzenmacher. Cuckoo Filter: Practically Better Than Bloom.\nIn Proceedings of the 10th ACM International Conference on emerging Networking Experiments and Technologies (CoNEXT 14). Association for Computing Machinery, New York, NY, USA, pp. 75-88, 2014."}),"\n",(0,n.jsx)(t.p,{children:"[2] Rasmus Pagha and Flemming Friche Rodler. Cuckoo hashing. Journal of Algorithms, 51(2), pp. 122-144, 2004."}),"\n",(0,n.jsx)(t.p,{children:"[3] Martin Dietzfelbinger and Christoph Weidling. Balanced Allocation and Dictionaries with Tightly Packed Constant Size Bins. Theoretical Computer Science, 380(1), pp. 47-68, 2007."}),"\n",(0,n.jsx)(t.p,{children:"[4] Paulo S. Almeida, Carlos Baquero, Nuno Pregui\xe7a, and David Hutchison. Scalable Bloom Filters. Information Processing Letters, 101(6), pp. 255-261, 2007."}),"\n",(0,n.jsx)(t.p,{children:"[5] John G. Cleary. Compact hash tables using bidirectional linear probing. IEEE Transactions on Computers. 33(9), pp. 828-834, 1984."}),"\n",(0,n.jsx)(t.p,{children:"[6] Anna Pagh, Rasmus Pagh, and S. Srinivasa Rao. An optimal Bloom filter replacement. Proceedings of the Sixteenth Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 823-829, 2005."}),"\n",(0,n.jsx)(t.p,{children:"[7] Thomas Mueller Graf and Daniel Lemire. Xor Filters: Faster and Smaller Than Bloom and Cuckoo Filters. ACM Journal of Experimental Algorithmics. 25, pp. 1-16, 2020."})]})}function d(e={}){const{wrapper:t}={...(0,o.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},9969:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/bloom-79da0db687b4fb2060758838b9c44513.png"},5441:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/capacity-size-5c2576bd69db0e5b510781e7cc1c5257.png"},9844:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/fp-rate-size-fbb54b2450b4a91e28c97d8adf0253e8.png"},989:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/insert-3ff48d4c63724adcf399f81b29607691.png"},8915:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/lookup-e36011237d8602b5f6c36fe5dd145bf5.png"},9440:(e,t,i)=>{i.d(t,{Z:()=>n});const n=i.p+"assets/images/math-formul-a247d4df475b26b1e7cbb2acfc0ab8c2.png"},1151:(e,t,i)=>{i.d(t,{Z:()=>a,a:()=>s});var n=i(7294);const o={},r=n.createContext(o);function s(e){const t=n.useContext(r);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),n.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/7aefc753.fbdb3d6f.js b/assets/js/7aefc753.323b130b.js similarity index 99% rename from assets/js/7aefc753.fbdb3d6f.js rename to assets/js/7aefc753.323b130b.js index 98baafb15..8cbb0b8f1 100644 --- a/assets/js/7aefc753.fbdb3d6f.js +++ b/assets/js/7aefc753.323b130b.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[1251],{8717:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>g,frontMatter:()=>r,metadata:()=>o,toc:()=>d});var i=t(5893),s=t(1151),l=t(3872);const r={title:"Uninstall Lightning Node",slug:"uninstall-lightning-node",hide_title:!0,tags:["References","Help","Uninstall","Remove","Delete","Clear","Clean"]},a=void 0,o={id:"Lightning CLI/uninstall-lightning-node",title:"Uninstall Lightning Node",description:"Remove symLink",source:"@site/references/Lightning CLI/uninstall-lightning-node.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/uninstall-lightning-node",permalink:"/references/Lightning CLI/uninstall-lightning-node",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/uninstall-lightning-node.md",tags:[{label:"References",permalink:"/references/tags/references"},{label:"Help",permalink:"/references/tags/help"},{label:"Uninstall",permalink:"/references/tags/uninstall"},{label:"Remove",permalink:"/references/tags/remove"},{label:"Delete",permalink:"/references/tags/delete"},{label:"Clear",permalink:"/references/tags/clear"},{label:"Clean",permalink:"/references/tags/clean"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Uninstall Lightning Node",slug:"uninstall-lightning-node",hide_title:!0,tags:["References","Help","Uninstall","Remove","Delete","Clear","Clean"]},sidebar:"defaultSidebar",previous:{title:"Restore the keystore",permalink:"/references/Lightning CLI/restore-the-keystore"},next:{title:"Update CLI from source code",permalink:"/references/Lightning CLI/update-cli-from-source-code"}},c={},d=[{value:"Remove symLink",id:"remove-symlink",level:2},{value:"Delete the local source code",id:"delete-the-local-source-code",level:2},{value:"Disable the systemd service",id:"disable-the-systemd-service",level:2},{value:"Clear the lightning config directory",id:"clear-the-lightning-config-directory",level:2},{value:"Uninstall Cargo and Rust",id:"uninstall-cargo-and-rust",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h2,{id:"remove-symlink",children:"Remove symLink"}),"\n",(0,i.jsxs)(n.p,{children:["To remove a symbolic link, use either the rm or unlink command followed by the name of the symlink as an argument. Here's an example with ",(0,i.jsx)(n.code,{children:"unlink"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"unlink /usr/local/bin/lgtn\n"})}),"\n",(0,i.jsx)(n.h2,{id:"delete-the-local-source-code",children:"Delete the local source code"}),"\n",(0,i.jsxs)(n.p,{children:["Delete the local source code which was copied from the remote ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"repository"}),". You can delete it recursively by:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"rm -r ~/fleek-network/lightning\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\ud83d\udca1 Use the flag ",(0,i.jsx)(n.code,{children:"f"})," to force remove by skipping any prompts, e.g. ",(0,i.jsx)(n.code,{children:"rm -rf "})]}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsxs)(n.p,{children:["The default install location is ",(0,i.jsx)(n.code,{children:"$HOME/fleek-network/lightning"}),". If you have selected a different location to store the repository, change the target path."]})}),"\n",(0,i.jsx)(n.h2,{id:"disable-the-systemd-service",children:"Disable the systemd service"}),"\n",(0,i.jsx)(n.p,{children:"To disable the Fleek Network Lightning Systemd's service, start by stopping the service."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo systemctl stop lightning.service\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["You can replace ",(0,i.jsx)(n.code,{children:"lightning.service"})," by ",(0,i.jsx)(n.code,{children:"lightning"}),"."]})}),"\n",(0,i.jsx)(n.p,{children:"Disable the lightning service"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo systemctl disable lightning.service\n"})}),"\n",(0,i.jsxs)(n.p,{children:["If you have used the recommended procedures in the ",(0,i.jsx)(n.a,{href:"/docs/node/install",children:"install"})," documentation you'll have to remove the Systemd unit (file that defines the service)."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"rm /etc/systemd/system/lightning.service\n"})}),"\n",(0,i.jsx)(n.p,{children:"Reload the Systemd service daemon"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo systemctl daemon-reload\n"})}),"\n",(0,i.jsx)(n.h2,{id:"clear-the-lightning-config-directory",children:"Clear the lightning config directory"}),"\n",(0,i.jsx)(n.p,{children:"The Fleek Network lightning config directory is where the configuration, keystore\u2013the location where your private key is hosted\u2013and other system files are stored."}),"\n",(0,i.jsx)(n.admonition,{title:"WARNING",type:"caution",children:(0,i.jsx)(n.p,{children:"Make sure to back up any sensitive data, such as the keystore (private keys), as you won't be able to recover the keys by any other means. If you have any funds associated with it, it'll be lost forever. The Fleek Network team or anyone else will not be able to help recover keys. Your keys, your responsibility."})}),"\n",(0,i.jsxs)(n.p,{children:["Alternatively, instead of deleting you can move the files to a custom directory name such as",(0,i.jsx)(n.code,{children:".lightning.backupDATESTAMP"}),", e.g. the example below we've used the date ",(0,i.jsx)(n.code,{children:"2023-09-06-1205"})," as that was the time this text was written:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"mv ~/.lightning ~/.lightning.backup202309061205\n"})}),"\n",(0,i.jsx)(n.p,{children:"To clear the lightning config directory remove any files recursively by running the following command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"rm -r ~/.lightning/*\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\ud83d\udca1 Use the flag ",(0,i.jsx)(n.code,{children:"f"})," to force remove by skipping any prompts, e.g. ",(0,i.jsx)(n.code,{children:"rm -rf /*"})]}),"\n",(0,i.jsxs)(n.p,{children:["Alternatively, delete the ",(0,i.jsx)(n.code,{children:"~/.lightning"})," directory:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"rm -r ~/.lightning\n"})}),"\n",(0,i.jsx)(n.h2,{id:"uninstall-cargo-and-rust",children:"Uninstall Cargo and Rust"}),"\n",(0,i.jsx)(n.p,{children:"To uninstall rustc, rustup and cargo run the following command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"rustup self uninstall\n"})}),"\n",(0,i.jsx)(l.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function g(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},3872:(e,n,t)=>{t.d(n,{Z:()=>s});t(7294);var i=t(5893);const s=e=>{let{image:n,name:t,title:s,url:l,communityMember:r=!1}=e;return(0,i.jsx)("section",{className:"author_card",children:(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"avatar",children:(0,i.jsx)("a",{href:l,target:"_blank",alt:t,children:(0,i.jsx)("img",{src:n,alt:t})})}),(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"name",children:(0,i.jsx)("a",{href:l,target:"_blank",alt:t,children:t})}),(0,i.jsx)("span",{className:"title",children:s}),(0,i.jsxs)("span",{className:"discord",children:[r?"Join our community on":"Got questions? Find us on"," ",(0,i.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>r});var i=t(7294);const s={},l=i.createContext(s);function r(e){const n=i.useContext(l);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(s):e.components||s:r(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[1251],{8717:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>g,frontMatter:()=>r,metadata:()=>o,toc:()=>d});var i=t(5893),s=t(1151),l=t(3872);const r={title:"Uninstall Lightning Node",slug:"uninstall-lightning-node",hide_title:!0,tags:["References","Help","Uninstall","Remove","Delete","Clear","Clean"]},a=void 0,o={id:"Lightning CLI/uninstall-lightning-node",title:"Uninstall Lightning Node",description:"Remove symLink",source:"@site/references/Lightning CLI/uninstall-lightning-node.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/uninstall-lightning-node",permalink:"/references/Lightning CLI/uninstall-lightning-node",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/uninstall-lightning-node.md",tags:[{label:"References",permalink:"/references/tags/references"},{label:"Help",permalink:"/references/tags/help"},{label:"Uninstall",permalink:"/references/tags/uninstall"},{label:"Remove",permalink:"/references/tags/remove"},{label:"Delete",permalink:"/references/tags/delete"},{label:"Clear",permalink:"/references/tags/clear"},{label:"Clean",permalink:"/references/tags/clean"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Uninstall Lightning Node",slug:"uninstall-lightning-node",hide_title:!0,tags:["References","Help","Uninstall","Remove","Delete","Clear","Clean"]},sidebar:"defaultSidebar",previous:{title:"Restore the keystore",permalink:"/references/Lightning CLI/restore-the-keystore"},next:{title:"Update CLI from source code",permalink:"/references/Lightning CLI/update-cli-from-source-code"}},c={},d=[{value:"Remove symLink",id:"remove-symlink",level:2},{value:"Delete the local source code",id:"delete-the-local-source-code",level:2},{value:"Disable the systemd service",id:"disable-the-systemd-service",level:2},{value:"Clear the lightning config directory",id:"clear-the-lightning-config-directory",level:2},{value:"Uninstall Cargo and Rust",id:"uninstall-cargo-and-rust",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h2,{id:"remove-symlink",children:"Remove symLink"}),"\n",(0,i.jsxs)(n.p,{children:["To remove a symbolic link, use either the rm or unlink command followed by the name of the symlink as an argument. Here's an example with ",(0,i.jsx)(n.code,{children:"unlink"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"unlink /usr/local/bin/lgtn\n"})}),"\n",(0,i.jsx)(n.h2,{id:"delete-the-local-source-code",children:"Delete the local source code"}),"\n",(0,i.jsxs)(n.p,{children:["Delete the local source code which was copied from the remote ",(0,i.jsx)(n.a,{href:"https://github.com/fleek-network/lightning",children:"repository"}),". You can delete it recursively by:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"rm -r ~/fleek-network/lightning\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\ud83d\udca1 Use the flag ",(0,i.jsx)(n.code,{children:"f"})," to force remove by skipping any prompts, e.g. ",(0,i.jsx)(n.code,{children:"rm -rf "})]}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsxs)(n.p,{children:["The default install location is ",(0,i.jsx)(n.code,{children:"$HOME/fleek-network/lightning"}),". If you have selected a different location to store the repository, change the target path."]})}),"\n",(0,i.jsx)(n.h2,{id:"disable-the-systemd-service",children:"Disable the systemd service"}),"\n",(0,i.jsx)(n.p,{children:"To disable the Fleek Network Lightning Systemd's service, start by stopping the service."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo systemctl stop lightning.service\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["You can replace ",(0,i.jsx)(n.code,{children:"lightning.service"})," by ",(0,i.jsx)(n.code,{children:"lightning"}),"."]})}),"\n",(0,i.jsx)(n.p,{children:"Disable the lightning service"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo systemctl disable lightning.service\n"})}),"\n",(0,i.jsxs)(n.p,{children:["If you have used the recommended procedures in the ",(0,i.jsx)(n.a,{href:"/docs/node/install",children:"install"})," documentation you'll have to remove the Systemd unit (file that defines the service)."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"rm /etc/systemd/system/lightning.service\n"})}),"\n",(0,i.jsx)(n.p,{children:"Reload the Systemd service daemon"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"sudo systemctl daemon-reload\n"})}),"\n",(0,i.jsx)(n.h2,{id:"clear-the-lightning-config-directory",children:"Clear the lightning config directory"}),"\n",(0,i.jsx)(n.p,{children:"The Fleek Network lightning config directory is where the configuration, keystore\u2013the location where your private key is hosted\u2013and other system files are stored."}),"\n",(0,i.jsx)(n.admonition,{title:"WARNING",type:"caution",children:(0,i.jsx)(n.p,{children:"Make sure to back up any sensitive data, such as the keystore (private keys), as you won't be able to recover the keys by any other means. If you have any funds associated with it, it'll be lost forever. The Fleek Network team or anyone else will not be able to help recover keys. Your keys, your responsibility."})}),"\n",(0,i.jsxs)(n.p,{children:["Alternatively, instead of deleting you can move the files to a custom directory name such as",(0,i.jsx)(n.code,{children:".lightning.backupDATESTAMP"}),", e.g. the example below we've used the date ",(0,i.jsx)(n.code,{children:"2023-09-06-1205"})," as that was the time this text was written:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"mv ~/.lightning ~/.lightning.backup202309061205\n"})}),"\n",(0,i.jsx)(n.p,{children:"To clear the lightning config directory remove any files recursively by running the following command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"rm -r ~/.lightning/*\n"})}),"\n",(0,i.jsxs)(n.p,{children:["\ud83d\udca1 Use the flag ",(0,i.jsx)(n.code,{children:"f"})," to force remove by skipping any prompts, e.g. ",(0,i.jsx)(n.code,{children:"rm -rf /*"})]}),"\n",(0,i.jsxs)(n.p,{children:["Alternatively, delete the ",(0,i.jsx)(n.code,{children:"~/.lightning"})," directory:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"rm -r ~/.lightning\n"})}),"\n",(0,i.jsx)(n.h2,{id:"uninstall-cargo-and-rust",children:"Uninstall Cargo and Rust"}),"\n",(0,i.jsx)(n.p,{children:"To uninstall rustc, rustup and cargo run the following command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"rustup self uninstall\n"})}),"\n",(0,i.jsx)(l.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function g(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},3872:(e,n,t)=>{t.d(n,{Z:()=>s});t(7294);var i=t(5893);const s=e=>{let{image:n,name:t,title:s,url:l,communityMember:r=!1}=e;return(0,i.jsx)("section",{className:"author_card",children:(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"avatar",children:(0,i.jsx)("a",{href:l,target:"_blank",alt:t,children:(0,i.jsx)("img",{src:n,alt:t})})}),(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"name",children:(0,i.jsx)("a",{href:l,target:"_blank",alt:t,children:t})}),(0,i.jsx)("span",{className:"title",children:s}),(0,i.jsxs)("span",{className:"discord",children:[r?"Join our community on":"Got questions? Find us on"," ",(0,i.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,t)=>{t.d(n,{Z:()=>a,a:()=>r});var i=t(7294);const s={},l=i.createContext(s);function r(e){const n=i.useContext(l);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(s):e.components||s:r(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/866d553a.a4f27ef0.js b/assets/js/866d553a.27898c3e.js similarity index 99% rename from assets/js/866d553a.a4f27ef0.js rename to assets/js/866d553a.27898c3e.js index 50570806d..675392a5f 100644 --- a/assets/js/866d553a.a4f27ef0.js +++ b/assets/js/866d553a.27898c3e.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[8668],{1534:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>r,default:()=>u,frontMatter:()=>a,metadata:()=>d,toc:()=>o});var t=s(5893),l=s(1151),i=s(3872);const a={title:"Frequently used commands for Native setup",slug:"frequently-used-commands-for-native-setup",hide_title:!0,tags:["commands","cli","lightning"]},r=void 0,d={id:"Lightning CLI/frequently-used-commands-for-native-setup",title:"Frequently used commands for Native setup",description:"TL;DR",source:"@site/references/Lightning CLI/frequently-used-commands-for-native-setup.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/frequently-used-commands-for-native-setup",permalink:"/references/Lightning CLI/frequently-used-commands-for-native-setup",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/frequently-used-commands-for-native-setup.md",tags:[{label:"commands",permalink:"/references/tags/commands"},{label:"cli",permalink:"/references/tags/cli"},{label:"lightning",permalink:"/references/tags/lightning"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Frequently used commands for Native setup",slug:"frequently-used-commands-for-native-setup",hide_title:!0,tags:["commands","cli","lightning"]},sidebar:"defaultSidebar",previous:{title:"File permissions and Ownership",permalink:"/references/Lightning CLI/file-permissions-and-ownership"},next:{title:"Keys not found",permalink:"/references/Lightning CLI/keys-not-found"}},c={},o=[{value:"TL;DR",id:"tldr",level:2},{value:"Systemctl Service Management",id:"systemctl-service-management",level:2},{value:"Enable",id:"enable",level:3},{value:"Disable",id:"disable",level:3},{value:"Start",id:"start",level:3},{value:"Stop",id:"stop",level:3},{value:"Restart",id:"restart",level:3},{value:"Status",id:"status",level:3},{value:"Lightning CLI",id:"lightning-cli",level:2},{value:"Show keys for user config",id:"show-keys-for-user-config",level:3},{value:"Diagnostic tools",id:"diagnostic-tools",level:2},{value:"Extended verification health check",id:"extended-verification-health-check",level:3},{value:"Health status",id:"health-status",level:3},{value:"Node details",id:"node-details",level:3},{value:"Analyzing Logs",id:"analyzing-logs",level:2},{value:"Standard output",id:"standard-output",level:3},{value:"Standard error",id:"standard-error",level:3}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,l.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h2,{id:"tldr",children:"TL;DR"}),"\n",(0,t.jsxs)(n.p,{children:["Most assisted processes are available through the ",(0,t.jsx)(n.code,{children:"get.fleek.network"})," command, where you can select to install, do a health check amongst others."]}),"\n",(0,t.jsx)(n.p,{children:"To access the menu options run the command in the shell prompt:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"curl https://get.fleek.network | bash\n"})}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["For Docker setup users read the corresponding version in the section ",(0,t.jsx)(n.a,{href:"/references/Docker/frequently-used-commands-for-docker-setup",children:"Frequently Used Commands for Docker Setup"})]})}),"\n",(0,t.jsx)(n.h2,{id:"systemctl-service-management",children:"Systemctl Service Management"}),"\n",(0,t.jsx)(n.h3,{id:"enable",children:"Enable"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl enable lightning\n"})}),"\n",(0,t.jsx)(n.h3,{id:"disable",children:"Disable"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl enable lightning\n"})}),"\n",(0,t.jsx)(n.h3,{id:"start",children:"Start"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl start lightning\n"})}),"\n",(0,t.jsx)(n.h3,{id:"stop",children:"Stop"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl stop lightning\n"})}),"\n",(0,t.jsx)(n.h3,{id:"restart",children:"Restart"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl restart lightning\n"})}),"\n",(0,t.jsx)(n.h3,{id:"status",children:"Status"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl status lightning\n"})}),"\n",(0,t.jsx)(n.h2,{id:"lightning-cli",children:"Lightning CLI"}),"\n",(0,t.jsx)(n.h3,{id:"show-keys-for-user-config",children:"Show keys for user config"}),"\n",(0,t.jsxs)(n.p,{children:["Show the keys by running the sub-commands ",(0,t.jsx)(n.code,{children:"keys show"})," and declaring the configuration file location:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"lgtn -c /home//.lightning/config.toml keys show\n"})}),"\n",(0,t.jsx)(n.h2,{id:"diagnostic-tools",children:"Diagnostic tools"}),"\n",(0,t.jsx)(n.h3,{id:"extended-verification-health-check",children:"Extended verification health check"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"curl -sS https://get.fleek.network/healthcheck | bash\n"})}),"\n",(0,t.jsx)(n.h3,{id:"health-status",children:"Health status"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:'curl -w "\\n" localhost:4230/health\n'})}),"\n",(0,t.jsx)(n.h3,{id:"node-details",children:"Node details"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"curl -sS https://get.fleek.network/node_details | bash\n"})}),"\n",(0,t.jsx)(n.h2,{id:"analyzing-logs",children:"Analyzing Logs"}),"\n",(0,t.jsx)(n.h3,{id:"standard-output",children:"Standard output"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"tail -f /var/log/lightning/output.log\n"})}),"\n",(0,t.jsx)(n.h3,{id:"standard-error",children:"Standard error"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"tail -f /var/log/lightning/diagnostic.log\n"})}),"\n",(0,t.jsx)(i.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function u(e={}){const{wrapper:n}={...(0,l.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},3872:(e,n,s)=>{s.d(n,{Z:()=>l});s(7294);var t=s(5893);const l=e=>{let{image:n,name:s,title:l,url:i,communityMember:a=!1}=e;return(0,t.jsx)("section",{className:"author_card",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"avatar",children:(0,t.jsx)("a",{href:i,target:"_blank",alt:s,children:(0,t.jsx)("img",{src:n,alt:s})})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"name",children:(0,t.jsx)("a",{href:i,target:"_blank",alt:s,children:s})}),(0,t.jsx)("span",{className:"title",children:l}),(0,t.jsxs)("span",{className:"discord",children:[a?"Join our community on":"Got questions? Find us on"," ",(0,t.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,s)=>{s.d(n,{Z:()=>r,a:()=>a});var t=s(7294);const l={},i=t.createContext(l);function a(e){const n=t.useContext(i);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:a(e.components),t.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[8668],{1534:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>r,default:()=>u,frontMatter:()=>a,metadata:()=>d,toc:()=>o});var t=s(5893),l=s(1151),i=s(3872);const a={title:"Frequently used commands for Native setup",slug:"frequently-used-commands-for-native-setup",hide_title:!0,tags:["commands","cli","lightning"]},r=void 0,d={id:"Lightning CLI/frequently-used-commands-for-native-setup",title:"Frequently used commands for Native setup",description:"TL;DR",source:"@site/references/Lightning CLI/frequently-used-commands-for-native-setup.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/frequently-used-commands-for-native-setup",permalink:"/references/Lightning CLI/frequently-used-commands-for-native-setup",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/frequently-used-commands-for-native-setup.md",tags:[{label:"commands",permalink:"/references/tags/commands"},{label:"cli",permalink:"/references/tags/cli"},{label:"lightning",permalink:"/references/tags/lightning"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Frequently used commands for Native setup",slug:"frequently-used-commands-for-native-setup",hide_title:!0,tags:["commands","cli","lightning"]},sidebar:"defaultSidebar",previous:{title:"File permissions and Ownership",permalink:"/references/Lightning CLI/file-permissions-and-ownership"},next:{title:"Keys not found",permalink:"/references/Lightning CLI/keys-not-found"}},c={},o=[{value:"TL;DR",id:"tldr",level:2},{value:"Systemctl Service Management",id:"systemctl-service-management",level:2},{value:"Enable",id:"enable",level:3},{value:"Disable",id:"disable",level:3},{value:"Start",id:"start",level:3},{value:"Stop",id:"stop",level:3},{value:"Restart",id:"restart",level:3},{value:"Status",id:"status",level:3},{value:"Lightning CLI",id:"lightning-cli",level:2},{value:"Show keys for user config",id:"show-keys-for-user-config",level:3},{value:"Diagnostic tools",id:"diagnostic-tools",level:2},{value:"Extended verification health check",id:"extended-verification-health-check",level:3},{value:"Health status",id:"health-status",level:3},{value:"Node details",id:"node-details",level:3},{value:"Analyzing Logs",id:"analyzing-logs",level:2},{value:"Standard output",id:"standard-output",level:3},{value:"Standard error",id:"standard-error",level:3}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,l.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h2,{id:"tldr",children:"TL;DR"}),"\n",(0,t.jsxs)(n.p,{children:["Most assisted processes are available through the ",(0,t.jsx)(n.code,{children:"get.fleek.network"})," command, where you can select to install, do a health check amongst others."]}),"\n",(0,t.jsx)(n.p,{children:"To access the menu options run the command in the shell prompt:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"curl https://get.fleek.network | bash\n"})}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["For Docker setup users read the corresponding version in the section ",(0,t.jsx)(n.a,{href:"/references/Docker/frequently-used-commands-for-docker-setup",children:"Frequently Used Commands for Docker Setup"})]})}),"\n",(0,t.jsx)(n.h2,{id:"systemctl-service-management",children:"Systemctl Service Management"}),"\n",(0,t.jsx)(n.h3,{id:"enable",children:"Enable"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl enable lightning\n"})}),"\n",(0,t.jsx)(n.h3,{id:"disable",children:"Disable"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl enable lightning\n"})}),"\n",(0,t.jsx)(n.h3,{id:"start",children:"Start"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl start lightning\n"})}),"\n",(0,t.jsx)(n.h3,{id:"stop",children:"Stop"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl stop lightning\n"})}),"\n",(0,t.jsx)(n.h3,{id:"restart",children:"Restart"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl restart lightning\n"})}),"\n",(0,t.jsx)(n.h3,{id:"status",children:"Status"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl status lightning\n"})}),"\n",(0,t.jsx)(n.h2,{id:"lightning-cli",children:"Lightning CLI"}),"\n",(0,t.jsx)(n.h3,{id:"show-keys-for-user-config",children:"Show keys for user config"}),"\n",(0,t.jsxs)(n.p,{children:["Show the keys by running the sub-commands ",(0,t.jsx)(n.code,{children:"keys show"})," and declaring the configuration file location:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"lgtn -c /home//.lightning/config.toml keys show\n"})}),"\n",(0,t.jsx)(n.h2,{id:"diagnostic-tools",children:"Diagnostic tools"}),"\n",(0,t.jsx)(n.h3,{id:"extended-verification-health-check",children:"Extended verification health check"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"curl -sS https://get.fleek.network/healthcheck | bash\n"})}),"\n",(0,t.jsx)(n.h3,{id:"health-status",children:"Health status"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:'curl -w "\\n" localhost:4230/health\n'})}),"\n",(0,t.jsx)(n.h3,{id:"node-details",children:"Node details"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"curl -sS https://get.fleek.network/node_details | bash\n"})}),"\n",(0,t.jsx)(n.h2,{id:"analyzing-logs",children:"Analyzing Logs"}),"\n",(0,t.jsx)(n.h3,{id:"standard-output",children:"Standard output"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"tail -f /var/log/lightning/output.log\n"})}),"\n",(0,t.jsx)(n.h3,{id:"standard-error",children:"Standard error"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"tail -f /var/log/lightning/diagnostic.log\n"})}),"\n",(0,t.jsx)(i.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function u(e={}){const{wrapper:n}={...(0,l.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},3872:(e,n,s)=>{s.d(n,{Z:()=>l});s(7294);var t=s(5893);const l=e=>{let{image:n,name:s,title:l,url:i,communityMember:a=!1}=e;return(0,t.jsx)("section",{className:"author_card",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"avatar",children:(0,t.jsx)("a",{href:i,target:"_blank",alt:s,children:(0,t.jsx)("img",{src:n,alt:s})})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"name",children:(0,t.jsx)("a",{href:i,target:"_blank",alt:s,children:s})}),(0,t.jsx)("span",{className:"title",children:l}),(0,t.jsxs)("span",{className:"discord",children:[a?"Join our community on":"Got questions? Find us on"," ",(0,t.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,s)=>{s.d(n,{Z:()=>r,a:()=>a});var t=s(7294);const l={},i=t.createContext(l);function a(e){const n=t.useContext(i);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:a(e.components),t.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/8a92e787.95159fba.js b/assets/js/8a92e787.4171c4bb.js similarity index 99% rename from assets/js/8a92e787.95159fba.js rename to assets/js/8a92e787.4171c4bb.js index dc87ea4ac..c542c8913 100644 --- a/assets/js/8a92e787.95159fba.js +++ b/assets/js/8a92e787.4171c4bb.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[2517],{6739:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>a,contentTitle:()=>c,default:()=>u,frontMatter:()=>i,metadata:()=>l,toc:()=>d});var t=n(5893),r=n(1151),o=n(3872);const i={title:"Shutting down persistance",slug:"shutting-down-persistance",hide_title:!0,tags:["reference","shutdown","frozen","idle","service error","systemctl","systemd"]},c=void 0,l={id:"Systemd/shutting-down-persistance",title:"Shutting down persistance",description:"Systemd Service as frozen or idle",source:"@site/references/Systemd/shutting-down-persistance.md",sourceDirName:"Systemd",slug:"/Systemd/shutting-down-persistance",permalink:"/references/Systemd/shutting-down-persistance",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Systemd/shutting-down-persistance.md",tags:[{label:"reference",permalink:"/references/tags/reference"},{label:"shutdown",permalink:"/references/tags/shutdown"},{label:"frozen",permalink:"/references/tags/frozen"},{label:"idle",permalink:"/references/tags/idle"},{label:"service error",permalink:"/references/tags/service-error"},{label:"systemctl",permalink:"/references/tags/systemctl"},{label:"systemd",permalink:"/references/tags/systemd"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Shutting down persistance",slug:"shutting-down-persistance",hide_title:!0,tags:["reference","shutdown","frozen","idle","service error","systemctl","systemd"]},sidebar:"defaultSidebar",previous:{title:"Service keeps running after shutdown",permalink:"/references/Systemd/service-keeps-running-after-shutdown"},next:{title:"User service",permalink:"/references/Systemd/user-service"}},a={},d=[{value:"Systemd Service as frozen or idle",id:"systemd-service-as-frozen-or-idle",level:2}];function h(e){const s={code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,r.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.h2,{id:"systemd-service-as-frozen-or-idle",children:"Systemd Service as frozen or idle"}),"\n",(0,t.jsxs)(s.p,{children:["If you have a ",(0,t.jsx)(s.code,{children:"Shutting node down"})," message on the service log, the process is likely failing to respond to Systemd shut down command by failing to terminate all the child processes that were started by the service."]}),"\n",(0,t.jsx)(s.p,{children:"The logs should be similar to the following:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-sh",children:"2023-09-11 18:02:07 | ERROR | lightning_consensus::consensus - core/consensus/src/consensus.rs:371 - node: XsE9KtedDRUGv22MLHvy8qcc52QsWGWJYY1LBnWhglg=\n2023-09-11 18:02:07 | ERROR | lightning_consensus::consensus - core/consensus/src/consensus.rs:371 - node: zBmZaycvQsdFRfe0p5Rig/KgyYPD4yNKQTPDo7JrugM=\n2023-09-11 18:02:07 | WARN | lightning_consensus::consensus - core/consensus/src/consensus.rs:373 - ##################\n2023-09-11 18:02:07 | WARN | lightning_consensus::consensus - core/consensus/src/consensus.rs:374 - ********************************\nRPC server starting up\nlistening on 0.0.0.0:4230\nShutting node down.\nShutting node down.\nShutting node down.\nShutting node down.\nShutting node down.\n"})}),"\n",(0,t.jsxs)(s.p,{children:["To resolve this issue, start by executing a new ",(0,t.jsx)(s.code,{children:"shutdown"})," command as follows:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-sh",children:"systemctl stop lightning\n"})}),"\n",(0,t.jsxs)(s.p,{children:["If you need to delegate to root, then use the ",(0,t.jsx)(s.strong,{children:"sudo"})," keyword, as follows:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-sh",children:"sudo systemctl stop lightning\n"})}),"\n",(0,t.jsx)(s.p,{children:"Once completed, clear the logs to avoid confusion as the log aggregates messages past and current."}),"\n",(0,t.jsx)(s.p,{children:"Delete all the log files (output.log and diagnostic.log) by running:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-sh",children:"sudo rm -f /var/log/lightning/*.log\n"})}),"\n",(0,t.jsx)(s.p,{children:"Launch the service:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-sh",children:"systemctl start lightning\n"})}),"\n",(0,t.jsxs)(s.p,{children:["If you need to delegate to root, then use the ",(0,t.jsx)(s.strong,{children:"sudo"})," keyword, as follows:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-sh",children:"sudo systemctl start lightning\n"})}),"\n",(0,t.jsx)(s.p,{children:"You can watch the log output of the service by running:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-sh",children:"tail -f /var/log/lightning/output.log\n"})}),"\n",(0,t.jsx)(s.p,{children:"The output should be similar to:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-sh",children:"2023-09-12 13:53:51 | WARN | lightning_consensus::consensus - core/consensus/src/consensus.rs:373 - ##################\n2023-09-12 13:53:51 | WARN | lightning_consensus::consensus - core/consensus/src/consensus.rs:374 - ********************************\n"})}),"\n",(0,t.jsx)(s.p,{children:"Alternatively, you can watch the diagnostic.log"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-sh",children:"tail -f /var/log/lightning/diagnostic.log\n"})}),"\n",(0,t.jsx)(o.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function u(e={}){const{wrapper:s}={...(0,r.a)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},3872:(e,s,n)=>{n.d(s,{Z:()=>r});n(7294);var t=n(5893);const r=e=>{let{image:s,name:n,title:r,url:o,communityMember:i=!1}=e;return(0,t.jsx)("section",{className:"author_card",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"avatar",children:(0,t.jsx)("a",{href:o,target:"_blank",alt:n,children:(0,t.jsx)("img",{src:s,alt:n})})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"name",children:(0,t.jsx)("a",{href:o,target:"_blank",alt:n,children:n})}),(0,t.jsx)("span",{className:"title",children:r}),(0,t.jsxs)("span",{className:"discord",children:[i?"Join our community on":"Got questions? Find us on"," ",(0,t.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,s,n)=>{n.d(s,{Z:()=>c,a:()=>i});var t=n(7294);const r={},o=t.createContext(r);function i(e){const s=t.useContext(o);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function c(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),t.createElement(o.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[2517],{6739:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>a,contentTitle:()=>c,default:()=>u,frontMatter:()=>i,metadata:()=>l,toc:()=>d});var t=n(5893),r=n(1151),o=n(3872);const i={title:"Shutting down persistance",slug:"shutting-down-persistance",hide_title:!0,tags:["reference","shutdown","frozen","idle","service error","systemctl","systemd"]},c=void 0,l={id:"Systemd/shutting-down-persistance",title:"Shutting down persistance",description:"Systemd Service as frozen or idle",source:"@site/references/Systemd/shutting-down-persistance.md",sourceDirName:"Systemd",slug:"/Systemd/shutting-down-persistance",permalink:"/references/Systemd/shutting-down-persistance",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Systemd/shutting-down-persistance.md",tags:[{label:"reference",permalink:"/references/tags/reference"},{label:"shutdown",permalink:"/references/tags/shutdown"},{label:"frozen",permalink:"/references/tags/frozen"},{label:"idle",permalink:"/references/tags/idle"},{label:"service error",permalink:"/references/tags/service-error"},{label:"systemctl",permalink:"/references/tags/systemctl"},{label:"systemd",permalink:"/references/tags/systemd"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Shutting down persistance",slug:"shutting-down-persistance",hide_title:!0,tags:["reference","shutdown","frozen","idle","service error","systemctl","systemd"]},sidebar:"defaultSidebar",previous:{title:"Service keeps running after shutdown",permalink:"/references/Systemd/service-keeps-running-after-shutdown"},next:{title:"User service",permalink:"/references/Systemd/user-service"}},a={},d=[{value:"Systemd Service as frozen or idle",id:"systemd-service-as-frozen-or-idle",level:2}];function h(e){const s={code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,r.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.h2,{id:"systemd-service-as-frozen-or-idle",children:"Systemd Service as frozen or idle"}),"\n",(0,t.jsxs)(s.p,{children:["If you have a ",(0,t.jsx)(s.code,{children:"Shutting node down"})," message on the service log, the process is likely failing to respond to Systemd shut down command by failing to terminate all the child processes that were started by the service."]}),"\n",(0,t.jsx)(s.p,{children:"The logs should be similar to the following:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-sh",children:"2023-09-11 18:02:07 | ERROR | lightning_consensus::consensus - core/consensus/src/consensus.rs:371 - node: XsE9KtedDRUGv22MLHvy8qcc52QsWGWJYY1LBnWhglg=\n2023-09-11 18:02:07 | ERROR | lightning_consensus::consensus - core/consensus/src/consensus.rs:371 - node: zBmZaycvQsdFRfe0p5Rig/KgyYPD4yNKQTPDo7JrugM=\n2023-09-11 18:02:07 | WARN | lightning_consensus::consensus - core/consensus/src/consensus.rs:373 - ##################\n2023-09-11 18:02:07 | WARN | lightning_consensus::consensus - core/consensus/src/consensus.rs:374 - ********************************\nRPC server starting up\nlistening on 0.0.0.0:4230\nShutting node down.\nShutting node down.\nShutting node down.\nShutting node down.\nShutting node down.\n"})}),"\n",(0,t.jsxs)(s.p,{children:["To resolve this issue, start by executing a new ",(0,t.jsx)(s.code,{children:"shutdown"})," command as follows:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-sh",children:"systemctl stop lightning\n"})}),"\n",(0,t.jsxs)(s.p,{children:["If you need to delegate to root, then use the ",(0,t.jsx)(s.strong,{children:"sudo"})," keyword, as follows:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-sh",children:"sudo systemctl stop lightning\n"})}),"\n",(0,t.jsx)(s.p,{children:"Once completed, clear the logs to avoid confusion as the log aggregates messages past and current."}),"\n",(0,t.jsx)(s.p,{children:"Delete all the log files (output.log and diagnostic.log) by running:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-sh",children:"sudo rm -f /var/log/lightning/*.log\n"})}),"\n",(0,t.jsx)(s.p,{children:"Launch the service:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-sh",children:"systemctl start lightning\n"})}),"\n",(0,t.jsxs)(s.p,{children:["If you need to delegate to root, then use the ",(0,t.jsx)(s.strong,{children:"sudo"})," keyword, as follows:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-sh",children:"sudo systemctl start lightning\n"})}),"\n",(0,t.jsx)(s.p,{children:"You can watch the log output of the service by running:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-sh",children:"tail -f /var/log/lightning/output.log\n"})}),"\n",(0,t.jsx)(s.p,{children:"The output should be similar to:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-sh",children:"2023-09-12 13:53:51 | WARN | lightning_consensus::consensus - core/consensus/src/consensus.rs:373 - ##################\n2023-09-12 13:53:51 | WARN | lightning_consensus::consensus - core/consensus/src/consensus.rs:374 - ********************************\n"})}),"\n",(0,t.jsx)(s.p,{children:"Alternatively, you can watch the diagnostic.log"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-sh",children:"tail -f /var/log/lightning/diagnostic.log\n"})}),"\n",(0,t.jsx)(o.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function u(e={}){const{wrapper:s}={...(0,r.a)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},3872:(e,s,n)=>{n.d(s,{Z:()=>r});n(7294);var t=n(5893);const r=e=>{let{image:s,name:n,title:r,url:o,communityMember:i=!1}=e;return(0,t.jsx)("section",{className:"author_card",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"avatar",children:(0,t.jsx)("a",{href:o,target:"_blank",alt:n,children:(0,t.jsx)("img",{src:s,alt:n})})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"name",children:(0,t.jsx)("a",{href:o,target:"_blank",alt:n,children:n})}),(0,t.jsx)("span",{className:"title",children:r}),(0,t.jsxs)("span",{className:"discord",children:[i?"Join our community on":"Got questions? Find us on"," ",(0,t.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,s,n)=>{n.d(s,{Z:()=>c,a:()=>i});var t=n(7294);const r={},o=t.createContext(r);function i(e){const s=t.useContext(o);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function c(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),t.createElement(o.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/9722e053.28d4d3be.js b/assets/js/9722e053.0c778bca.js similarity index 99% rename from assets/js/9722e053.28d4d3be.js rename to assets/js/9722e053.0c778bca.js index 932c33d42..45350d52b 100644 --- a/assets/js/9722e053.28d4d3be.js +++ b/assets/js/9722e053.0c778bca.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[1955],{6410:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>i,default:()=>u,frontMatter:()=>l,metadata:()=>c,toc:()=>o});var t=s(5893),r=s(1151),a=s(3872);const l={title:"Frequently used commands for Docker setup",slug:"frequently-used-commands-for-docker-setup",hide_title:!0,tags:["commands","cli","lightning","docker"]},i=void 0,c={id:"Docker/frequently-used-commands-for-docker-setup",title:"Frequently used commands for Docker setup",description:"TL;DR",source:"@site/references/Docker/frequently-used-commands-for-docker-setup.md",sourceDirName:"Docker",slug:"/Docker/frequently-used-commands-for-docker-setup",permalink:"/references/Docker/frequently-used-commands-for-docker-setup",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Docker/frequently-used-commands-for-docker-setup.md",tags:[{label:"commands",permalink:"/references/tags/commands"},{label:"cli",permalink:"/references/tags/cli"},{label:"lightning",permalink:"/references/tags/lightning"},{label:"docker",permalink:"/references/tags/docker"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Frequently used commands for Docker setup",slug:"frequently-used-commands-for-docker-setup",hide_title:!0,tags:["commands","cli","lightning","docker"]},sidebar:"defaultSidebar",previous:{title:"Build and run in Docker",permalink:"/references/Docker/build-and-run-in-docker"},next:{title:"Uninstall Docker Setup",permalink:"/references/Docker/uninstall-docker-setup"}},d={},o=[{value:"TL;DR",id:"tldr",level:2},{value:"Systemctl Service Management",id:"systemctl-service-management",level:2},{value:"Enable",id:"enable",level:3},{value:"Disable",id:"disable",level:3},{value:"Start",id:"start",level:3},{value:"Stop",id:"stop",level:3},{value:"Restart",id:"restart",level:3},{value:"Status",id:"status",level:3},{value:"Lightning CLI via Docker",id:"lightning-cli-via-docker",level:2},{value:"Show keys for user config",id:"show-keys-for-user-config",level:3},{value:"Diagnostic tools",id:"diagnostic-tools",level:2},{value:"Extended verification health check",id:"extended-verification-health-check",level:3},{value:"Health status",id:"health-status",level:3},{value:"Node details",id:"node-details",level:3},{value:"Analyzing Logs",id:"analyzing-logs",level:2},{value:"Standard output",id:"standard-output",level:3},{value:"Standard error",id:"standard-error",level:3},{value:"Docker Container Logs",id:"docker-container-logs",level:3},{value:"Interactive Container",id:"interactive-container",level:2},{value:"Execute Bash",id:"execute-bash",level:3},{value:"Docker",id:"docker",level:2},{value:"List Containers",id:"list-containers",level:3},{value:"Start Container",id:"start-container",level:3},{value:"Stop Container",id:"stop-container",level:3},{value:"Remove Container",id:"remove-container",level:3}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h2,{id:"tldr",children:"TL;DR"}),"\n",(0,t.jsxs)(n.p,{children:["Most assisted processes are available through the ",(0,t.jsx)(n.code,{children:"get.fleek.network"})," command, where you can select to install, do a health check amongst others."]}),"\n",(0,t.jsx)(n.p,{children:"To access the menu options run the command in the shell prompt:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"curl https://get.fleek.network | bash\n"})}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["For Native setup users read the corresponding version in the section ",(0,t.jsx)(n.a,{href:"/references/Lightning%20CLI/frequently-used-commands-for-native-setup",children:"Frequently Used Commands for Native Setup"})]})}),"\n",(0,t.jsx)(n.h2,{id:"systemctl-service-management",children:"Systemctl Service Management"}),"\n",(0,t.jsx)(n.h3,{id:"enable",children:"Enable"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl enable docker-lightning\n"})}),"\n",(0,t.jsx)(n.h3,{id:"disable",children:"Disable"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl enable docker-lightning\n"})}),"\n",(0,t.jsx)(n.h3,{id:"start",children:"Start"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl start docker-lightning\n"})}),"\n",(0,t.jsx)(n.h3,{id:"stop",children:"Stop"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl stop docker-lightning\n"})}),"\n",(0,t.jsx)(n.h3,{id:"restart",children:"Restart"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl restart docker-lightning\n"})}),"\n",(0,t.jsx)(n.h3,{id:"status",children:"Status"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl status docker-lightning\n"})}),"\n",(0,t.jsx)(n.h2,{id:"lightning-cli-via-docker",children:"Lightning CLI via Docker"}),"\n",(0,t.jsx)(n.h3,{id:"show-keys-for-user-config",children:"Show keys for user config"}),"\n",(0,t.jsxs)(n.p,{children:["Show the keys by running the sub-commands ",(0,t.jsx)(n.code,{children:"keys show"})," and declaring the configuration file location (in-docker pathname):"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker exec -it lightning-node lgtn -c /home/lgtn/.lightning/config.toml keys show\n"})}),"\n",(0,t.jsx)(n.h2,{id:"diagnostic-tools",children:"Diagnostic tools"}),"\n",(0,t.jsx)(n.h3,{id:"extended-verification-health-check",children:"Extended verification health check"}),"\n",(0,t.jsx)(n.p,{children:"The command show be executed from host and not in-Docker container."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"curl -sS https://get.fleek.network/healthcheck | bash\n"})}),"\n",(0,t.jsx)(n.h3,{id:"health-status",children:"Health status"}),"\n",(0,t.jsx)(n.p,{children:"The command show be executed from host and not in-Docker container."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:'curl -w "\\n" localhost:4230/health\n'})}),"\n",(0,t.jsx)(n.h3,{id:"node-details",children:"Node details"}),"\n",(0,t.jsx)(n.p,{children:"The command show be executed from host and not in-Docker container."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"curl -sS https://get.fleek.network/node_details | bash\n"})}),"\n",(0,t.jsx)(n.h2,{id:"analyzing-logs",children:"Analyzing Logs"}),"\n",(0,t.jsx)(n.h3,{id:"standard-output",children:"Standard output"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"tail -f /var/log/lightning/output.log\n"})}),"\n",(0,t.jsx)(n.h3,{id:"standard-error",children:"Standard error"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"tail -f /var/log/lightning/diagnostic.log\n"})}),"\n",(0,t.jsx)(n.h3,{id:"docker-container-logs",children:"Docker Container Logs"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker logs -f lightning-node\n"})}),"\n",(0,t.jsx)(n.h2,{id:"interactive-container",children:"Interactive Container"}),"\n",(0,t.jsx)(n.h3,{id:"execute-bash",children:"Execute Bash"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker exec -it lightning-node bash\n"})}),"\n",(0,t.jsx)(n.h2,{id:"docker",children:"Docker"}),"\n",(0,t.jsx)(n.h3,{id:"list-containers",children:"List Containers"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker ps -a\n"})}),"\n",(0,t.jsx)(n.h3,{id:"start-container",children:"Start Container"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker start \n"})}),"\n",(0,t.jsx)(n.h3,{id:"stop-container",children:"Stop Container"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker stop \n"})}),"\n",(0,t.jsx)(n.h3,{id:"remove-container",children:"Remove Container"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker rm \n"})}),"\n",(0,t.jsx)(a.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function u(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},3872:(e,n,s)=>{s.d(n,{Z:()=>r});s(7294);var t=s(5893);const r=e=>{let{image:n,name:s,title:r,url:a,communityMember:l=!1}=e;return(0,t.jsx)("section",{className:"author_card",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"avatar",children:(0,t.jsx)("a",{href:a,target:"_blank",alt:s,children:(0,t.jsx)("img",{src:n,alt:s})})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"name",children:(0,t.jsx)("a",{href:a,target:"_blank",alt:s,children:s})}),(0,t.jsx)("span",{className:"title",children:r}),(0,t.jsxs)("span",{className:"discord",children:[l?"Join our community on":"Got questions? Find us on"," ",(0,t.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,s)=>{s.d(n,{Z:()=>i,a:()=>l});var t=s(7294);const r={},a=t.createContext(r);function l(e){const n=t.useContext(a);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),t.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[1955],{6410:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>i,default:()=>u,frontMatter:()=>l,metadata:()=>c,toc:()=>o});var t=s(5893),r=s(1151),a=s(3872);const l={title:"Frequently used commands for Docker setup",slug:"frequently-used-commands-for-docker-setup",hide_title:!0,tags:["commands","cli","lightning","docker"]},i=void 0,c={id:"Docker/frequently-used-commands-for-docker-setup",title:"Frequently used commands for Docker setup",description:"TL;DR",source:"@site/references/Docker/frequently-used-commands-for-docker-setup.md",sourceDirName:"Docker",slug:"/Docker/frequently-used-commands-for-docker-setup",permalink:"/references/Docker/frequently-used-commands-for-docker-setup",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Docker/frequently-used-commands-for-docker-setup.md",tags:[{label:"commands",permalink:"/references/tags/commands"},{label:"cli",permalink:"/references/tags/cli"},{label:"lightning",permalink:"/references/tags/lightning"},{label:"docker",permalink:"/references/tags/docker"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Frequently used commands for Docker setup",slug:"frequently-used-commands-for-docker-setup",hide_title:!0,tags:["commands","cli","lightning","docker"]},sidebar:"defaultSidebar",previous:{title:"Build and run in Docker",permalink:"/references/Docker/build-and-run-in-docker"},next:{title:"Uninstall Docker Setup",permalink:"/references/Docker/uninstall-docker-setup"}},d={},o=[{value:"TL;DR",id:"tldr",level:2},{value:"Systemctl Service Management",id:"systemctl-service-management",level:2},{value:"Enable",id:"enable",level:3},{value:"Disable",id:"disable",level:3},{value:"Start",id:"start",level:3},{value:"Stop",id:"stop",level:3},{value:"Restart",id:"restart",level:3},{value:"Status",id:"status",level:3},{value:"Lightning CLI via Docker",id:"lightning-cli-via-docker",level:2},{value:"Show keys for user config",id:"show-keys-for-user-config",level:3},{value:"Diagnostic tools",id:"diagnostic-tools",level:2},{value:"Extended verification health check",id:"extended-verification-health-check",level:3},{value:"Health status",id:"health-status",level:3},{value:"Node details",id:"node-details",level:3},{value:"Analyzing Logs",id:"analyzing-logs",level:2},{value:"Standard output",id:"standard-output",level:3},{value:"Standard error",id:"standard-error",level:3},{value:"Docker Container Logs",id:"docker-container-logs",level:3},{value:"Interactive Container",id:"interactive-container",level:2},{value:"Execute Bash",id:"execute-bash",level:3},{value:"Docker",id:"docker",level:2},{value:"List Containers",id:"list-containers",level:3},{value:"Start Container",id:"start-container",level:3},{value:"Stop Container",id:"stop-container",level:3},{value:"Remove Container",id:"remove-container",level:3}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h2,{id:"tldr",children:"TL;DR"}),"\n",(0,t.jsxs)(n.p,{children:["Most assisted processes are available through the ",(0,t.jsx)(n.code,{children:"get.fleek.network"})," command, where you can select to install, do a health check amongst others."]}),"\n",(0,t.jsx)(n.p,{children:"To access the menu options run the command in the shell prompt:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"curl https://get.fleek.network | bash\n"})}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["For Native setup users read the corresponding version in the section ",(0,t.jsx)(n.a,{href:"/references/Lightning%20CLI/frequently-used-commands-for-native-setup",children:"Frequently Used Commands for Native Setup"})]})}),"\n",(0,t.jsx)(n.h2,{id:"systemctl-service-management",children:"Systemctl Service Management"}),"\n",(0,t.jsx)(n.h3,{id:"enable",children:"Enable"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl enable docker-lightning\n"})}),"\n",(0,t.jsx)(n.h3,{id:"disable",children:"Disable"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl enable docker-lightning\n"})}),"\n",(0,t.jsx)(n.h3,{id:"start",children:"Start"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl start docker-lightning\n"})}),"\n",(0,t.jsx)(n.h3,{id:"stop",children:"Stop"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl stop docker-lightning\n"})}),"\n",(0,t.jsx)(n.h3,{id:"restart",children:"Restart"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl restart docker-lightning\n"})}),"\n",(0,t.jsx)(n.h3,{id:"status",children:"Status"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo systemctl status docker-lightning\n"})}),"\n",(0,t.jsx)(n.h2,{id:"lightning-cli-via-docker",children:"Lightning CLI via Docker"}),"\n",(0,t.jsx)(n.h3,{id:"show-keys-for-user-config",children:"Show keys for user config"}),"\n",(0,t.jsxs)(n.p,{children:["Show the keys by running the sub-commands ",(0,t.jsx)(n.code,{children:"keys show"})," and declaring the configuration file location (in-docker pathname):"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker exec -it lightning-node lgtn -c /home/lgtn/.lightning/config.toml keys show\n"})}),"\n",(0,t.jsx)(n.h2,{id:"diagnostic-tools",children:"Diagnostic tools"}),"\n",(0,t.jsx)(n.h3,{id:"extended-verification-health-check",children:"Extended verification health check"}),"\n",(0,t.jsx)(n.p,{children:"The command show be executed from host and not in-Docker container."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"curl -sS https://get.fleek.network/healthcheck | bash\n"})}),"\n",(0,t.jsx)(n.h3,{id:"health-status",children:"Health status"}),"\n",(0,t.jsx)(n.p,{children:"The command show be executed from host and not in-Docker container."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:'curl -w "\\n" localhost:4230/health\n'})}),"\n",(0,t.jsx)(n.h3,{id:"node-details",children:"Node details"}),"\n",(0,t.jsx)(n.p,{children:"The command show be executed from host and not in-Docker container."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"curl -sS https://get.fleek.network/node_details | bash\n"})}),"\n",(0,t.jsx)(n.h2,{id:"analyzing-logs",children:"Analyzing Logs"}),"\n",(0,t.jsx)(n.h3,{id:"standard-output",children:"Standard output"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"tail -f /var/log/lightning/output.log\n"})}),"\n",(0,t.jsx)(n.h3,{id:"standard-error",children:"Standard error"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"tail -f /var/log/lightning/diagnostic.log\n"})}),"\n",(0,t.jsx)(n.h3,{id:"docker-container-logs",children:"Docker Container Logs"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker logs -f lightning-node\n"})}),"\n",(0,t.jsx)(n.h2,{id:"interactive-container",children:"Interactive Container"}),"\n",(0,t.jsx)(n.h3,{id:"execute-bash",children:"Execute Bash"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker exec -it lightning-node bash\n"})}),"\n",(0,t.jsx)(n.h2,{id:"docker",children:"Docker"}),"\n",(0,t.jsx)(n.h3,{id:"list-containers",children:"List Containers"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker ps -a\n"})}),"\n",(0,t.jsx)(n.h3,{id:"start-container",children:"Start Container"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker start \n"})}),"\n",(0,t.jsx)(n.h3,{id:"stop-container",children:"Stop Container"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker stop \n"})}),"\n",(0,t.jsx)(n.h3,{id:"remove-container",children:"Remove Container"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker rm \n"})}),"\n",(0,t.jsx)(a.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function u(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},3872:(e,n,s)=>{s.d(n,{Z:()=>r});s(7294);var t=s(5893);const r=e=>{let{image:n,name:s,title:r,url:a,communityMember:l=!1}=e;return(0,t.jsx)("section",{className:"author_card",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"avatar",children:(0,t.jsx)("a",{href:a,target:"_blank",alt:s,children:(0,t.jsx)("img",{src:n,alt:s})})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"name",children:(0,t.jsx)("a",{href:a,target:"_blank",alt:s,children:s})}),(0,t.jsx)("span",{className:"title",children:r}),(0,t.jsxs)("span",{className:"discord",children:[l?"Join our community on":"Got questions? Find us on"," ",(0,t.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,s)=>{s.d(n,{Z:()=>i,a:()=>l});var t=s(7294);const r={},a=t.createContext(r);function l(e){const n=t.useContext(a);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),t.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/98f9308d.df6d55cb.js b/assets/js/98f9308d.d63e05f4.js similarity index 98% rename from assets/js/98f9308d.df6d55cb.js rename to assets/js/98f9308d.d63e05f4.js index 256f56f47..e541829a3 100644 --- a/assets/js/98f9308d.df6d55cb.js +++ b/assets/js/98f9308d.d63e05f4.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[1025],{2150:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>a,contentTitle:()=>l,default:()=>u,frontMatter:()=>c,metadata:()=>o,toc:()=>d});var n=t(5893),r=t(1151),i=t(3872);const c={title:"Service keeps running after shutdown",slug:"service-keeps-running-after-shutdown",hide_title:!0,tags:["reference","shutdown","systemctl","systemd","pkill","process"]},l=void 0,o={id:"Systemd/service-keeps-running-after-shutdown",title:"Service keeps running after shutdown",description:"Stop the service",source:"@site/references/Systemd/service-keeps-running-after-shutdown.md",sourceDirName:"Systemd",slug:"/Systemd/service-keeps-running-after-shutdown",permalink:"/references/Systemd/service-keeps-running-after-shutdown",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Systemd/service-keeps-running-after-shutdown.md",tags:[{label:"reference",permalink:"/references/tags/reference"},{label:"shutdown",permalink:"/references/tags/shutdown"},{label:"systemctl",permalink:"/references/tags/systemctl"},{label:"systemd",permalink:"/references/tags/systemd"},{label:"pkill",permalink:"/references/tags/pkill"},{label:"process",permalink:"/references/tags/process"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Service keeps running after shutdown",slug:"service-keeps-running-after-shutdown",hide_title:!0,tags:["reference","shutdown","systemctl","systemd","pkill","process"]},sidebar:"defaultSidebar",previous:{title:"Update CLI from source code",permalink:"/references/Lightning CLI/update-cli-from-source-code"},next:{title:"Shutting down persistance",permalink:"/references/Systemd/shutting-down-persistance"}},a={},d=[{value:"Stop the service",id:"stop-the-service",level:2},{value:"Kill the process by name",id:"kill-the-process-by-name",level:2}];function h(e){const s={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.h2,{id:"stop-the-service",children:"Stop the service"}),"\n",(0,n.jsxs)(s.p,{children:["The ",(0,n.jsx)(s.a,{href:"/docs/node/systemd-service",children:"Systemd service"})," section tells how to stop the service, as follows:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"sudo systemctl stop lightning\n"})}),"\n",(0,n.jsx)(s.p,{children:"Although, the service is set to restart on failure after a few seconds."}),"\n",(0,n.jsx)(s.h2,{id:"kill-the-process-by-name",children:"Kill the process by name"}),"\n",(0,n.jsxs)(s.p,{children:["Force stop a process by name with the command ",(0,n.jsx)(s.code,{children:"pkill"}),"."]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"pkill -f \n"})}),"\n",(0,n.jsxs)(s.p,{children:["If you've followed the recommended settings, or used the assisted installer the process should be called ",(0,n.jsx)(s.code,{children:"lgtn"}),"."]}),"\n",(0,n.jsxs)(s.p,{children:["A Systemd service is managed by ",(0,n.jsx)(s.a,{href:"/docs/node/systemd-service",children:"Systemctl"}),", to start, stop, to get status or restart. The service controls the Lightning CLI service, that for our convenience named as ",(0,n.jsx)(s.code,{children:"lgtn"}),"\u2013short for lightning. If you haven't followed the recommended settings and have a custom set up, you need to use the custom details you have defined."]}),"\n",(0,n.jsxs)(s.p,{children:["To force stop the service ",(0,n.jsx)(s.code,{children:"lgtn"})," execute the command:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"sudo killall -9 lgtn\n"})}),"\n",(0,n.jsx)(i.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function u(e={}){const{wrapper:s}={...(0,r.a)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},3872:(e,s,t)=>{t.d(s,{Z:()=>r});t(7294);var n=t(5893);const r=e=>{let{image:s,name:t,title:r,url:i,communityMember:c=!1}=e;return(0,n.jsx)("section",{className:"author_card",children:(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"avatar",children:(0,n.jsx)("a",{href:i,target:"_blank",alt:t,children:(0,n.jsx)("img",{src:s,alt:t})})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"name",children:(0,n.jsx)("a",{href:i,target:"_blank",alt:t,children:t})}),(0,n.jsx)("span",{className:"title",children:r}),(0,n.jsxs)("span",{className:"discord",children:[c?"Join our community on":"Got questions? Find us on"," ",(0,n.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,s,t)=>{t.d(s,{Z:()=>l,a:()=>c});var n=t(7294);const r={},i=n.createContext(r);function c(e){const s=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),n.createElement(i.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[1025],{2150:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>a,contentTitle:()=>l,default:()=>u,frontMatter:()=>c,metadata:()=>o,toc:()=>d});var n=t(5893),r=t(1151),i=t(3872);const c={title:"Service keeps running after shutdown",slug:"service-keeps-running-after-shutdown",hide_title:!0,tags:["reference","shutdown","systemctl","systemd","pkill","process"]},l=void 0,o={id:"Systemd/service-keeps-running-after-shutdown",title:"Service keeps running after shutdown",description:"Stop the service",source:"@site/references/Systemd/service-keeps-running-after-shutdown.md",sourceDirName:"Systemd",slug:"/Systemd/service-keeps-running-after-shutdown",permalink:"/references/Systemd/service-keeps-running-after-shutdown",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Systemd/service-keeps-running-after-shutdown.md",tags:[{label:"reference",permalink:"/references/tags/reference"},{label:"shutdown",permalink:"/references/tags/shutdown"},{label:"systemctl",permalink:"/references/tags/systemctl"},{label:"systemd",permalink:"/references/tags/systemd"},{label:"pkill",permalink:"/references/tags/pkill"},{label:"process",permalink:"/references/tags/process"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Service keeps running after shutdown",slug:"service-keeps-running-after-shutdown",hide_title:!0,tags:["reference","shutdown","systemctl","systemd","pkill","process"]},sidebar:"defaultSidebar",previous:{title:"Update CLI from source code",permalink:"/references/Lightning CLI/update-cli-from-source-code"},next:{title:"Shutting down persistance",permalink:"/references/Systemd/shutting-down-persistance"}},a={},d=[{value:"Stop the service",id:"stop-the-service",level:2},{value:"Kill the process by name",id:"kill-the-process-by-name",level:2}];function h(e){const s={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.h2,{id:"stop-the-service",children:"Stop the service"}),"\n",(0,n.jsxs)(s.p,{children:["The ",(0,n.jsx)(s.a,{href:"/docs/node/systemd-service",children:"Systemd service"})," section tells how to stop the service, as follows:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"sudo systemctl stop lightning\n"})}),"\n",(0,n.jsx)(s.p,{children:"Although, the service is set to restart on failure after a few seconds."}),"\n",(0,n.jsx)(s.h2,{id:"kill-the-process-by-name",children:"Kill the process by name"}),"\n",(0,n.jsxs)(s.p,{children:["Force stop a process by name with the command ",(0,n.jsx)(s.code,{children:"pkill"}),"."]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"pkill -f \n"})}),"\n",(0,n.jsxs)(s.p,{children:["If you've followed the recommended settings, or used the assisted installer the process should be called ",(0,n.jsx)(s.code,{children:"lgtn"}),"."]}),"\n",(0,n.jsxs)(s.p,{children:["A Systemd service is managed by ",(0,n.jsx)(s.a,{href:"/docs/node/systemd-service",children:"Systemctl"}),", to start, stop, to get status or restart. The service controls the Lightning CLI service, that for our convenience named as ",(0,n.jsx)(s.code,{children:"lgtn"}),"\u2013short for lightning. If you haven't followed the recommended settings and have a custom set up, you need to use the custom details you have defined."]}),"\n",(0,n.jsxs)(s.p,{children:["To force stop the service ",(0,n.jsx)(s.code,{children:"lgtn"})," execute the command:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"sudo killall -9 lgtn\n"})}),"\n",(0,n.jsx)(i.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function u(e={}){const{wrapper:s}={...(0,r.a)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},3872:(e,s,t)=>{t.d(s,{Z:()=>r});t(7294);var n=t(5893);const r=e=>{let{image:s,name:t,title:r,url:i,communityMember:c=!1}=e;return(0,n.jsx)("section",{className:"author_card",children:(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"avatar",children:(0,n.jsx)("a",{href:i,target:"_blank",alt:t,children:(0,n.jsx)("img",{src:s,alt:t})})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"name",children:(0,n.jsx)("a",{href:i,target:"_blank",alt:t,children:t})}),(0,n.jsx)("span",{className:"title",children:r}),(0,n.jsxs)("span",{className:"discord",children:[c?"Join our community on":"Got questions? Find us on"," ",(0,n.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,s,t)=>{t.d(s,{Z:()=>l,a:()=>c});var n=t(7294);const r={},i=n.createContext(r);function c(e){const s=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),n.createElement(i.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/b249ed45.9bed42cb.js b/assets/js/b249ed45.d5d97986.js similarity index 99% rename from assets/js/b249ed45.9bed42cb.js rename to assets/js/b249ed45.d5d97986.js index e000524b8..502ac25a7 100644 --- a/assets/js/b249ed45.9bed42cb.js +++ b/assets/js/b249ed45.d5d97986.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[5767],{3183:(e,n,t)=>{t.d(n,{ZP:()=>s});var r=t(5893),o=t(1151);function i(e){const n={a:"a",admonition:"admonition",code:"code",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.a)(),...e.components};return(0,r.jsxs)(n.admonition,{type:"tip",children:[(0,r.jsx)(n.p,{children:"You have several ways of doing this:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Clone via HTTPS"}),"\n",(0,r.jsx)(n.li,{children:"Clone via SSH"}),"\n",(0,r.jsx)(n.li,{children:"Download via Github CLI"}),"\n",(0,r.jsxs)(n.li,{children:["Download the ",(0,r.jsx)(n.a,{href:"https://github.com/fleek-network/lightning/archive/refs/heads/main.zip",children:"zip package"})," from the repository"]}),"\n"]}),(0,r.jsxs)(n.p,{children:["We recommend HTTPS because it is the easiest to set up in the wild, and by users who are new to all this.\nAlthough, we strongly recommend using an SSH connection when interacting with GitHub. If you are to this and are interested read more about it ",(0,r.jsx)(n.a,{href:"https://docs.github.com/en/authentication/connecting-to-github-with-ssh",children:"here"}),"."]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"git clone -b testnet-alpha-1 https://github.com/fleek-network/lightning.git \n"})}),(0,r.jsxs)(n.p,{children:["At time of writing, we are checking the branch name ",(0,r.jsx)(n.code,{children:"testnet-alpha-1"})," that corresponds to the testnet phase.\nHere's an example of what it'd look like when sticking to the recommended path location:"]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"git clone -b testnet-alpha-1 https://github.com/fleek-network/lightning.git ~/fleek-network/lightning\n"})})]})}function s(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(i,{...e})}):i(e)}},1583:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>c,default:()=>m,frontMatter:()=>s,metadata:()=>l,toc:()=>d});var r=t(5893),o=t(1151),i=t(3872);t(3183);const s={title:"Uninstall Docker Setup",slug:"uninstall-docker-setup",hide_title:!0,tags:["references","help","docker","image","container"]},c=void 0,l={id:"Docker/uninstall-docker-setup",title:"Uninstall Docker Setup",description:"Remove the source code locally",source:"@site/references/Docker/uninstall-docker-setup.md",sourceDirName:"Docker",slug:"/Docker/uninstall-docker-setup",permalink:"/references/Docker/uninstall-docker-setup",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Docker/uninstall-docker-setup.md",tags:[{label:"references",permalink:"/references/tags/references"},{label:"help",permalink:"/references/tags/help"},{label:"docker",permalink:"/references/tags/docker"},{label:"image",permalink:"/references/tags/image"},{label:"container",permalink:"/references/tags/container"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Uninstall Docker Setup",slug:"uninstall-docker-setup",hide_title:!0,tags:["references","help","docker","image","container"]},sidebar:"defaultSidebar",previous:{title:"Frequently used commands for Docker setup",permalink:"/references/Docker/frequently-used-commands-for-docker-setup"},next:{title:"Error building on ARM64",permalink:"/references/Lightning CLI/error-building-on-arm64"}},a={},d=[{value:"Remove the source code locally",id:"remove-the-source-code-locally",level:2},{value:"Stop the Docker service",id:"stop-the-docker-service",level:2},{value:"Confirm the Docker service status",id:"confirm-the-docker-service-status",level:2},{value:"Reload the daemon",id:"reload-the-daemon",level:2},{value:"Remove the Systemd Service Unit file",id:"remove-the-systemd-service-unit-file",level:2},{value:"Delete the Docker image",id:"delete-the-docker-image",level:2},{value:"Uninstall Docker",id:"uninstall-docker",level:2},{value:"Manage keys",id:"manage-keys",level:2},{value:"Remove the logs",id:"remove-the-logs",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",...(0,o.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h2,{id:"remove-the-source-code-locally",children:"Remove the source code locally"}),"\n",(0,r.jsx)(n.p,{children:"For users who build the Docker image from source-code."}),"\n",(0,r.jsxs)(n.p,{children:["Assuming the default installation source-code path ",(0,r.jsx)(n.code,{children:"~/fleek-network/lightning"}),", run the command:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"rm -rf ~/fleek-network/lightning\n"})}),"\n",(0,r.jsx)(n.p,{children:"If you have a custom path, you need to change the pathname to the correct path you have selected during your custom install."}),"\n",(0,r.jsx)(n.h2,{id:"stop-the-docker-service",children:"Stop the Docker service"}),"\n",(0,r.jsx)(n.p,{children:"The Fleek Network recommends systemctl to manage the services, either natively or docker. It's an interface that is easily to translate across the setups, and to communicate to the users in a common manner."}),"\n",(0,r.jsx)(n.p,{children:"If you have followed the recommendations, you should have the Systemd Unit Service setup."}),"\n",(0,r.jsx)(n.p,{children:"To stop the service run the command:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"sudo systemctl stop docker-lightning\n"})}),"\n",(0,r.jsx)(n.h2,{id:"confirm-the-docker-service-status",children:"Confirm the Docker service status"}),"\n",(0,r.jsx)(n.p,{children:"Check the status by:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"sudo systemctl status docker-lightning\n"})}),"\n",(0,r.jsx)(n.p,{children:"Disable the service by:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"sudo systemctl disable docker-lightning\n"})}),"\n",(0,r.jsxs)(n.admonition,{type:"tip",children:[(0,r.jsxs)(n.p,{children:["Once stop, you can run the following command to confirm it is not running. If you have used the recommended container name ",(0,r.jsx)(n.code,{children:"lightning-node"})," the command you'd have to execute is:"]}),(0,r.jsxs)(n.p,{children:["You can check the Docker container isn't running by running the following command. Notice that we are assuming that your docker container name is the default ",(0,r.jsx)(n.code,{children:"lightning-node"}),". If you have customized the name use the correct selected name:"]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"sudo docker container inspect -f '{{.State.Running}}' lightning-node\n"})})]}),"\n",(0,r.jsx)(n.h2,{id:"reload-the-daemon",children:"Reload the daemon"}),"\n",(0,r.jsx)(n.p,{children:"Reload the daemon by:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"sudo systemctl daemon-reload\n"})}),"\n",(0,r.jsx)(n.h2,{id:"remove-the-systemd-service-unit-file",children:"Remove the Systemd Service Unit file"}),"\n",(0,r.jsx)(n.p,{children:"If you have followed the recommendations, you should find the Systemd Service Unit file at:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"/etc/systemd/system/docker-lightning\n"})}),"\n",(0,r.jsx)(n.p,{children:"To remove the file, run the command:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"sudo rm -f /etc/systemd/system/docker-lightning\n"})}),"\n",(0,r.jsx)(n.h2,{id:"delete-the-docker-image",children:"Delete the Docker image"}),"\n",(0,r.jsxs)(n.p,{children:["For our example, we'll assume that the Docker image for Fleek Network is the default ",(0,r.jsx)(n.code,{children:"lightning-node"}),". If you have created the image under a different name, change in accordance to your preference."]}),"\n",(0,r.jsx)(n.p,{children:"Delete the image by running the following command:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"sudo docker rmi $(docker images | grep 'lightning-node')\n"})}),"\n",(0,r.jsxs)(n.p,{children:["To learn more about the docker image remove command, visit the official documentation ",(0,r.jsx)(n.a,{href:"https://docs.docker.com/engine/reference/commandline/image_rm/",children:"here"})]}),"\n",(0,r.jsx)(n.h2,{id:"uninstall-docker",children:"Uninstall Docker"}),"\n",(0,r.jsx)(n.p,{children:"Uninstalling Docker should only be performed if you don't need in your system. If you already had Docker for some purpose, you should not have to uninstall it."}),"\n",(0,r.jsxs)(n.p,{children:["Visit the Docker official documentation site for uninstall instructions ",(0,r.jsx)(n.a,{href:"https://docs.docker.com/desktop/uninstall/",children:"here"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"manage-keys",children:"Manage keys"}),"\n",(0,r.jsxs)(n.p,{children:["The configuration directory of Fleek Network is in the host machine file system. This is the directory where you can find the ",(0,r.jsx)(n.code,{children:"config.toml"}),", ",(0,r.jsx)(n.code,{children:"keystore"})," for the public keys, amongst others."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"/home//.lightning\n"})}),"\n",(0,r.jsxs)(n.p,{children:["For example, for the user ",(0,r.jsx)(n.code,{children:"lgtn"})," the location of these files is:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"/home/lgtn/.lightning\n"})}),"\n",(0,r.jsx)(n.admonition,{title:"warning",type:"caution",children:(0,r.jsx)(n.p,{children:"The directory can be deleted but have in mind that the keystore is located here. If you need to backup the keystore, be careful as this is not possible to recover by anyone. The keys are your responsibility."})}),"\n",(0,r.jsxs)(n.p,{children:["To learn more about the keystore read the guide ",(0,r.jsx)(n.a,{href:"/guides/Node%20Operators/managing-the-keystore",children:"managing the keystore"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["If you are happy to delete the directory, run the following command by replacing the ",(0,r.jsx)(n.code,{children:""})," by yours:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"rm -rf /home//.lightning\n"})}),"\n",(0,r.jsx)(n.h2,{id:"remove-the-logs",children:"Remove the logs"}),"\n",(0,r.jsx)(n.p,{children:"The Docker container generates output to stdout and stderr. All the content is stored in the location:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"/var/log/lightning\n"})}),"\n",(0,r.jsx)(n.p,{children:"To completely remove the directory run the command:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"sudo rm -rf /var/log/lightning\n"})}),"\n",(0,r.jsx)(i.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function m(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},3872:(e,n,t)=>{t.d(n,{Z:()=>o});t(7294);var r=t(5893);const o=e=>{let{image:n,name:t,title:o,url:i,communityMember:s=!1}=e;return(0,r.jsx)("section",{className:"author_card",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"avatar",children:(0,r.jsx)("a",{href:i,target:"_blank",alt:t,children:(0,r.jsx)("img",{src:n,alt:t})})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"name",children:(0,r.jsx)("a",{href:i,target:"_blank",alt:t,children:t})}),(0,r.jsx)("span",{className:"title",children:o}),(0,r.jsxs)("span",{className:"discord",children:[s?"Join our community on":"Got questions? Find us on"," ",(0,r.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>s});var r=t(7294);const o={},i=r.createContext(o);function s(e){const n=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),r.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[5767],{3183:(e,n,t)=>{t.d(n,{ZP:()=>s});var r=t(5893),o=t(1151);function i(e){const n={a:"a",admonition:"admonition",code:"code",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.a)(),...e.components};return(0,r.jsxs)(n.admonition,{type:"tip",children:[(0,r.jsx)(n.p,{children:"You have several ways of doing this:"}),(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Clone via HTTPS"}),"\n",(0,r.jsx)(n.li,{children:"Clone via SSH"}),"\n",(0,r.jsx)(n.li,{children:"Download via Github CLI"}),"\n",(0,r.jsxs)(n.li,{children:["Download the ",(0,r.jsx)(n.a,{href:"https://github.com/fleek-network/lightning/archive/refs/heads/main.zip",children:"zip package"})," from the repository"]}),"\n"]}),(0,r.jsxs)(n.p,{children:["We recommend HTTPS because it is the easiest to set up in the wild, and by users who are new to all this.\nAlthough, we strongly recommend using an SSH connection when interacting with GitHub. If you are to this and are interested read more about it ",(0,r.jsx)(n.a,{href:"https://docs.github.com/en/authentication/connecting-to-github-with-ssh",children:"here"}),"."]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"git clone -b testnet-alpha-1 https://github.com/fleek-network/lightning.git \n"})}),(0,r.jsxs)(n.p,{children:["At time of writing, we are checking the branch name ",(0,r.jsx)(n.code,{children:"testnet-alpha-1"})," that corresponds to the testnet phase.\nHere's an example of what it'd look like when sticking to the recommended path location:"]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"git clone -b testnet-alpha-1 https://github.com/fleek-network/lightning.git ~/fleek-network/lightning\n"})})]})}function s(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(i,{...e})}):i(e)}},1583:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>c,default:()=>m,frontMatter:()=>s,metadata:()=>l,toc:()=>d});var r=t(5893),o=t(1151),i=t(3872);t(3183);const s={title:"Uninstall Docker Setup",slug:"uninstall-docker-setup",hide_title:!0,tags:["references","help","docker","image","container"]},c=void 0,l={id:"Docker/uninstall-docker-setup",title:"Uninstall Docker Setup",description:"Remove the source code locally",source:"@site/references/Docker/uninstall-docker-setup.md",sourceDirName:"Docker",slug:"/Docker/uninstall-docker-setup",permalink:"/references/Docker/uninstall-docker-setup",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Docker/uninstall-docker-setup.md",tags:[{label:"references",permalink:"/references/tags/references"},{label:"help",permalink:"/references/tags/help"},{label:"docker",permalink:"/references/tags/docker"},{label:"image",permalink:"/references/tags/image"},{label:"container",permalink:"/references/tags/container"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Uninstall Docker Setup",slug:"uninstall-docker-setup",hide_title:!0,tags:["references","help","docker","image","container"]},sidebar:"defaultSidebar",previous:{title:"Frequently used commands for Docker setup",permalink:"/references/Docker/frequently-used-commands-for-docker-setup"},next:{title:"Error building on ARM64",permalink:"/references/Lightning CLI/error-building-on-arm64"}},a={},d=[{value:"Remove the source code locally",id:"remove-the-source-code-locally",level:2},{value:"Stop the Docker service",id:"stop-the-docker-service",level:2},{value:"Confirm the Docker service status",id:"confirm-the-docker-service-status",level:2},{value:"Reload the daemon",id:"reload-the-daemon",level:2},{value:"Remove the Systemd Service Unit file",id:"remove-the-systemd-service-unit-file",level:2},{value:"Delete the Docker image",id:"delete-the-docker-image",level:2},{value:"Uninstall Docker",id:"uninstall-docker",level:2},{value:"Manage keys",id:"manage-keys",level:2},{value:"Remove the logs",id:"remove-the-logs",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",...(0,o.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h2,{id:"remove-the-source-code-locally",children:"Remove the source code locally"}),"\n",(0,r.jsx)(n.p,{children:"For users who build the Docker image from source-code."}),"\n",(0,r.jsxs)(n.p,{children:["Assuming the default installation source-code path ",(0,r.jsx)(n.code,{children:"~/fleek-network/lightning"}),", run the command:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"rm -rf ~/fleek-network/lightning\n"})}),"\n",(0,r.jsx)(n.p,{children:"If you have a custom path, you need to change the pathname to the correct path you have selected during your custom install."}),"\n",(0,r.jsx)(n.h2,{id:"stop-the-docker-service",children:"Stop the Docker service"}),"\n",(0,r.jsx)(n.p,{children:"The Fleek Network recommends systemctl to manage the services, either natively or docker. It's an interface that is easily to translate across the setups, and to communicate to the users in a common manner."}),"\n",(0,r.jsx)(n.p,{children:"If you have followed the recommendations, you should have the Systemd Unit Service setup."}),"\n",(0,r.jsx)(n.p,{children:"To stop the service run the command:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"sudo systemctl stop docker-lightning\n"})}),"\n",(0,r.jsx)(n.h2,{id:"confirm-the-docker-service-status",children:"Confirm the Docker service status"}),"\n",(0,r.jsx)(n.p,{children:"Check the status by:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"sudo systemctl status docker-lightning\n"})}),"\n",(0,r.jsx)(n.p,{children:"Disable the service by:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"sudo systemctl disable docker-lightning\n"})}),"\n",(0,r.jsxs)(n.admonition,{type:"tip",children:[(0,r.jsxs)(n.p,{children:["Once stop, you can run the following command to confirm it is not running. If you have used the recommended container name ",(0,r.jsx)(n.code,{children:"lightning-node"})," the command you'd have to execute is:"]}),(0,r.jsxs)(n.p,{children:["You can check the Docker container isn't running by running the following command. Notice that we are assuming that your docker container name is the default ",(0,r.jsx)(n.code,{children:"lightning-node"}),". If you have customized the name use the correct selected name:"]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"sudo docker container inspect -f '{{.State.Running}}' lightning-node\n"})})]}),"\n",(0,r.jsx)(n.h2,{id:"reload-the-daemon",children:"Reload the daemon"}),"\n",(0,r.jsx)(n.p,{children:"Reload the daemon by:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"sudo systemctl daemon-reload\n"})}),"\n",(0,r.jsx)(n.h2,{id:"remove-the-systemd-service-unit-file",children:"Remove the Systemd Service Unit file"}),"\n",(0,r.jsx)(n.p,{children:"If you have followed the recommendations, you should find the Systemd Service Unit file at:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"/etc/systemd/system/docker-lightning\n"})}),"\n",(0,r.jsx)(n.p,{children:"To remove the file, run the command:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"sudo rm -f /etc/systemd/system/docker-lightning\n"})}),"\n",(0,r.jsx)(n.h2,{id:"delete-the-docker-image",children:"Delete the Docker image"}),"\n",(0,r.jsxs)(n.p,{children:["For our example, we'll assume that the Docker image for Fleek Network is the default ",(0,r.jsx)(n.code,{children:"lightning-node"}),". If you have created the image under a different name, change in accordance to your preference."]}),"\n",(0,r.jsx)(n.p,{children:"Delete the image by running the following command:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"sudo docker rmi $(docker images | grep 'lightning-node')\n"})}),"\n",(0,r.jsxs)(n.p,{children:["To learn more about the docker image remove command, visit the official documentation ",(0,r.jsx)(n.a,{href:"https://docs.docker.com/engine/reference/commandline/image_rm/",children:"here"})]}),"\n",(0,r.jsx)(n.h2,{id:"uninstall-docker",children:"Uninstall Docker"}),"\n",(0,r.jsx)(n.p,{children:"Uninstalling Docker should only be performed if you don't need in your system. If you already had Docker for some purpose, you should not have to uninstall it."}),"\n",(0,r.jsxs)(n.p,{children:["Visit the Docker official documentation site for uninstall instructions ",(0,r.jsx)(n.a,{href:"https://docs.docker.com/desktop/uninstall/",children:"here"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"manage-keys",children:"Manage keys"}),"\n",(0,r.jsxs)(n.p,{children:["The configuration directory of Fleek Network is in the host machine file system. This is the directory where you can find the ",(0,r.jsx)(n.code,{children:"config.toml"}),", ",(0,r.jsx)(n.code,{children:"keystore"})," for the public keys, amongst others."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"/home//.lightning\n"})}),"\n",(0,r.jsxs)(n.p,{children:["For example, for the user ",(0,r.jsx)(n.code,{children:"lgtn"})," the location of these files is:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"/home/lgtn/.lightning\n"})}),"\n",(0,r.jsx)(n.admonition,{title:"warning",type:"caution",children:(0,r.jsx)(n.p,{children:"The directory can be deleted but have in mind that the keystore is located here. If you need to backup the keystore, be careful as this is not possible to recover by anyone. The keys are your responsibility."})}),"\n",(0,r.jsxs)(n.p,{children:["To learn more about the keystore read the guide ",(0,r.jsx)(n.a,{href:"/guides/Node%20Operators/managing-the-keystore",children:"managing the keystore"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["If you are happy to delete the directory, run the following command by replacing the ",(0,r.jsx)(n.code,{children:""})," by yours:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"rm -rf /home//.lightning\n"})}),"\n",(0,r.jsx)(n.h2,{id:"remove-the-logs",children:"Remove the logs"}),"\n",(0,r.jsx)(n.p,{children:"The Docker container generates output to stdout and stderr. All the content is stored in the location:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"/var/log/lightning\n"})}),"\n",(0,r.jsx)(n.p,{children:"To completely remove the directory run the command:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"sudo rm -rf /var/log/lightning\n"})}),"\n",(0,r.jsx)(i.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function m(e={}){const{wrapper:n}={...(0,o.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},3872:(e,n,t)=>{t.d(n,{Z:()=>o});t(7294);var r=t(5893);const o=e=>{let{image:n,name:t,title:o,url:i,communityMember:s=!1}=e;return(0,r.jsx)("section",{className:"author_card",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"avatar",children:(0,r.jsx)("a",{href:i,target:"_blank",alt:t,children:(0,r.jsx)("img",{src:n,alt:t})})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"name",children:(0,r.jsx)("a",{href:i,target:"_blank",alt:t,children:t})}),(0,r.jsx)("span",{className:"title",children:o}),(0,r.jsxs)("span",{className:"discord",children:[s?"Join our community on":"Got questions? Find us on"," ",(0,r.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>s});var r=t(7294);const o={},i=r.createContext(o);function s(e){const n=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),r.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/b2f554cd.6b9ee749.js b/assets/js/b2f554cd.9e330ffd.js similarity index 99% rename from assets/js/b2f554cd.6b9ee749.js rename to assets/js/b2f554cd.9e330ffd.js index 20d7cbbc8..fd8e1a498 100644 --- a/assets/js/b2f554cd.6b9ee749.js +++ b/assets/js/b2f554cd.9e330ffd.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[1477],{10:e=>{e.exports=JSON.parse('{"blogPosts":[{"id":"bloom-and-cuckoo-filters-for-cache-summarization","metadata":{"permalink":"/blog/bloom-and-cuckoo-filters-for-cache-summarization","source":"@site/blog/bloom-and-cuckoo-filters-for-cache-summarization.md","title":"Bloom Filters and Cuckoo Filters for Cache Summarization","description":"Summary of our experiment informing whether or not we should replace our implementation of Counting Bloom filters with Cuckoo filters.","date":"2023-11-07T18:40:34.000Z","formattedDate":"November 7, 2023","tags":[{"label":"fleek network","permalink":"/blog/tags/fleek-network"},{"label":"blog","permalink":"/blog/tags/blog"},{"label":"engineering","permalink":"/blog/tags/engineering"},{"label":"content routing","permalink":"/blog/tags/content-routing"}],"readingTime":10.37,"hasTruncateMarker":true,"authors":[{"name":"Matthias Wright","title":"Software Engineer","url":"https://github.com/matthias-wright","image_url":"https://github.com/matthias-wright.png","imageURL":"https://github.com/matthias-wright.png"}],"frontMatter":{"title":"Bloom Filters and Cuckoo Filters for Cache Summarization","description":"Summary of our experiment informing whether or not we should replace our implementation of Counting Bloom filters with Cuckoo filters.","slug":"bloom-and-cuckoo-filters-for-cache-summarization","image":"./assets/bloom-cuckoo/bloom.png?202301181528","authors":{"name":"Matthias Wright","title":"Software Engineer","url":"https://github.com/matthias-wright","image_url":"https://github.com/matthias-wright.png","imageURL":"https://github.com/matthias-wright.png"},"tags":["fleek network","blog","engineering","content routing"]},"unlisted":false},"content":"Disclaimer: This is not a general comparison between Bloom filters and Cuckoo filters. This blog post summarizes some of the experiments we conducted to decide whether or not we should replace our implementation of Counting Bloom filters with Cuckoo filters, for a specific use case.\\n\\n\x3c!--truncate--\x3e\\n\\n## Background\\n\\nNodes on Fleek Network currently use Counting Bloom filters to summarize their cached content. These cache summaries are exchanged with other nodes in order to facilitate content routing.\\n\\nIf a particular node does not store a requested piece of content, it can use the Bloom filters that it received from its peers to check if a peer stores the requested content.\\n\\nWe are using Counting Bloom filters rather than regular Bloom filters because we need to be able to remove elements from the filter to support cache eviction.\\n\\n## Bloom Filters\\n\\nA Bloom filter is a space-efficient probabilistic data structure that can be used to perform approximate set membership queries.\\nThe answer to an approximate set membership query is not `no` or `yes,` but rather `no` or `probably.` This `probably` is quantified with the false positive rate. \\n\\nOne of the convenient features of Bloom filters is that they can be configured to have a specific false positive rate.\\nOf course, there is a tradeoff here; the lower the false positive rate, the larger the memory footprint. Bloom filters support two operations: `insert` and `contains.` \\n\\nA Bloom filter is represented by an array of m bits together with k independent hash functions. To insert an element into the filter, it is hashed with each of the k hash functions.\\nThe resulting hashes are interpreted as integers (modulo m) to obtain k array positions. The bits at these positions are then set to 1 (if there aren\'t already 1). \\nTo check whether or not an element is contained in the filter, the element is hashed k times with the different hash functions.\\n\\nIf all bits at the resulting array positions are 1, the element is assumed to be present. If any of the k bits are zero, we can be certain that the queried element is not present in the set.\\n\\nHowever, even if all bits are 1, it might still be the case that the bits were set by a combination of other elements. This is where the aforementioned false positive rate comes into play. \\n\\nSince we also need a `remove` operation for our use case, we have been using Counting Bloom filters, a variant of Bloom filters.\\nCounting Bloom filters retain most of the properties that regular Bloom filters have. The `remove` operation comes at the cost of an increased memory footprint.\\n\\nEach position in the array is no longer a single bit but a group of bits representing a counter.\\nWhenever an element is inserted into the filter, the counters for all k positions are incremented by 1. To remove an element, we decrement the counters.\\n\\n## Cuckoo Filters\\n\\nBloom filters are the most known members of a class of data structures called Approximate Membership Query Filters (AMQ Filters).\\nA relatively recent addition to this class is the Cuckoo filter [1]. Cuckoo filters share many similarities with Bloom filters, especially Counting Bloom filters.\\n\\nThey are space-efficient and can be used for approximate set membership queries. Cuckoo filters also support the operations `insert,` `contains,` and `remove,` and have configurable false positive rates. \\n\\nCuckoo filters are based on Cuckoo hash tables [2] and leverage an optimization called partial-key cuckoo hashing. A basic Cuckoo hash table consists of an array of buckets.\\nWe determine two candidate buckets for each element using two different hash functions, h1 and h2. \\n\\nThe `contains` operation will check if either bucket contains the element.\\nFor insertion, if either bucket is empty, the element will be inserted into the empty bucket.\\n\\nIf neither bucket is empty, one of the buckets is selected, and the existing element is removed and inserted into its alternate location.\\nThis may trigger another relocation if the alternate location is not empty. \\n\\nAlthough the insertion operation may perform a sequence of relocations, the amortized runtime is O(1). \\n\\nMost implementations of Cuckoo hash tables and, consequently, Cuckoo filters will use buckets that can hold multiple elements, as proposed in [3].\\n\\nFor Cuckoo filters, the hash table size is reduced by only storing fingerprints - a bit string calculated from an element\'s hash - rather than key-value pairs.\\n\\nThe fingerprint size is derived from the desired false positive rate. \\nA problem that arises is that, to relocate existing fingerprints using the Cuckoo hashing approach described above, we need the original hash from which the fingerprint was derived.\\n\\nOf course, we could store this hash somewhere, but the whole point of using fingerprints is to reduce the memory footprint of the filter.\\n\\nThe solution to this predicament is the aforementioned partial-key cuckoo hashing, a technique for determining an element\'s alternate location using only its fingerprint. \\nFor a given element x, the two candidate buckets are computed as follows: \\n\\n\\n\x3c!-- \\nTODO: Install math forms renderer, till then use img\\n\\n$h_1(x) = \\\\text{hash}(x)$\\n\\n$h_2(x) = h_1(x) \\\\oplus \\\\text{hash}(\\\\text{fingerprint}(x))$\\n--\x3e\\n\\n![](./assets/bloom-cuckoo/math-formul.png?202301181528)\\n\\nAn important property of this technique is that h1(x) can also be computed from h2(x) and the fingerprint.\\n\\n## Benchmarking\\n\\nAs this post mentioned, we are not aiming for a general comparison of Counting Bloom and Cuckoo filters.\\n\\nInstead, we want to determine which filter suits our specific use case better. The two main properties we are looking for are space efficiency and lookup performance. \\n\\nSpace efficiency is important because nodes frequently update their cache and have to communicate these changes with their peers. These messages should take up as little bandwidth as possible.\\n\\nLookup speed is also important because Fleek Network aims to serve user requests as quickly as possible. Checking whether a peer has some content stored in their cache summary should not be a bottleneck. \\n\\n## Experimental Setup\\n\\nWe are using our own Counting Bloom filter [implementation](https://github.com/fleek-network/ursa/blob/483f4d56cbaa5e83182454d2c1db6f6af7c54912/crates/ursa-network/src/utils/bloom_filter.rs#L11) and [scalable cuckoo filter](https://github.com/sile/scalable_cuckoo_filter?gh) Cuckoo filter implementation in Rust, the [original cuckoofilter](https://github.com/efficient/cuckoofilter?gh) implementation is in C++. All experiments were performed on a Linux machine with 16 GB RAM and an Intel Core i7 (10th Gen). Whenever the experiment is probabilistic, we repeat the experiment 20 times and report the mean and standard deviation.\\n\\n## Memory Footprint\\n\\nFor both Counting Bloom filters and Cuckoo filters, the memory footprint is determined by two factors: the filter\'s capacity and the desired false positive rate. In the first experiment, we examine the impact that\\nthese factors have on the memory footprint. \\n\\nTo this end, we fix the false positive rate and initialize the filters with capacities ranging from 100K to 1M. The result is shown in Fig. 1. \\nThe size of Bloom filters scales linearly with the capacity. Cuckoo filters are more space-efficient. This result is consistent with the experiments reported in [1].\\n\\n![](./assets/bloom-cuckoo/capacity-size.png?202301121718)\\n\\n> Figure 1: We fix the false positive rate and initialize the filters with capacities ranging from 100K to 1M. The y-axis shows the size of the filters in Megabytes.\\n\\nNext, we fix the capacity and initialize the filters with false positive rates ranging from 0.0001 to 0.5. Fig. 2 shows that Cuckoo filters are more space-efficient.\\n\\nThe gap between Counting Bloom filters and Cuckoo filters grows as the false positive rate decreases. This is also consistent with experiments in [1].\\n\\n![](./assets/bloom-cuckoo/fp-rate-size.png?202301121718)\\n\\n> Figure 2: We fix the capacity and initialize the filters with false positive rates ranging from 0.0001 to 0.5. The y-axis shows the size of the filters in Megabytes.\\n\\n## Lookup Performance\\n\\nWe first add elements to both filters until the capacity is reached. We then measure the lookup performance for different ratios of positive and negative lookups.\\n\\nA positive lookup is for an existing element, and a negative lookup is for an element not contained in the filter. We perform 100K lookups for each ratio and report the average lookup duration and standard deviation. \\n\\nFig. 3 shows the results. Bloom filters perform slightly better on average than Cuckoo filters. This result is inconsistent with [1],\\nwhere Cuckoo filters were reported to have a better lookup performance than Bloom filters. It should be noted here that the authors in [1] use the original C++ Cuckoo filter implementation and their own unreleased Bloom filter implementation. In contrast, we use a Rust Cuckoo filter implementation and our Bloom filter implementation. We cannot easily determine the reason for this discrepancy.\\n\\nHowever, the performance difference is negligible.\\n\\n![](./assets/bloom-cuckoo/lookup.png?202301121718)\\n\\n> Figure 3: Lookup performance for different ratios of positive and negative lookups. For example, ratio 0.25 indicates that 25% of lookups are positive and 75% are negative.\\nThe shaded region indicates the standard deviation.\\n\\n## Insertion Performance\\n\\nLess critical than lookup performance but still important for our purposes is insertion performance. We measure how the insertion performance varies for different occupancy levels.\\nFig. 4 shows the results. The insertion performance is constant across all levels of occupancy for Bloom filters.\\n\\nFor Cuckoo filters, the performance decreases as the filter becomes fuller because more relocations are required. In Fig. 4, the performance for Bloom filters is not constant. It quickly increases and then remains constant. This can be explained by CPU caching. \\n\\n![](./assets/bloom-cuckoo/insert.png?202301121718)\\n\\n> Figure 4: Insertion performance for different occupancy levels. The shaded region indicates the standard deviation.\\n\\n## Capacity and Scaling\\n\\nWe have mentioned the capacity of a filter several times now. An interesting case is what happens when a filter\'s capacity is exceeded.\\nBloom filters and Cuckoo filters behave differently in this scenario.\\n\\nFor Bloom filters, the `insertion` operation always succeeds. However, the false positive rate will rapidly increase as we exceed the filter\'s capacity. While Bloom filters fail silently, Cuckoo filters are more explicit. Most implementations have a maximum number of\\nrelocations that will be performed for an insertion. The `insertion` operation will return an error if more relocations are required. \\n\\nFor both filters, we can avoid this problem by simply initializing the filter with a sufficiently large capacity. However, this will increase the memory footprint of the filter.\\n\\nFurthermore, it is difficult to predict how many elements a node on Fleek Network will cache. It is also likely that the number of cached elements will greatly vary for different nodes. \\n\\nFortunately, a variant of Bloom filters called Scalable Bloom Filters [4] can adapt dynamically to the number of elements stored while guaranteeing a maximum false positive rate.\\n\\nThe proposed technique is also applicable to Cuckoo filters.\\n\\n## Other Filters\\n\\nWhile we only looked at Bloom filters and Cuckoo filters, there are other AMQ filters that we want to mention here briefly:\\n\\n* Quotient filters [5, 6]: Compact hash tables that support insertion, lookup, and deletion. Less space-efficient than Bloom filters and Cuckoo filters. \\n\\n* XOR filters [7]: More space-efficient than Bloom filters and Cuckoo filters. However, they are static, meaning the filter has to be rebuilt if additional elements are added. \\n\\n## Conclusion\\n\\nWe examined whether Counting Bloom filters or Cuckoo filters are more suitable for summarizing caches on Fleek Network. Cuckoo filters are more space-efficient, especially for lower false positive rates. Bloom filters have a slightly better insertion and lookup performance for the implementations we tested.\\n\\nBoth filters can be adapted to grow and shrink in size dynamically. Since the difference in insertion and lookup performance is negligible while Cuckoo filters are significantly more space-efficient, we favor Cuckoo filters for our use case. \\n\\n### References\\n\\n[1] Bin Fan, Dave G. Andersen, Michael Kaminsky, and Michael D. Mitzenmacher. Cuckoo Filter: Practically Better Than Bloom.\\nIn Proceedings of the 10th ACM International Conference on emerging Networking Experiments and Technologies (CoNEXT 14). Association for Computing Machinery, New York, NY, USA, pp. 75-88, 2014. \\n\\n[2] Rasmus Pagha and Flemming Friche Rodler. Cuckoo hashing. Journal of Algorithms, 51(2), pp. 122-144, 2004. \\n\\n[3] Martin Dietzfelbinger and Christoph Weidling. Balanced Allocation and Dictionaries with Tightly Packed Constant Size Bins. Theoretical Computer Science, 380(1), pp. 47-68, 2007. \\n\\n[4] Paulo S. Almeida, Carlos Baquero, Nuno Pregui\xe7a, and David Hutchison. Scalable Bloom Filters. Information Processing Letters, 101(6), pp. 255-261, 2007. \\n\\n[5] John G. Cleary. Compact hash tables using bidirectional linear probing. IEEE Transactions on Computers. 33(9), pp. 828-834, 1984. \\n\\n[6] Anna Pagh, Rasmus Pagh, and S. Srinivasa Rao. An optimal Bloom filter replacement. Proceedings of the Sixteenth Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 823-829, 2005. \\n \\n[7] Thomas Mueller Graf and Daniel Lemire. Xor Filters: Faster and Smaller Than Bloom and Cuckoo Filters. ACM Journal of Experimental Algorithmics. 25, pp. 1-16, 2020."}]}')}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[1477],{10:e=>{e.exports=JSON.parse('{"blogPosts":[{"id":"bloom-and-cuckoo-filters-for-cache-summarization","metadata":{"permalink":"/blog/bloom-and-cuckoo-filters-for-cache-summarization","source":"@site/blog/bloom-and-cuckoo-filters-for-cache-summarization.md","title":"Bloom Filters and Cuckoo Filters for Cache Summarization","description":"Summary of our experiment informing whether or not we should replace our implementation of Counting Bloom filters with Cuckoo filters.","date":"2023-11-07T19:16:06.000Z","formattedDate":"November 7, 2023","tags":[{"label":"fleek network","permalink":"/blog/tags/fleek-network"},{"label":"blog","permalink":"/blog/tags/blog"},{"label":"engineering","permalink":"/blog/tags/engineering"},{"label":"content routing","permalink":"/blog/tags/content-routing"}],"readingTime":10.37,"hasTruncateMarker":true,"authors":[{"name":"Matthias Wright","title":"Software Engineer","url":"https://github.com/matthias-wright","image_url":"https://github.com/matthias-wright.png","imageURL":"https://github.com/matthias-wright.png"}],"frontMatter":{"title":"Bloom Filters and Cuckoo Filters for Cache Summarization","description":"Summary of our experiment informing whether or not we should replace our implementation of Counting Bloom filters with Cuckoo filters.","slug":"bloom-and-cuckoo-filters-for-cache-summarization","image":"./assets/bloom-cuckoo/bloom.png?202301181528","authors":{"name":"Matthias Wright","title":"Software Engineer","url":"https://github.com/matthias-wright","image_url":"https://github.com/matthias-wright.png","imageURL":"https://github.com/matthias-wright.png"},"tags":["fleek network","blog","engineering","content routing"]},"unlisted":false},"content":"Disclaimer: This is not a general comparison between Bloom filters and Cuckoo filters. This blog post summarizes some of the experiments we conducted to decide whether or not we should replace our implementation of Counting Bloom filters with Cuckoo filters, for a specific use case.\\n\\n\x3c!--truncate--\x3e\\n\\n## Background\\n\\nNodes on Fleek Network currently use Counting Bloom filters to summarize their cached content. These cache summaries are exchanged with other nodes in order to facilitate content routing.\\n\\nIf a particular node does not store a requested piece of content, it can use the Bloom filters that it received from its peers to check if a peer stores the requested content.\\n\\nWe are using Counting Bloom filters rather than regular Bloom filters because we need to be able to remove elements from the filter to support cache eviction.\\n\\n## Bloom Filters\\n\\nA Bloom filter is a space-efficient probabilistic data structure that can be used to perform approximate set membership queries.\\nThe answer to an approximate set membership query is not `no` or `yes,` but rather `no` or `probably.` This `probably` is quantified with the false positive rate. \\n\\nOne of the convenient features of Bloom filters is that they can be configured to have a specific false positive rate.\\nOf course, there is a tradeoff here; the lower the false positive rate, the larger the memory footprint. Bloom filters support two operations: `insert` and `contains.` \\n\\nA Bloom filter is represented by an array of m bits together with k independent hash functions. To insert an element into the filter, it is hashed with each of the k hash functions.\\nThe resulting hashes are interpreted as integers (modulo m) to obtain k array positions. The bits at these positions are then set to 1 (if there aren\'t already 1). \\nTo check whether or not an element is contained in the filter, the element is hashed k times with the different hash functions.\\n\\nIf all bits at the resulting array positions are 1, the element is assumed to be present. If any of the k bits are zero, we can be certain that the queried element is not present in the set.\\n\\nHowever, even if all bits are 1, it might still be the case that the bits were set by a combination of other elements. This is where the aforementioned false positive rate comes into play. \\n\\nSince we also need a `remove` operation for our use case, we have been using Counting Bloom filters, a variant of Bloom filters.\\nCounting Bloom filters retain most of the properties that regular Bloom filters have. The `remove` operation comes at the cost of an increased memory footprint.\\n\\nEach position in the array is no longer a single bit but a group of bits representing a counter.\\nWhenever an element is inserted into the filter, the counters for all k positions are incremented by 1. To remove an element, we decrement the counters.\\n\\n## Cuckoo Filters\\n\\nBloom filters are the most known members of a class of data structures called Approximate Membership Query Filters (AMQ Filters).\\nA relatively recent addition to this class is the Cuckoo filter [1]. Cuckoo filters share many similarities with Bloom filters, especially Counting Bloom filters.\\n\\nThey are space-efficient and can be used for approximate set membership queries. Cuckoo filters also support the operations `insert,` `contains,` and `remove,` and have configurable false positive rates. \\n\\nCuckoo filters are based on Cuckoo hash tables [2] and leverage an optimization called partial-key cuckoo hashing. A basic Cuckoo hash table consists of an array of buckets.\\nWe determine two candidate buckets for each element using two different hash functions, h1 and h2. \\n\\nThe `contains` operation will check if either bucket contains the element.\\nFor insertion, if either bucket is empty, the element will be inserted into the empty bucket.\\n\\nIf neither bucket is empty, one of the buckets is selected, and the existing element is removed and inserted into its alternate location.\\nThis may trigger another relocation if the alternate location is not empty. \\n\\nAlthough the insertion operation may perform a sequence of relocations, the amortized runtime is O(1). \\n\\nMost implementations of Cuckoo hash tables and, consequently, Cuckoo filters will use buckets that can hold multiple elements, as proposed in [3].\\n\\nFor Cuckoo filters, the hash table size is reduced by only storing fingerprints - a bit string calculated from an element\'s hash - rather than key-value pairs.\\n\\nThe fingerprint size is derived from the desired false positive rate. \\nA problem that arises is that, to relocate existing fingerprints using the Cuckoo hashing approach described above, we need the original hash from which the fingerprint was derived.\\n\\nOf course, we could store this hash somewhere, but the whole point of using fingerprints is to reduce the memory footprint of the filter.\\n\\nThe solution to this predicament is the aforementioned partial-key cuckoo hashing, a technique for determining an element\'s alternate location using only its fingerprint. \\nFor a given element x, the two candidate buckets are computed as follows: \\n\\n\\n\x3c!-- \\nTODO: Install math forms renderer, till then use img\\n\\n$h_1(x) = \\\\text{hash}(x)$\\n\\n$h_2(x) = h_1(x) \\\\oplus \\\\text{hash}(\\\\text{fingerprint}(x))$\\n--\x3e\\n\\n![](./assets/bloom-cuckoo/math-formul.png?202301181528)\\n\\nAn important property of this technique is that h1(x) can also be computed from h2(x) and the fingerprint.\\n\\n## Benchmarking\\n\\nAs this post mentioned, we are not aiming for a general comparison of Counting Bloom and Cuckoo filters.\\n\\nInstead, we want to determine which filter suits our specific use case better. The two main properties we are looking for are space efficiency and lookup performance. \\n\\nSpace efficiency is important because nodes frequently update their cache and have to communicate these changes with their peers. These messages should take up as little bandwidth as possible.\\n\\nLookup speed is also important because Fleek Network aims to serve user requests as quickly as possible. Checking whether a peer has some content stored in their cache summary should not be a bottleneck. \\n\\n## Experimental Setup\\n\\nWe are using our own Counting Bloom filter [implementation](https://github.com/fleek-network/ursa/blob/483f4d56cbaa5e83182454d2c1db6f6af7c54912/crates/ursa-network/src/utils/bloom_filter.rs#L11) and [scalable cuckoo filter](https://github.com/sile/scalable_cuckoo_filter?gh) Cuckoo filter implementation in Rust, the [original cuckoofilter](https://github.com/efficient/cuckoofilter?gh) implementation is in C++. All experiments were performed on a Linux machine with 16 GB RAM and an Intel Core i7 (10th Gen). Whenever the experiment is probabilistic, we repeat the experiment 20 times and report the mean and standard deviation.\\n\\n## Memory Footprint\\n\\nFor both Counting Bloom filters and Cuckoo filters, the memory footprint is determined by two factors: the filter\'s capacity and the desired false positive rate. In the first experiment, we examine the impact that\\nthese factors have on the memory footprint. \\n\\nTo this end, we fix the false positive rate and initialize the filters with capacities ranging from 100K to 1M. The result is shown in Fig. 1. \\nThe size of Bloom filters scales linearly with the capacity. Cuckoo filters are more space-efficient. This result is consistent with the experiments reported in [1].\\n\\n![](./assets/bloom-cuckoo/capacity-size.png?202301121718)\\n\\n> Figure 1: We fix the false positive rate and initialize the filters with capacities ranging from 100K to 1M. The y-axis shows the size of the filters in Megabytes.\\n\\nNext, we fix the capacity and initialize the filters with false positive rates ranging from 0.0001 to 0.5. Fig. 2 shows that Cuckoo filters are more space-efficient.\\n\\nThe gap between Counting Bloom filters and Cuckoo filters grows as the false positive rate decreases. This is also consistent with experiments in [1].\\n\\n![](./assets/bloom-cuckoo/fp-rate-size.png?202301121718)\\n\\n> Figure 2: We fix the capacity and initialize the filters with false positive rates ranging from 0.0001 to 0.5. The y-axis shows the size of the filters in Megabytes.\\n\\n## Lookup Performance\\n\\nWe first add elements to both filters until the capacity is reached. We then measure the lookup performance for different ratios of positive and negative lookups.\\n\\nA positive lookup is for an existing element, and a negative lookup is for an element not contained in the filter. We perform 100K lookups for each ratio and report the average lookup duration and standard deviation. \\n\\nFig. 3 shows the results. Bloom filters perform slightly better on average than Cuckoo filters. This result is inconsistent with [1],\\nwhere Cuckoo filters were reported to have a better lookup performance than Bloom filters. It should be noted here that the authors in [1] use the original C++ Cuckoo filter implementation and their own unreleased Bloom filter implementation. In contrast, we use a Rust Cuckoo filter implementation and our Bloom filter implementation. We cannot easily determine the reason for this discrepancy.\\n\\nHowever, the performance difference is negligible.\\n\\n![](./assets/bloom-cuckoo/lookup.png?202301121718)\\n\\n> Figure 3: Lookup performance for different ratios of positive and negative lookups. For example, ratio 0.25 indicates that 25% of lookups are positive and 75% are negative.\\nThe shaded region indicates the standard deviation.\\n\\n## Insertion Performance\\n\\nLess critical than lookup performance but still important for our purposes is insertion performance. We measure how the insertion performance varies for different occupancy levels.\\nFig. 4 shows the results. The insertion performance is constant across all levels of occupancy for Bloom filters.\\n\\nFor Cuckoo filters, the performance decreases as the filter becomes fuller because more relocations are required. In Fig. 4, the performance for Bloom filters is not constant. It quickly increases and then remains constant. This can be explained by CPU caching. \\n\\n![](./assets/bloom-cuckoo/insert.png?202301121718)\\n\\n> Figure 4: Insertion performance for different occupancy levels. The shaded region indicates the standard deviation.\\n\\n## Capacity and Scaling\\n\\nWe have mentioned the capacity of a filter several times now. An interesting case is what happens when a filter\'s capacity is exceeded.\\nBloom filters and Cuckoo filters behave differently in this scenario.\\n\\nFor Bloom filters, the `insertion` operation always succeeds. However, the false positive rate will rapidly increase as we exceed the filter\'s capacity. While Bloom filters fail silently, Cuckoo filters are more explicit. Most implementations have a maximum number of\\nrelocations that will be performed for an insertion. The `insertion` operation will return an error if more relocations are required. \\n\\nFor both filters, we can avoid this problem by simply initializing the filter with a sufficiently large capacity. However, this will increase the memory footprint of the filter.\\n\\nFurthermore, it is difficult to predict how many elements a node on Fleek Network will cache. It is also likely that the number of cached elements will greatly vary for different nodes. \\n\\nFortunately, a variant of Bloom filters called Scalable Bloom Filters [4] can adapt dynamically to the number of elements stored while guaranteeing a maximum false positive rate.\\n\\nThe proposed technique is also applicable to Cuckoo filters.\\n\\n## Other Filters\\n\\nWhile we only looked at Bloom filters and Cuckoo filters, there are other AMQ filters that we want to mention here briefly:\\n\\n* Quotient filters [5, 6]: Compact hash tables that support insertion, lookup, and deletion. Less space-efficient than Bloom filters and Cuckoo filters. \\n\\n* XOR filters [7]: More space-efficient than Bloom filters and Cuckoo filters. However, they are static, meaning the filter has to be rebuilt if additional elements are added. \\n\\n## Conclusion\\n\\nWe examined whether Counting Bloom filters or Cuckoo filters are more suitable for summarizing caches on Fleek Network. Cuckoo filters are more space-efficient, especially for lower false positive rates. Bloom filters have a slightly better insertion and lookup performance for the implementations we tested.\\n\\nBoth filters can be adapted to grow and shrink in size dynamically. Since the difference in insertion and lookup performance is negligible while Cuckoo filters are significantly more space-efficient, we favor Cuckoo filters for our use case. \\n\\n### References\\n\\n[1] Bin Fan, Dave G. Andersen, Michael Kaminsky, and Michael D. Mitzenmacher. Cuckoo Filter: Practically Better Than Bloom.\\nIn Proceedings of the 10th ACM International Conference on emerging Networking Experiments and Technologies (CoNEXT 14). Association for Computing Machinery, New York, NY, USA, pp. 75-88, 2014. \\n\\n[2] Rasmus Pagha and Flemming Friche Rodler. Cuckoo hashing. Journal of Algorithms, 51(2), pp. 122-144, 2004. \\n\\n[3] Martin Dietzfelbinger and Christoph Weidling. Balanced Allocation and Dictionaries with Tightly Packed Constant Size Bins. Theoretical Computer Science, 380(1), pp. 47-68, 2007. \\n\\n[4] Paulo S. Almeida, Carlos Baquero, Nuno Pregui\xe7a, and David Hutchison. Scalable Bloom Filters. Information Processing Letters, 101(6), pp. 255-261, 2007. \\n\\n[5] John G. Cleary. Compact hash tables using bidirectional linear probing. IEEE Transactions on Computers. 33(9), pp. 828-834, 1984. \\n\\n[6] Anna Pagh, Rasmus Pagh, and S. Srinivasa Rao. An optimal Bloom filter replacement. Proceedings of the Sixteenth Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 823-829, 2005. \\n \\n[7] Thomas Mueller Graf and Daniel Lemire. Xor Filters: Faster and Smaller Than Bloom and Cuckoo Filters. ACM Journal of Experimental Algorithmics. 25, pp. 1-16, 2020."}]}')}}]); \ No newline at end of file diff --git a/assets/js/b35f1b7f.b5350077.js b/assets/js/b35f1b7f.c3162db4.js similarity index 99% rename from assets/js/b35f1b7f.b5350077.js rename to assets/js/b35f1b7f.c3162db4.js index e76c66ba6..792848e76 100644 --- a/assets/js/b35f1b7f.b5350077.js +++ b/assets/js/b35f1b7f.c3162db4.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[7706],{9747:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>o,contentTitle:()=>l,default:()=>u,frontMatter:()=>c,metadata:()=>d,toc:()=>a});var n=t(5893),r=t(1151),i=t(3872);const c={title:"User service",slug:"user-service",hide_title:!0,tags:["references","help","user service","unit","systemctl","systemd"]},l=void 0,d={id:"Systemd/user-service",title:"User service",description:"A user should have the ability to run a Systemd user service unit without having to use sudo to control it.",source:"@site/references/Systemd/user-service.md",sourceDirName:"Systemd",slug:"/Systemd/user-service",permalink:"/references/Systemd/user-service",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Systemd/user-service.md",tags:[{label:"references",permalink:"/references/tags/references"},{label:"help",permalink:"/references/tags/help"},{label:"user service",permalink:"/references/tags/user-service"},{label:"unit",permalink:"/references/tags/unit"},{label:"systemctl",permalink:"/references/tags/systemctl"},{label:"systemd",permalink:"/references/tags/systemd"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"User service",slug:"user-service",hide_title:!0,tags:["references","help","user service","unit","systemctl","systemd"]},sidebar:"defaultSidebar",previous:{title:"Shutting down persistance",permalink:"/references/Systemd/shutting-down-persistance"}},o={},a=[{value:"Check --user support",id:"check---user-support",level:2},{value:"Put the service unit in the user service",id:"put-the-service-unit-in-the-user-service",level:2},{value:"Reload daemon",id:"reload-daemon",level:2},{value:"Systemd service control as --user",id:"systemd-service-control-as---user",level:2},{value:"Problem statement",id:"problem-statement",level:2}];function h(e){const s={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,r.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(s.p,{children:["A user should have the ability to run a Systemd user service unit without having to use ",(0,n.jsx)(s.code,{children:"sudo"})," to control it."]}),"\n",(0,n.jsxs)(s.h2,{id:"check---user-support",children:["Check ",(0,n.jsx)(s.code,{children:"--user"})," support"]}),"\n",(0,n.jsxs)(s.p,{children:["Use the ",(0,n.jsx)(s.code,{children:"--user"})," flag when getting the list of unit files."]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"systemctl --user list-unit-files\n"})}),"\n",(0,n.jsx)(s.p,{children:"It should return a list of unit files."}),"\n",(0,n.jsx)(s.h2,{id:"put-the-service-unit-in-the-user-service",children:"Put the service unit in the user service"}),"\n",(0,n.jsx)(s.p,{children:"Create the Systemd user units directory:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"sudo mkdir -p /etc/systemd/system/user\n"})}),"\n",(0,n.jsxs)(s.p,{children:["Move the ",(0,n.jsx)(s.code,{children:"lightning.service"})," to the system user unit service directory:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"mv /etc/systemd/system/lightning.service /etc/systemd/system/user/lightning.service\n"})}),"\n",(0,n.jsxs)(s.p,{children:["Check the ",(0,n.jsx)(s.strong,{children:"Load path when running in user mode (--user)"})," in ",(0,n.jsx)(s.a,{href:"https://www.freedesktop.org/software/systemd/man/systemd.unit.html",children:"Systemd unit"})," for other alternative user paths, or to understand how it works to customize your server accordingly."]}),"\n",(0,n.jsx)(s.h2,{id:"reload-daemon",children:"Reload daemon"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"sudo systemctl daemon-reload\n"})}),"\n",(0,n.jsxs)(s.h2,{id:"systemd-service-control-as---user",children:["Systemd service control as ",(0,n.jsx)(s.code,{children:"--user"})]}),"\n",(0,n.jsx)(s.p,{children:"Reload the Systemctl daemon by executing the command:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"systemctl --user daemon-reload\n"})}),"\n",(0,n.jsx)(s.p,{children:"Enable the service for starting up on system boot:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"systemctl --user enable lightning.service\n"})}),"\n",(0,n.jsx)(s.p,{children:"Start the service by:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"systemctl --user start lightning\n"})}),"\n",(0,n.jsx)(s.p,{children:"Stop the service by:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"systemctl --user stop lightning\n"})}),"\n",(0,n.jsx)(s.p,{children:"Restart the service by:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"systemctl --user restart lightning\n"})}),"\n",(0,n.jsx)(s.p,{children:"Check the service status by:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"systemctl --user status lightning.service\n"})}),"\n",(0,n.jsx)(s.h2,{id:"problem-statement",children:"Problem statement"}),"\n",(0,n.jsxs)(s.p,{children:["On tests done in a DigitalOcean Ubuntu 22.x, we had set up user-level services which were operated with ",(0,n.jsx)(s.code,{children:"--user"}),". When the commands were executed as ",(0,n.jsx)(s.code,{children:"--user"})," it failed with:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"Failed to connect to bus: Operation not permitted (consider using --machine=@.host --user to connect to bus of other user)\n"})}),"\n",(0,n.jsx)(s.p,{children:"The user should be able to operate as user, it shouldn't be required to connect on behalf of other users. This means that even for a simple command, such as to retrieve the list of unit files:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"systemctl --user list-unit-files\n"})}),"\n",(0,n.jsx)(s.p,{children:"We'd get the error:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"Failed to connect to bus: Operation not permitted (consider using --machine=@.host --user to connect to bus of other user)\n"})}),"\n",(0,n.jsxs)(s.p,{children:["For any of the supported user unit locations e.g. $HOME/.config/systemd/user as documented in ",(0,n.jsx)(s.a,{href:"https://www.freedesktop.org/software/systemd/man/systemd.unit.html",children:"Systemd unit documentation"}),", the result is the error above."]}),"\n",(0,n.jsxs)(s.p,{children:["This is related to the load paths when running in user mode (--user), as described in the discussion ",(0,n.jsx)(s.a,{href:"https://unix.stackexchange.com/questions/224992/where-do-i-put-my-systemd-unit-file/367237#367237",children:"here"}),"."]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.strong,{children:"User-dependent"})}),"\n",(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.strong,{children:"$XDG_CONFIG_HOME/systemd/user"})," User configuration (only used when $XDG_CONFIG_HOME is set)"]}),"\n",(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.strong,{children:"$HOME/.config/systemd/user"})," User configuration (only used when $XDG_CONFIG_HOME is not set)"]}),"\n",(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.strong,{children:"$XDG_RUNTIME_DIR/systemd/user"})," Runtime units (only used when $XDG_RUNTIME_DIR is set)"]}),"\n",(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.strong,{children:"$XDG_DATA_HOME/systemd/user"})," Units of packages that have been installed in the home directory (only used when $XDG_DATA_HOME is set)"]}),"\n",(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.strong,{children:"$HOME/.local/share/systemd/user"})," Units of packages that have been installed in the home directory (only used when $XDG_DATA_HOME is not set)"]}),"\n",(0,n.jsxs)(s.p,{children:["For example, if we check the ",(0,n.jsx)(s.code,{children:"$XDG_RUNTIME_DIR"})," in a DigitalOcean box, we get the following output:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"/run/user/0\n"})}),"\n",(0,n.jsx)(s.p,{children:"For this reason and to provide support for a wider audience of users and systems, we've stuck to sudo to execute the service, but this should not be a requirement and is not recommended."}),"\n",(0,n.jsx)(i.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function u(e={}){const{wrapper:s}={...(0,r.a)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},3872:(e,s,t)=>{t.d(s,{Z:()=>r});t(7294);var n=t(5893);const r=e=>{let{image:s,name:t,title:r,url:i,communityMember:c=!1}=e;return(0,n.jsx)("section",{className:"author_card",children:(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"avatar",children:(0,n.jsx)("a",{href:i,target:"_blank",alt:t,children:(0,n.jsx)("img",{src:s,alt:t})})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"name",children:(0,n.jsx)("a",{href:i,target:"_blank",alt:t,children:t})}),(0,n.jsx)("span",{className:"title",children:r}),(0,n.jsxs)("span",{className:"discord",children:[c?"Join our community on":"Got questions? Find us on"," ",(0,n.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,s,t)=>{t.d(s,{Z:()=>l,a:()=>c});var n=t(7294);const r={},i=n.createContext(r);function c(e){const s=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),n.createElement(i.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[7706],{9747:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>o,contentTitle:()=>l,default:()=>u,frontMatter:()=>c,metadata:()=>d,toc:()=>a});var n=t(5893),r=t(1151),i=t(3872);const c={title:"User service",slug:"user-service",hide_title:!0,tags:["references","help","user service","unit","systemctl","systemd"]},l=void 0,d={id:"Systemd/user-service",title:"User service",description:"A user should have the ability to run a Systemd user service unit without having to use sudo to control it.",source:"@site/references/Systemd/user-service.md",sourceDirName:"Systemd",slug:"/Systemd/user-service",permalink:"/references/Systemd/user-service",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Systemd/user-service.md",tags:[{label:"references",permalink:"/references/tags/references"},{label:"help",permalink:"/references/tags/help"},{label:"user service",permalink:"/references/tags/user-service"},{label:"unit",permalink:"/references/tags/unit"},{label:"systemctl",permalink:"/references/tags/systemctl"},{label:"systemd",permalink:"/references/tags/systemd"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"User service",slug:"user-service",hide_title:!0,tags:["references","help","user service","unit","systemctl","systemd"]},sidebar:"defaultSidebar",previous:{title:"Shutting down persistance",permalink:"/references/Systemd/shutting-down-persistance"}},o={},a=[{value:"Check --user support",id:"check---user-support",level:2},{value:"Put the service unit in the user service",id:"put-the-service-unit-in-the-user-service",level:2},{value:"Reload daemon",id:"reload-daemon",level:2},{value:"Systemd service control as --user",id:"systemd-service-control-as---user",level:2},{value:"Problem statement",id:"problem-statement",level:2}];function h(e){const s={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,r.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(s.p,{children:["A user should have the ability to run a Systemd user service unit without having to use ",(0,n.jsx)(s.code,{children:"sudo"})," to control it."]}),"\n",(0,n.jsxs)(s.h2,{id:"check---user-support",children:["Check ",(0,n.jsx)(s.code,{children:"--user"})," support"]}),"\n",(0,n.jsxs)(s.p,{children:["Use the ",(0,n.jsx)(s.code,{children:"--user"})," flag when getting the list of unit files."]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"systemctl --user list-unit-files\n"})}),"\n",(0,n.jsx)(s.p,{children:"It should return a list of unit files."}),"\n",(0,n.jsx)(s.h2,{id:"put-the-service-unit-in-the-user-service",children:"Put the service unit in the user service"}),"\n",(0,n.jsx)(s.p,{children:"Create the Systemd user units directory:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"sudo mkdir -p /etc/systemd/system/user\n"})}),"\n",(0,n.jsxs)(s.p,{children:["Move the ",(0,n.jsx)(s.code,{children:"lightning.service"})," to the system user unit service directory:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"mv /etc/systemd/system/lightning.service /etc/systemd/system/user/lightning.service\n"})}),"\n",(0,n.jsxs)(s.p,{children:["Check the ",(0,n.jsx)(s.strong,{children:"Load path when running in user mode (--user)"})," in ",(0,n.jsx)(s.a,{href:"https://www.freedesktop.org/software/systemd/man/systemd.unit.html",children:"Systemd unit"})," for other alternative user paths, or to understand how it works to customize your server accordingly."]}),"\n",(0,n.jsx)(s.h2,{id:"reload-daemon",children:"Reload daemon"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"sudo systemctl daemon-reload\n"})}),"\n",(0,n.jsxs)(s.h2,{id:"systemd-service-control-as---user",children:["Systemd service control as ",(0,n.jsx)(s.code,{children:"--user"})]}),"\n",(0,n.jsx)(s.p,{children:"Reload the Systemctl daemon by executing the command:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"systemctl --user daemon-reload\n"})}),"\n",(0,n.jsx)(s.p,{children:"Enable the service for starting up on system boot:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"systemctl --user enable lightning.service\n"})}),"\n",(0,n.jsx)(s.p,{children:"Start the service by:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"systemctl --user start lightning\n"})}),"\n",(0,n.jsx)(s.p,{children:"Stop the service by:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"systemctl --user stop lightning\n"})}),"\n",(0,n.jsx)(s.p,{children:"Restart the service by:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"systemctl --user restart lightning\n"})}),"\n",(0,n.jsx)(s.p,{children:"Check the service status by:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"systemctl --user status lightning.service\n"})}),"\n",(0,n.jsx)(s.h2,{id:"problem-statement",children:"Problem statement"}),"\n",(0,n.jsxs)(s.p,{children:["On tests done in a DigitalOcean Ubuntu 22.x, we had set up user-level services which were operated with ",(0,n.jsx)(s.code,{children:"--user"}),". When the commands were executed as ",(0,n.jsx)(s.code,{children:"--user"})," it failed with:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"Failed to connect to bus: Operation not permitted (consider using --machine=@.host --user to connect to bus of other user)\n"})}),"\n",(0,n.jsx)(s.p,{children:"The user should be able to operate as user, it shouldn't be required to connect on behalf of other users. This means that even for a simple command, such as to retrieve the list of unit files:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"systemctl --user list-unit-files\n"})}),"\n",(0,n.jsx)(s.p,{children:"We'd get the error:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"Failed to connect to bus: Operation not permitted (consider using --machine=@.host --user to connect to bus of other user)\n"})}),"\n",(0,n.jsxs)(s.p,{children:["For any of the supported user unit locations e.g. $HOME/.config/systemd/user as documented in ",(0,n.jsx)(s.a,{href:"https://www.freedesktop.org/software/systemd/man/systemd.unit.html",children:"Systemd unit documentation"}),", the result is the error above."]}),"\n",(0,n.jsxs)(s.p,{children:["This is related to the load paths when running in user mode (--user), as described in the discussion ",(0,n.jsx)(s.a,{href:"https://unix.stackexchange.com/questions/224992/where-do-i-put-my-systemd-unit-file/367237#367237",children:"here"}),"."]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.strong,{children:"User-dependent"})}),"\n",(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.strong,{children:"$XDG_CONFIG_HOME/systemd/user"})," User configuration (only used when $XDG_CONFIG_HOME is set)"]}),"\n",(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.strong,{children:"$HOME/.config/systemd/user"})," User configuration (only used when $XDG_CONFIG_HOME is not set)"]}),"\n",(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.strong,{children:"$XDG_RUNTIME_DIR/systemd/user"})," Runtime units (only used when $XDG_RUNTIME_DIR is set)"]}),"\n",(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.strong,{children:"$XDG_DATA_HOME/systemd/user"})," Units of packages that have been installed in the home directory (only used when $XDG_DATA_HOME is set)"]}),"\n",(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.strong,{children:"$HOME/.local/share/systemd/user"})," Units of packages that have been installed in the home directory (only used when $XDG_DATA_HOME is not set)"]}),"\n",(0,n.jsxs)(s.p,{children:["For example, if we check the ",(0,n.jsx)(s.code,{children:"$XDG_RUNTIME_DIR"})," in a DigitalOcean box, we get the following output:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-sh",children:"/run/user/0\n"})}),"\n",(0,n.jsx)(s.p,{children:"For this reason and to provide support for a wider audience of users and systems, we've stuck to sudo to execute the service, but this should not be a requirement and is not recommended."}),"\n",(0,n.jsx)(i.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function u(e={}){const{wrapper:s}={...(0,r.a)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},3872:(e,s,t)=>{t.d(s,{Z:()=>r});t(7294);var n=t(5893);const r=e=>{let{image:s,name:t,title:r,url:i,communityMember:c=!1}=e;return(0,n.jsx)("section",{className:"author_card",children:(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"avatar",children:(0,n.jsx)("a",{href:i,target:"_blank",alt:t,children:(0,n.jsx)("img",{src:s,alt:t})})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"name",children:(0,n.jsx)("a",{href:i,target:"_blank",alt:t,children:t})}),(0,n.jsx)("span",{className:"title",children:r}),(0,n.jsxs)("span",{className:"discord",children:[c?"Join our community on":"Got questions? Find us on"," ",(0,n.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,s,t)=>{t.d(s,{Z:()=>l,a:()=>c});var n=t(7294);const r={},i=n.createContext(r);function c(e){const s=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),n.createElement(i.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/d1b78a4d.6f8b362b.js b/assets/js/d1b78a4d.64818930.js similarity index 96% rename from assets/js/d1b78a4d.6f8b362b.js rename to assets/js/d1b78a4d.64818930.js index e22b22156..e70b5c761 100644 --- a/assets/js/d1b78a4d.6f8b362b.js +++ b/assets/js/d1b78a4d.64818930.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[3023],{756:(t,e,o)=>{o.r(e),o.d(e,{assets:()=>l,contentTitle:()=>a,default:()=>u,frontMatter:()=>r,metadata:()=>s,toc:()=>m});var i=o(5893),n=o(1151);const r={title:"Bloom Filters and Cuckoo Filters for Cache Summarization",description:"Summary of our experiment informing whether or not we should replace our implementation of Counting Bloom filters with Cuckoo filters.",slug:"bloom-and-cuckoo-filters-for-cache-summarization",image:"./assets/bloom-cuckoo/bloom.png?202301181528",authors:{name:"Matthias Wright",title:"Software Engineer",url:"https://github.com/matthias-wright",image_url:"https://github.com/matthias-wright.png"},tags:["fleek network","blog","engineering","content routing"]},a=void 0,s={permalink:"/blog/bloom-and-cuckoo-filters-for-cache-summarization",source:"@site/blog/bloom-and-cuckoo-filters-for-cache-summarization.md",title:"Bloom Filters and Cuckoo Filters for Cache Summarization",description:"Summary of our experiment informing whether or not we should replace our implementation of Counting Bloom filters with Cuckoo filters.",date:"2023-11-07T18:40:34.000Z",formattedDate:"November 7, 2023",tags:[{label:"fleek network",permalink:"/blog/tags/fleek-network"},{label:"blog",permalink:"/blog/tags/blog"},{label:"engineering",permalink:"/blog/tags/engineering"},{label:"content routing",permalink:"/blog/tags/content-routing"}],readingTime:10.37,hasTruncateMarker:!0,authors:[{name:"Matthias Wright",title:"Software Engineer",url:"https://github.com/matthias-wright",image_url:"https://github.com/matthias-wright.png",imageURL:"https://github.com/matthias-wright.png"}],frontMatter:{title:"Bloom Filters and Cuckoo Filters for Cache Summarization",description:"Summary of our experiment informing whether or not we should replace our implementation of Counting Bloom filters with Cuckoo filters.",slug:"bloom-and-cuckoo-filters-for-cache-summarization",image:"./assets/bloom-cuckoo/bloom.png?202301181528",authors:{name:"Matthias Wright",title:"Software Engineer",url:"https://github.com/matthias-wright",image_url:"https://github.com/matthias-wright.png",imageURL:"https://github.com/matthias-wright.png"},tags:["fleek network","blog","engineering","content routing"]},unlisted:!1},l={image:o(9969).Z,authorsImageUrls:[void 0]},m=[];function c(t){const e={p:"p",...(0,n.a)(),...t.components};return(0,i.jsx)(e.p,{children:"Disclaimer: This is not a general comparison between Bloom filters and Cuckoo filters. This blog post summarizes some of the experiments we conducted to decide whether or not we should replace our implementation of Counting Bloom filters with Cuckoo filters, for a specific use case."})}function u(t={}){const{wrapper:e}={...(0,n.a)(),...t.components};return e?(0,i.jsx)(e,{...t,children:(0,i.jsx)(c,{...t})}):c(t)}},9969:(t,e,o)=>{o.d(e,{Z:()=>i});const i=o.p+"assets/images/bloom-79da0db687b4fb2060758838b9c44513.png"},1151:(t,e,o)=>{o.d(e,{Z:()=>s,a:()=>a});var i=o(7294);const n={},r=i.createContext(n);function a(t){const e=i.useContext(r);return i.useMemo((function(){return"function"==typeof t?t(e):{...e,...t}}),[e,t])}function s(t){let e;return e=t.disableParentContext?"function"==typeof t.components?t.components(n):t.components||n:a(t.components),i.createElement(r.Provider,{value:e},t.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[3023],{756:(t,e,o)=>{o.r(e),o.d(e,{assets:()=>l,contentTitle:()=>a,default:()=>u,frontMatter:()=>r,metadata:()=>s,toc:()=>m});var i=o(5893),n=o(1151);const r={title:"Bloom Filters and Cuckoo Filters for Cache Summarization",description:"Summary of our experiment informing whether or not we should replace our implementation of Counting Bloom filters with Cuckoo filters.",slug:"bloom-and-cuckoo-filters-for-cache-summarization",image:"./assets/bloom-cuckoo/bloom.png?202301181528",authors:{name:"Matthias Wright",title:"Software Engineer",url:"https://github.com/matthias-wright",image_url:"https://github.com/matthias-wright.png"},tags:["fleek network","blog","engineering","content routing"]},a=void 0,s={permalink:"/blog/bloom-and-cuckoo-filters-for-cache-summarization",source:"@site/blog/bloom-and-cuckoo-filters-for-cache-summarization.md",title:"Bloom Filters and Cuckoo Filters for Cache Summarization",description:"Summary of our experiment informing whether or not we should replace our implementation of Counting Bloom filters with Cuckoo filters.",date:"2023-11-07T19:16:06.000Z",formattedDate:"November 7, 2023",tags:[{label:"fleek network",permalink:"/blog/tags/fleek-network"},{label:"blog",permalink:"/blog/tags/blog"},{label:"engineering",permalink:"/blog/tags/engineering"},{label:"content routing",permalink:"/blog/tags/content-routing"}],readingTime:10.37,hasTruncateMarker:!0,authors:[{name:"Matthias Wright",title:"Software Engineer",url:"https://github.com/matthias-wright",image_url:"https://github.com/matthias-wright.png",imageURL:"https://github.com/matthias-wright.png"}],frontMatter:{title:"Bloom Filters and Cuckoo Filters for Cache Summarization",description:"Summary of our experiment informing whether or not we should replace our implementation of Counting Bloom filters with Cuckoo filters.",slug:"bloom-and-cuckoo-filters-for-cache-summarization",image:"./assets/bloom-cuckoo/bloom.png?202301181528",authors:{name:"Matthias Wright",title:"Software Engineer",url:"https://github.com/matthias-wright",image_url:"https://github.com/matthias-wright.png",imageURL:"https://github.com/matthias-wright.png"},tags:["fleek network","blog","engineering","content routing"]},unlisted:!1},l={image:o(9969).Z,authorsImageUrls:[void 0]},m=[];function c(t){const e={p:"p",...(0,n.a)(),...t.components};return(0,i.jsx)(e.p,{children:"Disclaimer: This is not a general comparison between Bloom filters and Cuckoo filters. This blog post summarizes some of the experiments we conducted to decide whether or not we should replace our implementation of Counting Bloom filters with Cuckoo filters, for a specific use case."})}function u(t={}){const{wrapper:e}={...(0,n.a)(),...t.components};return e?(0,i.jsx)(e,{...t,children:(0,i.jsx)(c,{...t})}):c(t)}},9969:(t,e,o)=>{o.d(e,{Z:()=>i});const i=o.p+"assets/images/bloom-79da0db687b4fb2060758838b9c44513.png"},1151:(t,e,o)=>{o.d(e,{Z:()=>s,a:()=>a});var i=o(7294);const n={},r=i.createContext(n);function a(t){const e=i.useContext(r);return i.useMemo((function(){return"function"==typeof t?t(e):{...e,...t}}),[e,t])}function s(t){let e;return e=t.disableParentContext?"function"==typeof t.components?t.components(n):t.components||n:a(t.components),i.createElement(r.Provider,{value:e},t.children)}}}]); \ No newline at end of file diff --git a/assets/js/d23df0ea.a41a1d95.js b/assets/js/d23df0ea.ec40fe4c.js similarity index 99% rename from assets/js/d23df0ea.a41a1d95.js rename to assets/js/d23df0ea.ec40fe4c.js index df98b84ed..41cb25de1 100644 --- a/assets/js/d23df0ea.a41a1d95.js +++ b/assets/js/d23df0ea.ec40fe4c.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[5548],{3183:(e,n,r)=>{r.d(n,{ZP:()=>l});var t=r(5893),i=r(1151);function o(e){const n={a:"a",admonition:"admonition",code:"code",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.a)(),...e.components};return(0,t.jsxs)(n.admonition,{type:"tip",children:[(0,t.jsx)(n.p,{children:"You have several ways of doing this:"}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Clone via HTTPS"}),"\n",(0,t.jsx)(n.li,{children:"Clone via SSH"}),"\n",(0,t.jsx)(n.li,{children:"Download via Github CLI"}),"\n",(0,t.jsxs)(n.li,{children:["Download the ",(0,t.jsx)(n.a,{href:"https://github.com/fleek-network/lightning/archive/refs/heads/main.zip",children:"zip package"})," from the repository"]}),"\n"]}),(0,t.jsxs)(n.p,{children:["We recommend HTTPS because it is the easiest to set up in the wild, and by users who are new to all this.\nAlthough, we strongly recommend using an SSH connection when interacting with GitHub. If you are to this and are interested read more about it ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/authentication/connecting-to-github-with-ssh",children:"here"}),"."]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"git clone -b testnet-alpha-1 https://github.com/fleek-network/lightning.git \n"})}),(0,t.jsxs)(n.p,{children:["At time of writing, we are checking the branch name ",(0,t.jsx)(n.code,{children:"testnet-alpha-1"})," that corresponds to the testnet phase.\nHere's an example of what it'd look like when sticking to the recommended path location:"]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"git clone -b testnet-alpha-1 https://github.com/fleek-network/lightning.git ~/fleek-network/lightning\n"})})]})}function l(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(o,{...e})}):o(e)}},5081:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>d,contentTitle:()=>c,default:()=>g,frontMatter:()=>s,metadata:()=>a,toc:()=>h});var t=r(5893),i=r(1151),o=r(3872),l=r(3183);const s={title:"Build and run in Docker",slug:"build-and-run-in-docker",hide_title:!0,tags:["references","help","docker","build","image","container"]},c=void 0,a={id:"Docker/build-and-run-in-docker",title:"Build and run in Docker",description:"Clone the source code locally",source:"@site/references/Docker/build-and-run-in-docker.md",sourceDirName:"Docker",slug:"/Docker/build-and-run-in-docker",permalink:"/references/Docker/build-and-run-in-docker",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Docker/build-and-run-in-docker.md",tags:[{label:"references",permalink:"/references/tags/references"},{label:"help",permalink:"/references/tags/help"},{label:"docker",permalink:"/references/tags/docker"},{label:"build",permalink:"/references/tags/build"},{label:"image",permalink:"/references/tags/image"},{label:"container",permalink:"/references/tags/container"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Build and run in Docker",slug:"build-and-run-in-docker",hide_title:!0,tags:["references","help","docker","build","image","container"]},sidebar:"defaultSidebar",previous:{title:"About references",permalink:"/references/"},next:{title:"Frequently used commands for Docker setup",permalink:"/references/Docker/frequently-used-commands-for-docker-setup"}},d={},h=[{value:"Clone the source code locally",id:"clone-the-source-code-locally",level:2},{value:"Change directory to Lightning source code",id:"change-directory-to-lightning-source-code",level:2},{value:"Install Docker",id:"install-docker",level:2},{value:"Docker setup verification",id:"docker-setup-verification",level:2},{value:"Check the Dockerfile",id:"check-the-dockerfile",level:2},{value:"Build the Docker image",id:"build-the-docker-image",level:2},{value:"Generate keys",id:"generate-keys",level:2},{value:"Docker Container",id:"docker-container",level:2},{value:"View logs",id:"view-logs",level:2}];function u(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h2,{id:"clone-the-source-code-locally",children:"Clone the source code locally"}),"\n",(0,t.jsx)(l.ZP,{}),"\n",(0,t.jsx)(n.h2,{id:"change-directory-to-lightning-source-code",children:"Change directory to Lightning source code"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"cd ~/fleek-network/lightning\n"})}),"\n",(0,t.jsx)(n.h2,{id:"install-docker",children:"Install Docker"}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["We're using Ubuntu Linux. You'll have to make the required tweaks for your preferred Linux Distro. Find the list of support operating systems ",(0,t.jsx)(n.a,{href:"/docs/node/requirements#server",children:"here"}),"."]})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo apt update\n"})}),"\n",(0,t.jsx)(n.p,{children:"Next, install the required packages to let apt use packages over HTTPS:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo apt install \\\n apt-transport-https \\\n ca-certificates \\\n software-properties-common\n"})}),"\n",(0,t.jsx)(n.p,{children:"Add the GPG key for the official Docker repository to your system:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -\n"})}),"\n",(0,t.jsx)(n.p,{children:"Add the Docker repository to apt sources and update the package database with the Docker packages from the new added repository:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:'sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu jammy stable"\n'})}),"\n",(0,t.jsx)(n.p,{children:"Set to install from the Docker repo instead of the default Ubuntu repo:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"apt-cache policy docker-ce\n"})}),"\n",(0,t.jsx)(n.p,{children:"Finally, install Docker:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo apt install docker-ce\n"})}),"\n",(0,t.jsx)(n.p,{children:"Once complete you should be able to run it via the CLI, as such:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"docker -v\n"})}),"\n",(0,t.jsx)(n.p,{children:"Here's the output (versions might differ a bit from the time of writing):"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"Docker version 24.0.6, build ed223bc\n"})}),"\n",(0,t.jsx)(n.h2,{id:"docker-setup-verification",children:"Docker setup verification"}),"\n",(0,t.jsx)(n.p,{children:"The following command's output will indicate if Docker's working correctly:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker run hello-world\n"})}),"\n",(0,t.jsx)(n.p,{children:'You should get a "Hello from Docker!".'}),"\n",(0,t.jsx)(n.h2,{id:"check-the-dockerfile",children:"Check the Dockerfile"}),"\n",(0,t.jsxs)(n.p,{children:["You should have ",(0,t.jsx)(n.a,{href:"#change-directory-to-lightning-source-code",children:"changed directory"})," to the projecto directory."]}),"\n",(0,t.jsxs)(n.p,{children:["If you run a ",(0,t.jsx)(n.code,{children:"cat Dockerfile"}),", you should have content similar to:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"FROM rust:latest as builder\nARG PROFILE=release\nWORKDIR /lightning\n\nRUN apt-get update\nRUN apt-get install -y \\\n build-essential \\\n cmake \\\n clang \\\n pkg-config \\\n libssl-dev \\\n gcc \\\n protobuf-compiler\n\n...\n"})}),"\n",(0,t.jsx)(n.h2,{id:"build-the-docker-image",children:"Build the Docker image"}),"\n",(0,t.jsxs)(n.p,{children:["Build the image named as ",(0,t.jsx)(n.code,{children:"lightning"})," from our Dockerfile:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker build -t lightning -f ./Dockerfile .\n"})}),"\n",(0,t.jsx)(n.h2,{id:"generate-keys",children:"Generate keys"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker exec -it lightning-node lgtn keys generate\n"})}),"\n",(0,t.jsx)(n.h2,{id:"docker-container",children:"Docker Container"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker run \\\n -p 4200-4299:4200-4299 \\\n -p 4300-4399:4300-4399 \\\n --mount type=bind,source=$HOME/.lightning,target=/home/lgtn/.lightning \\\n --mount type=bind,source=/var/tmp,target=/var/tmp \\\n --name lightning-node \\\n -it lightning\n"})}),"\n",(0,t.jsx)(n.h2,{id:"view-logs",children:"View logs"}),"\n",(0,t.jsx)(n.p,{children:"To view the logs of a Docker container in real time, use the following command:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker logs -f lightning-node\n"})}),"\n",(0,t.jsx)(o.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function g(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(u,{...e})}):u(e)}},3872:(e,n,r)=>{r.d(n,{Z:()=>i});r(7294);var t=r(5893);const i=e=>{let{image:n,name:r,title:i,url:o,communityMember:l=!1}=e;return(0,t.jsx)("section",{className:"author_card",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"avatar",children:(0,t.jsx)("a",{href:o,target:"_blank",alt:r,children:(0,t.jsx)("img",{src:n,alt:r})})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"name",children:(0,t.jsx)("a",{href:o,target:"_blank",alt:r,children:r})}),(0,t.jsx)("span",{className:"title",children:i}),(0,t.jsxs)("span",{className:"discord",children:[l?"Join our community on":"Got questions? Find us on"," ",(0,t.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,r)=>{r.d(n,{Z:()=>s,a:()=>l});var t=r(7294);const i={},o=t.createContext(i);function l(e){const n=t.useContext(o);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),t.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[5548],{3183:(e,n,r)=>{r.d(n,{ZP:()=>l});var t=r(5893),i=r(1151);function o(e){const n={a:"a",admonition:"admonition",code:"code",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.a)(),...e.components};return(0,t.jsxs)(n.admonition,{type:"tip",children:[(0,t.jsx)(n.p,{children:"You have several ways of doing this:"}),(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Clone via HTTPS"}),"\n",(0,t.jsx)(n.li,{children:"Clone via SSH"}),"\n",(0,t.jsx)(n.li,{children:"Download via Github CLI"}),"\n",(0,t.jsxs)(n.li,{children:["Download the ",(0,t.jsx)(n.a,{href:"https://github.com/fleek-network/lightning/archive/refs/heads/main.zip",children:"zip package"})," from the repository"]}),"\n"]}),(0,t.jsxs)(n.p,{children:["We recommend HTTPS because it is the easiest to set up in the wild, and by users who are new to all this.\nAlthough, we strongly recommend using an SSH connection when interacting with GitHub. If you are to this and are interested read more about it ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/authentication/connecting-to-github-with-ssh",children:"here"}),"."]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"git clone -b testnet-alpha-1 https://github.com/fleek-network/lightning.git \n"})}),(0,t.jsxs)(n.p,{children:["At time of writing, we are checking the branch name ",(0,t.jsx)(n.code,{children:"testnet-alpha-1"})," that corresponds to the testnet phase.\nHere's an example of what it'd look like when sticking to the recommended path location:"]}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"git clone -b testnet-alpha-1 https://github.com/fleek-network/lightning.git ~/fleek-network/lightning\n"})})]})}function l(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(o,{...e})}):o(e)}},5081:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>d,contentTitle:()=>c,default:()=>g,frontMatter:()=>s,metadata:()=>a,toc:()=>h});var t=r(5893),i=r(1151),o=r(3872),l=r(3183);const s={title:"Build and run in Docker",slug:"build-and-run-in-docker",hide_title:!0,tags:["references","help","docker","build","image","container"]},c=void 0,a={id:"Docker/build-and-run-in-docker",title:"Build and run in Docker",description:"Clone the source code locally",source:"@site/references/Docker/build-and-run-in-docker.md",sourceDirName:"Docker",slug:"/Docker/build-and-run-in-docker",permalink:"/references/Docker/build-and-run-in-docker",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Docker/build-and-run-in-docker.md",tags:[{label:"references",permalink:"/references/tags/references"},{label:"help",permalink:"/references/tags/help"},{label:"docker",permalink:"/references/tags/docker"},{label:"build",permalink:"/references/tags/build"},{label:"image",permalink:"/references/tags/image"},{label:"container",permalink:"/references/tags/container"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Build and run in Docker",slug:"build-and-run-in-docker",hide_title:!0,tags:["references","help","docker","build","image","container"]},sidebar:"defaultSidebar",previous:{title:"About references",permalink:"/references/"},next:{title:"Frequently used commands for Docker setup",permalink:"/references/Docker/frequently-used-commands-for-docker-setup"}},d={},h=[{value:"Clone the source code locally",id:"clone-the-source-code-locally",level:2},{value:"Change directory to Lightning source code",id:"change-directory-to-lightning-source-code",level:2},{value:"Install Docker",id:"install-docker",level:2},{value:"Docker setup verification",id:"docker-setup-verification",level:2},{value:"Check the Dockerfile",id:"check-the-dockerfile",level:2},{value:"Build the Docker image",id:"build-the-docker-image",level:2},{value:"Generate keys",id:"generate-keys",level:2},{value:"Docker Container",id:"docker-container",level:2},{value:"View logs",id:"view-logs",level:2}];function u(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h2,{id:"clone-the-source-code-locally",children:"Clone the source code locally"}),"\n",(0,t.jsx)(l.ZP,{}),"\n",(0,t.jsx)(n.h2,{id:"change-directory-to-lightning-source-code",children:"Change directory to Lightning source code"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"cd ~/fleek-network/lightning\n"})}),"\n",(0,t.jsx)(n.h2,{id:"install-docker",children:"Install Docker"}),"\n",(0,t.jsx)(n.admonition,{type:"tip",children:(0,t.jsxs)(n.p,{children:["We're using Ubuntu Linux. You'll have to make the required tweaks for your preferred Linux Distro. Find the list of support operating systems ",(0,t.jsx)(n.a,{href:"/docs/node/requirements#server",children:"here"}),"."]})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo apt update\n"})}),"\n",(0,t.jsx)(n.p,{children:"Next, install the required packages to let apt use packages over HTTPS:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo apt install \\\n apt-transport-https \\\n ca-certificates \\\n software-properties-common\n"})}),"\n",(0,t.jsx)(n.p,{children:"Add the GPG key for the official Docker repository to your system:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -\n"})}),"\n",(0,t.jsx)(n.p,{children:"Add the Docker repository to apt sources and update the package database with the Docker packages from the new added repository:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:'sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu jammy stable"\n'})}),"\n",(0,t.jsx)(n.p,{children:"Set to install from the Docker repo instead of the default Ubuntu repo:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"apt-cache policy docker-ce\n"})}),"\n",(0,t.jsx)(n.p,{children:"Finally, install Docker:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo apt install docker-ce\n"})}),"\n",(0,t.jsx)(n.p,{children:"Once complete you should be able to run it via the CLI, as such:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"docker -v\n"})}),"\n",(0,t.jsx)(n.p,{children:"Here's the output (versions might differ a bit from the time of writing):"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"Docker version 24.0.6, build ed223bc\n"})}),"\n",(0,t.jsx)(n.h2,{id:"docker-setup-verification",children:"Docker setup verification"}),"\n",(0,t.jsx)(n.p,{children:"The following command's output will indicate if Docker's working correctly:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker run hello-world\n"})}),"\n",(0,t.jsx)(n.p,{children:'You should get a "Hello from Docker!".'}),"\n",(0,t.jsx)(n.h2,{id:"check-the-dockerfile",children:"Check the Dockerfile"}),"\n",(0,t.jsxs)(n.p,{children:["You should have ",(0,t.jsx)(n.a,{href:"#change-directory-to-lightning-source-code",children:"changed directory"})," to the projecto directory."]}),"\n",(0,t.jsxs)(n.p,{children:["If you run a ",(0,t.jsx)(n.code,{children:"cat Dockerfile"}),", you should have content similar to:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"FROM rust:latest as builder\nARG PROFILE=release\nWORKDIR /lightning\n\nRUN apt-get update\nRUN apt-get install -y \\\n build-essential \\\n cmake \\\n clang \\\n pkg-config \\\n libssl-dev \\\n gcc \\\n protobuf-compiler\n\n...\n"})}),"\n",(0,t.jsx)(n.h2,{id:"build-the-docker-image",children:"Build the Docker image"}),"\n",(0,t.jsxs)(n.p,{children:["Build the image named as ",(0,t.jsx)(n.code,{children:"lightning"})," from our Dockerfile:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker build -t lightning -f ./Dockerfile .\n"})}),"\n",(0,t.jsx)(n.h2,{id:"generate-keys",children:"Generate keys"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker exec -it lightning-node lgtn keys generate\n"})}),"\n",(0,t.jsx)(n.h2,{id:"docker-container",children:"Docker Container"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker run \\\n -p 4200-4299:4200-4299 \\\n -p 4300-4399:4300-4399 \\\n --mount type=bind,source=$HOME/.lightning,target=/home/lgtn/.lightning \\\n --mount type=bind,source=/var/tmp,target=/var/tmp \\\n --name lightning-node \\\n -it lightning\n"})}),"\n",(0,t.jsx)(n.h2,{id:"view-logs",children:"View logs"}),"\n",(0,t.jsx)(n.p,{children:"To view the logs of a Docker container in real time, use the following command:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"sudo docker logs -f lightning-node\n"})}),"\n",(0,t.jsx)(o.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function g(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(u,{...e})}):u(e)}},3872:(e,n,r)=>{r.d(n,{Z:()=>i});r(7294);var t=r(5893);const i=e=>{let{image:n,name:r,title:i,url:o,communityMember:l=!1}=e;return(0,t.jsx)("section",{className:"author_card",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"avatar",children:(0,t.jsx)("a",{href:o,target:"_blank",alt:r,children:(0,t.jsx)("img",{src:n,alt:r})})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"name",children:(0,t.jsx)("a",{href:o,target:"_blank",alt:r,children:r})}),(0,t.jsx)("span",{className:"title",children:i}),(0,t.jsxs)("span",{className:"discord",children:[l?"Join our community on":"Got questions? Find us on"," ",(0,t.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,r)=>{r.d(n,{Z:()=>s,a:()=>l});var t=r(7294);const i={},o=t.createContext(i);function l(e){const n=t.useContext(o);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),t.createElement(o.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/d7d81bf6.97d3ae9f.js b/assets/js/d7d81bf6.0245f265.js similarity index 99% rename from assets/js/d7d81bf6.97d3ae9f.js rename to assets/js/d7d81bf6.0245f265.js index cb74cc096..20648b8f7 100644 --- a/assets/js/d7d81bf6.97d3ae9f.js +++ b/assets/js/d7d81bf6.0245f265.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[2918],{6710:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>u,frontMatter:()=>l,metadata:()=>o,toc:()=>d});var t=r(5893),i=r(1151),s=r(3872);const l={title:"Error building on ARM64",slug:"error-building-on-arm64",hide_title:!0,tags:["references","help","fix"]},a=void 0,o={id:"Lightning CLI/error-building-on-arm64",title:"Error building on ARM64",description:"Building on the ARM64 (aarch64)",source:"@site/references/Lightning CLI/error-building-on-arm64.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/error-building-on-arm64",permalink:"/references/Lightning CLI/error-building-on-arm64",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/error-building-on-arm64.md",tags:[{label:"references",permalink:"/references/tags/references"},{label:"help",permalink:"/references/tags/help"},{label:"fix",permalink:"/references/tags/fix"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Error building on ARM64",slug:"error-building-on-arm64",hide_title:!0,tags:["references","help","fix"]},sidebar:"defaultSidebar",previous:{title:"Uninstall Docker Setup",permalink:"/references/Docker/uninstall-docker-setup"},next:{title:"Error linking with cc",permalink:"/references/Lightning CLI/error-linking-with-cc-failed-exist-status-1"}},c={},d=[{value:"Building on the ARM64 (aarch64)",id:"building-on-the-arm64-aarch64",level:2}];function h(e){const n={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h2,{id:"building-on-the-arm64-aarch64",children:"Building on the ARM64 (aarch64)"}),"\n",(0,t.jsxs)(n.p,{children:["ARM64 platform has its own specifics, and currently consists of requiring ",(0,t.jsx)(n.code,{children:"gcc"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"sudo apt install gcc\n"})}),"\n",(0,t.jsxs)(n.p,{children:["On cargo build, the error ",(0,t.jsx)(n.code,{children:"error: linking with "}),"cc",(0,t.jsx)(n.code,{children:" failed: exit status: 1"})," occurs, as demonstrated in the output below:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"error: linking with `cc` failed: exit status: 1\n# ... wall of text\n# ... the key error is \u21b4\n= note: /usr/bin/ld: /home/ubuntu/fleek-network/lightning/target/release/deps/libblake3-a927e9b36d695ff0.rlib(blake3-a927e9b36d695ff0.blake3.91a53ea05847a7a5-cgu.0.rcgu.o): in function `blake3_compress_in_place_portable':\n /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/blake3-1.4.1/src/ffi_neon.rs:45: multiple definition of `blake3_compress_in_place_portable'; /home/ubuntu/fleek-network/lightning/target/release/deps/libfleek_blake3-990c4c0cfb4eaa87.rlib(fleek_blake3-990c4c0cfb4eaa87.fleek_blake3.4f11e9370af31773-cgu.0.rcgu.o):/home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fleek-blake3-1.4.1/src/ffi_neon.rs:45: first defined here\n"})}),"\n",(0,t.jsxs)(n.p,{children:["As a result of the ",(0,t.jsx)(n.a,{href:"https://github.com/ryssroad/fleek-aarch64-build",children:"research"})," by the community member ",(0,t.jsx)(n.a,{href:"https://github.com/ryssroad",children:"ryssroad"}),", the following solution was shared."]}),"\n",(0,t.jsxs)(n.p,{children:["Open the ",(0,t.jsx)(n.code,{children:"cargo.toml"})," file in ",(0,t.jsx)(n.code,{children:"~/fleek-network/lightning/Cargo.toml"})," and find the ",(0,t.jsx)(n.code,{children:"lto"})," key."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"lto = true\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Change the ",(0,t.jsx)(n.code,{children:"lto"})," key value from ",(0,t.jsx)(n.code,{children:"true"})," to ",(0,t.jsx)(n.code,{children:"thin"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:'...\n[profile.release]\n# currently enabled, may increase build time, but runtime faster, can set to `"thin"`.\nlto = "thin"\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Set ",(0,t.jsx)(n.code,{children:"RUSTFLAGS"})," on build, as follows:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition" cargo +stable build --release \n'})}),"\n",(0,t.jsxs)(n.p,{children:["Once the build completes, you should find the generated binary ",(0,t.jsx)(n.code,{children:"lightning-node"})," under the directory ",(0,t.jsx)(n.code,{children:"~/fleek-network/lightning/target/release/lightning-node"}),"."]}),"\n",(0,t.jsx)(n.p,{children:"As an example, execute:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"~/fleek-network/lightning/target/release/lightning-node help\n"})}),"\n",(0,t.jsx)(n.p,{children:"To find the help output:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"Usage: lightning-node [OPTIONS] \n\nCommands:\n run Start the node\n keys Handle keys\n print-config Print the loaded configuration\n help Print this message or the help of the given subcommand(s)\n\nOptions:\n -c, --config Path to the toml configuration file [default: ~/.lightning/config.toml]\n --with-mock-consensus Determines that we should be using the mock consensus backend\n -v... Increases the level of verbosity (the max level is -vvv)\n --log-location Print code location on console logs\n -h, --help Print help\n -V, --version Print version\n"})}),"\n",(0,t.jsx)(s.Z,{name:"Road aka @road",image:"https://github.com/ryssroad.png",title:"Community member",url:"https://github.com/ryssroad",communityMember:"true"})]})}function u(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},3872:(e,n,r)=>{r.d(n,{Z:()=>i});r(7294);var t=r(5893);const i=e=>{let{image:n,name:r,title:i,url:s,communityMember:l=!1}=e;return(0,t.jsx)("section",{className:"author_card",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"avatar",children:(0,t.jsx)("a",{href:s,target:"_blank",alt:r,children:(0,t.jsx)("img",{src:n,alt:r})})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"name",children:(0,t.jsx)("a",{href:s,target:"_blank",alt:r,children:r})}),(0,t.jsx)("span",{className:"title",children:i}),(0,t.jsxs)("span",{className:"discord",children:[l?"Join our community on":"Got questions? Find us on"," ",(0,t.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,r)=>{r.d(n,{Z:()=>a,a:()=>l});var t=r(7294);const i={},s=t.createContext(i);function l(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(i):e.components||i:l(e.components),t.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[2918],{6710:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>u,frontMatter:()=>l,metadata:()=>o,toc:()=>d});var t=r(5893),i=r(1151),s=r(3872);const l={title:"Error building on ARM64",slug:"error-building-on-arm64",hide_title:!0,tags:["references","help","fix"]},a=void 0,o={id:"Lightning CLI/error-building-on-arm64",title:"Error building on ARM64",description:"Building on the ARM64 (aarch64)",source:"@site/references/Lightning CLI/error-building-on-arm64.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/error-building-on-arm64",permalink:"/references/Lightning CLI/error-building-on-arm64",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/error-building-on-arm64.md",tags:[{label:"references",permalink:"/references/tags/references"},{label:"help",permalink:"/references/tags/help"},{label:"fix",permalink:"/references/tags/fix"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Error building on ARM64",slug:"error-building-on-arm64",hide_title:!0,tags:["references","help","fix"]},sidebar:"defaultSidebar",previous:{title:"Uninstall Docker Setup",permalink:"/references/Docker/uninstall-docker-setup"},next:{title:"Error linking with cc",permalink:"/references/Lightning CLI/error-linking-with-cc-failed-exist-status-1"}},c={},d=[{value:"Building on the ARM64 (aarch64)",id:"building-on-the-arm64-aarch64",level:2}];function h(e){const n={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",...(0,i.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h2,{id:"building-on-the-arm64-aarch64",children:"Building on the ARM64 (aarch64)"}),"\n",(0,t.jsxs)(n.p,{children:["ARM64 platform has its own specifics, and currently consists of requiring ",(0,t.jsx)(n.code,{children:"gcc"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"sudo apt install gcc\n"})}),"\n",(0,t.jsxs)(n.p,{children:["On cargo build, the error ",(0,t.jsx)(n.code,{children:"error: linking with "}),"cc",(0,t.jsx)(n.code,{children:" failed: exit status: 1"})," occurs, as demonstrated in the output below:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"error: linking with `cc` failed: exit status: 1\n# ... wall of text\n# ... the key error is \u21b4\n= note: /usr/bin/ld: /home/ubuntu/fleek-network/lightning/target/release/deps/libblake3-a927e9b36d695ff0.rlib(blake3-a927e9b36d695ff0.blake3.91a53ea05847a7a5-cgu.0.rcgu.o): in function `blake3_compress_in_place_portable':\n /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/blake3-1.4.1/src/ffi_neon.rs:45: multiple definition of `blake3_compress_in_place_portable'; /home/ubuntu/fleek-network/lightning/target/release/deps/libfleek_blake3-990c4c0cfb4eaa87.rlib(fleek_blake3-990c4c0cfb4eaa87.fleek_blake3.4f11e9370af31773-cgu.0.rcgu.o):/home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/fleek-blake3-1.4.1/src/ffi_neon.rs:45: first defined here\n"})}),"\n",(0,t.jsxs)(n.p,{children:["As a result of the ",(0,t.jsx)(n.a,{href:"https://github.com/ryssroad/fleek-aarch64-build",children:"research"})," by the community member ",(0,t.jsx)(n.a,{href:"https://github.com/ryssroad",children:"ryssroad"}),", the following solution was shared."]}),"\n",(0,t.jsxs)(n.p,{children:["Open the ",(0,t.jsx)(n.code,{children:"cargo.toml"})," file in ",(0,t.jsx)(n.code,{children:"~/fleek-network/lightning/Cargo.toml"})," and find the ",(0,t.jsx)(n.code,{children:"lto"})," key."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"lto = true\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Change the ",(0,t.jsx)(n.code,{children:"lto"})," key value from ",(0,t.jsx)(n.code,{children:"true"})," to ",(0,t.jsx)(n.code,{children:"thin"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:'...\n[profile.release]\n# currently enabled, may increase build time, but runtime faster, can set to `"thin"`.\nlto = "thin"\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Set ",(0,t.jsx)(n.code,{children:"RUSTFLAGS"})," on build, as follows:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition" cargo +stable build --release \n'})}),"\n",(0,t.jsxs)(n.p,{children:["Once the build completes, you should find the generated binary ",(0,t.jsx)(n.code,{children:"lightning-node"})," under the directory ",(0,t.jsx)(n.code,{children:"~/fleek-network/lightning/target/release/lightning-node"}),"."]}),"\n",(0,t.jsx)(n.p,{children:"As an example, execute:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"~/fleek-network/lightning/target/release/lightning-node help\n"})}),"\n",(0,t.jsx)(n.p,{children:"To find the help output:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"Usage: lightning-node [OPTIONS] \n\nCommands:\n run Start the node\n keys Handle keys\n print-config Print the loaded configuration\n help Print this message or the help of the given subcommand(s)\n\nOptions:\n -c, --config Path to the toml configuration file [default: ~/.lightning/config.toml]\n --with-mock-consensus Determines that we should be using the mock consensus backend\n -v... Increases the level of verbosity (the max level is -vvv)\n --log-location Print code location on console logs\n -h, --help Print help\n -V, --version Print version\n"})}),"\n",(0,t.jsx)(s.Z,{name:"Road aka @road",image:"https://github.com/ryssroad.png",title:"Community member",url:"https://github.com/ryssroad",communityMember:"true"})]})}function u(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},3872:(e,n,r)=>{r.d(n,{Z:()=>i});r(7294);var t=r(5893);const i=e=>{let{image:n,name:r,title:i,url:s,communityMember:l=!1}=e;return(0,t.jsx)("section",{className:"author_card",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"avatar",children:(0,t.jsx)("a",{href:s,target:"_blank",alt:r,children:(0,t.jsx)("img",{src:n,alt:r})})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"name",children:(0,t.jsx)("a",{href:s,target:"_blank",alt:r,children:r})}),(0,t.jsx)("span",{className:"title",children:i}),(0,t.jsxs)("span",{className:"discord",children:[l?"Join our community on":"Got questions? Find us on"," ",(0,t.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,r)=>{r.d(n,{Z:()=>a,a:()=>l});var t=r(7294);const i={},s=t.createContext(i);function l(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(i):e.components||i:l(e.components),t.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/d8be0e5a.7273b2cf.js b/assets/js/d8be0e5a.4d19f9ce.js similarity index 99% rename from assets/js/d8be0e5a.7273b2cf.js rename to assets/js/d8be0e5a.4d19f9ce.js index 5d8be4cf1..366c4f8a2 100644 --- a/assets/js/d8be0e5a.7273b2cf.js +++ b/assets/js/d8be0e5a.4d19f9ce.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[1706],{4751:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>o,contentTitle:()=>a,default:()=>u,frontMatter:()=>l,metadata:()=>c,toc:()=>d});var r=i(5893),t=i(1151),s=i(3872);const l={title:"Error linking with cc",slug:"error-linking-with-cc-failed-exist-status-1",hide_title:!0,tags:["references","help","update","upgrade","fix"]},a=void 0,c={id:"Lightning CLI/error-linking-with-cc-failed",title:"Error linking with cc",description:"Check if CPU is supported",source:"@site/references/Lightning CLI/error-linking-with-cc-failed.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/error-linking-with-cc-failed-exist-status-1",permalink:"/references/Lightning CLI/error-linking-with-cc-failed-exist-status-1",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/error-linking-with-cc-failed.md",tags:[{label:"references",permalink:"/references/tags/references"},{label:"help",permalink:"/references/tags/help"},{label:"update",permalink:"/references/tags/update"},{label:"upgrade",permalink:"/references/tags/upgrade"},{label:"fix",permalink:"/references/tags/fix"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Error linking with cc",slug:"error-linking-with-cc-failed-exist-status-1",hide_title:!0,tags:["references","help","update","upgrade","fix"]},sidebar:"defaultSidebar",previous:{title:"Error building on ARM64",permalink:"/references/Lightning CLI/error-building-on-arm64"},next:{title:"File permissions and Ownership",permalink:"/references/Lightning CLI/file-permissions-and-ownership"}},o={},d=[{value:"Check if CPU is supported",id:"check-if-cpu-is-supported",level:2},{value:"Linking with cc error",id:"linking-with-cc-error",level:2},{value:"Update",id:"update",level:2},{value:"Install gcc:",id:"install-gcc",level:2},{value:"Remove previous installation files",id:"remove-previous-installation-files",level:2},{value:"Run the installation script",id:"run-the-installation-script",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",...(0,t.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h2,{id:"check-if-cpu-is-supported",children:"Check if CPU is supported"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"uname -i\n"})}),"\n",(0,r.jsxs)(n.admonition,{title:"WARNING",type:"caution",children:[(0,r.jsxs)(n.p,{children:["Given the ",(0,r.jsx)(n.a,{href:"https://docs.fleek.network/docs/node/requirements/#specs",children:"CPU requirements"}),", currently we're mainly supporting ",(0,r.jsx)(n.code,{children:"GenuineIntel"})," and there have been reports of failure to build the binary on ",(0,r.jsx)(n.code,{children:"AMD"}),". The ",(0,r.jsx)(n.code,{children:"ARM64"})," is a different architecture, thus not supported, but there has been some community contributions in that regard, find it in the reference ",(0,r.jsx)(n.a,{href:"/references/Lightning%20CLI/error-building-on-arm64",children:"error building on ARM64"}),"."]}),(0,r.jsxs)(n.p,{children:["Any contribution or feedback to provide support is appreciated. Feel free to let us know on our ",(0,r.jsx)(n.a,{href:"https://discord.gg/fleekxyz",children:"Discord channel"}),"."]})]}),"\n",(0,r.jsx)(n.h2,{id:"linking-with-cc-error",children:"Linking with cc error"}),"\n",(0,r.jsxs)(n.p,{children:["A user who finds the error ",(0,r.jsx)(n.code,{children:"linking with cc failed"}),", will have to install the required dependencies."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"error: linking with `cc` failed: exit status: 1\nerror: could not compile `fleek-service-ping-example` (lib) due to previous error\n"})}),"\n",(0,r.jsx)(n.h2,{id:"update",children:"Update"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"sudo apt-get update\n"})}),"\n",(0,r.jsxs)(n.h2,{id:"install-gcc",children:["Install ",(0,r.jsx)(n.code,{children:"gcc"}),":"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"sudo apt-get install gcc\n"})}),"\n",(0,r.jsx)(n.h2,{id:"remove-previous-installation-files",children:"Remove previous installation files"}),"\n",(0,r.jsxs)(n.p,{children:["You can re-run the installation process. If you are using the assisted installer, it'll complain that the source code directory already exists. Since you've probably cloned the source code repository locally, you'll have to remove it manually. If you need help, find the instructions in the ",(0,r.jsx)(n.a,{href:"/references/Lightning%20CLI/uninstall-lightning-node",children:"reference"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"run-the-installation-script",children:"Run the installation script"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"curl https://get.fleek.network | bash\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Alternatively, read the ",(0,r.jsx)(n.a,{href:"/docs/node/install#manual-installation",children:"manual installation instructions"})," for more information."]}),"\n",(0,r.jsx)(s.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function u(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},3872:(e,n,i)=>{i.d(n,{Z:()=>t});i(7294);var r=i(5893);const t=e=>{let{image:n,name:i,title:t,url:s,communityMember:l=!1}=e;return(0,r.jsx)("section",{className:"author_card",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"avatar",children:(0,r.jsx)("a",{href:s,target:"_blank",alt:i,children:(0,r.jsx)("img",{src:n,alt:i})})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"name",children:(0,r.jsx)("a",{href:s,target:"_blank",alt:i,children:i})}),(0,r.jsx)("span",{className:"title",children:t}),(0,r.jsxs)("span",{className:"discord",children:[l?"Join our community on":"Got questions? Find us on"," ",(0,r.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,i)=>{i.d(n,{Z:()=>a,a:()=>l});var r=i(7294);const t={},s=r.createContext(t);function l(e){const n=r.useContext(s);return r.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),r.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[1706],{4751:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>o,contentTitle:()=>a,default:()=>u,frontMatter:()=>l,metadata:()=>c,toc:()=>d});var r=i(5893),t=i(1151),s=i(3872);const l={title:"Error linking with cc",slug:"error-linking-with-cc-failed-exist-status-1",hide_title:!0,tags:["references","help","update","upgrade","fix"]},a=void 0,c={id:"Lightning CLI/error-linking-with-cc-failed",title:"Error linking with cc",description:"Check if CPU is supported",source:"@site/references/Lightning CLI/error-linking-with-cc-failed.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/error-linking-with-cc-failed-exist-status-1",permalink:"/references/Lightning CLI/error-linking-with-cc-failed-exist-status-1",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/error-linking-with-cc-failed.md",tags:[{label:"references",permalink:"/references/tags/references"},{label:"help",permalink:"/references/tags/help"},{label:"update",permalink:"/references/tags/update"},{label:"upgrade",permalink:"/references/tags/upgrade"},{label:"fix",permalink:"/references/tags/fix"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Error linking with cc",slug:"error-linking-with-cc-failed-exist-status-1",hide_title:!0,tags:["references","help","update","upgrade","fix"]},sidebar:"defaultSidebar",previous:{title:"Error building on ARM64",permalink:"/references/Lightning CLI/error-building-on-arm64"},next:{title:"File permissions and Ownership",permalink:"/references/Lightning CLI/file-permissions-and-ownership"}},o={},d=[{value:"Check if CPU is supported",id:"check-if-cpu-is-supported",level:2},{value:"Linking with cc error",id:"linking-with-cc-error",level:2},{value:"Update",id:"update",level:2},{value:"Install gcc:",id:"install-gcc",level:2},{value:"Remove previous installation files",id:"remove-previous-installation-files",level:2},{value:"Run the installation script",id:"run-the-installation-script",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",p:"p",pre:"pre",...(0,t.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h2,{id:"check-if-cpu-is-supported",children:"Check if CPU is supported"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"uname -i\n"})}),"\n",(0,r.jsxs)(n.admonition,{title:"WARNING",type:"caution",children:[(0,r.jsxs)(n.p,{children:["Given the ",(0,r.jsx)(n.a,{href:"https://docs.fleek.network/docs/node/requirements/#specs",children:"CPU requirements"}),", currently we're mainly supporting ",(0,r.jsx)(n.code,{children:"GenuineIntel"})," and there have been reports of failure to build the binary on ",(0,r.jsx)(n.code,{children:"AMD"}),". The ",(0,r.jsx)(n.code,{children:"ARM64"})," is a different architecture, thus not supported, but there has been some community contributions in that regard, find it in the reference ",(0,r.jsx)(n.a,{href:"/references/Lightning%20CLI/error-building-on-arm64",children:"error building on ARM64"}),"."]}),(0,r.jsxs)(n.p,{children:["Any contribution or feedback to provide support is appreciated. Feel free to let us know on our ",(0,r.jsx)(n.a,{href:"https://discord.gg/fleekxyz",children:"Discord channel"}),"."]})]}),"\n",(0,r.jsx)(n.h2,{id:"linking-with-cc-error",children:"Linking with cc error"}),"\n",(0,r.jsxs)(n.p,{children:["A user who finds the error ",(0,r.jsx)(n.code,{children:"linking with cc failed"}),", will have to install the required dependencies."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"error: linking with `cc` failed: exit status: 1\nerror: could not compile `fleek-service-ping-example` (lib) due to previous error\n"})}),"\n",(0,r.jsx)(n.h2,{id:"update",children:"Update"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"sudo apt-get update\n"})}),"\n",(0,r.jsxs)(n.h2,{id:"install-gcc",children:["Install ",(0,r.jsx)(n.code,{children:"gcc"}),":"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"sudo apt-get install gcc\n"})}),"\n",(0,r.jsx)(n.h2,{id:"remove-previous-installation-files",children:"Remove previous installation files"}),"\n",(0,r.jsxs)(n.p,{children:["You can re-run the installation process. If you are using the assisted installer, it'll complain that the source code directory already exists. Since you've probably cloned the source code repository locally, you'll have to remove it manually. If you need help, find the instructions in the ",(0,r.jsx)(n.a,{href:"/references/Lightning%20CLI/uninstall-lightning-node",children:"reference"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"run-the-installation-script",children:"Run the installation script"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"curl https://get.fleek.network | bash\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Alternatively, read the ",(0,r.jsx)(n.a,{href:"/docs/node/install#manual-installation",children:"manual installation instructions"})," for more information."]}),"\n",(0,r.jsx)(s.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function u(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},3872:(e,n,i)=>{i.d(n,{Z:()=>t});i(7294);var r=i(5893);const t=e=>{let{image:n,name:i,title:t,url:s,communityMember:l=!1}=e;return(0,r.jsx)("section",{className:"author_card",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"avatar",children:(0,r.jsx)("a",{href:s,target:"_blank",alt:i,children:(0,r.jsx)("img",{src:n,alt:i})})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"name",children:(0,r.jsx)("a",{href:s,target:"_blank",alt:i,children:i})}),(0,r.jsx)("span",{className:"title",children:t}),(0,r.jsxs)("span",{className:"discord",children:[l?"Join our community on":"Got questions? Find us on"," ",(0,r.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,n,i)=>{i.d(n,{Z:()=>a,a:()=>l});var r=i(7294);const t={},s=r.createContext(t);function l(e){const n=r.useContext(s);return r.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),r.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/fd2b74dc.28ff9e79.js b/assets/js/fd2b74dc.015313e6.js similarity index 98% rename from assets/js/fd2b74dc.28ff9e79.js rename to assets/js/fd2b74dc.015313e6.js index ae49d0ded..5176d6988 100644 --- a/assets/js/fd2b74dc.28ff9e79.js +++ b/assets/js/fd2b74dc.015313e6.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[4846],{949:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>u,frontMatter:()=>i,metadata:()=>d,toc:()=>c});var s=n(5893),o=n(1151),r=n(3872);const i={title:"Keys not found",slug:"keys-not-found",hide_title:!0,tags:["keystore","lost keys","ownership","file permissions"]},a=void 0,d={id:"Lightning CLI/keys-not-found",title:"Keys not found",description:"Node key does not exist",source:"@site/references/Lightning CLI/keys-not-found.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/keys-not-found",permalink:"/references/Lightning CLI/keys-not-found",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/keys-not-found.md",tags:[{label:"keystore",permalink:"/references/tags/keystore"},{label:"lost keys",permalink:"/references/tags/lost-keys"},{label:"ownership",permalink:"/references/tags/ownership"},{label:"file permissions",permalink:"/references/tags/file-permissions"}],version:"current",lastUpdatedAt:1699382434,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Keys not found",slug:"keys-not-found",hide_title:!0,tags:["keystore","lost keys","ownership","file permissions"]},sidebar:"defaultSidebar",previous:{title:"Frequently used commands for Native setup",permalink:"/references/Lightning CLI/frequently-used-commands-for-native-setup"},next:{title:"Backing up the keystore",permalink:"/references/Lightning CLI/backing-up-the-keystore"}},l={},c=[{value:"Node key does not exist",id:"node-key-does-not-exist",level:2}];function h(e){const t={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,o.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h2,{id:"node-key-does-not-exist",children:"Node key does not exist"}),"\n",(0,s.jsx)(t.p,{children:'When watching the Fleek Network Lightning service log output, you find the "Node key does not exist" message placed recursively. As follows:'}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-sh",children:"thread 'main' panicked at 'Node key does not exist. Use CLI to generate keys.', core/node/src/testnet_sync.rs:126:9\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\nthread 'main' panicked at 'Node key does not exist. Use CLI to generate keys.', core/node/src/testnet_sync.rs:126:9\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n"})}),"\n",(0,s.jsxs)(t.p,{children:["If you haven't deleted the keystore and can locate it, it's due to how the service is being run. As a user can delegate (sudo) the execution of the process to ",(0,s.jsx)(t.strong,{children:"root"}),", the location of the keystore differs on runtime."]}),"\n",(0,s.jsxs)(t.p,{children:["To learn more about how file permissions and ownership work, you're advised to read the reference document ",(0,s.jsx)(t.a,{href:"/references/Lightning%20CLI/file-permissions-and-ownership",children:"here"}),"."]}),"\n",(0,s.jsx)(r.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function u(e={}){const{wrapper:t}={...(0,o.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},3872:(e,t,n)=>{n.d(t,{Z:()=>o});n(7294);var s=n(5893);const o=e=>{let{image:t,name:n,title:o,url:r,communityMember:i=!1}=e;return(0,s.jsx)("section",{className:"author_card",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"avatar",children:(0,s.jsx)("a",{href:r,target:"_blank",alt:n,children:(0,s.jsx)("img",{src:t,alt:n})})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"name",children:(0,s.jsx)("a",{href:r,target:"_blank",alt:n,children:n})}),(0,s.jsx)("span",{className:"title",children:o}),(0,s.jsxs)("span",{className:"discord",children:[i?"Join our community on":"Got questions? Find us on"," ",(0,s.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,t,n)=>{n.d(t,{Z:()=>a,a:()=>i});var s=n(7294);const o={},r=s.createContext(o);function i(e){const t=s.useContext(r);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:i(e.components),s.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[4846],{949:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>u,frontMatter:()=>i,metadata:()=>d,toc:()=>c});var s=n(5893),o=n(1151),r=n(3872);const i={title:"Keys not found",slug:"keys-not-found",hide_title:!0,tags:["keystore","lost keys","ownership","file permissions"]},a=void 0,d={id:"Lightning CLI/keys-not-found",title:"Keys not found",description:"Node key does not exist",source:"@site/references/Lightning CLI/keys-not-found.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/keys-not-found",permalink:"/references/Lightning CLI/keys-not-found",draft:!1,unlisted:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/keys-not-found.md",tags:[{label:"keystore",permalink:"/references/tags/keystore"},{label:"lost keys",permalink:"/references/tags/lost-keys"},{label:"ownership",permalink:"/references/tags/ownership"},{label:"file permissions",permalink:"/references/tags/file-permissions"}],version:"current",lastUpdatedAt:1699384566,formattedLastUpdatedAt:"Nov 7, 2023",frontMatter:{title:"Keys not found",slug:"keys-not-found",hide_title:!0,tags:["keystore","lost keys","ownership","file permissions"]},sidebar:"defaultSidebar",previous:{title:"Frequently used commands for Native setup",permalink:"/references/Lightning CLI/frequently-used-commands-for-native-setup"},next:{title:"Backing up the keystore",permalink:"/references/Lightning CLI/backing-up-the-keystore"}},l={},c=[{value:"Node key does not exist",id:"node-key-does-not-exist",level:2}];function h(e){const t={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,o.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h2,{id:"node-key-does-not-exist",children:"Node key does not exist"}),"\n",(0,s.jsx)(t.p,{children:'When watching the Fleek Network Lightning service log output, you find the "Node key does not exist" message placed recursively. As follows:'}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-sh",children:"thread 'main' panicked at 'Node key does not exist. Use CLI to generate keys.', core/node/src/testnet_sync.rs:126:9\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\nthread 'main' panicked at 'Node key does not exist. Use CLI to generate keys.', core/node/src/testnet_sync.rs:126:9\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n"})}),"\n",(0,s.jsxs)(t.p,{children:["If you haven't deleted the keystore and can locate it, it's due to how the service is being run. As a user can delegate (sudo) the execution of the process to ",(0,s.jsx)(t.strong,{children:"root"}),", the location of the keystore differs on runtime."]}),"\n",(0,s.jsxs)(t.p,{children:["To learn more about how file permissions and ownership work, you're advised to read the reference document ",(0,s.jsx)(t.a,{href:"/references/Lightning%20CLI/file-permissions-and-ownership",children:"here"}),"."]}),"\n",(0,s.jsx)(r.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida"})]})}function u(e={}){const{wrapper:t}={...(0,o.a)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},3872:(e,t,n)=>{n.d(t,{Z:()=>o});n(7294);var s=n(5893);const o=e=>{let{image:t,name:n,title:o,url:r,communityMember:i=!1}=e;return(0,s.jsx)("section",{className:"author_card",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"avatar",children:(0,s.jsx)("a",{href:r,target:"_blank",alt:n,children:(0,s.jsx)("img",{src:t,alt:n})})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"name",children:(0,s.jsx)("a",{href:r,target:"_blank",alt:n,children:n})}),(0,s.jsx)("span",{className:"title",children:o}),(0,s.jsxs)("span",{className:"discord",children:[i?"Join our community on":"Got questions? Find us on"," ",(0,s.jsx)("a",{href:"https://discord.gg/fleekxyz",target:"_blank",children:"discord!"})]})]})]})})}},1151:(e,t,n)=>{n.d(t,{Z:()=>a,a:()=>i});var s=n(7294);const o={},r=s.createContext(o);function i(e){const t=s.useContext(r);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:i(e.components),s.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/main.176c548d.js b/assets/js/main.63e95a14.js similarity index 99% rename from assets/js/main.176c548d.js rename to assets/js/main.63e95a14.js index a4a806c68..23354a8c8 100644 --- a/assets/js/main.176c548d.js +++ b/assets/js/main.63e95a14.js @@ -1,2 +1,2 @@ -/*! For license information please see main.176c548d.js.LICENSE.txt */ -(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[179],{830:(e,t,n)=>{"use strict";n.d(t,{W:()=>o});var r=n(7294);function o(){return r.createElement("svg",{width:"20",height:"20",className:"DocSearch-Search-Icon",viewBox:"0 0 20 20"},r.createElement("path",{d:"M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}},4334:(e,t,n)=>{"use strict";function r(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;to});const o=function(){for(var e,t,n=0,o="";n{"use strict";function r(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;to});const o=function(){for(var e,t,n=0,o="";n{"use strict";n.d(t,{Z:()=>f});n(7294);var r=n(8356),o=n.n(r),a=n(6887);const i={"00309d1b":[()=>n.e(9335).then(n.t.bind(n,5219,19)),"~docs/default/tag-docs-tags-fleek-network-206.json",5219],"01a85c17":[()=>Promise.all([n.e(532),n.e(4013)]).then(n.bind(n,4524)),"@theme/BlogTagsListPage",4524],"02f62b30":[()=>n.e(2170).then(n.t.bind(n,6037,19)),"/home/runner/work/fleek-network-docs/fleek-network-docs/.docusaurus/docusaurus-plugin-content-docs/guides/plugin-route-context-module-100.json",6037],"0359c679":[()=>n.e(7649).then(n.t.bind(n,8511,19)),"~docs/references/tag-references-tags-sudoer-94d.json",8511],"07f20919":[()=>n.e(4327).then(n.t.bind(n,6444,19)),"~docs/references/tag-references-tags-root-1d1.json",6444],"08dd5264":[()=>n.e(9267).then(n.t.bind(n,9692,19)),"~docs/default/tag-docs-tags-snarks-8e6.json",9692],"08ded6db":[()=>n.e(7216).then(n.t.bind(n,1426,19)),"~docs/references/tag-references-tags-lightning-d47.json",1426],"09ac38f0":[()=>n.e(3343).then(n.t.bind(n,4764,19)),"~docs/references/tag-references-tags-delete-f8c.json",4764],"0dffb83e":[()=>n.e(5075).then(n.bind(n,113)),"@site/docs/roadmap.md",113],"0ea1f268":[()=>n.e(663).then(n.t.bind(n,454,19)),"~docs/references/tag-references-tags-restore-2d4.json",454],"0fbdd4ac":[()=>n.e(8934).then(n.t.bind(n,8944,19)),"~docs/guides/tag-guides-tags-ownership-c29.json",8944],"1366d7ae":[()=>n.e(2564).then(n.bind(n,5468)),"@site/docs/node/lightning-cli.md",5468],"13986d62":[()=>n.e(9822).then(n.t.bind(n,8973,19)),"~docs/references/tag-references-tags-cli-35e.json",8973],"143de299":[()=>n.e(8427).then(n.t.bind(n,9162,19)),"~docs/default/tag-docs-tags-algorithms-8a4.json",9162],"153c226b":[()=>n.e(7249).then(n.t.bind(n,9141,19)),"~docs/default/tag-docs-tags-compile-66b.json",9141],"155c1e74":[()=>n.e(747).then(n.t.bind(n,8095,19)),"~docs/references/tag-references-tags-reference-379.json",8095],"166b5465":[()=>n.e(1517).then(n.t.bind(n,9151,19)),"~docs/references/tag-references-tags-pkill-ae0.json",9151],17896441:[()=>Promise.all([n.e(532),n.e(7874),n.e(7918)]).then(n.bind(n,8945)),"@theme/DocItem",8945],"179183ba":[()=>n.e(6601).then(n.t.bind(n,655,19)),"~docs/default/tag-docs-tags-protocol-8a8.json",655],"180ee354":[()=>n.e(9316).then(n.t.bind(n,5601,19)),"~docs/default/tag-docs-tags-manage-3d5.json",5601],"187c6361":[()=>n.e(6788).then(n.t.bind(n,1461,19)),"~docs/default/tag-docs-tags-edge-network-189.json",1461],"19f79f7b":[()=>n.e(8489).then(n.bind(n,8816)),"@site/guides/Node Operators/how-to-manage-logfiles.md",8816],"1a4e3797":[()=>Promise.all([n.e(532),n.e(7920)]).then(n.bind(n,2026)),"@theme/SearchPage",2026],"1c14429f":[()=>n.e(2702).then(n.bind(n,5894)),"@site/guides/Node Operators/getting-started-guide.md",5894],"1d8a5d15":[()=>n.e(9854).then(n.bind(n,884)),"@site/guides/Node Operators/transfering-setup-ownership.md",884],"1df93b7f":[()=>n.e(3237).then(n.bind(n,9754)),"@site/src/pages/index.tsx",9754],"21f2cabf":[()=>n.e(4537).then(n.t.bind(n,724,19)),"~docs/references/tag-references-tags-backup-7d5.json",724],"2218035b":[()=>n.e(4530).then(n.t.bind(n,3769,19)),"/home/runner/work/fleek-network-docs/fleek-network-docs/.docusaurus/docusaurus-plugin-content-docs/default/plugin-route-context-module-100.json",3769],"26b85cb6":[()=>n.e(7055).then(n.bind(n,6172)),"@site/references/Lightning CLI/restore-keystore.md",6172],"2730e145":[()=>n.e(7147).then(n.bind(n,5450)),"@site/references/Lightning CLI/permission-denied-os-error-13.md",5450],27528755:[()=>n.e(6926).then(n.t.bind(n,2578,19)),"~docs/references/tag-references-tags-uninstall-aa8.json",2578],"29b62a39":[()=>n.e(1498).then(n.bind(n,181)),"@site/guides/index.md",181],"29b83576":[()=>n.e(1510).then(n.bind(n,7003)),"@site/references/Lightning CLI/keystore-backup.md",7003],"2a6b0b88":[()=>n.e(6446).then(n.t.bind(n,8424,19)),"~docs/references/tag-references-tags-commands-89d.json",8424],"2adfdcac":[()=>n.e(3189).then(n.t.bind(n,4723,19)),"~docs/default/tag-docs-tags-token-d9b.json",4723],"2baa5a9a":[()=>n.e(9021).then(n.t.bind(n,8704,19)),"~docs/guides/tag-guides-tags-configuration-48b.json",8704],"2ddc9f52":[()=>n.e(7400).then(n.t.bind(n,5048,19)),"~docs/references/tag-references-tags-build-211.json",5048],"2e0a4d25":[()=>n.e(8132).then(n.t.bind(n,9073,19)),"~docs/references/tag-references-tags-systemctl-aa5.json",9073],"3290fbc2":[()=>n.e(2235).then(n.bind(n,6924)),"@site/docs/develop/client.md",6924],35230925:[()=>n.e(5602).then(n.bind(n,8139)),"@site/docs/learn/developers.md",8139],"35a7e2bf":[()=>n.e(4508).then(n.t.bind(n,8581,19)),"~docs/default/tag-docs-tags-contribute-7e0.json",8581],"3720c009":[()=>Promise.all([n.e(532),n.e(3751)]).then(n.bind(n,727)),"@theme/DocTagsListPage",727],"39574d2e":[()=>n.e(8747).then(n.t.bind(n,8270,19)),"~docs/default/tag-docs-tags-decentralization-674.json",8270],"399f21a8":[()=>n.e(2214).then(n.t.bind(n,2281,19)),"~docs/default/tag-docs-tags-rpc-9da.json",2281],"39e94577":[()=>n.e(1563).then(n.t.bind(n,3199,19)),"~docs/default/tag-docs-tags-build-2a2.json",3199],"3a6297ac":[()=>n.e(11).then(n.t.bind(n,2511,19)),"~docs/default/tag-docs-tags-sdk-70c.json",2511],"3b168dbd":[()=>n.e(469).then(n.t.bind(n,2832,19)),"~docs/guides/tag-guides-tags-edge-computing-c27.json",2832],"3f0cec70":[()=>n.e(9336).then(n.t.bind(n,4776,19)),"~docs/guides/tag-guides-tags-help-63e.json",4776],"3f3a03c1":[()=>n.e(4451).then(n.t.bind(n,1721,19)),"~blog/default/blog-tags-blog-476-list.json",1721],"3f90f51b":[()=>n.e(6669).then(n.bind(n,1054)),"@site/docs/learn/services.md",1054],"4035650f":[()=>n.e(2260).then(n.t.bind(n,9438,19)),"~blog/default/blog-tags-engineering-6ae.json",9438],"4061bfd3":[()=>n.e(3116).then(n.t.bind(n,7085,19)),"/home/runner/work/fleek-network-docs/fleek-network-docs/.docusaurus/docusaurus-theme-search-algolia/default/plugin-route-context-module-100.json",7085],"40aeb86f":[()=>n.e(4402).then(n.bind(n,2382)),"@site/references/Lightning CLI/update-cli-from-source-code.md",2382],"4247aede":[()=>n.e(2800).then(n.t.bind(n,4948,19)),"~docs/default/tag-docs-tags-consensus-a3b.json",4948],"433ff3d6":[()=>n.e(555).then(n.t.bind(n,2787,19)),"~docs/default/tag-docs-tags-rewards-1bb.json",2787],"43ee1886":[()=>n.e(5466).then(n.t.bind(n,653,19)),"~docs/references/tag-references-tags-idle-b08.json",653],"445e9e2a":[()=>n.e(8578).then(n.bind(n,1478)),"@site/references/Lightning CLI/node-secret-key-does-not-exist.md",1478],"44969bae":[()=>n.e(4063).then(n.bind(n,6019)),"@site/docs/node/requirements.md",6019],"45ac3af8":[()=>n.e(5204).then(n.t.bind(n,5796,19)),"~docs/default/tag-docs-tags-systemctl-2a0.json",5796],"45c86e35":[()=>n.e(9847).then(n.t.bind(n,2316,19)),"~docs/default/tag-docs-tags-about-3bc.json",2316],"45e1a117":[()=>n.e(6696).then(n.t.bind(n,5382,19)),"~docs/references/tag-references-tags-frozen-e7d.json",5382],"469c924f":[()=>n.e(2240).then(n.t.bind(n,342,19)),"~docs/default/tag-docs-tags-roadmap-bd4.json",342],"48857ff6":[()=>n.e(2908).then(n.t.bind(n,1014,19)),"~docs/default/tag-docs-tags-open-source-3c0.json",1014],"48e81e49":[()=>n.e(173).then(n.t.bind(n,5121,19)),"~docs/default/tag-docs-tags-incentives-3eb.json",5121],"49b5e83d":[()=>n.e(402).then(n.t.bind(n,3969,19)),"~docs/default/tag-docs-tags-manual-b97.json",3969],"4a821728":[()=>n.e(9513).then(n.t.bind(n,9748,19)),"~docs/default/tag-docs-tags-whitepaper-2ec.json",9748],"4beaa780":[()=>n.e(5081).then(n.t.bind(n,380,19)),"~docs/default/tag-docs-tags-reputation-c14.json",380],"4c027320":[()=>n.e(9511).then(n.t.bind(n,2564,19)),"~docs/guides/tag-guides-tags-getting-started-812.json",2564],"4c9535f7":[()=>n.e(6296).then(n.bind(n,9237)),"@site/guides/Node Operators/running-a-node-in-docker.md",9237],"4d7007b2":[()=>n.e(6272).then(n.bind(n,2482)),"@site/references/index.md",2482],"50f02954":[()=>n.e(4826).then(n.t.bind(n,3900,19)),"~docs/references/tag-references-tags-systemd-aff.json",3900],"514cab6e":[()=>n.e(6410).then(n.bind(n,5673)),"@site/docs/Open-source/code-of-conduct.md",5673],"51d5b592":[()=>n.e(1984).then(n.bind(n,7859)),"@site/docs/node/install.md",7859],"51f2bfad":[()=>n.e(71).then(n.t.bind(n,3386,19)),"~docs/default/tag-docs-tags-server-240.json",3386],"53ca291c":[()=>n.e(3863).then(n.t.bind(n,4586,19)),"~docs/default/tag-docs-tags-economics-342.json",4586],"5437f376":[()=>n.e(909).then(n.bind(n,3616)),"@site/guides/Node Operators/managing-the-keystore.md",3616],"54436d06":[()=>n.e(4872).then(n.t.bind(n,4094,19)),"~docs/default/tag-docs-tags-cli-dbf.json",4094],"5559e604":[()=>n.e(2501).then(n.t.bind(n,811,19)),"~docs/default/tag-docs-tags-systemd-9d0.json",811],"55960ee5":[()=>n.e(4121).then(n.t.bind(n,8070,19)),"~docs/default/tags-list-current-prop-15a.json",8070],"564044f9":[()=>n.e(1771).then(n.t.bind(n,4283,19)),"~docs/guides/tag-guides-tags-public-keys-1f7.json",4283],"581d5240":[()=>n.e(5318).then(n.bind(n,4798)),"@site/docs/node/health-check.md",4798],"5a9491fe":[()=>n.e(6476).then(n.t.bind(n,5751,19)),"~docs/guides/tag-guides-tags-keystore-6f8.json",5751],"5b6134d1":[()=>n.e(9752).then(n.bind(n,2421)),"@site/references/Lightning CLI/file-permissions-and-ownership.md",2421],"5bc389a1":[()=>n.e(9829).then(n.bind(n,7631)),"@site/guides/Node Operators/updating-lightning.md",7631],"5d08f08d":[()=>n.e(659).then(n.t.bind(n,340,19)),"~docs/guides/tag-guides-tags-guide-f01.json",340],"5d38c936":[()=>n.e(9804).then(n.t.bind(n,9797,19)),"~docs/default/tag-docs-tags-rust-dependencies-0a8.json",9797],"5e95c892":[()=>n.e(9661).then(n.bind(n,1892)),"@theme/DocsRoot",1892],"5e9f5e1a":[()=>Promise.resolve().then(n.bind(n,6809)),"@generated/docusaurus.config",6809],"5ec90731":[()=>n.e(8942).then(n.t.bind(n,5440,19)),"~docs/guides/tag-guides-tags-transfer-246.json",5440],"5ef0bdde":[()=>n.e(8567).then(n.t.bind(n,7778,19)),"~blog/default/blog-tags-content-routing-b90.json",7778],"616ee580":[()=>n.e(4749).then(n.t.bind(n,5736,19)),"~docs/references/tag-references-tags-remove-c35.json",5736],"631037e5":[()=>n.e(801).then(n.t.bind(n,7064,19)),"~blog/default/blog-tags-blog-476.json",7064],"64d03520":[()=>n.e(1138).then(n.t.bind(n,2217,19)),"~docs/default/tag-docs-tags-requirements-a99.json",2217],"665f164c":[()=>n.e(9320).then(n.bind(n,3566)),"@site/docs/node/testnet-onboarding.md",3566],"6875c492":[()=>Promise.all([n.e(532),n.e(7874),n.e(130),n.e(8610)]).then(n.bind(n,1714)),"@theme/BlogTagsPostsPage",1714],"68b99ecd":[()=>n.e(4556).then(n.t.bind(n,1407,19)),"~docs/default/tag-docs-tags-standards-f96.json",1407],"6be32138":[()=>n.e(3396).then(n.bind(n,3103)),"@site/blog/bloom-and-cuckoo-filters-for-cache-summarization.md",3103],"6cbb3cde":[()=>n.e(5136).then(n.t.bind(n,3860,19)),"~blog/default/blog-tags-engineering-6ae-list.json",3860],"6ccb158e":[()=>n.e(3218).then(n.t.bind(n,4391,19)),"~docs/references/tag-references-tags-keystore-d50.json",4391],"6e965365":[()=>n.e(4679).then(n.t.bind(n,8472,19)),"~docs/references/tag-references-tags-references-2ec.json",8472],"6f8964f3":[()=>n.e(7536).then(n.t.bind(n,9430,19)),"~docs/guides/tag-guides-tags-fleek-network-dce.json",9430],"719c0fd7":[()=>n.e(706).then(n.t.bind(n,6419,19)),"~docs/references/tag-references-tags-permissions-2fe.json",6419],"749619b5":[()=>n.e(6362).then(n.t.bind(n,5294,19)),"~docs/references/tag-references-tags-ownership-96b.json",5294],"74ec46b4":[()=>n.e(1263).then(n.t.bind(n,1337,19)),"~docs/default/tag-docs-tags-wizard-38b.json",1337],"75d8af72":[()=>n.e(1474).then(n.t.bind(n,1187,19)),"~docs/default/tag-docs-tags-diagnostic-a48.json",1187],"763344b9":[()=>n.e(5094).then(n.t.bind(n,5772,19)),"~docs/default/tag-docs-tags-toolkit-735.json",5772],"779cc1e8":[()=>n.e(4).then(n.t.bind(n,761,19)),"~docs/references/tag-references-tags-update-c18.json",761],"79055aff":[()=>n.e(8256).then(n.t.bind(n,92,19)),"~docs/default/tag-docs-tags-logs-8e1.json",92],"7aba1839":[()=>n.e(554).then(n.t.bind(n,7177,19)),"~docs/default/tag-docs-tags-ports-99f.json",7177],"7aefc753":[()=>n.e(1251).then(n.bind(n,8717)),"@site/references/Lightning CLI/uninstall-lightning-node.md",8717],"7b667a7f":[()=>n.e(5649).then(n.t.bind(n,5274,19)),"~docs/default/tag-docs-tags-git-514.json",5274],"7b788087":[()=>n.e(9062).then(n.t.bind(n,6149,19)),"~docs/guides/tag-guides-tags-keys-31a.json",6149],"7b9de75f":[()=>n.e(6353).then(n.t.bind(n,6378,19)),"~docs/default/tag-docs-tags-healthcheck-28a.json",6378],"7ceaa645":[()=>n.e(387).then(n.bind(n,155)),"@site/docs/learn/the-network.md",155],"814f3328":[()=>n.e(2535).then(n.t.bind(n,5641,19)),"~blog/default/blog-post-list-prop-default.json",5641],82893666:[()=>n.e(8005).then(n.t.bind(n,2220,19)),"~docs/default/tag-docs-tags-develop-1cf.json",2220],"8428fe34":[()=>n.e(5522).then(n.bind(n,576)),"@site/docs/node/diagnostics.md",576],"84cbd6c9":[()=>n.e(3336).then(n.t.bind(n,4793,19)),"~docs/guides/tags-list-current-prop-15a.json",4793],"84e08f43":[()=>n.e(8059).then(n.t.bind(n,3290,19)),"~docs/references/tag-references-tags-file-permissions-d5d.json",3290],"85d6e74d":[()=>n.e(4819).then(n.t.bind(n,5745,19)),"/home/runner/work/fleek-network-docs/fleek-network-docs/.docusaurus/docusaurus-plugin-content-pages/default/plugin-route-context-module-100.json",5745],"866d553a":[()=>n.e(8668).then(n.bind(n,1534)),"@site/references/Lightning CLI/frequently-used-commands-for-native-setup.md",1534],"86c3bd1d":[()=>n.e(2421).then(n.t.bind(n,813,19)),"~docs/references/tag-references-tags-user-service-d6a.json",813],"8a92e787":[()=>n.e(2517).then(n.bind(n,6739)),"@site/references/Systemd/shutting-down-persistance.md",6739],"8cf21e85":[()=>n.e(6854).then(n.t.bind(n,90,19)),"~docs/default/tag-docs-tags-client-ceb.json",90],"8def2dd5":[()=>n.e(382).then(n.bind(n,4610)),"@site/docs/learn/index.md",4610],"90decb6d":[()=>n.e(9649).then(n.t.bind(n,2570,19)),"~docs/guides/tag-guides-tags-private-keys-b97.json",2570],"933a69d3":[()=>n.e(7813).then(n.t.bind(n,1853,19)),"~docs/default/tag-docs-tags-getting-started-980.json",1853],"935f2afb":[()=>n.e(53).then(n.t.bind(n,1109,19)),"~docs/default/version-current-metadata-prop-751.json",1109],"93df2695":[()=>n.e(2386).then(n.bind(n,1367)),"@site/docs/learn/delivery-acknowledgements.md",1367],"95f4d37c":[()=>n.e(814).then(n.bind(n,7497)),"@site/docs/develop/index.md",7497],"965d240c":[()=>n.e(6577).then(n.t.bind(n,7668,19)),"~docs/guides/tag-guides-tags-rebuild-cdb.json",7668],"9722e053":[()=>n.e(1955).then(n.bind(n,6410)),"@site/references/Docker/frequently-used-commands-for-docker-setup.md",6410],"98f9308d":[()=>n.e(1025).then(n.bind(n,2150)),"@site/references/Systemd/service-keeps-running-after-shutdown.md",2150],"9bca08cf":[()=>n.e(8318).then(n.t.bind(n,7618,19)),"~docs/references/tag-references-tags-upgrade-b60.json",7618],"9bd69ffc":[()=>n.e(6699).then(n.t.bind(n,9790,19)),"~docs/default/tag-docs-tags-node-status-a43.json",9790],"9cc140f3":[()=>n.e(5049).then(n.t.bind(n,429,19)),"~docs/default/tag-docs-tags-repository-b8c.json",429],"9e4087bc":[()=>n.e(3608).then(n.bind(n,3169)),"@theme/BlogArchivePage",3169],"9f1c3232":[()=>n.e(373).then(n.bind(n,9129)),"@site/docs/node/index.md",9129],"9f7d0305":[()=>n.e(4713).then(n.bind(n,3890)),"@site/docs/node/analyzing-logs.md",3890],a13e0645:[()=>n.e(7136).then(n.t.bind(n,3120,19)),"~docs/default/tag-docs-tags-codebase-878.json",3120],a50e2e4f:[()=>n.e(7796).then(n.t.bind(n,2752,19)),"~docs/default/tag-docs-tags-awards-c13.json",2752],a626c4f3:[()=>n.e(581).then(n.t.bind(n,4218,19)),"~docs/default/tag-docs-tags-lightning-f7e.json",4218],a6aa9e1f:[()=>Promise.all([n.e(532),n.e(7874),n.e(130),n.e(3089)]).then(n.bind(n,3402)),"@theme/BlogListPage",3402],a7023ddc:[()=>n.e(1713).then(n.t.bind(n,3457,19)),"~blog/default/blog-tags-tags-4c2.json",3457],a771de40:[()=>n.e(6074).then(n.t.bind(n,8606,19)),"~docs/default/tag-docs-tags-control-341.json",8606],a7bd4aaa:[()=>n.e(8518).then(n.bind(n,8564)),"@theme/DocVersionRoot",8564],a94703ab:[()=>Promise.all([n.e(532),n.e(4368)]).then(n.bind(n,2674)),"@theme/DocRoot",2674],a9a76bf7:[()=>n.e(4356).then(n.t.bind(n,8826,19)),"~docs/default/tag-docs-tags-onboarding-2eb.json",8826],aa81941d:[()=>n.e(3012).then(n.t.bind(n,5689,19)),"~docs/default/tag-docs-tags-edge-platform-754.json",5689],ad04e600:[()=>n.e(5844).then(n.t.bind(n,3998,19)),"~docs/guides/tag-guides-tags-container-e63.json",3998],ae013ba6:[()=>n.e(9981).then(n.t.bind(n,2879,19)),"~docs/references/tag-references-tags-image-9d7.json",2879],ae70e824:[()=>n.e(1433).then(n.t.bind(n,360,19)),"~docs/guides/tag-guides-tags-logs-5d1.json",360],af6a11bf:[()=>n.e(3503).then(n.t.bind(n,5296,19)),"~docs/references/tag-references-tags-help-9a8.json",5296],b02525a9:[()=>n.e(6980).then(n.t.bind(n,3993,19)),"~docs/guides/tag-guides-tags-guides-141.json",3993],b03a0ac1:[()=>n.e(4785).then(n.t.bind(n,2312,19)),"~docs/default/tag-docs-tags-cdn-fa9.json",2312],b249ed45:[()=>n.e(5767).then(n.bind(n,1583)),"@site/references/Docker/uninstall-docker-setup.md",1583],b2b675dd:[()=>n.e(533).then(n.t.bind(n,8017,19)),"~blog/default/blog-c06.json",8017],b2f554cd:[()=>n.e(1477).then(n.t.bind(n,10,19)),"~blog/default/blog-archive-80c.json",10],b35f1b7f:[()=>n.e(7706).then(n.bind(n,9747)),"@site/references/Systemd/user-service.md",9747],b40daf0f:[()=>n.e(2126).then(n.bind(n,9303)),"@site/docs/node/configuration.md",9303],b4f44b9b:[()=>n.e(551).then(n.t.bind(n,2960,19)),"/home/runner/work/fleek-network-docs/fleek-network-docs/.docusaurus/docusaurus-plugin-content-docs/references/plugin-route-context-module-100.json",2960],b5954e33:[()=>n.e(2114).then(n.bind(n,852)),"@site/docs/learn/token-and-economics.md",852],b696d13b:[()=>n.e(327).then(n.t.bind(n,5212,19)),"~docs/default/tag-docs-tags-verification-caa.json",5212],b8466c91:[()=>n.e(4939).then(n.t.bind(n,942,19)),"~docs/guides/tag-guides-tags-setup-8ad.json",942],b8c37621:[()=>n.e(920).then(n.t.bind(n,3908,19)),"~docs/default/tag-docs-tags-guide-a32.json",3908],b9b7817e:[()=>n.e(1476).then(n.t.bind(n,7913,19)),"~docs/references/tag-references-tags-docker-edf.json",7913],bd59af11:[()=>n.e(9188).then(n.t.bind(n,7522,19)),"~docs/default/tag-docs-tags-diagnostics-265.json",7522],bea6e15b:[()=>n.e(8754).then(n.t.bind(n,815,19)),"~docs/references/tag-references-tags-fix-c13.json",815],c222de09:[()=>n.e(7563).then(n.bind(n,4342)),"@site/docs/whitepaper.md",4342],c377a04b:[()=>n.e(6971).then(n.bind(n,4606)),"@site/docs/index.md",4606],c3f5dd14:[()=>n.e(1345).then(n.t.bind(n,9826,19)),"~docs/references/tag-references-tags-clean-55b.json",9826],caaedc90:[()=>n.e(572).then(n.t.bind(n,8988,19)),"~docs/references/tag-references-tags-unit-0cd.json",8988],cc8e0b88:[()=>n.e(6310).then(n.t.bind(n,2560,19)),"~docs/default/tag-docs-tags-pledge-e5c.json",2560],cc9d5bf1:[()=>n.e(3236).then(n.t.bind(n,300,19)),"~blog/default/blog-tags-fleek-network-995-list.json",300],ccc49370:[()=>Promise.all([n.e(532),n.e(7874),n.e(130),n.e(6103)]).then(n.bind(n,5203)),"@theme/BlogPostPage",5203],ce321ae3:[()=>n.e(1837).then(n.t.bind(n,2141,19)),"~docs/default/tag-docs-tags-configuration-143.json",2141],ce4635d7:[()=>n.e(9395).then(n.t.bind(n,6062,19)),"~docs/references/tag-references-tags-lost-keys-940.json",6062],ceabd901:[()=>n.e(1354).then(n.t.bind(n,5e3,19)),"~docs/guides/tag-guides-tags-update-e5f.json",5e3],d16f6fc6:[()=>n.e(5530).then(n.t.bind(n,8316,19)),"~docs/references/tag-references-tags-clear-34f.json",8316],d1b78a4d:[()=>n.e(3023).then(n.bind(n,756)),"@site/blog/bloom-and-cuckoo-filters-for-cache-summarization.md?truncated=true",756],d1d29319:[()=>n.e(2027).then(n.t.bind(n,9887,19)),"~docs/references/tag-references-tags-service-error-f6a.json",9887],d23df0ea:[()=>n.e(5548).then(n.bind(n,5081)),"@site/references/Docker/build-and-run-in-docker.md",5081],d464210a:[()=>n.e(2023).then(n.t.bind(n,4075,19)),"~docs/default/tag-docs-tags-code-of-conduct-379.json",4075],d7d81bf6:[()=>n.e(2918).then(n.bind(n,6710)),"@site/references/Lightning CLI/error-building-on-arm64.md",6710],d8be0e5a:[()=>n.e(1706).then(n.bind(n,4751)),"@site/references/Lightning CLI/error-linking-with-cc-failed.md",4751],da002ab0:[()=>n.e(5888).then(n.t.bind(n,831,19)),"~blog/default/blog-tags-fleek-network-995.json",831],da8f35c6:[()=>n.e(4541).then(n.t.bind(n,4257,19)),"~blog/default/blog-tags-content-routing-b90-list.json",4257],dc2776f2:[()=>n.e(8644).then(n.bind(n,8864)),"@site/docs/Open-source/repositories.md",8864],dd97a9bc:[()=>n.e(9707).then(n.bind(n,7538)),"@site/docs/node/systemd-service.md",7538],de225737:[()=>n.e(6726).then(n.t.bind(n,4536,19)),"~docs/default/tag-docs-tags-lgtn-e06.json",4536],df203c0f:[()=>Promise.all([n.e(532),n.e(9924)]).then(n.bind(n,491)),"@theme/DocTagDocListPage",491],e10957d6:[()=>n.e(4708).then(n.t.bind(n,4469,19)),"/home/runner/work/fleek-network-docs/fleek-network-docs/.docusaurus/docusaurus-plugin-content-blog/default/plugin-route-context-module-100.json",4469],e331fbd7:[()=>n.e(9995).then(n.t.bind(n,7568,19)),"~docs/default/tag-docs-tags-permissionless-576.json",7568],e6a08407:[()=>n.e(2450).then(n.t.bind(n,607,19)),"~docs/references/tag-references-tags-container-a9e.json",607],e91f52c1:[()=>n.e(7091).then(n.t.bind(n,5393,19)),"~docs/references/tag-references-tags-process-5fa.json",5393],ec98ad91:[()=>n.e(4034).then(n.t.bind(n,1323,19)),"~docs/default/tag-docs-tags-testnet-9cf.json",1323],ecfddbd4:[()=>n.e(7804).then(n.bind(n,9893)),"@site/docs/Open-source.md",9893],f02c0d6e:[()=>n.e(3707).then(n.t.bind(n,3422,19)),"~docs/default/tag-docs-tags-tokenomics-43c.json",3422],f3d7f34e:[()=>n.e(982).then(n.t.bind(n,9299,19)),"~docs/references/version-current-metadata-prop-751.json",9299],f3f8ecb0:[()=>n.e(6939).then(n.bind(n,2200)),"@site/docs/develop/service-development.md",2200],f41bce02:[()=>n.e(3719).then(n.t.bind(n,4729,19)),"~docs/guides/tag-guides-tags-docker-ee0.json",4729],f4fd4511:[()=>n.e(6461).then(n.t.bind(n,6514,19)),"~docs/default/tag-docs-tags-phases-f9f.json",6514],f50a4147:[()=>n.e(4888).then(n.bind(n,8810)),"@site/docs/Open-source/contributing.md",8810],f6807fb4:[()=>n.e(4788).then(n.t.bind(n,9836,19)),"~docs/default/tag-docs-tags-architecture-68d.json",9836],f893ec16:[()=>n.e(3131).then(n.t.bind(n,2661,19)),"~docs/default/tag-docs-tags-command-line-interface-bff.json",2661],f9537533:[()=>n.e(5347).then(n.t.bind(n,881,19)),"~docs/references/tags-list-current-prop-15a.json",881],fa69a7f4:[()=>n.e(6798).then(n.t.bind(n,2469,19)),"~docs/guides/version-current-metadata-prop-751.json",2469],fa7546af:[()=>n.e(1611).then(n.t.bind(n,7327,19)),"~docs/references/tag-references-tags-shutdown-0e6.json",7327],fcc63351:[()=>n.e(9743).then(n.t.bind(n,7495,19)),"~docs/default/tag-docs-tags-services-754.json",7495],fd2b74dc:[()=>n.e(4846).then(n.bind(n,949)),"@site/references/Lightning CLI/keys-not-found.md",949],ffc337e7:[()=>n.e(7310).then(n.t.bind(n,2110,19)),"~docs/default/tag-docs-tags-learn-579.json",2110],ffcb1b32:[()=>n.e(5120).then(n.bind(n,8465)),"@site/docs/develop/json-rpc.md",8465]};var s=n(5893);function l(e){let{error:t,retry:n,pastDelay:r}=e;return t?(0,s.jsxs)("div",{style:{textAlign:"center",color:"#fff",backgroundColor:"#fa383e",borderColor:"#fa383e",borderStyle:"solid",borderRadius:"0.25rem",borderWidth:"1px",boxSizing:"border-box",display:"block",padding:"1rem",flex:"0 0 50%",marginLeft:"25%",marginRight:"25%",marginTop:"5rem",maxWidth:"50%",width:"100%"},children:[(0,s.jsx)("p",{children:String(t)}),(0,s.jsx)("div",{children:(0,s.jsx)("button",{type:"button",onClick:n,children:"Retry"})})]}):r?(0,s.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:(0,s.jsx)("svg",{id:"loader",style:{width:128,height:110,position:"absolute",top:"calc(100vh - 64%)"},viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",stroke:"#61dafb",children:(0,s.jsxs)("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1)",strokeWidth:"2",children:[(0,s.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,s.jsx)("animate",{attributeName:"r",begin:"1.5s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"stroke-opacity",begin:"1.5s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"stroke-width",begin:"1.5s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,s.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,s.jsx)("animate",{attributeName:"r",begin:"3s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"stroke-opacity",begin:"3s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"stroke-width",begin:"3s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,s.jsx)("circle",{cx:"22",cy:"22",r:"8",children:(0,s.jsx)("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"6;1;2;3;4;5;6",calcMode:"linear",repeatCount:"indefinite"})})]})})}):null}var c=n(9670),u=n(226);function d(e,t){if("*"===e)return o()({loading:l,loader:()=>n.e(1772).then(n.bind(n,1772)),modules:["@theme/NotFound"],webpack:()=>[1772],render(e,t){const n=e.default;return(0,s.jsx)(u.z,{value:{plugin:{name:"native",id:"default"}},children:(0,s.jsx)(n,{...t})})}});const r=a[`${e}-${t}`],d={},f=[],p=[],g=(0,c.Z)(r);return Object.entries(g).forEach((e=>{let[t,n]=e;const r=i[n];r&&(d[t]=r[0],f.push(r[1]),p.push(r[2]))})),o().Map({loading:l,loader:d,modules:f,webpack:()=>p,render(t,n){const o=JSON.parse(JSON.stringify(r));Object.entries(t).forEach((t=>{let[n,r]=t;const a=r.default;if(!a)throw new Error(`The page component at ${e} doesn't have a default export. This makes it impossible to render anything. Consider default-exporting a React component.`);"object"!=typeof a&&"function"!=typeof a||Object.keys(r).filter((e=>"default"!==e)).forEach((e=>{a[e]=r[e]}));let i=o;const s=n.split(".");s.slice(0,-1).forEach((e=>{i=i[e]})),i[s[s.length-1]]=a}));const a=o.__comp;delete o.__comp;const i=o.__context;return delete o.__context,(0,s.jsx)(u.z,{value:i,children:(0,s.jsx)(a,{...o,...n})})}})}const f=[{path:"/blog/",component:d("/blog/","951"),exact:!0},{path:"/blog/archive/",component:d("/blog/archive/","d54"),exact:!0},{path:"/blog/bloom-and-cuckoo-filters-for-cache-summarization/",component:d("/blog/bloom-and-cuckoo-filters-for-cache-summarization/","5a5"),exact:!0},{path:"/blog/tags/",component:d("/blog/tags/","f8d"),exact:!0},{path:"/blog/tags/blog/",component:d("/blog/tags/blog/","dc0"),exact:!0},{path:"/blog/tags/content-routing/",component:d("/blog/tags/content-routing/","f84"),exact:!0},{path:"/blog/tags/engineering/",component:d("/blog/tags/engineering/","6c6"),exact:!0},{path:"/blog/tags/fleek-network/",component:d("/blog/tags/fleek-network/","490"),exact:!0},{path:"/search/",component:d("/search/","2a3"),exact:!0},{path:"/docs/",component:d("/docs/","605"),routes:[{path:"/docs/",component:d("/docs/","7aa"),routes:[{path:"/docs/tags/",component:d("/docs/tags/","71d"),exact:!0},{path:"/docs/tags/about/",component:d("/docs/tags/about/","4e0"),exact:!0},{path:"/docs/tags/algorithms/",component:d("/docs/tags/algorithms/","23a"),exact:!0},{path:"/docs/tags/architecture/",component:d("/docs/tags/architecture/","64c"),exact:!0},{path:"/docs/tags/awards/",component:d("/docs/tags/awards/","7ea"),exact:!0},{path:"/docs/tags/build/",component:d("/docs/tags/build/","0e4"),exact:!0},{path:"/docs/tags/cdn/",component:d("/docs/tags/cdn/","3d4"),exact:!0},{path:"/docs/tags/cli/",component:d("/docs/tags/cli/","cb7"),exact:!0},{path:"/docs/tags/client/",component:d("/docs/tags/client/","7ed"),exact:!0},{path:"/docs/tags/code-of-conduct/",component:d("/docs/tags/code-of-conduct/","b7d"),exact:!0},{path:"/docs/tags/codebase/",component:d("/docs/tags/codebase/","629"),exact:!0},{path:"/docs/tags/command-line-interface/",component:d("/docs/tags/command-line-interface/","b12"),exact:!0},{path:"/docs/tags/compile/",component:d("/docs/tags/compile/","3d0"),exact:!0},{path:"/docs/tags/configuration/",component:d("/docs/tags/configuration/","d0c"),exact:!0},{path:"/docs/tags/consensus/",component:d("/docs/tags/consensus/","5e9"),exact:!0},{path:"/docs/tags/contribute/",component:d("/docs/tags/contribute/","a58"),exact:!0},{path:"/docs/tags/control/",component:d("/docs/tags/control/","8ba"),exact:!0},{path:"/docs/tags/decentralization/",component:d("/docs/tags/decentralization/","516"),exact:!0},{path:"/docs/tags/develop/",component:d("/docs/tags/develop/","010"),exact:!0},{path:"/docs/tags/diagnostic/",component:d("/docs/tags/diagnostic/","9cb"),exact:!0},{path:"/docs/tags/diagnostics/",component:d("/docs/tags/diagnostics/","6bf"),exact:!0},{path:"/docs/tags/economics/",component:d("/docs/tags/economics/","6af"),exact:!0},{path:"/docs/tags/edge-network/",component:d("/docs/tags/edge-network/","d3f"),exact:!0},{path:"/docs/tags/edge-platform/",component:d("/docs/tags/edge-platform/","1fd"),exact:!0},{path:"/docs/tags/fleek-network/",component:d("/docs/tags/fleek-network/","0e0"),exact:!0},{path:"/docs/tags/getting-started/",component:d("/docs/tags/getting-started/","bc6"),exact:!0},{path:"/docs/tags/git/",component:d("/docs/tags/git/","810"),exact:!0},{path:"/docs/tags/guide/",component:d("/docs/tags/guide/","dbf"),exact:!0},{path:"/docs/tags/healthcheck/",component:d("/docs/tags/healthcheck/","008"),exact:!0},{path:"/docs/tags/incentives/",component:d("/docs/tags/incentives/","c6d"),exact:!0},{path:"/docs/tags/learn/",component:d("/docs/tags/learn/","73a"),exact:!0},{path:"/docs/tags/lgtn/",component:d("/docs/tags/lgtn/","6a9"),exact:!0},{path:"/docs/tags/lightning/",component:d("/docs/tags/lightning/","dd1"),exact:!0},{path:"/docs/tags/logs/",component:d("/docs/tags/logs/","d51"),exact:!0},{path:"/docs/tags/manage/",component:d("/docs/tags/manage/","8ec"),exact:!0},{path:"/docs/tags/manual/",component:d("/docs/tags/manual/","c7d"),exact:!0},{path:"/docs/tags/node-status/",component:d("/docs/tags/node-status/","c59"),exact:!0},{path:"/docs/tags/onboarding/",component:d("/docs/tags/onboarding/","bfa"),exact:!0},{path:"/docs/tags/open-source/",component:d("/docs/tags/open-source/","bbc"),exact:!0},{path:"/docs/tags/permissionless/",component:d("/docs/tags/permissionless/","42c"),exact:!0},{path:"/docs/tags/phases/",component:d("/docs/tags/phases/","643"),exact:!0},{path:"/docs/tags/pledge/",component:d("/docs/tags/pledge/","b60"),exact:!0},{path:"/docs/tags/ports/",component:d("/docs/tags/ports/","f53"),exact:!0},{path:"/docs/tags/protocol/",component:d("/docs/tags/protocol/","dfe"),exact:!0},{path:"/docs/tags/repository/",component:d("/docs/tags/repository/","425"),exact:!0},{path:"/docs/tags/reputation/",component:d("/docs/tags/reputation/","32e"),exact:!0},{path:"/docs/tags/requirements/",component:d("/docs/tags/requirements/","64a"),exact:!0},{path:"/docs/tags/rewards/",component:d("/docs/tags/rewards/","a8a"),exact:!0},{path:"/docs/tags/roadmap/",component:d("/docs/tags/roadmap/","af1"),exact:!0},{path:"/docs/tags/rpc/",component:d("/docs/tags/rpc/","4b6"),exact:!0},{path:"/docs/tags/rust-dependencies/",component:d("/docs/tags/rust-dependencies/","260"),exact:!0},{path:"/docs/tags/sdk/",component:d("/docs/tags/sdk/","e09"),exact:!0},{path:"/docs/tags/server/",component:d("/docs/tags/server/","6ce"),exact:!0},{path:"/docs/tags/services/",component:d("/docs/tags/services/","d7f"),exact:!0},{path:"/docs/tags/snarks/",component:d("/docs/tags/snarks/","dad"),exact:!0},{path:"/docs/tags/standards/",component:d("/docs/tags/standards/","83e"),exact:!0},{path:"/docs/tags/systemctl/",component:d("/docs/tags/systemctl/","6a1"),exact:!0},{path:"/docs/tags/systemd/",component:d("/docs/tags/systemd/","6d2"),exact:!0},{path:"/docs/tags/testnet/",component:d("/docs/tags/testnet/","f95"),exact:!0},{path:"/docs/tags/token/",component:d("/docs/tags/token/","e53"),exact:!0},{path:"/docs/tags/tokenomics/",component:d("/docs/tags/tokenomics/","e22"),exact:!0},{path:"/docs/tags/toolkit/",component:d("/docs/tags/toolkit/","7bc"),exact:!0},{path:"/docs/tags/verification/",component:d("/docs/tags/verification/","136"),exact:!0},{path:"/docs/tags/whitepaper/",component:d("/docs/tags/whitepaper/","949"),exact:!0},{path:"/docs/tags/wizard/",component:d("/docs/tags/wizard/","2cb"),exact:!0},{path:"/docs/",component:d("/docs/","b48"),routes:[{path:"/docs/",component:d("/docs/","e7a"),exact:!0,sidebar:"docs"},{path:"/docs/develop/client/",component:d("/docs/develop/client/","720"),exact:!0},{path:"/docs/develop/json-rpc/",component:d("/docs/develop/json-rpc/","3b0"),exact:!0},{path:"/docs/develop/overview/",component:d("/docs/develop/overview/","4ab"),exact:!0},{path:"/docs/develop/service-development/",component:d("/docs/develop/service-development/","a0d"),exact:!0},{path:"/docs/learn/delivery-acknowledgements/",component:d("/docs/learn/delivery-acknowledgements/","76f"),exact:!0,sidebar:"docs"},{path:"/docs/learn/developers/",component:d("/docs/learn/developers/","a5d"),exact:!0,sidebar:"docs"},{path:"/docs/learn/introduction/",component:d("/docs/learn/introduction/","0c9"),exact:!0,sidebar:"docs"},{path:"/docs/learn/services/",component:d("/docs/learn/services/","095"),exact:!0,sidebar:"docs"},{path:"/docs/learn/the-network/",component:d("/docs/learn/the-network/","8fa"),exact:!0,sidebar:"docs"},{path:"/docs/learn/token-and-economics/",component:d("/docs/learn/token-and-economics/","ede"),exact:!0,sidebar:"docs"},{path:"/docs/node/analyzing-logs/",component:d("/docs/node/analyzing-logs/","98d"),exact:!0,sidebar:"docs"},{path:"/docs/node/configuration/",component:d("/docs/node/configuration/","191"),exact:!0},{path:"/docs/node/diagnostics/",component:d("/docs/node/diagnostics/","83b"),exact:!0},{path:"/docs/node/health-check/",component:d("/docs/node/health-check/","59e"),exact:!0,sidebar:"docs"},{path:"/docs/node/install/",component:d("/docs/node/install/","0d6"),exact:!0,sidebar:"docs"},{path:"/docs/node/lightning-cli/",component:d("/docs/node/lightning-cli/","88d"),exact:!0,sidebar:"docs"},{path:"/docs/node/overview/",component:d("/docs/node/overview/","603"),exact:!0,sidebar:"docs"},{path:"/docs/node/requirements/",component:d("/docs/node/requirements/","8ae"),exact:!0,sidebar:"docs"},{path:"/docs/node/systemd-service/",component:d("/docs/node/systemd-service/","a24"),exact:!0,sidebar:"docs"},{path:"/docs/node/testnet-onboarding/",component:d("/docs/node/testnet-onboarding/","2f1"),exact:!0,sidebar:"docs"},{path:"/docs/Open-source/",component:d("/docs/Open-source/","81b"),exact:!0},{path:"/docs/Open-source/code-of-conduct/",component:d("/docs/Open-source/code-of-conduct/","ff8"),exact:!0,sidebar:"docs"},{path:"/docs/Open-source/contributing/",component:d("/docs/Open-source/contributing/","27e"),exact:!0,sidebar:"docs"},{path:"/docs/Open-source/repositories/",component:d("/docs/Open-source/repositories/","93e"),exact:!0,sidebar:"docs"},{path:"/docs/roadmap/",component:d("/docs/roadmap/","532"),exact:!0,sidebar:"docs"},{path:"/docs/whitepaper/",component:d("/docs/whitepaper/","d8d"),exact:!0,sidebar:"docs"}]}]}]},{path:"/guides/",component:d("/guides/","221"),routes:[{path:"/guides/",component:d("/guides/","fe0"),routes:[{path:"/guides/tags/",component:d("/guides/tags/","dae"),exact:!0},{path:"/guides/tags/configuration/",component:d("/guides/tags/configuration/","fea"),exact:!0},{path:"/guides/tags/container/",component:d("/guides/tags/container/","6ef"),exact:!0},{path:"/guides/tags/docker/",component:d("/guides/tags/docker/","06e"),exact:!0},{path:"/guides/tags/edge-computing/",component:d("/guides/tags/edge-computing/","1db"),exact:!0},{path:"/guides/tags/fleek-network/",component:d("/guides/tags/fleek-network/","f99"),exact:!0},{path:"/guides/tags/getting-started/",component:d("/guides/tags/getting-started/","21e"),exact:!0},{path:"/guides/tags/guide/",component:d("/guides/tags/guide/","218"),exact:!0},{path:"/guides/tags/guides/",component:d("/guides/tags/guides/","a6e"),exact:!0},{path:"/guides/tags/help/",component:d("/guides/tags/help/","d58"),exact:!0},{path:"/guides/tags/keys/",component:d("/guides/tags/keys/","61c"),exact:!0},{path:"/guides/tags/keystore/",component:d("/guides/tags/keystore/","873"),exact:!0},{path:"/guides/tags/logs/",component:d("/guides/tags/logs/","9fa"),exact:!0},{path:"/guides/tags/ownership/",component:d("/guides/tags/ownership/","99f"),exact:!0},{path:"/guides/tags/private-keys/",component:d("/guides/tags/private-keys/","a77"),exact:!0},{path:"/guides/tags/public-keys/",component:d("/guides/tags/public-keys/","29f"),exact:!0},{path:"/guides/tags/rebuild/",component:d("/guides/tags/rebuild/","ef7"),exact:!0},{path:"/guides/tags/setup/",component:d("/guides/tags/setup/","e31"),exact:!0},{path:"/guides/tags/transfer/",component:d("/guides/tags/transfer/","874"),exact:!0},{path:"/guides/tags/update/",component:d("/guides/tags/update/","30a"),exact:!0},{path:"/guides/",component:d("/guides/","6c0"),routes:[{path:"/guides/",component:d("/guides/","ef7"),exact:!0,sidebar:"defaultSidebar"},{path:"/guides/Node Operators/getting-started/",component:d("/guides/Node Operators/getting-started/","a1f"),exact:!0,sidebar:"defaultSidebar"},{path:"/guides/Node Operators/how-to-manage-log-files/",component:d("/guides/Node Operators/how-to-manage-log-files/","951"),exact:!0,sidebar:"defaultSidebar"},{path:"/guides/Node Operators/managing-the-keystore/",component:d("/guides/Node Operators/managing-the-keystore/","176"),exact:!0,sidebar:"defaultSidebar"},{path:"/guides/Node Operators/running-a-node-in-docker/",component:d("/guides/Node Operators/running-a-node-in-docker/","afa"),exact:!0,sidebar:"defaultSidebar"},{path:"/guides/Node Operators/transfering-setup-ownership/",component:d("/guides/Node Operators/transfering-setup-ownership/","2d8"),exact:!0,sidebar:"defaultSidebar"},{path:"/guides/Node Operators/updating-lightning/",component:d("/guides/Node Operators/updating-lightning/","a3e"),exact:!0,sidebar:"defaultSidebar"}]}]}]},{path:"/references/",component:d("/references/","d36"),routes:[{path:"/references/",component:d("/references/","d0d"),routes:[{path:"/references/tags/",component:d("/references/tags/","68a"),exact:!0},{path:"/references/tags/backup/",component:d("/references/tags/backup/","d58"),exact:!0},{path:"/references/tags/build/",component:d("/references/tags/build/","97c"),exact:!0},{path:"/references/tags/clean/",component:d("/references/tags/clean/","810"),exact:!0},{path:"/references/tags/clear/",component:d("/references/tags/clear/","e8b"),exact:!0},{path:"/references/tags/cli/",component:d("/references/tags/cli/","16b"),exact:!0},{path:"/references/tags/commands/",component:d("/references/tags/commands/","637"),exact:!0},{path:"/references/tags/container/",component:d("/references/tags/container/","8e1"),exact:!0},{path:"/references/tags/delete/",component:d("/references/tags/delete/","a94"),exact:!0},{path:"/references/tags/docker/",component:d("/references/tags/docker/","042"),exact:!0},{path:"/references/tags/file-permissions/",component:d("/references/tags/file-permissions/","148"),exact:!0},{path:"/references/tags/fix/",component:d("/references/tags/fix/","bd5"),exact:!0},{path:"/references/tags/frozen/",component:d("/references/tags/frozen/","07d"),exact:!0},{path:"/references/tags/help/",component:d("/references/tags/help/","74d"),exact:!0},{path:"/references/tags/idle/",component:d("/references/tags/idle/","109"),exact:!0},{path:"/references/tags/image/",component:d("/references/tags/image/","500"),exact:!0},{path:"/references/tags/keystore/",component:d("/references/tags/keystore/","7e3"),exact:!0},{path:"/references/tags/lightning/",component:d("/references/tags/lightning/","4db"),exact:!0},{path:"/references/tags/lost-keys/",component:d("/references/tags/lost-keys/","dde"),exact:!0},{path:"/references/tags/ownership/",component:d("/references/tags/ownership/","b97"),exact:!0},{path:"/references/tags/permissions/",component:d("/references/tags/permissions/","5ee"),exact:!0},{path:"/references/tags/pkill/",component:d("/references/tags/pkill/","c53"),exact:!0},{path:"/references/tags/process/",component:d("/references/tags/process/","108"),exact:!0},{path:"/references/tags/reference/",component:d("/references/tags/reference/","235"),exact:!0},{path:"/references/tags/references/",component:d("/references/tags/references/","440"),exact:!0},{path:"/references/tags/remove/",component:d("/references/tags/remove/","57a"),exact:!0},{path:"/references/tags/restore/",component:d("/references/tags/restore/","4c9"),exact:!0},{path:"/references/tags/root/",component:d("/references/tags/root/","923"),exact:!0},{path:"/references/tags/service-error/",component:d("/references/tags/service-error/","07d"),exact:!0},{path:"/references/tags/shutdown/",component:d("/references/tags/shutdown/","821"),exact:!0},{path:"/references/tags/sudoer/",component:d("/references/tags/sudoer/","302"),exact:!0},{path:"/references/tags/systemctl/",component:d("/references/tags/systemctl/","56f"),exact:!0},{path:"/references/tags/systemd/",component:d("/references/tags/systemd/","298"),exact:!0},{path:"/references/tags/uninstall/",component:d("/references/tags/uninstall/","dd6"),exact:!0},{path:"/references/tags/unit/",component:d("/references/tags/unit/","882"),exact:!0},{path:"/references/tags/update/",component:d("/references/tags/update/","e1c"),exact:!0},{path:"/references/tags/upgrade/",component:d("/references/tags/upgrade/","ace"),exact:!0},{path:"/references/tags/user-service/",component:d("/references/tags/user-service/","f65"),exact:!0},{path:"/references/",component:d("/references/","7ec"),routes:[{path:"/references/",component:d("/references/","418"),exact:!0,sidebar:"defaultSidebar"},{path:"/references/Docker/build-and-run-in-docker/",component:d("/references/Docker/build-and-run-in-docker/","8c9"),exact:!0,sidebar:"defaultSidebar"},{path:"/references/Docker/frequently-used-commands-for-docker-setup/",component:d("/references/Docker/frequently-used-commands-for-docker-setup/","070"),exact:!0,sidebar:"defaultSidebar"},{path:"/references/Docker/uninstall-docker-setup/",component:d("/references/Docker/uninstall-docker-setup/","ab1"),exact:!0,sidebar:"defaultSidebar"},{path:"/references/Lightning CLI/backing-up-the-keystore/",component:d("/references/Lightning CLI/backing-up-the-keystore/","4c3"),exact:!0,sidebar:"defaultSidebar"},{path:"/references/Lightning CLI/error-building-on-arm64/",component:d("/references/Lightning CLI/error-building-on-arm64/","cb1"),exact:!0,sidebar:"defaultSidebar"},{path:"/references/Lightning CLI/error-linking-with-cc-failed-exist-status-1/",component:d("/references/Lightning CLI/error-linking-with-cc-failed-exist-status-1/","bb4"),exact:!0,sidebar:"defaultSidebar"},{path:"/references/Lightning CLI/file-permissions-and-ownership/",component:d("/references/Lightning CLI/file-permissions-and-ownership/","974"),exact:!0,sidebar:"defaultSidebar"},{path:"/references/Lightning CLI/frequently-used-commands-for-native-setup/",component:d("/references/Lightning CLI/frequently-used-commands-for-native-setup/","a39"),exact:!0,sidebar:"defaultSidebar"},{path:"/references/Lightning CLI/keys-not-found/",component:d("/references/Lightning CLI/keys-not-found/","45f"),exact:!0,sidebar:"defaultSidebar"},{path:"/references/Lightning CLI/node-secret-key-does-not-exist/",component:d("/references/Lightning CLI/node-secret-key-does-not-exist/","c72"),exact:!0,sidebar:"defaultSidebar"},{path:"/references/Lightning CLI/permission-denied-os-error-13/",component:d("/references/Lightning CLI/permission-denied-os-error-13/","eed"),exact:!0,sidebar:"defaultSidebar"},{path:"/references/Lightning CLI/restore-the-keystore/",component:d("/references/Lightning CLI/restore-the-keystore/","d91"),exact:!0,sidebar:"defaultSidebar"},{path:"/references/Lightning CLI/uninstall-lightning-node/",component:d("/references/Lightning CLI/uninstall-lightning-node/","a83"),exact:!0,sidebar:"defaultSidebar"},{path:"/references/Lightning CLI/update-cli-from-source-code/",component:d("/references/Lightning CLI/update-cli-from-source-code/","6a3"),exact:!0,sidebar:"defaultSidebar"},{path:"/references/Systemd/service-keeps-running-after-shutdown/",component:d("/references/Systemd/service-keeps-running-after-shutdown/","176"),exact:!0,sidebar:"defaultSidebar"},{path:"/references/Systemd/shutting-down-persistance/",component:d("/references/Systemd/shutting-down-persistance/","27f"),exact:!0,sidebar:"defaultSidebar"},{path:"/references/Systemd/user-service/",component:d("/references/Systemd/user-service/","9d7"),exact:!0,sidebar:"defaultSidebar"}]}]}]},{path:"/",component:d("/","a33"),exact:!0},{path:"*",component:d("*")}]},8934:(e,t,n)=>{"use strict";n.d(t,{_:()=>a,t:()=>i});var r=n(7294),o=n(5893);const a=r.createContext(!1);function i(e){let{children:t}=e;const[n,i]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{i(!0)}),[]),(0,o.jsx)(a.Provider,{value:n,children:t})}},7221:(e,t,n)=>{"use strict";var r=n(7294),o=n(745),a=n(3727),i=n(405),s=n(412);const l=[n(2497),n(3310),n(8320),n(2295)];var c=n(723),u=n(6550),d=n(8790),f=n(5893);function p(e){let{children:t}=e;return(0,f.jsx)(f.Fragment,{children:t})}var g=n(5742),m=n(2263),h=n(4996),b=n(6668),y=n(833),v=n(4711),w=n(9727),k=n(3320),x=n(8780),S=n(197);function _(){const{i18n:{currentLocale:e,defaultLocale:t,localeConfigs:n}}=(0,m.Z)(),r=(0,v.l)(),o=n[e].htmlLang,a=e=>e.replace("-","_");return(0,f.jsxs)(g.Z,{children:[Object.entries(n).map((e=>{let[t,{htmlLang:n}]=e;return(0,f.jsx)("link",{rel:"alternate",href:r.createUrl({locale:t,fullyQualified:!0}),hrefLang:n},t)})),(0,f.jsx)("link",{rel:"alternate",href:r.createUrl({locale:t,fullyQualified:!0}),hrefLang:"x-default"}),(0,f.jsx)("meta",{property:"og:locale",content:a(o)}),Object.values(n).filter((e=>o!==e.htmlLang)).map((e=>(0,f.jsx)("meta",{property:"og:locale:alternate",content:a(e.htmlLang)},`meta-og-${e.htmlLang}`)))]})}function C(e){let{permalink:t}=e;const{siteConfig:{url:n}}=(0,m.Z)(),r=function(){const{siteConfig:{url:e,baseUrl:t,trailingSlash:n}}=(0,m.Z)(),{pathname:r}=(0,u.TH)();return e+(0,x.applyTrailingSlash)((0,h.Z)(r),{trailingSlash:n,baseUrl:t})}(),o=t?`${n}${t}`:r;return(0,f.jsxs)(g.Z,{children:[(0,f.jsx)("meta",{property:"og:url",content:o}),(0,f.jsx)("link",{rel:"canonical",href:o})]})}function E(){const{i18n:{currentLocale:e}}=(0,m.Z)(),{metadata:t,image:n}=(0,b.L)();return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(g.Z,{children:[(0,f.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,f.jsx)("body",{className:w.h})]}),n&&(0,f.jsx)(y.d,{image:n}),(0,f.jsx)(C,{}),(0,f.jsx)(_,{}),(0,f.jsx)(S.Z,{tag:k.HX,locale:e}),(0,f.jsx)(g.Z,{children:t.map(((e,t)=>(0,f.jsx)("meta",{...e},t)))})]})}const T=new Map;function j(e){if(T.has(e.pathname))return{...e,pathname:T.get(e.pathname)};if((0,d.f)(c.Z,e.pathname).some((e=>{let{route:t}=e;return!0===t.exact})))return T.set(e.pathname,e.pathname),e;const t=e.pathname.trim().replace(/(?:\/index)?\.html$/,"")||"/";return T.set(e.pathname,t),{...e,pathname:t}}var L=n(8934),A=n(8940),N=n(469);function R(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{const r=t.default?.[e]??t[e];return r?.(...n)}));return()=>o.forEach((e=>e?.()))}const O=function(e){let{children:t,location:n,previousLocation:r}=e;return(0,N.Z)((()=>{r!==n&&(!function(e){let{location:t,previousLocation:n}=e;if(!n)return;const r=t.pathname===n.pathname,o=t.hash===n.hash,a=t.search===n.search;if(r&&o&&!a)return;const{hash:i}=t;if(i){const e=decodeURIComponent(i.substring(1)),t=document.getElementById(e);t?.scrollIntoView()}else window.scrollTo(0,0)}({location:n,previousLocation:r}),R("onRouteDidUpdate",{previousLocation:r,location:n}))}),[r,n]),t};function P(e){const t=Array.from(new Set([e,decodeURI(e)])).map((e=>(0,d.f)(c.Z,e))).flat();return Promise.all(t.map((e=>e.route.component.preload?.())))}class I extends r.Component{previousLocation;routeUpdateCleanupCb;constructor(e){super(e),this.previousLocation=null,this.routeUpdateCleanupCb=s.Z.canUseDOM?R("onRouteUpdate",{previousLocation:null,location:this.props.location}):()=>{},this.state={nextRouteHasLoaded:!0}}shouldComponentUpdate(e,t){if(e.location===this.props.location)return t.nextRouteHasLoaded;const n=e.location;return this.previousLocation=this.props.location,this.setState({nextRouteHasLoaded:!1}),this.routeUpdateCleanupCb=R("onRouteUpdate",{previousLocation:this.previousLocation,location:n}),P(n.pathname).then((()=>{this.routeUpdateCleanupCb(),this.setState({nextRouteHasLoaded:!0})})).catch((e=>{console.warn(e),window.location.reload()})),!1}render(){const{children:e,location:t}=this.props;return(0,f.jsx)(O,{previousLocation:this.previousLocation,location:t,children:(0,f.jsx)(u.AW,{location:t,render:()=>e})})}}const D=I,M="__docusaurus-base-url-issue-banner-container",F="__docusaurus-base-url-issue-banner",z="__docusaurus-base-url-issue-banner-suggestion-container";function B(e){return`\ndocument.addEventListener('DOMContentLoaded', function maybeInsertBanner() {\n var shouldInsert = typeof window['docusaurus'] === 'undefined';\n shouldInsert && insertBanner();\n});\n\nfunction insertBanner() {\n var bannerContainer = document.createElement('div');\n bannerContainer.id = '${M}';\n var bannerHtml = ${JSON.stringify(function(e){return`\n
\n

Your Docusaurus site did not load properly.

\n

A very common reason is a wrong site baseUrl configuration.

\n

Current configured baseUrl = ${e} ${"/"===e?" (default value)":""}

\n

We suggest trying baseUrl =

\n
\n`}(e)).replace(/{if("undefined"==typeof document)return void n();const r=document.createElement("link");r.setAttribute("rel","prefetch"),r.setAttribute("href",e),r.onload=()=>t(),r.onerror=()=>n();const o=document.getElementsByTagName("head")[0]??document.getElementsByName("script")[0]?.parentNode;o?.appendChild(r)}))}:function(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),r.withCredentials=!0,r.onload=()=>{200===r.status?t():n()},r.send(null)}))};var Q=n(9670);const Y=new Set,X=new Set,J=()=>navigator.connection?.effectiveType.includes("2g")||navigator.connection?.saveData,ee={prefetch(e){if(!(e=>!J()&&!X.has(e)&&!Y.has(e))(e))return!1;Y.add(e);const t=(0,d.f)(c.Z,e).flatMap((e=>{return t=e.route.path,Object.entries(W).filter((e=>{let[n]=e;return n.replace(/-[^-]+$/,"")===t})).flatMap((e=>{let[,t]=e;return Object.values((0,Q.Z)(t))}));var t}));return Promise.all(t.map((e=>{const t=n.gca(e);return t&&!t.includes("undefined")?K(t).catch((()=>{})):Promise.resolve()})))},preload:e=>!!(e=>!J()&&!X.has(e))(e)&&(X.add(e),P(e))},te=Object.freeze(ee),ne=Boolean(!0);if(s.Z.canUseDOM){window.docusaurus=te;const e=document.getElementById("__docusaurus"),t=(0,f.jsx)(i.B6,{children:(0,f.jsx)(a.VK,{children:(0,f.jsx)(V,{})})}),n=(e,t)=>{console.error("Docusaurus React Root onRecoverableError:",e,t)},s=()=>{if(ne)r.startTransition((()=>{o.hydrateRoot(e,t,{onRecoverableError:n})}));else{const a=o.createRoot(e,{onRecoverableError:n});r.startTransition((()=>{a.render(t)}))}};P(window.location.pathname).then(s)}},8940:(e,t,n)=>{"use strict";n.d(t,{_:()=>d,M:()=>f});var r=n(7294),o=n(6809);const a=JSON.parse('{"docusaurus-plugin-google-tag-manager":{"default":{"containerId":"GTM-PC422SF","id":"default"}},"docusaurus-plugin-content-docs":{"references":{"path":"/references","versions":[{"name":"current","label":"Next","isLast":true,"path":"/references","mainDocId":"index","docs":[{"id":"Docker/build-and-run-in-docker","path":"/references/Docker/build-and-run-in-docker","sidebar":"defaultSidebar"},{"id":"Docker/frequently-used-commands-for-docker-setup","path":"/references/Docker/frequently-used-commands-for-docker-setup","sidebar":"defaultSidebar"},{"id":"Docker/uninstall-docker-setup","path":"/references/Docker/uninstall-docker-setup","sidebar":"defaultSidebar"},{"id":"index","path":"/references/","sidebar":"defaultSidebar"},{"id":"Lightning CLI/error-building-on-arm64","path":"/references/Lightning CLI/error-building-on-arm64","sidebar":"defaultSidebar"},{"id":"Lightning CLI/error-linking-with-cc-failed","path":"/references/Lightning CLI/error-linking-with-cc-failed-exist-status-1","sidebar":"defaultSidebar"},{"id":"Lightning CLI/file-permissions-and-ownership","path":"/references/Lightning CLI/file-permissions-and-ownership","sidebar":"defaultSidebar"},{"id":"Lightning CLI/frequently-used-commands-for-native-setup","path":"/references/Lightning CLI/frequently-used-commands-for-native-setup","sidebar":"defaultSidebar"},{"id":"Lightning CLI/keys-not-found","path":"/references/Lightning CLI/keys-not-found","sidebar":"defaultSidebar"},{"id":"Lightning CLI/keystore-backup","path":"/references/Lightning CLI/backing-up-the-keystore","sidebar":"defaultSidebar"},{"id":"Lightning CLI/node-secret-key-does-not-exist","path":"/references/Lightning CLI/node-secret-key-does-not-exist","sidebar":"defaultSidebar"},{"id":"Lightning CLI/permission-denied-os-error-13","path":"/references/Lightning CLI/permission-denied-os-error-13","sidebar":"defaultSidebar"},{"id":"Lightning CLI/restore-keystore","path":"/references/Lightning CLI/restore-the-keystore","sidebar":"defaultSidebar"},{"id":"Lightning CLI/uninstall-lightning-node","path":"/references/Lightning CLI/uninstall-lightning-node","sidebar":"defaultSidebar"},{"id":"Lightning CLI/update-cli-from-source-code","path":"/references/Lightning CLI/update-cli-from-source-code","sidebar":"defaultSidebar"},{"id":"Systemd/service-keeps-running-after-shutdown","path":"/references/Systemd/service-keeps-running-after-shutdown","sidebar":"defaultSidebar"},{"id":"Systemd/shutting-down-persistance","path":"/references/Systemd/shutting-down-persistance","sidebar":"defaultSidebar"},{"id":"Systemd/user-service","path":"/references/Systemd/user-service","sidebar":"defaultSidebar"}],"draftIds":[],"sidebars":{"defaultSidebar":{"link":{"path":"/references/","label":"index"}}}}],"breadcrumbs":false},"default":{"path":"/docs","versions":[{"name":"current","label":"Next","isLast":true,"path":"/docs","mainDocId":"index","docs":[{"id":"develop/client","path":"/docs/develop/client"},{"id":"develop/index","path":"/docs/develop/overview"},{"id":"develop/json-rpc","path":"/docs/develop/json-rpc"},{"id":"develop/service-development","path":"/docs/develop/service-development"},{"id":"index","path":"/docs/","sidebar":"docs"},{"id":"learn/delivery-acknowledgements","path":"/docs/learn/delivery-acknowledgements","sidebar":"docs"},{"id":"learn/developers","path":"/docs/learn/developers","sidebar":"docs"},{"id":"learn/index","path":"/docs/learn/introduction","sidebar":"docs"},{"id":"learn/services","path":"/docs/learn/services","sidebar":"docs"},{"id":"learn/the-network","path":"/docs/learn/the-network","sidebar":"docs"},{"id":"learn/token-and-economics","path":"/docs/learn/token-and-economics","sidebar":"docs"},{"id":"node/analyzing-logs","path":"/docs/node/analyzing-logs","sidebar":"docs"},{"id":"node/configuration","path":"/docs/node/configuration"},{"id":"node/diagnostics","path":"/docs/node/diagnostics"},{"id":"node/health-check","path":"/docs/node/health-check","sidebar":"docs"},{"id":"node/index","path":"/docs/node/overview","sidebar":"docs"},{"id":"node/install","path":"/docs/node/install","sidebar":"docs"},{"id":"node/lightning-cli","path":"/docs/node/lightning-cli","sidebar":"docs"},{"id":"node/requirements","path":"/docs/node/requirements","sidebar":"docs"},{"id":"node/systemd-service","path":"/docs/node/systemd-service","sidebar":"docs"},{"id":"node/testnet-onboarding","path":"/docs/node/testnet-onboarding","sidebar":"docs"},{"id":"Open-source","path":"/docs/Open-source"},{"id":"Open-source/code-of-conduct","path":"/docs/Open-source/code-of-conduct","sidebar":"docs"},{"id":"Open-source/contributing","path":"/docs/Open-source/contributing","sidebar":"docs"},{"id":"Open-source/repositories","path":"/docs/Open-source/repositories","sidebar":"docs"},{"id":"roadmap","path":"/docs/roadmap","sidebar":"docs"},{"id":"whitepaper","path":"/docs/whitepaper","sidebar":"docs"}],"draftIds":[],"sidebars":{"docs":{"link":{"path":"/docs/","label":"index"}}}}],"breadcrumbs":true},"guides":{"path":"/guides","versions":[{"name":"current","label":"Next","isLast":true,"path":"/guides","mainDocId":"index","docs":[{"id":"index","path":"/guides/","sidebar":"defaultSidebar"},{"id":"Node Operators/getting-started-guide","path":"/guides/Node Operators/getting-started","sidebar":"defaultSidebar"},{"id":"Node Operators/how-to-manage-logfiles","path":"/guides/Node Operators/how-to-manage-log-files","sidebar":"defaultSidebar"},{"id":"Node Operators/managing-the-keystore","path":"/guides/Node Operators/managing-the-keystore","sidebar":"defaultSidebar"},{"id":"Node Operators/running-a-node-in-docker","path":"/guides/Node Operators/running-a-node-in-docker","sidebar":"defaultSidebar"},{"id":"Node Operators/transfering-setup-ownership","path":"/guides/Node Operators/transfering-setup-ownership","sidebar":"defaultSidebar"},{"id":"Node Operators/updating-lightning","path":"/guides/Node Operators/updating-lightning","sidebar":"defaultSidebar"}],"draftIds":[],"sidebars":{"defaultSidebar":{"link":{"path":"/guides/","label":"index"}}}}],"breadcrumbs":false}}}'),i=JSON.parse('{"defaultLocale":"en","locales":["en"],"path":"i18n","currentLocale":"en","localeConfigs":{"en":{"label":"English","direction":"ltr","htmlLang":"en","calendar":"gregory","path":"en"}}}');var s=n(7529);const l=JSON.parse('{"docusaurusVersion":"3.0.0","siteVersion":"0.0.0","pluginVersions":{"docusaurus-plugin-content-docs":{"type":"package","name":"@docusaurus/plugin-content-docs","version":"3.0.0"},"docusaurus-plugin-content-blog":{"type":"package","name":"@docusaurus/plugin-content-blog","version":"3.0.0"},"docusaurus-plugin-content-pages":{"type":"package","name":"@docusaurus/plugin-content-pages","version":"3.0.0"},"docusaurus-plugin-sitemap":{"type":"package","name":"@docusaurus/plugin-sitemap","version":"3.0.0"},"docusaurus-theme-classic":{"type":"package","name":"@docusaurus/theme-classic","version":"3.0.0"},"docusaurus-theme-search-algolia":{"type":"package","name":"@docusaurus/theme-search-algolia","version":"3.0.0"},"docusaurus-plugin-google-tag-manager":{"type":"package","name":"@docusaurus/plugin-google-tag-manager","version":"3.0.0"}}}');var c=n(5893);const u={siteConfig:o.default,siteMetadata:l,globalData:a,i18n:i,codeTranslations:s},d=r.createContext(u);function f(e){let{children:t}=e;return(0,c.jsx)(d.Provider,{value:u,children:t})}},4763:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(7294),o=n(412),a=n(5742),i=n(8780),s=n(8888),l=n(5893);function c(e){let{error:t,tryAgain:n}=e;return(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",minHeight:"100vh",width:"100%",maxWidth:"80ch",fontSize:"20px",margin:"0 auto",padding:"1rem"},children:[(0,l.jsx)("h1",{style:{fontSize:"3rem"},children:"This page crashed"}),(0,l.jsx)("button",{type:"button",onClick:n,style:{margin:"1rem 0",fontSize:"2rem",cursor:"pointer",borderRadius:20,padding:"1rem"},children:"Try again"}),(0,l.jsx)(u,{error:t})]})}function u(e){let{error:t}=e;const n=(0,i.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return(0,l.jsx)("p",{style:{whiteSpace:"pre-wrap"},children:n})}function d(e){let{error:t,tryAgain:n}=e;return(0,l.jsxs)(p,{fallback:()=>(0,l.jsx)(c,{error:t,tryAgain:n}),children:[(0,l.jsx)(a.Z,{children:(0,l.jsx)("title",{children:"Page Error"})}),(0,l.jsx)(s.Z,{children:(0,l.jsx)(c,{error:t,tryAgain:n})})]})}const f=e=>(0,l.jsx)(d,{...e});class p extends r.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){o.Z.canUseDOM&&this.setState({error:e})}render(){const{children:e}=this.props,{error:t}=this.state;if(t){const e={error:t,tryAgain:()=>this.setState({error:null})};return(this.props.fallback??f)(e)}return e??null}}},412:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const r="undefined"!=typeof window&&"document"in window&&"createElement"in window.document,o={canUseDOM:r,canUseEventListeners:r&&("addEventListener"in window||"attachEvent"in window),canUseIntersectionObserver:r&&"IntersectionObserver"in window,canUseViewport:r&&"screen"in window}},5742:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});n(7294);var r=n(405),o=n(5893);function a(e){return(0,o.jsx)(r.ql,{...e})}},9960:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(7294),o=n(3727),a=n(8780),i=n(2263),s=n(3919),l=n(412),c=n(5893);const u=r.createContext({collectLink:()=>{}});var d=n(4996);function f(e,t){let{isNavLink:n,to:f,href:p,activeClassName:g,isActive:m,"data-noBrokenLinkCheck":h,autoAddBaseUrl:b=!0,...y}=e;const{siteConfig:{trailingSlash:v,baseUrl:w}}=(0,i.Z)(),{withBaseUrl:k}=(0,d.C)(),x=(0,r.useContext)(u),S=(0,r.useRef)(null);(0,r.useImperativeHandle)(t,(()=>S.current));const _=f||p;const C=(0,s.Z)(_),E=_?.replace("pathname://","");let T=void 0!==E?(j=E,b&&(e=>e.startsWith("/"))(j)?k(j):j):void 0;var j;T&&C&&(T=(0,a.applyTrailingSlash)(T,{trailingSlash:v,baseUrl:w}));const L=(0,r.useRef)(!1),A=n?o.OL:o.rU,N=l.Z.canUseIntersectionObserver,R=(0,r.useRef)(),O=()=>{L.current||null==T||(window.docusaurus.preload(T),L.current=!0)};(0,r.useEffect)((()=>(!N&&C&&null!=T&&window.docusaurus.prefetch(T),()=>{N&&R.current&&R.current.disconnect()})),[R,T,N,C]);const P=T?.startsWith("#")??!1,I=!T||!C||P;return I||h||x.collectLink(T),I?(0,c.jsx)("a",{ref:S,href:T,..._&&!C&&{target:"_blank",rel:"noopener noreferrer"},...y}):(0,c.jsx)(A,{...y,onMouseEnter:O,onTouchStart:O,innerRef:e=>{S.current=e,N&&e&&C&&(R.current=new window.IntersectionObserver((t=>{t.forEach((t=>{e===t.target&&(t.isIntersecting||t.intersectionRatio>0)&&(R.current.unobserve(e),R.current.disconnect(),null!=T&&window.docusaurus.prefetch(T))}))})),R.current.observe(e))},to:T,...n&&{isActive:m,activeClassName:g}})}const p=r.forwardRef(f)},5999:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c,I:()=>l});var r=n(7294),o=n(5893);function a(e,t){const n=e.split(/(\{\w+\})/).map(((e,n)=>{if(n%2==1){const n=t?.[e.slice(1,-1)];if(void 0!==n)return n}return e}));return n.some((e=>(0,r.isValidElement)(e)))?n.map(((e,t)=>(0,r.isValidElement)(e)?r.cloneElement(e,{key:t}):e)).filter((e=>""!==e)):n.join("")}var i=n(7529);function s(e){let{id:t,message:n}=e;if(void 0===t&&void 0===n)throw new Error("Docusaurus translation declarations must have at least a translation id or a default translation message");return i[t??n]??n??t}function l(e,t){let{message:n,id:r}=e;return a(s({message:n,id:r}),t)}function c(e){let{children:t,id:n,values:r}=e;if(t&&"string"!=typeof t)throw console.warn("Illegal children",t),new Error("The Docusaurus component only accept simple string values");const i=s({message:t,id:n});return(0,o.jsx)(o.Fragment,{children:a(i,r)})}},9935:(e,t,n)=>{"use strict";n.d(t,{m:()=>r});const r="default"},3919:(e,t,n)=>{"use strict";function r(e){return/^(?:\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,{Z:()=>o,b:()=>r})},4996:(e,t,n)=>{"use strict";n.d(t,{C:()=>i,Z:()=>s});var r=n(7294),o=n(2263),a=n(3919);function i(){const{siteConfig:{baseUrl:e,url:t}}=(0,o.Z)(),n=(0,r.useCallback)(((n,r)=>function(e,t,n,r){let{forcePrependBaseUrl:o=!1,absolute:i=!1}=void 0===r?{}:r;if(!n||n.startsWith("#")||(0,a.b)(n))return n;if(o)return t+n.replace(/^\//,"");if(n===t.replace(/\/$/,""))return t;const s=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+s:s}(t,e,n,r)),[t,e]);return{withBaseUrl:n}}function s(e,t){void 0===t&&(t={});const{withBaseUrl:n}=i();return n(e,t)}},2263:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(7294),o=n(8940);function a(){return(0,r.useContext)(o._)}},2389:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(7294),o=n(8934);function a(){return(0,r.useContext)(o._)}},469:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294);const o=n(412).Z.canUseDOM?r.useLayoutEffect:r.useEffect},9670:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});const r=e=>"object"==typeof e&&!!e&&Object.keys(e).length>0;function o(e){const t={};return function e(n,o){Object.entries(n).forEach((n=>{let[a,i]=n;const s=o?`${o}.${a}`:a;r(i)?e(i,s):t[s]=i}))}(e),t}},226:(e,t,n)=>{"use strict";n.d(t,{_:()=>a,z:()=>i});var r=n(7294),o=n(5893);const a=r.createContext(null);function i(e){let{children:t,value:n}=e;const i=r.useContext(a),s=(0,r.useMemo)((()=>function(e){let{parent:t,value:n}=e;if(!t){if(!n)throw new Error("Unexpected: no Docusaurus route context found");if(!("plugin"in n))throw new Error("Unexpected: Docusaurus topmost route context has no `plugin` attribute");return n}const r={...t.data,...n?.data};return{plugin:t.plugin,data:r}}({parent:i,value:n})),[i,n]);return(0,o.jsx)(a.Provider,{value:s,children:t})}},143:(e,t,n)=>{"use strict";n.d(t,{Iw:()=>b,gA:()=>p,WS:()=>g,_r:()=>d,Jo:()=>y,zh:()=>f,yW:()=>h,gB:()=>m});var r=n(6550),o=n(2263),a=n(9935);function i(e,t){void 0===t&&(t={});const n=function(){const{globalData:e}=(0,o.Z)();return e}()[e];if(!n&&t.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin.`);return n}const s=e=>e.versions.find((e=>e.isLast));function l(e,t){const n=s(e);return[...e.versions.filter((e=>e!==n)),n].find((e=>!!(0,r.LX)(t,{path:e.path,exact:!1,strict:!1})))}function c(e,t){const n=l(e,t),o=n?.docs.find((e=>!!(0,r.LX)(t,{path:e.path,exact:!0,strict:!1})));return{activeVersion:n,activeDoc:o,alternateDocVersions:o?function(t){const n={};return e.versions.forEach((e=>{e.docs.forEach((r=>{r.id===t&&(n[e.name]=r)}))})),n}(o.id):{}}}const u={},d=()=>i("docusaurus-plugin-content-docs")??u,f=e=>function(e,t,n){void 0===t&&(t=a.m),void 0===n&&(n={});const r=i(e),o=r?.[t];if(!o&&n.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin with id "${t}".`);return o}("docusaurus-plugin-content-docs",e,{failfast:!0});function p(e){void 0===e&&(e={});const t=d(),{pathname:n}=(0,r.TH)();return function(e,t,n){void 0===n&&(n={});const o=Object.entries(e).sort(((e,t)=>t[1].path.localeCompare(e[1].path))).find((e=>{let[,n]=e;return!!(0,r.LX)(t,{path:n.path,exact:!1,strict:!1})})),a=o?{pluginId:o[0],pluginData:o[1]}:void 0;if(!a&&n.failfast)throw new Error(`Can't find active docs plugin for "${t}" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(e).map((e=>e.path)).join(", ")}`);return a}(t,n,e)}function g(e){void 0===e&&(e={});const t=p(e),{pathname:n}=(0,r.TH)();if(!t)return;return{activePlugin:t,activeVersion:l(t.pluginData,n)}}function m(e){return f(e).versions}function h(e){const t=f(e);return s(t)}function b(e){const t=f(e),{pathname:n}=(0,r.TH)();return c(t,n)}function y(e){const t=f(e),{pathname:n}=(0,r.TH)();return function(e,t){const n=s(e);return{latestDocSuggestion:c(e,t).alternateDocVersions[n.name],latestVersionSuggestion:n}}(t,n)}},8320:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>a});var r=n(4865),o=n.n(r);o().configure({showSpinner:!1});const a={onRouteUpdate(e){let{location:t,previousLocation:n}=e;if(n&&t.pathname!==n.pathname){const e=window.setTimeout((()=>{o().start()}),200);return()=>window.clearTimeout(e)}},onRouteDidUpdate(){o().done()}}},3310:(e,t,n)=>{"use strict";n.r(t);var r=n(204),o=n(6809);!function(e){const{themeConfig:{prism:t}}=o.default,{additionalLanguages:r}=t;globalThis.Prism=e,r.forEach((e=>{"php"===e&&n(6854),n(6726)(`./prism-${e}`)})),delete globalThis.Prism}(r.p1)},2503:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});n(7294);var r=n(4334),o=n(5999),a=n(6668),i=n(9960);const s={anchorWithStickyNavbar:"anchorWithStickyNavbar_LWe7",anchorWithHideOnScrollNavbar:"anchorWithHideOnScrollNavbar_WYt5"};var l=n(5893);function c(e){let{as:t,id:n,...c}=e;const{navbar:{hideOnScroll:u}}=(0,a.L)();if("h1"===t||!n)return(0,l.jsx)(t,{...c,id:void 0});const d=(0,o.I)({id:"theme.common.headingLinkTitle",message:"Direct link to {heading}",description:"Title for link to heading"},{heading:"string"==typeof c.children?c.children:n});return(0,l.jsxs)(t,{...c,className:(0,r.Z)("anchor",u?s.anchorWithHideOnScrollNavbar:s.anchorWithStickyNavbar,c.className),id:n,children:[c.children,(0,l.jsx)(i.Z,{className:"hash-link",to:`#${n}`,"aria-label":d,title:d,children:"\u200b"})]})}},9471:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});n(7294);const r={iconExternalLink:"iconExternalLink_nPIU"};var o=n(5893);function a(e){let{width:t=13.5,height:n=13.5}=e;return(0,o.jsx)("svg",{width:t,height:n,"aria-hidden":"true",viewBox:"0 0 24 24",className:r.iconExternalLink,children:(0,o.jsx)("path",{fill:"currentColor",d:"M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"})})}},8888:(e,t,n)=>{"use strict";n.d(t,{Z:()=>Nt});var r=n(7294),o=n(4334),a=n(4763),i=n(833),s=n(6550),l=n(5999),c=n(5936),u=n(5893);const d="__docusaurus_skipToContent_fallback";function f(e){e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")}function p(){const e=(0,r.useRef)(null),{action:t}=(0,s.k6)(),n=(0,r.useCallback)((e=>{e.preventDefault();const t=document.querySelector("main:first-of-type")??document.getElementById(d);t&&f(t)}),[]);return(0,c.S)((n=>{let{location:r}=n;e.current&&!r.hash&&"PUSH"===t&&f(e.current)})),{containerRef:e,onClick:n}}const g=(0,l.I)({id:"theme.common.skipToMainContent",description:"The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation",message:"Skip to main content"});function m(e){const t=e.children??g,{containerRef:n,onClick:r}=p();return(0,u.jsx)("div",{ref:n,role:"region","aria-label":g,children:(0,u.jsx)("a",{...e,href:`#${d}`,onClick:r,children:t})})}var h=n(5281),b=n(9727);const y={skipToContent:"skipToContent_fXgn"};function v(){return(0,u.jsx)(m,{className:y.skipToContent})}var w=n(6668),k=n(9689);function x(e){let{width:t=21,height:n=21,color:r="currentColor",strokeWidth:o=1.2,className:a,...i}=e;return(0,u.jsx)("svg",{viewBox:"0 0 15 15",width:t,height:n,...i,children:(0,u.jsx)("g",{stroke:r,strokeWidth:o,children:(0,u.jsx)("path",{d:"M.75.75l13.5 13.5M14.25.75L.75 14.25"})})})}const S={closeButton:"closeButton_CVFx"};function _(e){return(0,u.jsx)("button",{type:"button","aria-label":(0,l.I)({id:"theme.AnnouncementBar.closeButtonAriaLabel",message:"Close",description:"The ARIA label for close button of announcement bar"}),...e,className:(0,o.Z)("clean-btn close",S.closeButton,e.className),children:(0,u.jsx)(x,{width:14,height:14,strokeWidth:3.1})})}const C={content:"content_knG7"};function E(e){const{announcementBar:t}=(0,w.L)(),{content:n}=t;return(0,u.jsx)("div",{...e,className:(0,o.Z)(C.content,e.className),dangerouslySetInnerHTML:{__html:n}})}const T={announcementBar:"announcementBar_mb4j",announcementBarPlaceholder:"announcementBarPlaceholder_vyr4",announcementBarClose:"announcementBarClose_gvF7",announcementBarContent:"announcementBarContent_xLdY"};function j(){const{announcementBar:e}=(0,w.L)(),{isActive:t,close:n}=(0,k.nT)();if(!t)return null;const{backgroundColor:r,textColor:o,isCloseable:a}=e;return(0,u.jsxs)("div",{className:T.announcementBar,style:{backgroundColor:r,color:o},role:"banner",children:[a&&(0,u.jsx)("div",{className:T.announcementBarPlaceholder}),(0,u.jsx)(E,{className:T.announcementBarContent}),a&&(0,u.jsx)(_,{onClick:n,className:T.announcementBarClose})]})}var L=n(3163),A=n(2466);var N=n(902),R=n(3102);const O=r.createContext(null);function P(e){let{children:t}=e;const n=function(){const e=(0,L.e)(),t=(0,R.HY)(),[n,o]=(0,r.useState)(!1),a=null!==t.component,i=(0,N.D9)(a);return(0,r.useEffect)((()=>{a&&!i&&o(!0)}),[a,i]),(0,r.useEffect)((()=>{a?e.shown||o(!0):o(!1)}),[e.shown,a]),(0,r.useMemo)((()=>[n,o]),[n])}();return(0,u.jsx)(O.Provider,{value:n,children:t})}function I(e){if(e.component){const t=e.component;return(0,u.jsx)(t,{...e.props})}}function D(){const e=(0,r.useContext)(O);if(!e)throw new N.i6("NavbarSecondaryMenuDisplayProvider");const[t,n]=e,o=(0,r.useCallback)((()=>n(!1)),[n]),a=(0,R.HY)();return(0,r.useMemo)((()=>({shown:t,hide:o,content:I(a)})),[o,a,t])}function M(e){let{header:t,primaryMenu:n,secondaryMenu:r}=e;const{shown:a}=D();return(0,u.jsxs)("div",{className:"navbar-sidebar",children:[t,(0,u.jsxs)("div",{className:(0,o.Z)("navbar-sidebar__items",{"navbar-sidebar__items--show-secondary":a}),children:[(0,u.jsx)("div",{className:"navbar-sidebar__item menu",children:n}),(0,u.jsx)("div",{className:"navbar-sidebar__item menu",children:r})]})]})}var F=n(2949),z=n(2389);function B(e){return(0,u.jsx)("svg",{viewBox:"0 0 24 24",width:24,height:24,...e,children:(0,u.jsx)("path",{fill:"currentColor",d:"M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"})})}function U(e){return(0,u.jsx)("svg",{viewBox:"0 0 24 24",width:24,height:24,...e,children:(0,u.jsx)("path",{fill:"currentColor",d:"M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"})})}const $={toggle:"toggle_vylO",toggleButton:"toggleButton_gllP",darkToggleIcon:"darkToggleIcon_wfgR",lightToggleIcon:"lightToggleIcon_pyhR",toggleButtonDisabled:"toggleButtonDisabled_aARS"};function q(e){let{className:t,buttonClassName:n,value:r,onChange:a}=e;const i=(0,z.Z)(),s=(0,l.I)({message:"Switch between dark and light mode (currently {mode})",id:"theme.colorToggle.ariaLabel",description:"The ARIA label for the navbar color mode toggle"},{mode:"dark"===r?(0,l.I)({message:"dark mode",id:"theme.colorToggle.ariaLabel.mode.dark",description:"The name for the dark color mode"}):(0,l.I)({message:"light mode",id:"theme.colorToggle.ariaLabel.mode.light",description:"The name for the light color mode"})});return(0,u.jsx)("div",{className:(0,o.Z)($.toggle,t),children:(0,u.jsxs)("button",{className:(0,o.Z)("clean-btn",$.toggleButton,!i&&$.toggleButtonDisabled,n),type:"button",onClick:()=>a("dark"===r?"light":"dark"),disabled:!i,title:s,"aria-label":s,"aria-live":"polite",children:[(0,u.jsx)(B,{className:(0,o.Z)($.toggleIcon,$.lightToggleIcon)}),(0,u.jsx)(U,{className:(0,o.Z)($.toggleIcon,$.darkToggleIcon)})]})})}const H=r.memo(q),Z={darkNavbarColorModeToggle:"darkNavbarColorModeToggle_X3D1"};function G(e){let{className:t}=e;const n=(0,w.L)().navbar.style,r=(0,w.L)().colorMode.disableSwitch,{colorMode:o,setColorMode:a}=(0,F.I)();return r?null:(0,u.jsx)(H,{className:t,buttonClassName:"dark"===n?Z.darkNavbarColorModeToggle:void 0,value:o,onChange:a})}var V=n(1327);function W(){return(0,u.jsx)(V.Z,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:"navbar__title text--truncate"})}function K(){const e=(0,L.e)();return(0,u.jsx)("button",{type:"button","aria-label":(0,l.I)({id:"theme.docs.sidebar.closeSidebarButtonAriaLabel",message:"Close navigation bar",description:"The ARIA label for close button of mobile sidebar"}),className:"clean-btn navbar-sidebar__close",onClick:()=>e.toggle(),children:(0,u.jsx)(x,{color:"var(--ifm-color-emphasis-600)"})})}function Q(){return(0,u.jsxs)("div",{className:"navbar-sidebar__brand",children:[(0,u.jsx)(W,{}),(0,u.jsx)(G,{className:"margin-right--md"}),(0,u.jsx)(K,{})]})}var Y=n(9960),X=n(4996),J=n(3919),ee=n(8022),te=n(9471);function ne(e){let{activeBasePath:t,activeBaseRegex:n,to:r,href:o,label:a,html:i,isDropdownLink:s,prependBaseUrlToHref:l,...c}=e;const d=(0,X.Z)(r),f=(0,X.Z)(t),p=(0,X.Z)(o,{forcePrependBaseUrl:!0}),g=a&&o&&!(0,J.Z)(o),m=i?{dangerouslySetInnerHTML:{__html:i}}:{children:(0,u.jsxs)(u.Fragment,{children:[a,g&&(0,u.jsx)(te.Z,{...s&&{width:12,height:12}})]})};return o?(0,u.jsx)(Y.Z,{href:l?p:o,...c,...m}):(0,u.jsx)(Y.Z,{to:d,isNavLink:!0,...(t||n)&&{isActive:(e,t)=>n?(0,ee.F)(n,t.pathname):t.pathname.startsWith(f)},...c,...m})}function re(e){let{className:t,isDropdownItem:n=!1,...r}=e;const a=(0,u.jsx)(ne,{className:(0,o.Z)(n?"dropdown__link":"navbar__item navbar__link",t),isDropdownLink:n,...r});return n?(0,u.jsx)("li",{children:a}):a}function oe(e){let{className:t,isDropdownItem:n,...r}=e;return(0,u.jsx)("li",{className:"menu__list-item",children:(0,u.jsx)(ne,{className:(0,o.Z)("menu__link",t),...r})})}function ae(e){let{mobile:t=!1,position:n,...r}=e;const o=t?oe:re;return(0,u.jsx)(o,{...r,activeClassName:r.activeClassName??(t?"menu__link--active":"navbar__link--active")})}var ie=n(6043),se=n(8596),le=n(2263);function ce(e,t){return e.some((e=>function(e,t){return!!(0,se.Mg)(e.to,t)||!!(0,ee.F)(e.activeBaseRegex,t)||!(!e.activeBasePath||!t.startsWith(e.activeBasePath))}(e,t)))}function ue(e){let{items:t,position:n,className:a,onClick:i,...s}=e;const l=(0,r.useRef)(null),[c,d]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{const e=e=>{l.current&&!l.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),document.addEventListener("focusin",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e),document.removeEventListener("focusin",e)}}),[l]),(0,u.jsxs)("div",{ref:l,className:(0,o.Z)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--right":"right"===n,"dropdown--show":c}),children:[(0,u.jsx)(ne,{"aria-haspopup":"true","aria-expanded":c,role:"button",href:s.to?void 0:"#",className:(0,o.Z)("navbar__link",a),...s,onClick:s.to?void 0:e=>e.preventDefault(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),d(!c))},children:s.children??s.label}),(0,u.jsx)("ul",{className:"dropdown__menu",children:t.map(((e,t)=>(0,r.createElement)(qe,{isDropdownItem:!0,activeClassName:"dropdown__link--active",...e,key:t})))})]})}function de(e){let{items:t,className:n,position:a,onClick:i,...l}=e;const c=function(){const{siteConfig:{baseUrl:e}}=(0,le.Z)(),{pathname:t}=(0,s.TH)();return t.replace(e,"/")}(),d=ce(t,c),{collapsed:f,toggleCollapsed:p,setCollapsed:g}=(0,ie.u)({initialState:()=>!d});return(0,r.useEffect)((()=>{d&&g(!d)}),[c,d,g]),(0,u.jsxs)("li",{className:(0,o.Z)("menu__list-item",{"menu__list-item--collapsed":f}),children:[(0,u.jsx)(ne,{role:"button",className:(0,o.Z)("menu__link menu__link--sublist menu__link--sublist-caret",n),...l,onClick:e=>{e.preventDefault(),p()},children:l.children??l.label}),(0,u.jsx)(ie.z,{lazy:!0,as:"ul",className:"menu__list",collapsed:f,children:t.map(((e,t)=>(0,r.createElement)(qe,{mobile:!0,isDropdownItem:!0,onClick:i,activeClassName:"menu__link--active",...e,key:t})))})]})}function fe(e){let{mobile:t=!1,...n}=e;const r=t?de:ue;return(0,u.jsx)(r,{...n})}var pe=n(4711);function ge(e){let{width:t=20,height:n=20,...r}=e;return(0,u.jsx)("svg",{viewBox:"0 0 24 24",width:t,height:n,"aria-hidden":!0,...r,children:(0,u.jsx)("path",{fill:"currentColor",d:"M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"})})}const me="iconLanguage_nlXk";function he(){return r.createElement("svg",{width:"15",height:"15",className:"DocSearch-Control-Key-Icon"},r.createElement("path",{d:"M4.505 4.496h2M5.505 5.496v5M8.216 4.496l.055 5.993M10 7.5c.333.333.5.667.5 1v2M12.326 4.5v5.996M8.384 4.496c1.674 0 2.116 0 2.116 1.5s-.442 1.5-2.116 1.5M3.205 9.303c-.09.448-.277 1.21-1.241 1.203C1 10.5.5 9.513.5 8V7c0-1.57.5-2.5 1.464-2.494.964.006 1.134.598 1.24 1.342M12.553 10.5h1.953",strokeWidth:"1.2",stroke:"currentColor",fill:"none",strokeLinecap:"square"}))}var be=n(830),ye=["translations"];function ve(){return ve=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Se="Ctrl";var _e=r.forwardRef((function(e,t){var n=e.translations,o=void 0===n?{}:n,a=xe(e,ye),i=o.buttonText,s=void 0===i?"Search":i,l=o.buttonAriaLabel,c=void 0===l?"Search":l,u=we((0,r.useState)(null),2),d=u[0],f=u[1];return(0,r.useEffect)((function(){"undefined"!=typeof navigator&&(/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)?f("\u2318"):f(Se))}),[]),r.createElement("button",ve({type:"button",className:"DocSearch DocSearch-Button","aria-label":c},a,{ref:t}),r.createElement("span",{className:"DocSearch-Button-Container"},r.createElement(be.W,null),r.createElement("span",{className:"DocSearch-Button-Placeholder"},s)),r.createElement("span",{className:"DocSearch-Button-Keys"},null!==d&&r.createElement(r.Fragment,null,r.createElement("kbd",{className:"DocSearch-Button-Key"},d===Se?r.createElement(he,null):d),r.createElement("kbd",{className:"DocSearch-Button-Key"},"K"))))})),Ce=n(5742),Ee=n(6177),Te=n(239),je=n(3320);var Le=n(3935);const Ae={button:{buttonText:(0,l.I)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"}),buttonAriaLabel:(0,l.I)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"})},modal:{searchBox:{resetButtonTitle:(0,l.I)({id:"theme.SearchModal.searchBox.resetButtonTitle",message:"Clear the query",description:"The label and ARIA label for search box reset button"}),resetButtonAriaLabel:(0,l.I)({id:"theme.SearchModal.searchBox.resetButtonTitle",message:"Clear the query",description:"The label and ARIA label for search box reset button"}),cancelButtonText:(0,l.I)({id:"theme.SearchModal.searchBox.cancelButtonText",message:"Cancel",description:"The label and ARIA label for search box cancel button"}),cancelButtonAriaLabel:(0,l.I)({id:"theme.SearchModal.searchBox.cancelButtonText",message:"Cancel",description:"The label and ARIA label for search box cancel button"})},startScreen:{recentSearchesTitle:(0,l.I)({id:"theme.SearchModal.startScreen.recentSearchesTitle",message:"Recent",description:"The title for recent searches"}),noRecentSearchesText:(0,l.I)({id:"theme.SearchModal.startScreen.noRecentSearchesText",message:"No recent searches",description:"The text when no recent searches"}),saveRecentSearchButtonTitle:(0,l.I)({id:"theme.SearchModal.startScreen.saveRecentSearchButtonTitle",message:"Save this search",description:"The label for save recent search button"}),removeRecentSearchButtonTitle:(0,l.I)({id:"theme.SearchModal.startScreen.removeRecentSearchButtonTitle",message:"Remove this search from history",description:"The label for remove recent search button"}),favoriteSearchesTitle:(0,l.I)({id:"theme.SearchModal.startScreen.favoriteSearchesTitle",message:"Favorite",description:"The title for favorite searches"}),removeFavoriteSearchButtonTitle:(0,l.I)({id:"theme.SearchModal.startScreen.removeFavoriteSearchButtonTitle",message:"Remove this search from favorites",description:"The label for remove favorite search button"})},errorScreen:{titleText:(0,l.I)({id:"theme.SearchModal.errorScreen.titleText",message:"Unable to fetch results",description:"The title for error screen of search modal"}),helpText:(0,l.I)({id:"theme.SearchModal.errorScreen.helpText",message:"You might want to check your network connection.",description:"The help text for error screen of search modal"})},footer:{selectText:(0,l.I)({id:"theme.SearchModal.footer.selectText",message:"to select",description:"The explanatory text of the action for the enter key"}),selectKeyAriaLabel:(0,l.I)({id:"theme.SearchModal.footer.selectKeyAriaLabel",message:"Enter key",description:"The ARIA label for the Enter key button that makes the selection"}),navigateText:(0,l.I)({id:"theme.SearchModal.footer.navigateText",message:"to navigate",description:"The explanatory text of the action for the Arrow up and Arrow down key"}),navigateUpKeyAriaLabel:(0,l.I)({id:"theme.SearchModal.footer.navigateUpKeyAriaLabel",message:"Arrow up",description:"The ARIA label for the Arrow up key button that makes the navigation"}),navigateDownKeyAriaLabel:(0,l.I)({id:"theme.SearchModal.footer.navigateDownKeyAriaLabel",message:"Arrow down",description:"The ARIA label for the Arrow down key button that makes the navigation"}),closeText:(0,l.I)({id:"theme.SearchModal.footer.closeText",message:"to close",description:"The explanatory text of the action for Escape key"}),closeKeyAriaLabel:(0,l.I)({id:"theme.SearchModal.footer.closeKeyAriaLabel",message:"Escape key",description:"The ARIA label for the Escape key button that close the modal"}),searchByText:(0,l.I)({id:"theme.SearchModal.footer.searchByText",message:"Search by",description:"The text explain that the search is making by Algolia"})},noResultsScreen:{noResultsText:(0,l.I)({id:"theme.SearchModal.noResultsScreen.noResultsText",message:"No results for",description:"The text explains that there are no results for the following search"}),suggestedQueryText:(0,l.I)({id:"theme.SearchModal.noResultsScreen.suggestedQueryText",message:"Try searching for",description:"The text for the suggested query when no results are found for the following search"}),reportMissingResultsText:(0,l.I)({id:"theme.SearchModal.noResultsScreen.reportMissingResultsText",message:"Believe this query should return results?",description:"The text for the question where the user thinks there are missing results"}),reportMissingResultsLinkText:(0,l.I)({id:"theme.SearchModal.noResultsScreen.reportMissingResultsLinkText",message:"Let us know.",description:"The text for the link to report missing results"})}},placeholder:(0,l.I)({id:"theme.SearchModal.placeholder",message:"Search docs",description:"The placeholder of the input of the DocSearch pop-up modal"})};let Ne=null;function Re(e){let{hit:t,children:n}=e;return(0,u.jsx)(Y.Z,{to:t.url,children:n})}function Oe(e){let{state:t,onClose:n}=e;const r=(0,Ee.M)();return(0,u.jsx)(Y.Z,{to:r(t.query),onClick:n,children:(0,u.jsx)(l.Z,{id:"theme.SearchBar.seeAll",values:{count:t.context.nbHits},children:"See all {count} results"})})}function Pe(e){let{contextualSearch:t,externalUrlRegex:o,...a}=e;const{siteMetadata:i}=(0,le.Z)(),l=(0,Te.l)(),c=function(){const{locale:e,tags:t}=(0,je._q)();return[`language:${e}`,t.map((e=>`docusaurus_tag:${e}`))]}(),d=a.searchParameters?.facetFilters??[],f=t?function(e,t){const n=e=>"string"==typeof e?[e]:e;return[...n(e),...n(t)]}(c,d):d,p={...a.searchParameters,facetFilters:f},g=(0,s.k6)(),m=(0,r.useRef)(null),h=(0,r.useRef)(null),[b,y]=(0,r.useState)(!1),[v,w]=(0,r.useState)(void 0),k=(0,r.useCallback)((()=>Ne?Promise.resolve():Promise.all([n.e(1426).then(n.bind(n,6672)),Promise.all([n.e(532),n.e(6945)]).then(n.bind(n,6945)),Promise.all([n.e(532),n.e(8894)]).then(n.bind(n,8894))]).then((e=>{let[{DocSearchModal:t}]=e;Ne=t}))),[]),x=(0,r.useCallback)((()=>{k().then((()=>{m.current=document.createElement("div"),document.body.insertBefore(m.current,document.body.firstChild),y(!0)}))}),[k,y]),S=(0,r.useCallback)((()=>{y(!1),m.current?.remove()}),[y]),_=(0,r.useCallback)((e=>{k().then((()=>{y(!0),w(e.key)}))}),[k,y,w]),C=(0,r.useRef)({navigate(e){let{itemUrl:t}=e;(0,ee.F)(o,t)?window.location.href=t:g.push(t)}}).current,E=(0,r.useRef)((e=>a.transformItems?a.transformItems(e):e.map((e=>({...e,url:l(e.url)}))))).current,T=(0,r.useMemo)((()=>e=>(0,u.jsx)(Oe,{...e,onClose:S})),[S]),j=(0,r.useCallback)((e=>(e.addAlgoliaAgent("docusaurus",i.docusaurusVersion),e)),[i.docusaurusVersion]);return function(e){var t=e.isOpen,n=e.onOpen,o=e.onClose,a=e.onInput,i=e.searchButtonRef;r.useEffect((function(){function e(e){var r;(27===e.keyCode&&t||"k"===(null===(r=e.key)||void 0===r?void 0:r.toLowerCase())&&(e.metaKey||e.ctrlKey)||!function(e){var t=e.target,n=t.tagName;return t.isContentEditable||"INPUT"===n||"SELECT"===n||"TEXTAREA"===n}(e)&&"/"===e.key&&!t)&&(e.preventDefault(),t?o():document.body.classList.contains("DocSearch--active")||document.body.classList.contains("DocSearch--active")||n()),i&&i.current===document.activeElement&&a&&/[a-zA-Z0-9]/.test(String.fromCharCode(e.keyCode))&&a(e)}return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}),[t,n,o,a,i])}({isOpen:b,onOpen:x,onClose:S,onInput:_,searchButtonRef:h}),(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Ce.Z,{children:(0,u.jsx)("link",{rel:"preconnect",href:`https://${a.appId}-dsn.algolia.net`,crossOrigin:"anonymous"})}),(0,u.jsx)(_e,{onTouchStart:k,onFocus:k,onMouseOver:k,onClick:x,ref:h,translations:Ae.button}),b&&Ne&&m.current&&(0,Le.createPortal)((0,u.jsx)(Ne,{onClose:S,initialScrollY:window.scrollY,initialQuery:v,navigator:C,transformItems:E,hitComponent:Re,transformSearchClient:j,...a.searchPagePath&&{resultsFooterComponent:T},...a,searchParameters:p,placeholder:Ae.placeholder,translations:Ae.modal}),m.current)]})}function Ie(){const{siteConfig:e}=(0,le.Z)();return(0,u.jsx)(Pe,{...e.themeConfig.algolia})}const De={navbarSearchContainer:"navbarSearchContainer_Bca1"};function Me(e){let{children:t,className:n}=e;return(0,u.jsx)("div",{className:(0,o.Z)(n,De.navbarSearchContainer),children:t})}var Fe=n(143),ze=n(2802);var Be=n(373);const Ue=e=>e.docs.find((t=>t.id===e.mainDocId));const $e={default:ae,localeDropdown:function(e){let{mobile:t,dropdownItemsBefore:n,dropdownItemsAfter:r,queryString:o="",...a}=e;const{i18n:{currentLocale:i,locales:c,localeConfigs:d}}=(0,le.Z)(),f=(0,pe.l)(),{search:p,hash:g}=(0,s.TH)(),m=[...n,...c.map((e=>{const n=`${`pathname://${f.createUrl({locale:e,fullyQualified:!1})}`}${p}${g}${o}`;return{label:d[e].label,lang:d[e].htmlLang,to:n,target:"_self",autoAddBaseUrl:!1,className:e===i?t?"menu__link--active":"dropdown__link--active":""}})),...r],h=t?(0,l.I)({message:"Languages",id:"theme.navbar.mobileLanguageDropdown.label",description:"The label for the mobile language switcher dropdown"}):d[i].label;return(0,u.jsx)(fe,{...a,mobile:t,label:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ge,{className:me}),h]}),items:m})},search:function(e){let{mobile:t,className:n}=e;return t?null:(0,u.jsx)(Me,{className:n,children:(0,u.jsx)(Ie,{})})},dropdown:fe,html:function(e){let{value:t,className:n,mobile:r=!1,isDropdownItem:a=!1}=e;const i=a?"li":"div";return(0,u.jsx)(i,{className:(0,o.Z)({navbar__item:!r&&!a,"menu__list-item":r},n),dangerouslySetInnerHTML:{__html:t}})},doc:function(e){let{docId:t,label:n,docsPluginId:r,...o}=e;const{activeDoc:a}=(0,Fe.Iw)(r),i=(0,ze.vY)(t,r),s=a?.path===i?.path;return null===i||i.unlisted&&!s?null:(0,u.jsx)(ae,{exact:!0,...o,isActive:()=>s||!!a?.sidebar&&a.sidebar===i.sidebar,label:n??i.id,to:i.path})},docSidebar:function(e){let{sidebarId:t,label:n,docsPluginId:r,...o}=e;const{activeDoc:a}=(0,Fe.Iw)(r),i=(0,ze.oz)(t,r).link;if(!i)throw new Error(`DocSidebarNavbarItem: Sidebar with ID "${t}" doesn't have anything to be linked to.`);return(0,u.jsx)(ae,{exact:!0,...o,isActive:()=>a?.sidebar===t,label:n??i.label,to:i.path})},docsVersion:function(e){let{label:t,to:n,docsPluginId:r,...o}=e;const a=(0,ze.lO)(r)[0],i=t??a.label,s=n??(e=>e.docs.find((t=>t.id===e.mainDocId)))(a).path;return(0,u.jsx)(ae,{...o,label:i,to:s})},docsVersionDropdown:function(e){let{mobile:t,docsPluginId:n,dropdownActiveClassDisabled:r,dropdownItemsBefore:o,dropdownItemsAfter:a,...i}=e;const{search:c,hash:d}=(0,s.TH)(),f=(0,Fe.Iw)(n),p=(0,Fe.gB)(n),{savePreferredVersionName:g}=(0,Be.J)(n),m=[...o,...p.map((e=>{const t=f.alternateDocVersions[e.name]??Ue(e);return{label:e.label,to:`${t.path}${c}${d}`,isActive:()=>e===f.activeVersion,onClick:()=>g(e.name)}})),...a],h=(0,ze.lO)(n)[0],b=t&&m.length>1?(0,l.I)({id:"theme.navbar.mobileVersionsDropdown.label",message:"Versions",description:"The label for the navbar versions dropdown on mobile view"}):h.label,y=t&&m.length>1?void 0:Ue(h).path;return m.length<=1?(0,u.jsx)(ae,{...i,mobile:t,label:b,to:y,isActive:r?()=>!1:void 0}):(0,u.jsx)(fe,{...i,mobile:t,label:b,to:y,items:m,isActive:r?()=>!1:void 0})}};function qe(e){let{type:t,...n}=e;const r=function(e,t){return e&&"default"!==e?e:"items"in t?"dropdown":"default"}(t,n),o=$e[r];if(!o)throw new Error(`No NavbarItem component found for type "${t}".`);return(0,u.jsx)(o,{...n})}function He(){const e=(0,L.e)(),t=(0,w.L)().navbar.items;return(0,u.jsx)("ul",{className:"menu__list",children:t.map(((t,n)=>(0,r.createElement)(qe,{mobile:!0,...t,onClick:()=>e.toggle(),key:n})))})}function Ze(e){return(0,u.jsx)("button",{...e,type:"button",className:"clean-btn navbar-sidebar__back",children:(0,u.jsx)(l.Z,{id:"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel",description:"The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)",children:"\u2190 Back to main menu"})})}function Ge(){const e=0===(0,w.L)().navbar.items.length,t=D();return(0,u.jsxs)(u.Fragment,{children:[!e&&(0,u.jsx)(Ze,{onClick:()=>t.hide()}),t.content]})}function Ve(){const e=(0,L.e)();var t;return void 0===(t=e.shown)&&(t=!0),(0,r.useEffect)((()=>(document.body.style.overflow=t?"hidden":"visible",()=>{document.body.style.overflow="visible"})),[t]),e.shouldRender?(0,u.jsx)(M,{header:(0,u.jsx)(Q,{}),primaryMenu:(0,u.jsx)(He,{}),secondaryMenu:(0,u.jsx)(Ge,{})}):null}const We={navbarHideable:"navbarHideable_m1mJ",navbarHidden:"navbarHidden_jGov"};function Ke(e){return(0,u.jsx)("div",{role:"presentation",...e,className:(0,o.Z)("navbar-sidebar__backdrop",e.className)})}function Qe(e){let{children:t}=e;const{navbar:{hideOnScroll:n,style:a}}=(0,w.L)(),i=(0,L.e)(),{navbarRef:s,isNavbarVisible:d}=function(e){const[t,n]=(0,r.useState)(e),o=(0,r.useRef)(!1),a=(0,r.useRef)(0),i=(0,r.useCallback)((e=>{null!==e&&(a.current=e.getBoundingClientRect().height)}),[]);return(0,A.RF)(((t,r)=>{let{scrollY:i}=t;if(!e)return;if(i=s?n(!1):i+c{if(!e)return;const r=t.location.hash;if(r?document.getElementById(r.substring(1)):void 0)return o.current=!0,void n(!1);n(!0)})),{navbarRef:i,isNavbarVisible:t}}(n);return(0,u.jsxs)("nav",{ref:s,"aria-label":(0,l.I)({id:"theme.NavBar.navAriaLabel",message:"Main",description:"The ARIA label for the main navigation"}),className:(0,o.Z)("navbar","navbar--fixed-top",n&&[We.navbarHideable,!d&&We.navbarHidden],{"navbar--dark":"dark"===a,"navbar--primary":"primary"===a,"navbar-sidebar--show":i.shown}),children:[t,(0,u.jsx)(Ke,{onClick:i.toggle}),(0,u.jsx)(Ve,{})]})}const Ye="right";function Xe(e){let{width:t=30,height:n=30,className:r,...o}=e;return(0,u.jsx)("svg",{className:r,width:t,height:n,viewBox:"0 0 30 30","aria-hidden":"true",...o,children:(0,u.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M4 7h22M4 15h22M4 23h22"})})}function Je(){const{toggle:e,shown:t}=(0,L.e)();return(0,u.jsx)("button",{onClick:e,"aria-label":(0,l.I)({id:"theme.docs.sidebar.toggleSidebarButtonAriaLabel",message:"Toggle navigation bar",description:"The ARIA label for hamburger menu button of mobile navigation"}),"aria-expanded":t,className:"navbar__toggle clean-btn",type:"button",children:(0,u.jsx)(Xe,{})})}const et={colorModeToggle:"colorModeToggle_x44X"};function tt(e){let{items:t}=e;return(0,u.jsx)(u.Fragment,{children:t.map(((e,t)=>(0,r.createElement)(qe,{...e,key:t})))})}function nt(e){let{left:t,right:n}=e;return(0,u.jsxs)("div",{className:"navbar__inner",children:[(0,u.jsx)("div",{className:"navbar__items",children:t}),(0,u.jsx)("div",{className:"navbar__items navbar__items--right",children:n})]})}function rt(){const e=(0,L.e)(),t=(0,w.L)().navbar.items,[n,r]=function(e){function t(e){return"left"===(e.position??Ye)}return[e.filter(t),e.filter((e=>!t(e)))]}(t),o=t.find((e=>"search"===e.type));return(0,u.jsx)(nt,{left:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("div",{children:[!e.disabled&&(0,u.jsx)(Je,{}),(0,u.jsx)(W,{}),(0,u.jsx)(tt,{items:n})]}),(0,u.jsx)("div",{children:!o&&(0,u.jsx)(Me,{children:(0,u.jsx)(Ie,{})})})]}),right:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(tt,{items:r}),(0,u.jsx)(G,{className:et.colorModeToggle})]})})}function ot(){return(0,u.jsx)(Qe,{children:(0,u.jsx)(rt,{})})}function at(e){let{item:t}=e;const{to:n,href:r,label:o,prependBaseUrlToHref:a,...i}=t,s=(0,X.Z)(n),l=(0,X.Z)(r,{forcePrependBaseUrl:!0});return(0,u.jsxs)(Y.Z,{className:"footer__link-item",...r?{href:a?l:r}:{to:s},...i,children:[o,r&&!(0,J.Z)(r)&&(0,u.jsx)(te.Z,{})]})}function it(e){let{item:t}=e;return t.html?(0,u.jsx)("li",{className:"footer__item",dangerouslySetInnerHTML:{__html:t.html}}):(0,u.jsx)("li",{className:"footer__item",children:(0,u.jsx)(at,{item:t})},t.href??t.to)}function st(e){let{column:t}=e;return(0,u.jsxs)("div",{className:"col footer__col",children:[(0,u.jsx)("div",{className:"footer__title",children:t.title}),(0,u.jsx)("ul",{className:"footer__items clean-list",children:t.items.map(((e,t)=>(0,u.jsx)(it,{item:e},t)))})]})}function lt(e){let{columns:t}=e;return(0,u.jsx)("div",{className:"row footer__links",children:t.map(((e,t)=>(0,u.jsx)(st,{column:e},t)))})}function ct(){return(0,u.jsx)("span",{className:"footer__link-separator",children:"\xb7"})}function ut(e){let{item:t}=e;return t.html?(0,u.jsx)("span",{className:"footer__link-item",dangerouslySetInnerHTML:{__html:t.html}}):(0,u.jsx)(at,{item:t})}function dt(e){let{links:t}=e;return(0,u.jsx)("div",{className:"footer__links text--center",children:(0,u.jsx)("div",{className:"footer__links",children:t.map(((e,n)=>(0,u.jsxs)(r.Fragment,{children:[(0,u.jsx)(ut,{item:e}),t.length!==n+1&&(0,u.jsx)(ct,{})]},n)))})})}function ft(e){let{links:t}=e;return function(e){return"title"in e[0]}(t)?(0,u.jsx)(lt,{columns:t}):(0,u.jsx)(dt,{links:t})}var pt=n(9965);const gt={footerLogoLink:"footerLogoLink_BH7S"};function mt(e){let{logo:t}=e;const{withBaseUrl:n}=(0,X.C)(),r={light:n(t.src),dark:n(t.srcDark??t.src)};return(0,u.jsx)(pt.Z,{className:(0,o.Z)("footer__logo",t.className),alt:t.alt,sources:r,width:t.width,height:t.height,style:t.style})}function ht(e){let{logo:t}=e;return t.href?(0,u.jsx)(Y.Z,{href:t.href,className:gt.footerLogoLink,target:t.target,children:(0,u.jsx)(mt,{logo:t})}):(0,u.jsx)(mt,{logo:t})}function bt(e){let{copyright:t}=e;return(0,u.jsx)("div",{className:"footer__copyright",dangerouslySetInnerHTML:{__html:t}})}var yt=n(512);function vt(e){let{style:t,links:n,logo:r,copyright:o}=e;return(0,u.jsx)("footer",{className:(0,yt.Z)("footer",{"footer--dark":"dark"===t}),children:(0,u.jsxs)("div",{className:"container container-fluid",children:[n,(r||o)&&(0,u.jsxs)("div",{className:"footer__bottom text--left",children:[r&&(0,u.jsx)("div",{className:"margin-bottom--sm",children:r}),o]})]})})}function wt(){const{footer:e}=(0,w.L)();if(!e)return null;const{copyright:t,links:n,logo:r,style:o}=e;return(0,u.jsx)(vt,{style:o,links:n&&n.length>0&&(0,u.jsx)(ft,{links:n}),logo:r&&(0,u.jsx)(ht,{logo:r}),copyright:t&&(0,u.jsx)(bt,{copyright:t})})}const kt=r.memo(wt),xt=(0,N.Qc)([F.S,k.pl,A.OC,Be.L5,i.VC,function(e){let{children:t}=e;return(0,u.jsx)(R.n2,{children:(0,u.jsx)(L.M,{children:(0,u.jsx)(P,{children:t})})})}]);function St(e){let{children:t}=e;return(0,u.jsx)(xt,{children:t})}var _t=n(8780);const Ct={errorBoundaryError:"errorBoundaryError_a6uf",errorBoundaryFallback:"errorBoundaryFallback_VBag"};function Et(e){return(0,u.jsx)("button",{type:"button",...e,children:(0,u.jsx)(l.Z,{id:"theme.ErrorPageContent.tryAgain",description:"The label of the button to try again rendering when the React error boundary captures an error",children:"Try again"})})}function Tt(e){let{error:t}=e;const n=(0,_t.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return(0,u.jsx)("p",{className:Ct.errorBoundaryError,children:n})}r.Component;var jt=n(2503);function Lt(e){let{error:t,tryAgain:n}=e;return(0,u.jsx)("main",{className:"container margin-vert--xl",children:(0,u.jsx)("div",{className:"row",children:(0,u.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,u.jsx)(jt.Z,{as:"h1",className:"hero__title",children:(0,u.jsx)(l.Z,{id:"theme.ErrorPageContent.title",description:"The title of the fallback page when the page crashed",children:"This page crashed."})}),(0,u.jsx)("div",{className:"margin-vert--lg",children:(0,u.jsx)(Et,{onClick:n,className:"button button--primary shadow--lw"})}),(0,u.jsx)("hr",{}),(0,u.jsx)("div",{className:"margin-vert--md",children:(0,u.jsx)(Tt,{error:t})})]})})})}const At={mainWrapper:"mainWrapper_z2l0"};function Nt(e){const{children:t,noFooter:n,wrapperClassName:r,title:s,description:l}=e;return(0,b.t)(),(0,u.jsxs)(St,{children:[(0,u.jsx)(i.d,{title:s,description:l}),(0,u.jsx)(v,{}),(0,u.jsx)(j,{}),(0,u.jsx)(ot,{}),(0,u.jsx)("div",{id:d,className:(0,o.Z)(h.k.wrapper.main,At.mainWrapper,r),children:(0,u.jsx)(a.Z,{fallback:e=>(0,u.jsx)(Lt,{...e}),children:t})}),!n&&(0,u.jsx)(kt,{})]})}},1327:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});n(7294);var r=n(9960),o=n(4996),a=n(2263),i=n(6668),s=n(9965),l=n(5893);function c(e){let{logo:t,alt:n,imageClassName:r}=e;const a={light:(0,o.Z)(t.src),dark:(0,o.Z)(t.srcDark||t.src)},i=(0,l.jsx)(s.Z,{className:t.className,sources:a,height:t.height,width:t.width,alt:n,style:t.style});return r?(0,l.jsx)("div",{className:r,children:i}):i}function u(e){const{siteConfig:{title:t}}=(0,a.Z)(),{navbar:{title:n,logo:s}}=(0,i.L)(),{imageClassName:u,titleClassName:d,...f}=e,p=(0,o.Z)(s?.href||"/"),g=n?"":t,m=s?.alt??g;return(0,l.jsxs)(r.Z,{to:p,...f,...s?.target&&{target:s.target},children:[s&&(0,l.jsx)(c,{logo:s,alt:m,imageClassName:u}),null!=n&&(0,l.jsx)("b",{className:d,children:n})]})}},197:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});n(7294);var r=n(5742),o=n(5893);function a(e){let{locale:t,version:n,tag:a}=e;const i=t;return(0,o.jsxs)(r.Z,{children:[t&&(0,o.jsx)("meta",{name:"docusaurus_locale",content:t}),n&&(0,o.jsx)("meta",{name:"docusaurus_version",content:n}),a&&(0,o.jsx)("meta",{name:"docusaurus_tag",content:a}),i&&(0,o.jsx)("meta",{name:"docsearch:language",content:i}),n&&(0,o.jsx)("meta",{name:"docsearch:version",content:n}),a&&(0,o.jsx)("meta",{name:"docsearch:docusaurus_tag",content:a})]})}},9965:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(7294),o=n(7459),a=n(2389),i=n(2949);const s={themedComponent:"themedComponent_mlkZ","themedComponent--light":"themedComponent--light_NVdE","themedComponent--dark":"themedComponent--dark_xIcU"};var l=n(5893);function c(e){let{className:t,children:n}=e;const c=(0,a.Z)(),{colorMode:u}=(0,i.I)();return(0,l.jsx)(l.Fragment,{children:(c?"dark"===u?["dark"]:["light"]:["light","dark"]).map((e=>{const a=n({theme:e,className:(0,o.Z)(t,s.themedComponent,s[`themedComponent--${e}`])});return(0,l.jsx)(r.Fragment,{children:a},e)}))})}function u(e){const{sources:t,className:n,alt:r,...o}=e;return(0,l.jsx)(c,{className:n,children:e=>{let{theme:n,className:a}=e;return(0,l.jsx)("img",{src:t[n],alt:r,className:a,...o})}})}},6043:(e,t,n)=>{"use strict";n.d(t,{u:()=>c,z:()=>b});var r=n(7294),o=n(412),a=n(469),i=n(1442),s=n(5893);const l="ease-in-out";function c(e){let{initialState:t}=e;const[n,o]=(0,r.useState)(t??!1),a=(0,r.useCallback)((()=>{o((e=>!e))}),[]);return{collapsed:n,setCollapsed:o,toggleCollapsed:a}}const u={display:"none",overflow:"hidden",height:"0px"},d={display:"block",overflow:"visible",height:"auto"};function f(e,t){const n=t?u:d;e.style.display=n.display,e.style.overflow=n.overflow,e.style.height=n.height}function p(e){let{collapsibleRef:t,collapsed:n,animation:o}=e;const a=(0,r.useRef)(!1);(0,r.useEffect)((()=>{const e=t.current;function r(){const t=e.scrollHeight,n=o?.duration??function(e){if((0,i.n)())return 1;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}(t);return{transition:`height ${n}ms ${o?.easing??l}`,height:`${t}px`}}function s(){const t=r();e.style.transition=t.transition,e.style.height=t.height}if(!a.current)return f(e,n),void(a.current=!0);return e.style.willChange="height",function(){const t=requestAnimationFrame((()=>{n?(s(),requestAnimationFrame((()=>{e.style.height=u.height,e.style.overflow=u.overflow}))):(e.style.display="block",requestAnimationFrame((()=>{s()})))}));return()=>cancelAnimationFrame(t)}()}),[t,n,o])}function g(e){if(!o.Z.canUseDOM)return e?u:d}function m(e){let{as:t="div",collapsed:n,children:o,animation:a,onCollapseTransitionEnd:i,className:l,disableSSRStyle:c}=e;const u=(0,r.useRef)(null);return p({collapsibleRef:u,collapsed:n,animation:a}),(0,s.jsx)(t,{ref:u,style:c?void 0:g(n),onTransitionEnd:e=>{"height"===e.propertyName&&(f(u.current,n),i?.(n))},className:l,children:o})}function h(e){let{collapsed:t,...n}=e;const[o,i]=(0,r.useState)(!t),[l,c]=(0,r.useState)(t);return(0,a.Z)((()=>{t||i(!0)}),[t]),(0,a.Z)((()=>{o&&c(t)}),[o,t]),o?(0,s.jsx)(m,{...n,collapsed:l}):null}function b(e){let{lazy:t,...n}=e;const r=t?h:m;return(0,s.jsx)(r,{...n})}},9689:(e,t,n)=>{"use strict";n.d(t,{nT:()=>m,pl:()=>g});var r=n(7294),o=n(2389),a=n(12),i=n(902),s=n(6668),l=n(5893);const c=(0,a.WA)("docusaurus.announcement.dismiss"),u=(0,a.WA)("docusaurus.announcement.id"),d=()=>"true"===c.get(),f=e=>c.set(String(e)),p=r.createContext(null);function g(e){let{children:t}=e;const n=function(){const{announcementBar:e}=(0,s.L)(),t=(0,o.Z)(),[n,a]=(0,r.useState)((()=>!!t&&d()));(0,r.useEffect)((()=>{a(d())}),[]);const i=(0,r.useCallback)((()=>{f(!0),a(!0)}),[]);return(0,r.useEffect)((()=>{if(!e)return;const{id:t}=e;let n=u.get();"annoucement-bar"===n&&(n="announcement-bar");const r=t!==n;u.set(t),r&&f(!1),!r&&d()||a(!1)}),[e]),(0,r.useMemo)((()=>({isActive:!!e&&!n,close:i})),[e,n,i])}();return(0,l.jsx)(p.Provider,{value:n,children:t})}function m(){const e=(0,r.useContext)(p);if(!e)throw new i.i6("AnnouncementBarProvider");return e}},2949:(e,t,n)=>{"use strict";n.d(t,{I:()=>b,S:()=>h});var r=n(7294),o=n(412),a=n(902),i=n(12),s=n(6668),l=n(5893);const c=r.createContext(void 0),u="theme",d=(0,i.WA)(u),f={light:"light",dark:"dark"},p=e=>e===f.dark?f.dark:f.light,g=e=>o.Z.canUseDOM?p(document.documentElement.getAttribute("data-theme")):p(e),m=e=>{d.set(p(e))};function h(e){let{children:t}=e;const n=function(){const{colorMode:{defaultMode:e,disableSwitch:t,respectPrefersColorScheme:n}}=(0,s.L)(),[o,a]=(0,r.useState)(g(e));(0,r.useEffect)((()=>{t&&d.del()}),[t]);const i=(0,r.useCallback)((function(t,r){void 0===r&&(r={});const{persist:o=!0}=r;t?(a(t),o&&m(t)):(a(n?window.matchMedia("(prefers-color-scheme: dark)").matches?f.dark:f.light:e),d.del())}),[n,e]);(0,r.useEffect)((()=>{document.documentElement.setAttribute("data-theme",p(o))}),[o]),(0,r.useEffect)((()=>{if(t)return;const e=e=>{if(e.key!==u)return;const t=d.get();null!==t&&i(p(t))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}),[t,i]);const l=(0,r.useRef)(!1);return(0,r.useEffect)((()=>{if(t&&!n)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{window.matchMedia("print").matches||l.current?l.current=window.matchMedia("print").matches:i(null)};return e.addListener(r),()=>e.removeListener(r)}),[i,t,n]),(0,r.useMemo)((()=>({colorMode:o,setColorMode:i,get isDarkTheme(){return o===f.dark},setLightTheme(){i(f.light)},setDarkTheme(){i(f.dark)}})),[o,i])}();return(0,l.jsx)(c.Provider,{value:n,children:t})}function b(){const e=(0,r.useContext)(c);if(null==e)throw new a.i6("ColorModeProvider","Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.");return e}},373:(e,t,n)=>{"use strict";n.d(t,{J:()=>v,L5:()=>b,Oh:()=>w});var r=n(7294),o=n(143),a=n(9935),i=n(6668),s=n(2802),l=n(902),c=n(12),u=n(5893);const d=e=>`docs-preferred-version-${e}`,f={save:(e,t,n)=>{(0,c.WA)(d(e),{persistence:t}).set(n)},read:(e,t)=>(0,c.WA)(d(e),{persistence:t}).get(),clear:(e,t)=>{(0,c.WA)(d(e),{persistence:t}).del()}},p=e=>Object.fromEntries(e.map((e=>[e,{preferredVersionName:null}])));const g=r.createContext(null);function m(){const e=(0,o._r)(),t=(0,i.L)().docs.versionPersistence,n=(0,r.useMemo)((()=>Object.keys(e)),[e]),[a,s]=(0,r.useState)((()=>p(n)));(0,r.useEffect)((()=>{s(function(e){let{pluginIds:t,versionPersistence:n,allDocsData:r}=e;function o(e){const t=f.read(e,n);return r[e].versions.some((e=>e.name===t))?{preferredVersionName:t}:(f.clear(e,n),{preferredVersionName:null})}return Object.fromEntries(t.map((e=>[e,o(e)])))}({allDocsData:e,versionPersistence:t,pluginIds:n}))}),[e,t,n]);return[a,(0,r.useMemo)((()=>({savePreferredVersion:function(e,n){f.save(e,t,n),s((t=>({...t,[e]:{preferredVersionName:n}})))}})),[t])]}function h(e){let{children:t}=e;const n=m();return(0,u.jsx)(g.Provider,{value:n,children:t})}function b(e){let{children:t}=e;return s.cE?(0,u.jsx)(h,{children:t}):(0,u.jsx)(u.Fragment,{children:t})}function y(){const e=(0,r.useContext)(g);if(!e)throw new l.i6("DocsPreferredVersionContextProvider");return e}function v(e){void 0===e&&(e=a.m);const t=(0,o.zh)(e),[n,i]=y(),{preferredVersionName:s}=n[e];return{preferredVersion:t.versions.find((e=>e.name===s))??null,savePreferredVersionName:(0,r.useCallback)((t=>{i.savePreferredVersion(e,t)}),[i,e])}}function w(){const e=(0,o._r)(),[t]=y();function n(n){const r=e[n],{preferredVersionName:o}=t[n];return r.versions.find((e=>e.name===o))??null}const r=Object.keys(e);return Object.fromEntries(r.map((e=>[e,n(e)])))}},1116:(e,t,n)=>{"use strict";n.d(t,{V:()=>c,b:()=>l});var r=n(7294),o=n(902),a=n(5893);const i=Symbol("EmptyContext"),s=r.createContext(i);function l(e){let{children:t,name:n,items:o}=e;const i=(0,r.useMemo)((()=>n&&o?{name:n,items:o}:null),[n,o]);return(0,a.jsx)(s.Provider,{value:i,children:t})}function c(){const e=(0,r.useContext)(s);if(e===i)throw new o.i6("DocsSidebarProvider");return e}},4477:(e,t,n)=>{"use strict";n.d(t,{E:()=>l,q:()=>s});var r=n(7294),o=n(902),a=n(5893);const i=r.createContext(null);function s(e){let{children:t,version:n}=e;return(0,a.jsx)(i.Provider,{value:n,children:t})}function l(){const e=(0,r.useContext)(i);if(null===e)throw new o.i6("DocsVersionProvider");return e}},3163:(e,t,n)=>{"use strict";n.d(t,{M:()=>f,e:()=>p});var r=n(7294),o=n(3102),a=n(7524),i=n(1980),s=n(6668),l=n(902),c=n(5893);const u=r.createContext(void 0);function d(){const e=function(){const e=(0,o.HY)(),{items:t}=(0,s.L)().navbar;return 0===t.length&&!e.component}(),t=(0,a.i)(),n=!e&&"mobile"===t,[l,c]=(0,r.useState)(!1);(0,i.Rb)((()=>{if(l)return c(!1),!1}));const u=(0,r.useCallback)((()=>{c((e=>!e))}),[]);return(0,r.useEffect)((()=>{"desktop"===t&&c(!1)}),[t]),(0,r.useMemo)((()=>({disabled:e,shouldRender:n,toggle:u,shown:l})),[e,n,u,l])}function f(e){let{children:t}=e;const n=d();return(0,c.jsx)(u.Provider,{value:n,children:t})}function p(){const e=r.useContext(u);if(void 0===e)throw new l.i6("NavbarMobileSidebarProvider");return e}},3102:(e,t,n)=>{"use strict";n.d(t,{HY:()=>l,Zo:()=>c,n2:()=>s});var r=n(7294),o=n(902),a=n(5893);const i=r.createContext(null);function s(e){let{children:t}=e;const n=(0,r.useState)({component:null,props:null});return(0,a.jsx)(i.Provider,{value:n,children:t})}function l(){const e=(0,r.useContext)(i);if(!e)throw new o.i6("NavbarSecondaryMenuContentProvider");return e[0]}function c(e){let{component:t,props:n}=e;const a=(0,r.useContext)(i);if(!a)throw new o.i6("NavbarSecondaryMenuContentProvider");const[,s]=a,l=(0,o.Ql)(n);return(0,r.useEffect)((()=>{s({component:t,props:l})}),[s,t,l]),(0,r.useEffect)((()=>()=>s({component:null,props:null})),[s]),null}},9727:(e,t,n)=>{"use strict";n.d(t,{h:()=>o,t:()=>a});var r=n(7294);const o="navigation-with-keyboard";function a(){(0,r.useEffect)((()=>{function e(e){"keydown"===e.type&&"Tab"===e.key&&document.body.classList.add(o),"mousedown"===e.type&&document.body.classList.remove(o)}return document.addEventListener("keydown",e),document.addEventListener("mousedown",e),()=>{document.body.classList.remove(o),document.removeEventListener("keydown",e),document.removeEventListener("mousedown",e)}}),[])}},6177:(e,t,n)=>{"use strict";n.d(t,{K:()=>s,M:()=>l});var r=n(7294),o=n(2263),a=n(1980);const i="q";function s(){return(0,a.Nc)(i)}function l(){const{siteConfig:{baseUrl:e,themeConfig:t}}=(0,o.Z)(),{algolia:{searchPagePath:n}}=t;return(0,r.useCallback)((t=>`${e}${n}?${i}=${encodeURIComponent(t)}`),[e,n])}},7524:(e,t,n)=>{"use strict";n.d(t,{i:()=>s});var r=n(7294),o=n(412);const a={desktop:"desktop",mobile:"mobile",ssr:"ssr"},i=996;function s(){const[e,t]=(0,r.useState)((()=>"ssr"));return(0,r.useEffect)((()=>{function e(){t(function(){if(!o.Z.canUseDOM)throw new Error("getWindowSize() should only be called after React hydration");return window.innerWidth>i?a.desktop:a.mobile}())}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),e}},5281:(e,t,n)=>{"use strict";n.d(t,{k:()=>r});const r={page:{blogListPage:"blog-list-page",blogPostPage:"blog-post-page",blogTagsListPage:"blog-tags-list-page",blogTagPostListPage:"blog-tags-post-list-page",docsDocPage:"docs-doc-page",docsTagsListPage:"docs-tags-list-page",docsTagDocListPage:"docs-tags-doc-list-page",mdxPage:"mdx-page"},wrapper:{main:"main-wrapper",blogPages:"blog-wrapper",docsPages:"docs-wrapper",mdxPages:"mdx-wrapper"},common:{editThisPage:"theme-edit-this-page",lastUpdated:"theme-last-updated",backToTopButton:"theme-back-to-top-button",codeBlock:"theme-code-block",admonition:"theme-admonition",unlistedBanner:"theme-unlisted-banner",admonitionType:e=>`theme-admonition-${e}`},layout:{},docs:{docVersionBanner:"theme-doc-version-banner",docVersionBadge:"theme-doc-version-badge",docBreadcrumbs:"theme-doc-breadcrumbs",docMarkdown:"theme-doc-markdown",docTocMobile:"theme-doc-toc-mobile",docTocDesktop:"theme-doc-toc-desktop",docFooter:"theme-doc-footer",docFooterTagsRow:"theme-doc-footer-tags-row",docFooterEditMetaRow:"theme-doc-footer-edit-meta-row",docSidebarContainer:"theme-doc-sidebar-container",docSidebarMenu:"theme-doc-sidebar-menu",docSidebarItemCategory:"theme-doc-sidebar-item-category",docSidebarItemLink:"theme-doc-sidebar-item-link",docSidebarItemCategoryLevel:e=>`theme-doc-sidebar-item-category-level-${e}`,docSidebarItemLinkLevel:e=>`theme-doc-sidebar-item-link-level-${e}`},blog:{}}},1442:(e,t,n)=>{"use strict";function r(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}n.d(t,{n:()=>r})},2802:(e,t,n)=>{"use strict";n.d(t,{LM:()=>p,_F:()=>h,cE:()=>f,SN:()=>_,lO:()=>k,vY:()=>S,oz:()=>x,s1:()=>w,f:()=>y});var r=n(7294),o=n(6550),a=n(8790),i=n(143),s=n(373),l=n(4477),c=n(1116);function u(e){return Array.from(new Set(e))}var d=n(8596);const f=!!i._r;function p(e){return"link"!==e.type||e.unlisted?"category"===e.type?function(e){if(e.href&&!e.linkUnlisted)return e.href;for(const t of e.items){const e=p(t);if(e)return e}}(e):void 0:e.href}const g=(e,t)=>void 0!==e&&(0,d.Mg)(e,t),m=(e,t)=>e.some((e=>h(e,t)));function h(e,t){return"link"===e.type?g(e.href,t):"category"===e.type&&(g(e.href,t)||m(e.items,t))}function b(e,t){switch(e.type){case"category":return h(e,t)||e.items.some((e=>b(e,t)));case"link":return!e.unlisted||h(e,t);default:return!1}}function y(e,t){return(0,r.useMemo)((()=>e.filter((e=>b(e,t)))),[e,t])}function v(e){let{sidebarItems:t,pathname:n,onlyCategories:r=!1}=e;const o=[];return function e(t){for(const a of t)if("category"===a.type&&((0,d.Mg)(a.href,n)||e(a.items))||"link"===a.type&&(0,d.Mg)(a.href,n)){return r&&"category"!==a.type||o.unshift(a),!0}return!1}(t),o}function w(){const e=(0,c.V)(),{pathname:t}=(0,o.TH)(),n=(0,i.gA)()?.pluginData.breadcrumbs;return!1!==n&&e?v({sidebarItems:e.items,pathname:t}):null}function k(e){const{activeVersion:t}=(0,i.Iw)(e),{preferredVersion:n}=(0,s.J)(e),o=(0,i.yW)(e);return(0,r.useMemo)((()=>u([t,n,o].filter(Boolean))),[t,n,o])}function x(e,t){const n=k(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.sidebars?Object.entries(e.sidebars):[])),r=t.find((t=>t[0]===e));if(!r)throw new Error(`Can't find any sidebar with id "${e}" in version${n.length>1?"s":""} ${n.map((e=>e.name)).join(", ")}".\nAvailable sidebar ids are:\n- ${t.map((e=>e[0])).join("\n- ")}`);return r[1]}),[e,n])}function S(e,t){const n=k(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.docs)),r=t.find((t=>t.id===e));if(!r){if(n.flatMap((e=>e.draftIds)).includes(e))return null;throw new Error(`Couldn't find any doc with id "${e}" in version${n.length>1?"s":""} "${n.map((e=>e.name)).join(", ")}".\nAvailable doc ids are:\n- ${u(t.map((e=>e.id))).join("\n- ")}`)}return r}),[e,n])}function _(e){let{route:t}=e;const n=(0,o.TH)(),r=(0,l.E)(),i=t.routes,s=i.find((e=>(0,o.LX)(n.pathname,e)));if(!s)return null;const c=s.sidebar,u=c?r.docsSidebars[c]:void 0;return{docElement:(0,a.H)(i),sidebarName:c,sidebarItems:u}}},2128:(e,t,n)=>{"use strict";n.d(t,{p:()=>o});var r=n(2263);function o(e){const{siteConfig:t}=(0,r.Z)(),{title:n,titleDelimiter:o}=t;return e?.trim().length?`${e.trim()} ${o} ${n}`:n}},1980:(e,t,n)=>{"use strict";n.d(t,{Nc:()=>l,Rb:()=>i});var r=n(7294),o=n(6550),a=n(902);function i(e){!function(e){const t=(0,o.k6)(),n=(0,a.zX)(e);(0,r.useEffect)((()=>t.block(((e,t)=>n(e,t)))),[t,n])}(((t,n)=>{if("POP"===n)return e(t,n)}))}function s(e){return function(e){const t=(0,o.k6)();return(0,r.useSyncExternalStore)(t.listen,(()=>e(t)),(()=>e(t)))}((t=>null===e?null:new URLSearchParams(t.location.search).get(e)))}function l(e){const t=s(e)??"",n=function(){const e=(0,o.k6)();return(0,r.useCallback)(((t,n,r)=>{const o=new URLSearchParams(e.location.search);n?o.set(t,n):o.delete(t),(r?.push?e.push:e.replace)({search:o.toString()})}),[e])}();return[t,(0,r.useCallback)(((t,r)=>{n(e,t,r)}),[n,e])]}},833:(e,t,n)=>{"use strict";n.d(t,{FG:()=>p,d:()=>d,VC:()=>g});var r=n(7294),o=n(7459),a=n(5742),i=n(226);function s(){const e=r.useContext(i._);if(!e)throw new Error("Unexpected: no Docusaurus route context found");return e}var l=n(4996),c=n(2128),u=n(5893);function d(e){let{title:t,description:n,keywords:r,image:o,children:i}=e;const s=(0,c.p)(t),{withBaseUrl:d}=(0,l.C)(),f=o?d(o,{absolute:!0}):void 0;return(0,u.jsxs)(a.Z,{children:[t&&(0,u.jsx)("title",{children:s}),t&&(0,u.jsx)("meta",{property:"og:title",content:s}),n&&(0,u.jsx)("meta",{name:"description",content:n}),n&&(0,u.jsx)("meta",{property:"og:description",content:n}),r&&(0,u.jsx)("meta",{name:"keywords",content:Array.isArray(r)?r.join(","):r}),f&&(0,u.jsx)("meta",{property:"og:image",content:f}),f&&(0,u.jsx)("meta",{name:"twitter:image",content:f}),i]})}const f=r.createContext(void 0);function p(e){let{className:t,children:n}=e;const i=r.useContext(f),s=(0,o.Z)(i,t);return(0,u.jsxs)(f.Provider,{value:s,children:[(0,u.jsx)(a.Z,{children:(0,u.jsx)("html",{className:s})}),n]})}function g(e){let{children:t}=e;const n=s(),r=`plugin-${n.plugin.name.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi,"")}`;const a=`plugin-id-${n.plugin.id}`;return(0,u.jsx)(p,{className:(0,o.Z)(r,a),children:t})}},902:(e,t,n)=>{"use strict";n.d(t,{D9:()=>s,Qc:()=>u,Ql:()=>c,i6:()=>l,zX:()=>i});var r=n(7294),o=n(469),a=n(5893);function i(e){const t=(0,r.useRef)(e);return(0,o.Z)((()=>{t.current=e}),[e]),(0,r.useCallback)((function(){return t.current(...arguments)}),[])}function s(e){const t=(0,r.useRef)();return(0,o.Z)((()=>{t.current=e})),t.current}class l extends Error{constructor(e,t){super(),this.name="ReactContextError",this.message=`Hook ${this.stack?.split("\n")[1]?.match(/at (?:\w+\.)?(?\w+)/)?.groups.name??""} is called outside the <${e}>. ${t??""}`}}function c(e){const t=Object.entries(e);return t.sort(((e,t)=>e[0].localeCompare(t[0]))),(0,r.useMemo)((()=>e),t.flat())}function u(e){return t=>{let{children:n}=t;return(0,a.jsx)(a.Fragment,{children:e.reduceRight(((e,t)=>(0,a.jsx)(t,{children:e})),n)})}}},8022:(e,t,n)=>{"use strict";function r(e,t){return void 0!==e&&void 0!==t&&new RegExp(e,"gi").test(t)}n.d(t,{F:()=>r})},8596:(e,t,n)=>{"use strict";n.d(t,{Mg:()=>i,Ns:()=>s});var r=n(7294),o=n(723),a=n(2263);function i(e,t){const n=e=>(!e||e.endsWith("/")?e:`${e}/`)?.toLowerCase();return n(e)===n(t)}function s(){const{baseUrl:e}=(0,a.Z)().siteConfig;return(0,r.useMemo)((()=>function(e){let{baseUrl:t,routes:n}=e;function r(e){return e.path===t&&!0===e.exact}function o(e){return e.path===t&&!e.exact}return function e(t){if(0===t.length)return;return t.find(r)||e(t.filter(o).flatMap((e=>e.routes??[])))}(n)}({routes:o.Z,baseUrl:e})),[e])}},2466:(e,t,n)=>{"use strict";n.d(t,{Ct:()=>p,OC:()=>c,RF:()=>f});var r=n(7294),o=n(412),a=n(2389),i=(n(469),n(902)),s=n(5893);const l=r.createContext(void 0);function c(e){let{children:t}=e;const n=function(){const e=(0,r.useRef)(!0);return(0,r.useMemo)((()=>({scrollEventsEnabledRef:e,enableScrollEvents:()=>{e.current=!0},disableScrollEvents:()=>{e.current=!1}})),[])}();return(0,s.jsx)(l.Provider,{value:n,children:t})}function u(){const e=(0,r.useContext)(l);if(null==e)throw new i.i6("ScrollControllerProvider");return e}const d=()=>o.Z.canUseDOM?{scrollX:window.pageXOffset,scrollY:window.pageYOffset}:null;function f(e,t){void 0===t&&(t=[]);const{scrollEventsEnabledRef:n}=u(),o=(0,r.useRef)(d()),a=(0,i.zX)(e);(0,r.useEffect)((()=>{const e=()=>{if(!n.current)return;const e=d();a(e,o.current),o.current=e},t={passive:!0};return e(),window.addEventListener("scroll",e,t),()=>window.removeEventListener("scroll",e,t)}),[a,n,...t])}function p(){const e=(0,r.useRef)(null),t=(0,a.Z)()&&"smooth"===getComputedStyle(document.documentElement).scrollBehavior;return{startScroll:n=>{e.current=t?function(e){return window.scrollTo({top:e,behavior:"smooth"}),()=>{}}(n):function(e){let t=null;const n=document.documentElement.scrollTop>e;return function r(){const o=document.documentElement.scrollTop;(n&&o>e||!n&&ot&&cancelAnimationFrame(t)}(n)},cancelScroll:()=>e.current?.()}}},3320:(e,t,n)=>{"use strict";n.d(t,{HX:()=>i,_q:()=>l,os:()=>s});var r=n(143),o=n(2263),a=n(373);const i="default";function s(e,t){return`docs-${e}-${t}`}function l(){const{i18n:e}=(0,o.Z)(),t=(0,r._r)(),n=(0,r.WS)(),l=(0,a.Oh)();const c=[i,...Object.keys(t).map((function(e){const r=n?.activePlugin.pluginId===e?n.activeVersion:void 0,o=l[e],a=t[e].versions.find((e=>e.isLast));return s(e,(r??o??a).name)}))];return{locale:e.currentLocale,tags:c}}},12:(e,t,n)=>{"use strict";n.d(t,{WA:()=>l});n(7294);const r="localStorage";function o(e){let{key:t,oldValue:n,newValue:r,storage:o}=e;if(n===r)return;const a=document.createEvent("StorageEvent");a.initStorageEvent("storage",!1,!1,t,n,r,window.location.href,o),window.dispatchEvent(a)}function a(e){if(void 0===e&&(e=r),"undefined"==typeof window)throw new Error("Browser storage is not available on Node.js/Docusaurus SSR process.");if("none"===e)return null;try{return window[e]}catch(n){return t=n,i||(console.warn("Docusaurus browser storage is not available.\nPossible reasons: running Docusaurus in an iframe, in an incognito browser session, or using too strict browser privacy settings.",t),i=!0),null}var t}let i=!1;const s={get:()=>null,set:()=>{},del:()=>{},listen:()=>()=>{}};function l(e,t){if("undefined"==typeof window)return function(e){function t(){throw new Error(`Illegal storage API usage for storage key "${e}".\nDocusaurus storage APIs are not supposed to be called on the server-rendering process.\nPlease only call storage APIs in effects and event handlers.`)}return{get:t,set:t,del:t,listen:t}}(e);const n=a(t?.persistence);return null===n?s:{get:()=>{try{return n.getItem(e)}catch(t){return console.error(`Docusaurus storage error, can't get key=${e}`,t),null}},set:t=>{try{const r=n.getItem(e);n.setItem(e,t),o({key:e,oldValue:r,newValue:t,storage:n})}catch(r){console.error(`Docusaurus storage error, can't set ${e}=${t}`,r)}},del:()=>{try{const t=n.getItem(e);n.removeItem(e),o({key:e,oldValue:t,newValue:null,storage:n})}catch(t){console.error(`Docusaurus storage error, can't delete key=${e}`,t)}},listen:t=>{try{const r=r=>{r.storageArea===n&&r.key===e&&t(r)};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)}catch(r){return console.error(`Docusaurus storage error, can't listen for changes of key=${e}`,r),()=>{}}}}}},4711:(e,t,n)=>{"use strict";n.d(t,{l:()=>i});var r=n(2263),o=n(6550),a=n(8780);function i(){const{siteConfig:{baseUrl:e,url:t,trailingSlash:n},i18n:{defaultLocale:i,currentLocale:s}}=(0,r.Z)(),{pathname:l}=(0,o.TH)(),c=(0,a.applyTrailingSlash)(l,{trailingSlash:n,baseUrl:e}),u=s===i?e:e.replace(`/${s}/`,"/"),d=c.replace(e,"");return{createUrl:function(e){let{locale:n,fullyQualified:r}=e;return`${r?t:""}${function(e){return e===i?`${u}`:`${u}${e}/`}(n)}${d}`}}}},5936:(e,t,n)=>{"use strict";n.d(t,{S:()=>i});var r=n(7294),o=n(6550),a=n(902);function i(e){const t=(0,o.TH)(),n=(0,a.D9)(t),i=(0,a.zX)(e);(0,r.useEffect)((()=>{n&&t!==n&&i({location:t,previousLocation:n})}),[i,t,n])}},6668:(e,t,n)=>{"use strict";n.d(t,{L:()=>o});var r=n(2263);function o(){return(0,r.Z)().siteConfig.themeConfig}},6278:(e,t,n)=>{"use strict";n.d(t,{L:()=>o});var r=n(2263);function o(){const{siteConfig:{themeConfig:e}}=(0,r.Z)();return e}},239:(e,t,n)=>{"use strict";n.d(t,{l:()=>s});var r=n(7294),o=n(8022),a=n(4996),i=n(6278);function s(){const{withBaseUrl:e}=(0,a.C)(),{algolia:{externalUrlRegex:t,replaceSearchResultPathname:n}}=(0,i.L)();return(0,r.useCallback)((r=>{const a=new URL(r);if((0,o.F)(t,a.href))return r;const i=`${a.pathname+a.hash}`;return e(function(e,t){return t?e.replaceAll(new RegExp(t.from,"g"),t.to):e}(i,n))}),[e,t,n])}},8802:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const{trailingSlash:n,baseUrl:r}=t;if(e.startsWith("#"))return e;if(void 0===n)return e;const[o]=e.split(/[#?]/),a="/"===o||o===r?o:(i=o,n?function(e){return e.endsWith("/")?e:`${e}/`}(i):function(e){return e.endsWith("/")?e.slice(0,-1):e}(i));var i;return e.replace(o,a)}},4143:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=void 0,t.getErrorCausalChain=function e(t){return t.cause?[t,...e(t.cause)]:[t]}},8780:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=t.applyTrailingSlash=t.blogPostContainerID=void 0,t.blogPostContainerID="__blog-post-container";var o=n(8802);Object.defineProperty(t,"applyTrailingSlash",{enumerable:!0,get:function(){return r(o).default}});var a=n(4143);Object.defineProperty(t,"getErrorCausalChain",{enumerable:!0,get:function(){return a.getErrorCausalChain}})},9318:(e,t,n)=>{"use strict";n.d(t,{lX:()=>w,q_:()=>E,ob:()=>p,PP:()=>j,Ep:()=>f});var r=n(7462);function o(e){return"/"===e.charAt(0)}function a(e,t){for(var n=t,r=n+1,o=e.length;r=0;f--){var p=i[f];"."===p?a(i,f):".."===p?(a(i,f),d++):d&&(a(i,f),d--)}if(!c)for(;d--;d)i.unshift("..");!c||""===i[0]||i[0]&&o(i[0])||i.unshift("");var g=i.join("/");return n&&"/"!==g.substr(-1)&&(g+="/"),g};var s=n(8776);function l(e){return"/"===e.charAt(0)?e:"/"+e}function c(e){return"/"===e.charAt(0)?e.substr(1):e}function u(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function d(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function f(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function p(e,t,n,o){var a;"string"==typeof e?(a=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var a=t.indexOf("?");return-1!==a&&(n=t.substr(a),t=t.substr(0,a)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),a.state=t):(void 0===(a=(0,r.Z)({},e)).pathname&&(a.pathname=""),a.search?"?"!==a.search.charAt(0)&&(a.search="?"+a.search):a.search="",a.hash?"#"!==a.hash.charAt(0)&&(a.hash="#"+a.hash):a.hash="",void 0!==t&&void 0===a.state&&(a.state=t));try{a.pathname=decodeURI(a.pathname)}catch(s){throw s instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):s}return n&&(a.key=n),o?a.pathname?"/"!==a.pathname.charAt(0)&&(a.pathname=i(a.pathname,o.pathname)):a.pathname=o.pathname:a.pathname||(a.pathname="/"),a}function g(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var a="function"==typeof e?e(t,n):e;"string"==typeof a?"function"==typeof r?r(a,o):o(!0):o(!1!==a)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,o):n.push(o),d({action:r,location:o,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",o=p(e,t,m(),w.location);u.confirmTransitionTo(o,r,n,(function(e){e&&(w.entries[w.index]=o,d({action:r,location:o}))}))},go:v,goBack:function(){v(-1)},goForward:function(){v(1)},canGo:function(e){var t=w.index+e;return t>=0&&t{"use strict";var r=n(9864),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?i:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,g=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(g){var o=p(n);o&&o!==g&&e(t,o,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var s=l(t),m=l(n),h=0;h{"use strict";e.exports=function(e,t,n,r,o,a,i,s){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,a,i,s],u=0;(l=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}},5826:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},2497:(e,t,n)=>{"use strict";n.r(t)},2295:(e,t,n)=>{"use strict";n.r(t)},4865:function(e,t,n){var r,o;r=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
'};function o(e,t,n){return en?n:e}function a(e){return 100*(-1+e)}function i(e,t,n){var o;return(o="translate3d"===r.positionUsing?{transform:"translate3d("+a(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+a(e)+"%,0)"}:{"margin-left":a(e)+"%"}).transition="all "+t+"ms "+n,o}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=o(e,r.minimum,1),n.status=1===e?null:e;var a=n.render(!t),c=a.querySelector(r.barSelector),u=r.speed,d=r.easing;return a.offsetWidth,s((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),l(c,i(e,u,d)),1===e?(l(a,{transition:"none",opacity:1}),a.offsetWidth,setTimeout((function(){l(a,{transition:"all "+u+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),u)}),u)):setTimeout(t,u)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*o(Math.random()*t,.1,.95)),t=o(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var o,i=t.querySelector(r.barSelector),s=e?"-100":a(n.status||0),c=document.querySelector(r.parent);return l(i,{transition:"all 0 linear",transform:"translate3d("+s+"%,0,0)"}),r.showSpinner||(o=t.querySelector(r.spinnerSelector))&&p(o),c!=document.body&&u(c,"nprogress-custom-parent"),c.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&p(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var s=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),l=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;for(var r,o=e.length,a=t.charAt(0).toUpperCase()+t.slice(1);o--;)if((r=e[o]+a)in n)return r;return t}function o(e){return e=n(e),t[e]||(t[e]=r(e))}function a(e,t,n){t=o(t),e.style[t]=n}return function(e,t){var n,r,o=arguments;if(2==o.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&a(e,n,r);else a(e,o[1],o[2])}}();function c(e,t){return("string"==typeof e?e:f(e)).indexOf(" "+t+" ")>=0}function u(e,t){var n=f(e),r=n+t;c(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=f(e);c(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function f(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function p(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n},void 0===(o="function"==typeof r?r.call(t,n,t,e):r)||(e.exports=o)},4779:(e,t,n)=>{var r=n(5826);e.exports=p,e.exports.parse=a,e.exports.compile=function(e,t){return s(a(e,t),t)},e.exports.tokensToFunction=s,e.exports.tokensToRegExp=f;var o=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function a(e,t){for(var n,r=[],a=0,i=0,s="",u=t&&t.delimiter||"/";null!=(n=o.exec(e));){var d=n[0],f=n[1],p=n.index;if(s+=e.slice(i,p),i=p+d.length,f)s+=f[1];else{var g=e[i],m=n[2],h=n[3],b=n[4],y=n[5],v=n[6],w=n[7];s&&(r.push(s),s="");var k=null!=m&&null!=g&&g!==m,x="+"===v||"*"===v,S="?"===v||"*"===v,_=n[2]||u,C=b||y;r.push({name:h||a++,prefix:m||"",delimiter:_,optional:S,repeat:x,partial:k,asterisk:!!w,pattern:C?c(C):w?".*":"[^"+l(_)+"]+?"})}}return i{e.exports&&(e.exports={core:{meta:{path:"components/prism-core.js",option:"mandatory"},core:"Core"},themes:{meta:{path:"themes/{id}.css",link:"index.html?theme={id}",exclusive:!0},prism:{title:"Default",option:"default"},"prism-dark":"Dark","prism-funky":"Funky","prism-okaidia":{title:"Okaidia",owner:"ocodia"},"prism-twilight":{title:"Twilight",owner:"remybach"},"prism-coy":{title:"Coy",owner:"tshedor"},"prism-solarizedlight":{title:"Solarized Light",owner:"hectormatos2011 "},"prism-tomorrow":{title:"Tomorrow Night",owner:"Rosey"}},languages:{meta:{path:"components/prism-{id}",noCSS:!0,examplesPath:"examples/prism-{id}",addCheckAll:!0},markup:{title:"Markup",alias:["html","xml","svg","mathml","ssml","atom","rss"],aliasTitles:{html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",ssml:"SSML",atom:"Atom",rss:"RSS"},option:"default"},css:{title:"CSS",option:"default",modify:"markup"},clike:{title:"C-like",option:"default"},javascript:{title:"JavaScript",require:"clike",modify:"markup",optional:"regex",alias:"js",option:"default"},abap:{title:"ABAP",owner:"dellagustin"},abnf:{title:"ABNF",owner:"RunDevelopment"},actionscript:{title:"ActionScript",require:"javascript",modify:"markup",owner:"Golmote"},ada:{title:"Ada",owner:"Lucretia"},agda:{title:"Agda",owner:"xy-ren"},al:{title:"AL",owner:"RunDevelopment"},antlr4:{title:"ANTLR4",alias:"g4",owner:"RunDevelopment"},apacheconf:{title:"Apache Configuration",owner:"GuiTeK"},apex:{title:"Apex",require:["clike","sql"],owner:"RunDevelopment"},apl:{title:"APL",owner:"ngn"},applescript:{title:"AppleScript",owner:"Golmote"},aql:{title:"AQL",owner:"RunDevelopment"},arduino:{title:"Arduino",require:"cpp",alias:"ino",owner:"dkern"},arff:{title:"ARFF",owner:"Golmote"},armasm:{title:"ARM Assembly",alias:"arm-asm",owner:"RunDevelopment"},arturo:{title:"Arturo",alias:"art",optional:["bash","css","javascript","markup","markdown","sql"],owner:"drkameleon"},asciidoc:{alias:"adoc",title:"AsciiDoc",owner:"Golmote"},aspnet:{title:"ASP.NET (C#)",require:["markup","csharp"],owner:"nauzilus"},asm6502:{title:"6502 Assembly",owner:"kzurawel"},asmatmel:{title:"Atmel AVR Assembly",owner:"cerkit"},autohotkey:{title:"AutoHotkey",owner:"aviaryan"},autoit:{title:"AutoIt",owner:"Golmote"},avisynth:{title:"AviSynth",alias:"avs",owner:"Zinfidel"},"avro-idl":{title:"Avro IDL",alias:"avdl",owner:"RunDevelopment"},awk:{title:"AWK",alias:"gawk",aliasTitles:{gawk:"GAWK"},owner:"RunDevelopment"},bash:{title:"Bash",alias:["sh","shell"],aliasTitles:{sh:"Shell",shell:"Shell"},owner:"zeitgeist87"},basic:{title:"BASIC",owner:"Golmote"},batch:{title:"Batch",owner:"Golmote"},bbcode:{title:"BBcode",alias:"shortcode",aliasTitles:{shortcode:"Shortcode"},owner:"RunDevelopment"},bbj:{title:"BBj",owner:"hyyan"},bicep:{title:"Bicep",owner:"johnnyreilly"},birb:{title:"Birb",require:"clike",owner:"Calamity210"},bison:{title:"Bison",require:"c",owner:"Golmote"},bnf:{title:"BNF",alias:"rbnf",aliasTitles:{rbnf:"RBNF"},owner:"RunDevelopment"},bqn:{title:"BQN",owner:"yewscion"},brainfuck:{title:"Brainfuck",owner:"Golmote"},brightscript:{title:"BrightScript",owner:"RunDevelopment"},bro:{title:"Bro",owner:"wayward710"},bsl:{title:"BSL (1C:Enterprise)",alias:"oscript",aliasTitles:{oscript:"OneScript"},owner:"Diversus23"},c:{title:"C",require:"clike",owner:"zeitgeist87"},csharp:{title:"C#",require:"clike",alias:["cs","dotnet"],owner:"mvalipour"},cpp:{title:"C++",require:"c",owner:"zeitgeist87"},cfscript:{title:"CFScript",require:"clike",alias:"cfc",owner:"mjclemente"},chaiscript:{title:"ChaiScript",require:["clike","cpp"],owner:"RunDevelopment"},cil:{title:"CIL",owner:"sbrl"},cilkc:{title:"Cilk/C",require:"c",alias:"cilk-c",owner:"OpenCilk"},cilkcpp:{title:"Cilk/C++",require:"cpp",alias:["cilk-cpp","cilk"],owner:"OpenCilk"},clojure:{title:"Clojure",owner:"troglotit"},cmake:{title:"CMake",owner:"mjrogozinski"},cobol:{title:"COBOL",owner:"RunDevelopment"},coffeescript:{title:"CoffeeScript",require:"javascript",alias:"coffee",owner:"R-osey"},concurnas:{title:"Concurnas",alias:"conc",owner:"jasontatton"},csp:{title:"Content-Security-Policy",owner:"ScottHelme"},cooklang:{title:"Cooklang",owner:"ahue"},coq:{title:"Coq",owner:"RunDevelopment"},crystal:{title:"Crystal",require:"ruby",owner:"MakeNowJust"},"css-extras":{title:"CSS Extras",require:"css",modify:"css",owner:"milesj"},csv:{title:"CSV",owner:"RunDevelopment"},cue:{title:"CUE",owner:"RunDevelopment"},cypher:{title:"Cypher",owner:"RunDevelopment"},d:{title:"D",require:"clike",owner:"Golmote"},dart:{title:"Dart",require:"clike",owner:"Golmote"},dataweave:{title:"DataWeave",owner:"machaval"},dax:{title:"DAX",owner:"peterbud"},dhall:{title:"Dhall",owner:"RunDevelopment"},diff:{title:"Diff",owner:"uranusjr"},django:{title:"Django/Jinja2",require:"markup-templating",alias:"jinja2",owner:"romanvm"},"dns-zone-file":{title:"DNS zone file",owner:"RunDevelopment",alias:"dns-zone"},docker:{title:"Docker",alias:"dockerfile",owner:"JustinBeckwith"},dot:{title:"DOT (Graphviz)",alias:"gv",optional:"markup",owner:"RunDevelopment"},ebnf:{title:"EBNF",owner:"RunDevelopment"},editorconfig:{title:"EditorConfig",owner:"osipxd"},eiffel:{title:"Eiffel",owner:"Conaclos"},ejs:{title:"EJS",require:["javascript","markup-templating"],owner:"RunDevelopment",alias:"eta",aliasTitles:{eta:"Eta"}},elixir:{title:"Elixir",owner:"Golmote"},elm:{title:"Elm",owner:"zwilias"},etlua:{title:"Embedded Lua templating",require:["lua","markup-templating"],owner:"RunDevelopment"},erb:{title:"ERB",require:["ruby","markup-templating"],owner:"Golmote"},erlang:{title:"Erlang",owner:"Golmote"},"excel-formula":{title:"Excel Formula",alias:["xlsx","xls"],owner:"RunDevelopment"},fsharp:{title:"F#",require:"clike",owner:"simonreynolds7"},factor:{title:"Factor",owner:"catb0t"},false:{title:"False",owner:"edukisto"},"firestore-security-rules":{title:"Firestore security rules",require:"clike",owner:"RunDevelopment"},flow:{title:"Flow",require:"javascript",owner:"Golmote"},fortran:{title:"Fortran",owner:"Golmote"},ftl:{title:"FreeMarker Template Language",require:"markup-templating",owner:"RunDevelopment"},gml:{title:"GameMaker Language",alias:"gamemakerlanguage",require:"clike",owner:"LiarOnce"},gap:{title:"GAP (CAS)",owner:"RunDevelopment"},gcode:{title:"G-code",owner:"RunDevelopment"},gdscript:{title:"GDScript",owner:"RunDevelopment"},gedcom:{title:"GEDCOM",owner:"Golmote"},gettext:{title:"gettext",alias:"po",owner:"RunDevelopment"},gherkin:{title:"Gherkin",owner:"hason"},git:{title:"Git",owner:"lgiraudel"},glsl:{title:"GLSL",require:"c",owner:"Golmote"},gn:{title:"GN",alias:"gni",owner:"RunDevelopment"},"linker-script":{title:"GNU Linker Script",alias:"ld",owner:"RunDevelopment"},go:{title:"Go",require:"clike",owner:"arnehormann"},"go-module":{title:"Go module",alias:"go-mod",owner:"RunDevelopment"},gradle:{title:"Gradle",require:"clike",owner:"zeabdelkhalek-badido18"},graphql:{title:"GraphQL",optional:"markdown",owner:"Golmote"},groovy:{title:"Groovy",require:"clike",owner:"robfletcher"},haml:{title:"Haml",require:"ruby",optional:["css","css-extras","coffeescript","erb","javascript","less","markdown","scss","textile"],owner:"Golmote"},handlebars:{title:"Handlebars",require:"markup-templating",alias:["hbs","mustache"],aliasTitles:{mustache:"Mustache"},owner:"Golmote"},haskell:{title:"Haskell",alias:"hs",owner:"bholst"},haxe:{title:"Haxe",require:"clike",optional:"regex",owner:"Golmote"},hcl:{title:"HCL",owner:"outsideris"},hlsl:{title:"HLSL",require:"c",owner:"RunDevelopment"},hoon:{title:"Hoon",owner:"matildepark"},http:{title:"HTTP",optional:["csp","css","hpkp","hsts","javascript","json","markup","uri"],owner:"danielgtaylor"},hpkp:{title:"HTTP Public-Key-Pins",owner:"ScottHelme"},hsts:{title:"HTTP Strict-Transport-Security",owner:"ScottHelme"},ichigojam:{title:"IchigoJam",owner:"BlueCocoa"},icon:{title:"Icon",owner:"Golmote"},"icu-message-format":{title:"ICU Message Format",owner:"RunDevelopment"},idris:{title:"Idris",alias:"idr",owner:"KeenS",require:"haskell"},ignore:{title:".ignore",owner:"osipxd",alias:["gitignore","hgignore","npmignore"],aliasTitles:{gitignore:".gitignore",hgignore:".hgignore",npmignore:".npmignore"}},inform7:{title:"Inform 7",owner:"Golmote"},ini:{title:"Ini",owner:"aviaryan"},io:{title:"Io",owner:"AlesTsurko"},j:{title:"J",owner:"Golmote"},java:{title:"Java",require:"clike",owner:"sherblot"},javadoc:{title:"JavaDoc",require:["markup","java","javadoclike"],modify:"java",optional:"scala",owner:"RunDevelopment"},javadoclike:{title:"JavaDoc-like",modify:["java","javascript","php"],owner:"RunDevelopment"},javastacktrace:{title:"Java stack trace",owner:"RunDevelopment"},jexl:{title:"Jexl",owner:"czosel"},jolie:{title:"Jolie",require:"clike",owner:"thesave"},jq:{title:"JQ",owner:"RunDevelopment"},jsdoc:{title:"JSDoc",require:["javascript","javadoclike","typescript"],modify:"javascript",optional:["actionscript","coffeescript"],owner:"RunDevelopment"},"js-extras":{title:"JS Extras",require:"javascript",modify:"javascript",optional:["actionscript","coffeescript","flow","n4js","typescript"],owner:"RunDevelopment"},json:{title:"JSON",alias:"webmanifest",aliasTitles:{webmanifest:"Web App Manifest"},owner:"CupOfTea696"},json5:{title:"JSON5",require:"json",owner:"RunDevelopment"},jsonp:{title:"JSONP",require:"json",owner:"RunDevelopment"},jsstacktrace:{title:"JS stack trace",owner:"sbrl"},"js-templates":{title:"JS Templates",require:"javascript",modify:"javascript",optional:["css","css-extras","graphql","markdown","markup","sql"],owner:"RunDevelopment"},julia:{title:"Julia",owner:"cdagnino"},keepalived:{title:"Keepalived Configure",owner:"dev-itsheng"},keyman:{title:"Keyman",owner:"mcdurdin"},kotlin:{title:"Kotlin",alias:["kt","kts"],aliasTitles:{kts:"Kotlin Script"},require:"clike",owner:"Golmote"},kumir:{title:"KuMir (\u041a\u0443\u041c\u0438\u0440)",alias:"kum",owner:"edukisto"},kusto:{title:"Kusto",owner:"RunDevelopment"},latex:{title:"LaTeX",alias:["tex","context"],aliasTitles:{tex:"TeX",context:"ConTeXt"},owner:"japborst"},latte:{title:"Latte",require:["clike","markup-templating","php"],owner:"nette"},less:{title:"Less",require:"css",optional:"css-extras",owner:"Golmote"},lilypond:{title:"LilyPond",require:"scheme",alias:"ly",owner:"RunDevelopment"},liquid:{title:"Liquid",require:"markup-templating",owner:"cinhtau"},lisp:{title:"Lisp",alias:["emacs","elisp","emacs-lisp"],owner:"JuanCaicedo"},livescript:{title:"LiveScript",owner:"Golmote"},llvm:{title:"LLVM IR",owner:"porglezomp"},log:{title:"Log file",optional:"javastacktrace",owner:"RunDevelopment"},lolcode:{title:"LOLCODE",owner:"Golmote"},lua:{title:"Lua",owner:"Golmote"},magma:{title:"Magma (CAS)",owner:"RunDevelopment"},makefile:{title:"Makefile",owner:"Golmote"},markdown:{title:"Markdown",require:"markup",optional:"yaml",alias:"md",owner:"Golmote"},"markup-templating":{title:"Markup templating",require:"markup",owner:"Golmote"},mata:{title:"Mata",owner:"RunDevelopment"},matlab:{title:"MATLAB",owner:"Golmote"},maxscript:{title:"MAXScript",owner:"RunDevelopment"},mel:{title:"MEL",owner:"Golmote"},mermaid:{title:"Mermaid",owner:"RunDevelopment"},metafont:{title:"METAFONT",owner:"LaeriExNihilo"},mizar:{title:"Mizar",owner:"Golmote"},mongodb:{title:"MongoDB",owner:"airs0urce",require:"javascript"},monkey:{title:"Monkey",owner:"Golmote"},moonscript:{title:"MoonScript",alias:"moon",owner:"RunDevelopment"},n1ql:{title:"N1QL",owner:"TMWilds"},n4js:{title:"N4JS",require:"javascript",optional:"jsdoc",alias:"n4jsd",owner:"bsmith-n4"},"nand2tetris-hdl":{title:"Nand To Tetris HDL",owner:"stephanmax"},naniscript:{title:"Naninovel Script",owner:"Elringus",alias:"nani"},nasm:{title:"NASM",owner:"rbmj"},neon:{title:"NEON",owner:"nette"},nevod:{title:"Nevod",owner:"nezaboodka"},nginx:{title:"nginx",owner:"volado"},nim:{title:"Nim",owner:"Golmote"},nix:{title:"Nix",owner:"Golmote"},nsis:{title:"NSIS",owner:"idleberg"},objectivec:{title:"Objective-C",require:"c",alias:"objc",owner:"uranusjr"},ocaml:{title:"OCaml",owner:"Golmote"},odin:{title:"Odin",owner:"edukisto"},opencl:{title:"OpenCL",require:"c",modify:["c","cpp"],owner:"Milania1"},openqasm:{title:"OpenQasm",alias:"qasm",owner:"RunDevelopment"},oz:{title:"Oz",owner:"Golmote"},parigp:{title:"PARI/GP",owner:"Golmote"},parser:{title:"Parser",require:"markup",owner:"Golmote"},pascal:{title:"Pascal",alias:"objectpascal",aliasTitles:{objectpascal:"Object Pascal"},owner:"Golmote"},pascaligo:{title:"Pascaligo",owner:"DefinitelyNotAGoat"},psl:{title:"PATROL Scripting Language",owner:"bertysentry"},pcaxis:{title:"PC-Axis",alias:"px",owner:"RunDevelopment"},peoplecode:{title:"PeopleCode",alias:"pcode",owner:"RunDevelopment"},perl:{title:"Perl",owner:"Golmote"},php:{title:"PHP",require:"markup-templating",owner:"milesj"},phpdoc:{title:"PHPDoc",require:["php","javadoclike"],modify:"php",owner:"RunDevelopment"},"php-extras":{title:"PHP Extras",require:"php",modify:"php",owner:"milesj"},"plant-uml":{title:"PlantUML",alias:"plantuml",owner:"RunDevelopment"},plsql:{title:"PL/SQL",require:"sql",owner:"Golmote"},powerquery:{title:"PowerQuery",alias:["pq","mscript"],owner:"peterbud"},powershell:{title:"PowerShell",owner:"nauzilus"},processing:{title:"Processing",require:"clike",owner:"Golmote"},prolog:{title:"Prolog",owner:"Golmote"},promql:{title:"PromQL",owner:"arendjr"},properties:{title:".properties",owner:"Golmote"},protobuf:{title:"Protocol Buffers",require:"clike",owner:"just-boris"},pug:{title:"Pug",require:["markup","javascript"],optional:["coffeescript","ejs","handlebars","less","livescript","markdown","scss","stylus","twig"],owner:"Golmote"},puppet:{title:"Puppet",owner:"Golmote"},pure:{title:"Pure",optional:["c","cpp","fortran"],owner:"Golmote"},purebasic:{title:"PureBasic",require:"clike",alias:"pbfasm",owner:"HeX0R101"},purescript:{title:"PureScript",require:"haskell",alias:"purs",owner:"sriharshachilakapati"},python:{title:"Python",alias:"py",owner:"multipetros"},qsharp:{title:"Q#",require:"clike",alias:"qs",owner:"fedonman"},q:{title:"Q (kdb+ database)",owner:"Golmote"},qml:{title:"QML",require:"javascript",owner:"RunDevelopment"},qore:{title:"Qore",require:"clike",owner:"temnroegg"},r:{title:"R",owner:"Golmote"},racket:{title:"Racket",require:"scheme",alias:"rkt",owner:"RunDevelopment"},cshtml:{title:"Razor C#",alias:"razor",require:["markup","csharp"],optional:["css","css-extras","javascript","js-extras"],owner:"RunDevelopment"},jsx:{title:"React JSX",require:["markup","javascript"],optional:["jsdoc","js-extras","js-templates"],owner:"vkbansal"},tsx:{title:"React TSX",require:["jsx","typescript"]},reason:{title:"Reason",require:"clike",owner:"Golmote"},regex:{title:"Regex",owner:"RunDevelopment"},rego:{title:"Rego",owner:"JordanSh"},renpy:{title:"Ren'py",alias:"rpy",owner:"HyuchiaDiego"},rescript:{title:"ReScript",alias:"res",owner:"vmarcosp"},rest:{title:"reST (reStructuredText)",owner:"Golmote"},rip:{title:"Rip",owner:"ravinggenius"},roboconf:{title:"Roboconf",owner:"Golmote"},robotframework:{title:"Robot Framework",alias:"robot",owner:"RunDevelopment"},ruby:{title:"Ruby",require:"clike",alias:"rb",owner:"samflores"},rust:{title:"Rust",owner:"Golmote"},sas:{title:"SAS",optional:["groovy","lua","sql"],owner:"Golmote"},sass:{title:"Sass (Sass)",require:"css",optional:"css-extras",owner:"Golmote"},scss:{title:"Sass (SCSS)",require:"css",optional:"css-extras",owner:"MoOx"},scala:{title:"Scala",require:"java",owner:"jozic"},scheme:{title:"Scheme",owner:"bacchus123"},"shell-session":{title:"Shell session",require:"bash",alias:["sh-session","shellsession"],owner:"RunDevelopment"},smali:{title:"Smali",owner:"RunDevelopment"},smalltalk:{title:"Smalltalk",owner:"Golmote"},smarty:{title:"Smarty",require:"markup-templating",optional:"php",owner:"Golmote"},sml:{title:"SML",alias:"smlnj",aliasTitles:{smlnj:"SML/NJ"},owner:"RunDevelopment"},solidity:{title:"Solidity (Ethereum)",alias:"sol",require:"clike",owner:"glachaud"},"solution-file":{title:"Solution file",alias:"sln",owner:"RunDevelopment"},soy:{title:"Soy (Closure Template)",require:"markup-templating",owner:"Golmote"},sparql:{title:"SPARQL",require:"turtle",owner:"Triply-Dev",alias:"rq"},"splunk-spl":{title:"Splunk SPL",owner:"RunDevelopment"},sqf:{title:"SQF: Status Quo Function (Arma 3)",require:"clike",owner:"RunDevelopment"},sql:{title:"SQL",owner:"multipetros"},squirrel:{title:"Squirrel",require:"clike",owner:"RunDevelopment"},stan:{title:"Stan",owner:"RunDevelopment"},stata:{title:"Stata Ado",require:["mata","java","python"],owner:"RunDevelopment"},iecst:{title:"Structured Text (IEC 61131-3)",owner:"serhioromano"},stylus:{title:"Stylus",owner:"vkbansal"},supercollider:{title:"SuperCollider",alias:"sclang",owner:"RunDevelopment"},swift:{title:"Swift",owner:"chrischares"},systemd:{title:"Systemd configuration file",owner:"RunDevelopment"},"t4-templating":{title:"T4 templating",owner:"RunDevelopment"},"t4-cs":{title:"T4 Text Templates (C#)",require:["t4-templating","csharp"],alias:"t4",owner:"RunDevelopment"},"t4-vb":{title:"T4 Text Templates (VB)",require:["t4-templating","vbnet"],owner:"RunDevelopment"},tap:{title:"TAP",owner:"isaacs",require:"yaml"},tcl:{title:"Tcl",owner:"PeterChaplin"},tt2:{title:"Template Toolkit 2",require:["clike","markup-templating"],owner:"gflohr"},textile:{title:"Textile",require:"markup",optional:"css",owner:"Golmote"},toml:{title:"TOML",owner:"RunDevelopment"},tremor:{title:"Tremor",alias:["trickle","troy"],owner:"darach",aliasTitles:{trickle:"trickle",troy:"troy"}},turtle:{title:"Turtle",alias:"trig",aliasTitles:{trig:"TriG"},owner:"jakubklimek"},twig:{title:"Twig",require:"markup-templating",owner:"brandonkelly"},typescript:{title:"TypeScript",require:"javascript",optional:"js-templates",alias:"ts",owner:"vkbansal"},typoscript:{title:"TypoScript",alias:"tsconfig",aliasTitles:{tsconfig:"TSConfig"},owner:"dkern"},unrealscript:{title:"UnrealScript",alias:["uscript","uc"],owner:"RunDevelopment"},uorazor:{title:"UO Razor Script",owner:"jaseowns"},uri:{title:"URI",alias:"url",aliasTitles:{url:"URL"},owner:"RunDevelopment"},v:{title:"V",require:"clike",owner:"taggon"},vala:{title:"Vala",require:"clike",optional:"regex",owner:"TemplarVolk"},vbnet:{title:"VB.Net",require:"basic",owner:"Bigsby"},velocity:{title:"Velocity",require:"markup",owner:"Golmote"},verilog:{title:"Verilog",owner:"a-rey"},vhdl:{title:"VHDL",owner:"a-rey"},vim:{title:"vim",owner:"westonganger"},"visual-basic":{title:"Visual Basic",alias:["vb","vba"],aliasTitles:{vba:"VBA"},owner:"Golmote"},warpscript:{title:"WarpScript",owner:"RunDevelopment"},wasm:{title:"WebAssembly",owner:"Golmote"},"web-idl":{title:"Web IDL",alias:"webidl",owner:"RunDevelopment"},wgsl:{title:"WGSL",owner:"Dr4gonthree"},wiki:{title:"Wiki markup",require:"markup",owner:"Golmote"},wolfram:{title:"Wolfram language",alias:["mathematica","nb","wl"],aliasTitles:{mathematica:"Mathematica",nb:"Mathematica Notebook"},owner:"msollami"},wren:{title:"Wren",owner:"clsource"},xeora:{title:"Xeora",require:"markup",alias:"xeoracube",aliasTitles:{xeoracube:"XeoraCube"},owner:"freakmaxi"},"xml-doc":{title:"XML doc (.net)",require:"markup",modify:["csharp","fsharp","vbnet"],owner:"RunDevelopment"},xojo:{title:"Xojo (REALbasic)",owner:"Golmote"},xquery:{title:"XQuery",require:"markup",owner:"Golmote"},yaml:{title:"YAML",alias:"yml",owner:"hason"},yang:{title:"YANG",owner:"RunDevelopment"},zig:{title:"Zig",owner:"RunDevelopment"}},plugins:{meta:{path:"plugins/{id}/prism-{id}",link:"plugins/{id}/"},"line-highlight":{title:"Line Highlight",description:"Highlights specific lines and/or line ranges."},"line-numbers":{title:"Line Numbers",description:"Line number at the beginning of code lines.",owner:"kuba-kubula"},"show-invisibles":{title:"Show Invisibles",description:"Show hidden characters such as tabs and line breaks.",optional:["autolinker","data-uri-highlight"]},autolinker:{title:"Autolinker",description:"Converts URLs and emails in code to clickable links. Parses Markdown links in comments."},wpd:{title:"WebPlatform Docs",description:'Makes tokens link to WebPlatform.org documentation. The links open in a new tab.'},"custom-class":{title:"Custom Class",description:"This plugin allows you to prefix Prism's default classes (.comment can become .namespace--comment) or replace them with your defined ones (like .editor__comment). You can even add new classes.",owner:"dvkndn",noCSS:!0},"file-highlight":{title:"File Highlight",description:"Fetch external files and highlight them with Prism. Used on the Prism website itself.",noCSS:!0},"show-language":{title:"Show Language",description:"Display the highlighted language in code blocks (inline code does not show the label).",owner:"nauzilus",noCSS:!0,require:"toolbar"},"jsonp-highlight":{title:"JSONP Highlight",description:"Fetch content with JSONP and highlight some interesting content (e.g. GitHub/Gists or Bitbucket API).",noCSS:!0,owner:"nauzilus"},"highlight-keywords":{title:"Highlight Keywords",description:"Adds special CSS classes for each keyword for fine-grained highlighting.",owner:"vkbansal",noCSS:!0},"remove-initial-line-feed":{title:"Remove initial line feed",description:"Removes the initial line feed in code blocks.",owner:"Golmote",noCSS:!0},"inline-color":{title:"Inline color",description:"Adds a small inline preview for colors in style sheets.",require:"css-extras",owner:"RunDevelopment"},previewers:{title:"Previewers",description:"Previewers for angles, colors, gradients, easing and time.",require:"css-extras",owner:"Golmote"},autoloader:{title:"Autoloader",description:"Automatically loads the needed languages to highlight the code blocks.",owner:"Golmote",noCSS:!0},"keep-markup":{title:"Keep Markup",description:"Prevents custom markup from being dropped out during highlighting.",owner:"Golmote",optional:"normalize-whitespace",noCSS:!0},"command-line":{title:"Command Line",description:"Display a command line with a prompt and, optionally, the output/response from the commands.",owner:"chriswells0"},"unescaped-markup":{title:"Unescaped Markup",description:"Write markup without having to escape anything."},"normalize-whitespace":{title:"Normalize Whitespace",description:"Supports multiple operations to normalize whitespace in code blocks.",owner:"zeitgeist87",optional:"unescaped-markup",noCSS:!0},"data-uri-highlight":{title:"Data-URI Highlight",description:"Highlights data-URI contents.",owner:"Golmote",noCSS:!0},toolbar:{title:"Toolbar",description:"Attach a toolbar for plugins to easily register buttons on the top of a code block.",owner:"mAAdhaTTah"},"copy-to-clipboard":{title:"Copy to Clipboard Button",description:"Add a button that copies the code block to the clipboard when clicked.",owner:"mAAdhaTTah",require:"toolbar",noCSS:!0},"download-button":{title:"Download Button",description:"A button in the toolbar of a code block adding a convenient way to download a code file.",owner:"Golmote",require:"toolbar",noCSS:!0},"match-braces":{title:"Match braces",description:"Highlights matching braces.",owner:"RunDevelopment"},"diff-highlight":{title:"Diff Highlight",description:"Highlights the code inside diff blocks.",owner:"RunDevelopment",require:"diff"},"filter-highlight-all":{title:"Filter highlightAll",description:"Filters the elements the highlightAll and highlightAllUnder methods actually highlight.",owner:"RunDevelopment",noCSS:!0},treeview:{title:"Treeview",description:"A language with special styles to highlight file system tree structures.",owner:"Golmote"}}})},2885:(e,t,n)=>{const r=n(9901),o=n(9642),a=new Set;function i(e){void 0===e?e=Object.keys(r.languages).filter((e=>"meta"!=e)):Array.isArray(e)||(e=[e]);const t=[...a,...Object.keys(Prism.languages)];o(r,e,t).load((e=>{if(!(e in r.languages))return void(i.silent||console.warn("Language does not exist: "+e));const t="./prism-"+e;delete n.c[n(6500).resolve(t)],delete Prism.languages[e],n(6500)(t),a.add(e)}))}i.silent=!1,e.exports=i},6854:()=>{!function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,o,a){if(n.language===r){var i=n.tokenStack=[];n.code=n.code.replace(o,(function(e){if("function"==typeof a&&!a(e))return e;for(var o,s=i.length;-1!==n.code.indexOf(o=t(r,s));)++s;return i[s]=e,o})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var o=0,a=Object.keys(n.tokenStack);!function i(s){for(var l=0;l=a.length);l++){var c=s[l];if("string"==typeof c||c.content&&"string"==typeof c.content){var u=a[o],d=n.tokenStack[u],f="string"==typeof c?c:c.content,p=t(r,u),g=f.indexOf(p);if(g>-1){++o;var m=f.substring(0,g),h=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),b=f.substring(g+p.length),y=[];m&&y.push.apply(y,i([m])),y.push(h),b&&y.push.apply(y,i([b])),"string"==typeof c?s.splice.apply(s,[l,1].concat(y)):c.content=y}}else c.content&&i(c.content)}return s}(n.tokens)}}}})}(Prism)},6726:(e,t,n)=>{var r={"./":2885};function o(e){var t=a(e);return n(t)}function a(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=a,e.exports=o,o.id=6726},6500:(e,t,n)=>{var r={"./":2885};function o(e){var t=a(e);return n(t)}function a(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=a,e.exports=o,o.id=6500},9642:e=>{"use strict";var t=function(){var e=function(){};function t(e,t){Array.isArray(e)?e.forEach(t):null!=e&&t(e,0)}function n(e){for(var t={},n=0,r=e.length;n "));var s={},l=e[r];if(l){function c(t){if(!(t in e))throw new Error(r+" depends on an unknown component "+t);if(!(t in s))for(var i in o(t,a),s[t]=!0,n[t])s[i]=!0}t(l.require,c),t(l.optional,c),t(l.modify,c)}n[r]=s,a.pop()}}return function(e){var t=n[e];return t||(o(e,r),t=n[e]),t}}function o(e){for(var t in e)return!0;return!1}return function(a,i,s){var l=function(e){var t={};for(var n in e){var r=e[n];for(var o in r)if("meta"!=o){var a=r[o];t[o]="string"==typeof a?{title:a}:a}}return t}(a),c=function(e){var n;return function(r){if(r in e)return r;if(!n)for(var o in n={},e){var a=e[o];t(a&&a.alias,(function(t){if(t in n)throw new Error(t+" cannot be alias for both "+o+" and "+n[t]);if(t in e)throw new Error(t+" cannot be alias of "+o+" because it is a component.");n[t]=o}))}return n[r]||r}}(l);i=i.map(c),s=(s||[]).map(c);var u=n(i),d=n(s);i.forEach((function e(n){var r=l[n];t(r&&r.require,(function(t){t in d||(u[t]=!0,e(t))}))}));for(var f,p=r(l),g=u;o(g);){for(var m in f={},g){var h=l[m];t(h&&h.modify,(function(e){e in d&&(f[e]=!0)}))}for(var b in d)if(!(b in u))for(var y in p(b))if(y in u){f[b]=!0;break}for(var v in g=f)u[v]=!0}var w={getIds:function(){var e=[];return w.load((function(t){e.push(t)})),e},load:function(t,n){return function(t,n,r,o){var a=o?o.series:void 0,i=o?o.parallel:e,s={},l={};function c(e){if(e in s)return s[e];l[e]=!0;var o,u=[];for(var d in t(e))d in n&&u.push(d);if(0===u.length)o=r(e);else{var f=i(u.map((function(e){var t=c(e);return delete l[e],t})));a?o=a(f,(function(){return r(e)})):r(e)}return s[e]=o}for(var u in n)c(u);var d=[];for(var f in l)d.push(s[f]);return i(d)}(p,u,t,n)}};return w}}();e.exports=t},2703:(e,t,n)=>{"use strict";var r=n(414);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},5697:(e,t,n)=>{e.exports=n(2703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4448:(e,t,n)=>{"use strict";var r=n(7294),o=n(3840);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n