diff --git a/404.html b/404.html index ee012e640..38c6ae657 100644 --- a/404.html +++ b/404.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- + \ No newline at end of file diff --git a/assets/js/1c14429f.e287cb67.js b/assets/js/1c14429f.5bbd228c.js similarity index 99% rename from assets/js/1c14429f.e287cb67.js rename to assets/js/1c14429f.5bbd228c.js index 258ae51a3..b44c71af0 100644 --- a/assets/js/1c14429f.e287cb67.js +++ b/assets/js/1c14429f.5bbd228c.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[2702],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>m});var o=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=o.createContext({}),d=function(e){var t=o.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},c=function(e){var t=d(e.components);return o.createElement(s.Provider,{value:t},e.children)},u="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},h=o.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),u=d(n),h=a,m=u["".concat(s,".").concat(h)]||u[h]||p[h]||r;return n?o.createElement(m,i(i({ref:t},c),{},{components:n})):o.createElement(m,i({ref:t},c))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,i=new Array(r);i[0]=h;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[u]="string"==typeof e?e:a,i[1]=l;for(var d=2;d{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>s,default:()=>m,frontMatter:()=>l,metadata:()=>d,toc:()=>u});var o=n(7462),a=(n(7294),n(3905)),r=n(3872),i=n(2915);const l={template:"post",draft:!1,hide_title:!0,title:"Getting Started",slug:"getting-started",date:new Date("2023-08-31T23:00:00.000Z"),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"]},s=void 0,d={unversionedId:"Node Operators/getting-started-guide",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,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:1694621981,formattedLastUpdatedAt:"Sep 13, 2023",frontMatter:{template:"post",draft:!1,hide_title:!0,title:"Getting Started",slug:"getting-started",date:"2023-08-31T23:00:00.000Z",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:"Transfering setup ownership",permalink:"/guides/Node Operators/transfering-setup-ownership"}},c={},u=[{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}],p={toc:u},h="wrapper";function m(e){let{components:t,...n}=e;return(0,a.kt)(h,(0,o.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"introduction"},"Introduction"),(0,a.kt)("p",null,"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 and making a request to a service to put and retrieve a .car files from the network."),(0,a.kt)("p",null,"For those seeking advanced knowledge:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Read our ",(0,a.kt)("a",{parentName:"li",href:"/docs/whitepaper"},"whitepaper"),"."),(0,a.kt)("li",{parentName:"ul"},"Check out ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/fleek-network/lightning"},"our open-source code"),".")),(0,a.kt)("admonition",{type:"tip"},(0,a.kt)("p",{parentName:"admonition"},"If you find any typos in our documentation, feel free to ",(0,a.kt)("a",{parentName:"p",href:"https://discord.gg/fleekxyz"},"provide us feedback")," or contribute by opening a PR in our repository ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/fleek-network/fleek-network-docs/"},"here"),".")),(0,a.kt)("h2",{id:"pre-requisites"},"Pre-requisites"),(0,a.kt)("p",null,"To follow the guide, you will need the following:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Familiarity with the command-line interface"),(0,a.kt)("li",{parentName:"ul"},"Git")),(0,a.kt)("h2",{id:"need-a-quick-fleek-network-tldr"},"Need a quick Fleek Network TL;DR?"),(0,a.kt)("p",null,"Fleek Network is an open-source edge computing platform to accelerate the development and execution of the next generation of web services."),(0,a.kt)("p",null,"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."),(0,a.kt)("p",null,"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."),(0,a.kt)("p",null,"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."),(0,a.kt)("p",null,"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."),(0,a.kt)("p",null,"To get started, install a Network Node in a ",(0,a.kt)("a",{parentName:"p",href:"/docs/node/requirements"},"supported")," Linux server, such as Debian or Ubuntu (latest) by utilizing our simple ",(0,a.kt)("a",{parentName:"p",href:"/docs/node/install#assisted-installer"},"assisted installer")," to help onboard as quickly as possible."),(0,a.kt)("admonition",{type:"tip"},(0,a.kt)("p",{parentName:"admonition"},"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!")),(0,a.kt)("p",null,"Once connected to the server, open a terminal window and execute the following command:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"curl https://get.fleek.network | bash\n")),(0,a.kt)("p",null,"Follow the install assistant recommendations to have the node ready without hassle and as quickly as possible."),(0,a.kt)("h2",{id:"why-is-fleek-network-needed"},"Why is Fleek Network needed?"),(0,a.kt)("p",null,"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."),(0,a.kt)("h2",{id:"how-does-fleek-network-work"},"How Does Fleek Network Work?"),(0,a.kt)("p",null,"When a client requests a service, the protocol determines the best route to the nodes where the service replicas and workload are allocated."),(0,a.kt)("p",null,"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."),(0,a.kt)("p",null,"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."),(0,a.kt)("h2",{id:"running-a-node"},"Running a Node"),(0,a.kt)("p",null,"A Fleek Network node can be built and run on your machine. It\u2019s an ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/fleek-network/lightning"},"open-source project")," and is open for contributions."),(0,a.kt)("p",null,"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."),(0,a.kt)("admonition",{type:"tip"},(0,a.kt)("p",{parentName:"admonition"},"To set up Rust, packages and library dependencies can be tricky. The quickest is to visit the ",(0,a.kt)("a",{parentName:"p",href:"https://rustup.rs/"},"rustup.rs"),". Alternatively, if you haven't already, the build section has a ",(0,a.kt)("a",{parentName:"p",href:"/docs/node/install#manual-installation"},"manual installation")," document to help.")),(0,a.kt)("h3",{id:"clone-the-source-code"},"Clone the source code"),(0,a.kt)("p",null,"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."),(0,a.kt)("admonition",{type:"note"},(0,a.kt)("p",{parentName:"admonition"},"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.")),(0,a.kt)("p",null,"Start by cloning the repository located at ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/fleek-network/lightning"},"https://github.com/fleek-network/lightning")),(0,a.kt)(i.ZP,{mdxType:"GitCloneOptions"}),(0,a.kt)("p",null,"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."),(0,a.kt)("h3",{id:"dependencies"},"Dependencies"),(0,a.kt)("p",null,"Install the required dependencies necessary for compiling general software and for our use-case Lightning CLI."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"sudo apt-get install \\\n build-essential \\\n clang \\\n pkg-config \\\n libssl-dev \\\n gcc-multilib \\\n protobuf-compiler\n")),(0,a.kt)("h3",{id:"build"},"Build"),(0,a.kt)("p",null,"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,a.kt)("inlineCode",{parentName:"p"},"~/fleek-network/lightning"),", as follows:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"cd ~/fleek-network/lightning\n")),(0,a.kt)("p",null,"Run the Rust package manager clean and update commands."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"cargo clean\ncargo update\n")),(0,a.kt)("p",null,"Execute the install command to build and install the Fleek Network CLI."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"cargo build\n")),(0,a.kt)("p",null,"The install command uses the Rust compiler to build; It might take a while depending on how speedy is your machine."),(0,a.kt)("p",null,"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,a.kt)("inlineCode",{parentName:"p"},"~/fleek-network/lightning/target/debug/lightning-node"),"."),(0,a.kt)("p",null,"To avoid having to specify the pathname everytime, create a symbolic link to keep it short. Here we'll name the process as the global ",(0,a.kt)("inlineCode",{parentName:"p"},"lgtn"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},'sudo ln -s "~/fleek-network/lightning/target/debug/lightning-node" /usr/local/bin/lgtn\n')),(0,a.kt)("p",null,"Run the CLI with the flag ",(0,a.kt)("inlineCode",{parentName:"p"},"version")," to confirm it's available globally."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"lgtn --version\n")),(0,a.kt)("p",null,"The output should look like:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"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")),(0,a.kt)("h3",{id:"node-launch"},"Node Launch"),(0,a.kt)("p",null,"After ",(0,a.kt)("a",{parentName:"p",href:"#build"},"building"),", the node can be launched by running the subcommand ",(0,a.kt)("inlineCode",{parentName:"p"},"run"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"lgtn run\n")),(0,a.kt)("admonition",{type:"tip"},(0,a.kt)("p",{parentName:"admonition"},"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.")),(0,a.kt)("p",null,"Learn how to create a new Systemd service in the ",(0,a.kt)("a",{parentName:"p",href:"/docs/node/install#manual-installation"},"manual installation")," document."),(0,a.kt)("h3",{id:"health-check"},"Health check"),(0,a.kt)("p",null,"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."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},'curl -w "\\n" localhost:4069/health\n')),(0,a.kt)("p",null,"If everything goes well, the response should be:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"OK\n")),(0,a.kt)("p",null,"Alternatively, use the JSON-RPC method ",(0,a.kt)("inlineCode",{parentName:"p"},"flk_ping"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},'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:4069/rpc/v0\n')),(0,a.kt)("p",null,"Which response should return the key ",(0,a.kt)("inlineCode",{parentName:"p"},"result")," with value ",(0,a.kt)("inlineCode",{parentName:"p"},"pong"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},'{\n "jsonrpc": "2.0",\n "result": "pong",\n "id": 1\n}\n')),(0,a.kt)("h2",{id:"next-steps"},"Next steps"),(0,a.kt)("p",null,"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!"),(0,a.kt)("p",null,"To avoid having to go through all the steps manually, we recommend reading our ",(0,a.kt)("a",{parentName:"p",href:"/docs/node/install#assisted-installer"},"assisted installer")," document for quick onboarding."),(0,a.kt)("h2",{id:"conclusion"},"Conclusion"),(0,a.kt)("p",null,"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."),(0,a.kt)("p",null,"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."),(0,a.kt)("p",null,"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."),(0,a.kt)("p",null,"Finally, we do a quick health check to confirm the status of our node."),(0,a.kt)("p",null,"Discover more about the project by ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/fleek-network/lightning"},"watching/contributing on GitHub"),", following us on ",(0,a.kt)("a",{parentName:"p",href:"https://twitter.com/fleek_net"},"Twitter"),", and joining ",(0,a.kt)("a",{parentName:"p",href:"https://discord.gg/fleekxyz"},"our community Discord")," for any updates."),(0,a.kt)(r.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida",mdxType:"Author"}))}m.isMDXComponent=!0},2915:(e,t,n)=>{n.d(t,{ZP:()=>l});var o=n(7462),a=(n(7294),n(3905));const r={toc:[]},i="wrapper";function l(e){let{components:t,...n}=e;return(0,a.kt)(i,(0,o.Z)({},r,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("admonition",{type:"tip"},(0,a.kt)("p",{parentName:"admonition"},"You have several ways of doing this:"),(0,a.kt)("ul",{parentName:"admonition"},(0,a.kt)("li",{parentName:"ul"},"Clone via HTTPS"),(0,a.kt)("li",{parentName:"ul"},"Clone via SSH"),(0,a.kt)("li",{parentName:"ul"},"Download via Github CLI"),(0,a.kt)("li",{parentName:"ul"},"Download the ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/fleek-network/lightning/archive/refs/heads/main.zip"},"zip package")," from the repository")),(0,a.kt)("p",{parentName:"admonition"},"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,a.kt)("a",{parentName:"p",href:"https://docs.github.com/en/authentication/connecting-to-github-with-ssh"},"here"),"."),(0,a.kt)("pre",{parentName:"admonition"},(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"git clone -b testnet-alpha-0 https://github.com/fleek-network/lightning.git \n")),(0,a.kt)("p",{parentName:"admonition"},"Here's an example of what it'd look like when sticking to the recommended path location:"),(0,a.kt)("pre",{parentName:"admonition"},(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"git clone -b testnet-alpha-0 https://github.com/fleek-network/lightning.git ~/fleek-network/lightning\n"))))}l.isMDXComponent=!0},3872:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(7294);const a=e=>{let{image:t,name:n,title:a,url:r}=e;return o.createElement("section",{className:"author_card"},o.createElement("div",null,o.createElement("span",{className:"avatar"},o.createElement("a",{href:r,target:"_blank",alt:n},o.createElement("img",{src:t,alt:n}))),o.createElement("div",null,o.createElement("span",{className:"name"},o.createElement("a",{href:r,target:"_blank",alt:n},n)),o.createElement("span",{className:"title"},a),o.createElement("span",{className:"discord"},"Got questions? Find us on ",o.createElement("a",{href:"https://discord.gg/fleekxyz",target:"_blank"},"Discord!")))))}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[2702],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>m});var o=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=o.createContext({}),d=function(e){var t=o.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},c=function(e){var t=d(e.components);return o.createElement(s.Provider,{value:t},e.children)},u="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},h=o.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),u=d(n),h=a,m=u["".concat(s,".").concat(h)]||u[h]||p[h]||r;return n?o.createElement(m,i(i({ref:t},c),{},{components:n})):o.createElement(m,i({ref:t},c))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,i=new Array(r);i[0]=h;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[u]="string"==typeof e?e:a,i[1]=l;for(var d=2;d{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>s,default:()=>m,frontMatter:()=>l,metadata:()=>d,toc:()=>u});var o=n(7462),a=(n(7294),n(3905)),r=n(3872),i=n(2915);const l={template:"post",draft:!1,hide_title:!0,title:"Getting Started",slug:"getting-started",date:new Date("2023-08-31T23:00:00.000Z"),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"]},s=void 0,d={unversionedId:"Node Operators/getting-started-guide",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,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:1694622179,formattedLastUpdatedAt:"Sep 13, 2023",frontMatter:{template:"post",draft:!1,hide_title:!0,title:"Getting Started",slug:"getting-started",date:"2023-08-31T23:00:00.000Z",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:"Transfering setup ownership",permalink:"/guides/Node Operators/transfering-setup-ownership"}},c={},u=[{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}],p={toc:u},h="wrapper";function m(e){let{components:t,...n}=e;return(0,a.kt)(h,(0,o.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"introduction"},"Introduction"),(0,a.kt)("p",null,"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 and making a request to a service to put and retrieve a .car files from the network."),(0,a.kt)("p",null,"For those seeking advanced knowledge:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Read our ",(0,a.kt)("a",{parentName:"li",href:"/docs/whitepaper"},"whitepaper"),"."),(0,a.kt)("li",{parentName:"ul"},"Check out ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/fleek-network/lightning"},"our open-source code"),".")),(0,a.kt)("admonition",{type:"tip"},(0,a.kt)("p",{parentName:"admonition"},"If you find any typos in our documentation, feel free to ",(0,a.kt)("a",{parentName:"p",href:"https://discord.gg/fleekxyz"},"provide us feedback")," or contribute by opening a PR in our repository ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/fleek-network/fleek-network-docs/"},"here"),".")),(0,a.kt)("h2",{id:"pre-requisites"},"Pre-requisites"),(0,a.kt)("p",null,"To follow the guide, you will need the following:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Familiarity with the command-line interface"),(0,a.kt)("li",{parentName:"ul"},"Git")),(0,a.kt)("h2",{id:"need-a-quick-fleek-network-tldr"},"Need a quick Fleek Network TL;DR?"),(0,a.kt)("p",null,"Fleek Network is an open-source edge computing platform to accelerate the development and execution of the next generation of web services."),(0,a.kt)("p",null,"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."),(0,a.kt)("p",null,"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."),(0,a.kt)("p",null,"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."),(0,a.kt)("p",null,"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."),(0,a.kt)("p",null,"To get started, install a Network Node in a ",(0,a.kt)("a",{parentName:"p",href:"/docs/node/requirements"},"supported")," Linux server, such as Debian or Ubuntu (latest) by utilizing our simple ",(0,a.kt)("a",{parentName:"p",href:"/docs/node/install#assisted-installer"},"assisted installer")," to help onboard as quickly as possible."),(0,a.kt)("admonition",{type:"tip"},(0,a.kt)("p",{parentName:"admonition"},"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!")),(0,a.kt)("p",null,"Once connected to the server, open a terminal window and execute the following command:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"curl https://get.fleek.network | bash\n")),(0,a.kt)("p",null,"Follow the install assistant recommendations to have the node ready without hassle and as quickly as possible."),(0,a.kt)("h2",{id:"why-is-fleek-network-needed"},"Why is Fleek Network needed?"),(0,a.kt)("p",null,"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."),(0,a.kt)("h2",{id:"how-does-fleek-network-work"},"How Does Fleek Network Work?"),(0,a.kt)("p",null,"When a client requests a service, the protocol determines the best route to the nodes where the service replicas and workload are allocated."),(0,a.kt)("p",null,"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."),(0,a.kt)("p",null,"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."),(0,a.kt)("h2",{id:"running-a-node"},"Running a Node"),(0,a.kt)("p",null,"A Fleek Network node can be built and run on your machine. It\u2019s an ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/fleek-network/lightning"},"open-source project")," and is open for contributions."),(0,a.kt)("p",null,"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."),(0,a.kt)("admonition",{type:"tip"},(0,a.kt)("p",{parentName:"admonition"},"To set up Rust, packages and library dependencies can be tricky. The quickest is to visit the ",(0,a.kt)("a",{parentName:"p",href:"https://rustup.rs/"},"rustup.rs"),". Alternatively, if you haven't already, the build section has a ",(0,a.kt)("a",{parentName:"p",href:"/docs/node/install#manual-installation"},"manual installation")," document to help.")),(0,a.kt)("h3",{id:"clone-the-source-code"},"Clone the source code"),(0,a.kt)("p",null,"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."),(0,a.kt)("admonition",{type:"note"},(0,a.kt)("p",{parentName:"admonition"},"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.")),(0,a.kt)("p",null,"Start by cloning the repository located at ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/fleek-network/lightning"},"https://github.com/fleek-network/lightning")),(0,a.kt)(i.ZP,{mdxType:"GitCloneOptions"}),(0,a.kt)("p",null,"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."),(0,a.kt)("h3",{id:"dependencies"},"Dependencies"),(0,a.kt)("p",null,"Install the required dependencies necessary for compiling general software and for our use-case Lightning CLI."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"sudo apt-get install \\\n build-essential \\\n clang \\\n pkg-config \\\n libssl-dev \\\n gcc-multilib \\\n protobuf-compiler\n")),(0,a.kt)("h3",{id:"build"},"Build"),(0,a.kt)("p",null,"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,a.kt)("inlineCode",{parentName:"p"},"~/fleek-network/lightning"),", as follows:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"cd ~/fleek-network/lightning\n")),(0,a.kt)("p",null,"Run the Rust package manager clean and update commands."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"cargo clean\ncargo update\n")),(0,a.kt)("p",null,"Execute the install command to build and install the Fleek Network CLI."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"cargo build\n")),(0,a.kt)("p",null,"The install command uses the Rust compiler to build; It might take a while depending on how speedy is your machine."),(0,a.kt)("p",null,"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,a.kt)("inlineCode",{parentName:"p"},"~/fleek-network/lightning/target/debug/lightning-node"),"."),(0,a.kt)("p",null,"To avoid having to specify the pathname everytime, create a symbolic link to keep it short. Here we'll name the process as the global ",(0,a.kt)("inlineCode",{parentName:"p"},"lgtn"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},'sudo ln -s "~/fleek-network/lightning/target/debug/lightning-node" /usr/local/bin/lgtn\n')),(0,a.kt)("p",null,"Run the CLI with the flag ",(0,a.kt)("inlineCode",{parentName:"p"},"version")," to confirm it's available globally."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"lgtn --version\n")),(0,a.kt)("p",null,"The output should look like:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"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")),(0,a.kt)("h3",{id:"node-launch"},"Node Launch"),(0,a.kt)("p",null,"After ",(0,a.kt)("a",{parentName:"p",href:"#build"},"building"),", the node can be launched by running the subcommand ",(0,a.kt)("inlineCode",{parentName:"p"},"run"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"lgtn run\n")),(0,a.kt)("admonition",{type:"tip"},(0,a.kt)("p",{parentName:"admonition"},"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.")),(0,a.kt)("p",null,"Learn how to create a new Systemd service in the ",(0,a.kt)("a",{parentName:"p",href:"/docs/node/install#manual-installation"},"manual installation")," document."),(0,a.kt)("h3",{id:"health-check"},"Health check"),(0,a.kt)("p",null,"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."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},'curl -w "\\n" localhost:4069/health\n')),(0,a.kt)("p",null,"If everything goes well, the response should be:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"OK\n")),(0,a.kt)("p",null,"Alternatively, use the JSON-RPC method ",(0,a.kt)("inlineCode",{parentName:"p"},"flk_ping"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},'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:4069/rpc/v0\n')),(0,a.kt)("p",null,"Which response should return the key ",(0,a.kt)("inlineCode",{parentName:"p"},"result")," with value ",(0,a.kt)("inlineCode",{parentName:"p"},"pong"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},'{\n "jsonrpc": "2.0",\n "result": "pong",\n "id": 1\n}\n')),(0,a.kt)("h2",{id:"next-steps"},"Next steps"),(0,a.kt)("p",null,"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!"),(0,a.kt)("p",null,"To avoid having to go through all the steps manually, we recommend reading our ",(0,a.kt)("a",{parentName:"p",href:"/docs/node/install#assisted-installer"},"assisted installer")," document for quick onboarding."),(0,a.kt)("h2",{id:"conclusion"},"Conclusion"),(0,a.kt)("p",null,"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."),(0,a.kt)("p",null,"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."),(0,a.kt)("p",null,"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."),(0,a.kt)("p",null,"Finally, we do a quick health check to confirm the status of our node."),(0,a.kt)("p",null,"Discover more about the project by ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/fleek-network/lightning"},"watching/contributing on GitHub"),", following us on ",(0,a.kt)("a",{parentName:"p",href:"https://twitter.com/fleek_net"},"Twitter"),", and joining ",(0,a.kt)("a",{parentName:"p",href:"https://discord.gg/fleekxyz"},"our community Discord")," for any updates."),(0,a.kt)(r.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida",mdxType:"Author"}))}m.isMDXComponent=!0},2915:(e,t,n)=>{n.d(t,{ZP:()=>l});var o=n(7462),a=(n(7294),n(3905));const r={toc:[]},i="wrapper";function l(e){let{components:t,...n}=e;return(0,a.kt)(i,(0,o.Z)({},r,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("admonition",{type:"tip"},(0,a.kt)("p",{parentName:"admonition"},"You have several ways of doing this:"),(0,a.kt)("ul",{parentName:"admonition"},(0,a.kt)("li",{parentName:"ul"},"Clone via HTTPS"),(0,a.kt)("li",{parentName:"ul"},"Clone via SSH"),(0,a.kt)("li",{parentName:"ul"},"Download via Github CLI"),(0,a.kt)("li",{parentName:"ul"},"Download the ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/fleek-network/lightning/archive/refs/heads/main.zip"},"zip package")," from the repository")),(0,a.kt)("p",{parentName:"admonition"},"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,a.kt)("a",{parentName:"p",href:"https://docs.github.com/en/authentication/connecting-to-github-with-ssh"},"here"),"."),(0,a.kt)("pre",{parentName:"admonition"},(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"git clone -b testnet-alpha-0 https://github.com/fleek-network/lightning.git \n")),(0,a.kt)("p",{parentName:"admonition"},"Here's an example of what it'd look like when sticking to the recommended path location:"),(0,a.kt)("pre",{parentName:"admonition"},(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"git clone -b testnet-alpha-0 https://github.com/fleek-network/lightning.git ~/fleek-network/lightning\n"))))}l.isMDXComponent=!0},3872:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(7294);const a=e=>{let{image:t,name:n,title:a,url:r}=e;return o.createElement("section",{className:"author_card"},o.createElement("div",null,o.createElement("span",{className:"avatar"},o.createElement("a",{href:r,target:"_blank",alt:n},o.createElement("img",{src:t,alt:n}))),o.createElement("div",null,o.createElement("span",{className:"name"},o.createElement("a",{href:r,target:"_blank",alt:n},n)),o.createElement("span",{className:"title"},a),o.createElement("span",{className:"discord"},"Got questions? Find us on ",o.createElement("a",{href:"https://discord.gg/fleekxyz",target:"_blank"},"Discord!")))))}}}]); \ No newline at end of file diff --git a/assets/js/1d8a5d15.211a6129.js b/assets/js/1d8a5d15.e64e862d.js similarity index 99% rename from assets/js/1d8a5d15.211a6129.js rename to assets/js/1d8a5d15.e64e862d.js index 9f0311ca1..d3d601d9e 100644 --- a/assets/js/1d8a5d15.211a6129.js +++ b/assets/js/1d8a5d15.e64e862d.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[9854],{3905:(e,t,n)=>{n.d(t,{Zo:()=>h,kt:()=>c});var o=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=o.createContext({}),p=function(e){var t=o.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},h=function(e){var t=p(e.components);return o.createElement(l.Provider,{value:t},e.children)},d="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},m=o.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,l=e.parentName,h=s(e,["components","mdxType","originalType","parentName"]),d=p(n),m=r,c=d["".concat(l,".").concat(m)]||d[m]||u[m]||a;return n?o.createElement(c,i(i({ref:t},h),{},{components:n})):o.createElement(c,i({ref:t},h))}));function c(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,i=new Array(a);i[0]=m;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[d]="string"==typeof e?e:r,i[1]=s;for(var p=2;p{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>p,default:()=>g,frontMatter:()=>l,metadata:()=>h,toc:()=>u});var o=n(7462),r=(n(7294),n(3905)),a=n(3872),i=(n(2915),n(6733)),s=n(3242);const l={template:"post",draft:!1,hide_title:!0,title:"Transfering setup ownership",slug:"transfering-setup-ownership",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"]},p=void 0,h={unversionedId:"Node Operators/transfering-setup-ownership",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,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:1694621981,formattedLastUpdatedAt:"Sep 13, 2023",frontMatter:{template:"post",draft:!1,hide_title:!0,title:"Transfering setup ownership",slug:"transfering-setup-ownership",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:"Getting Started",permalink:"/guides/Node Operators/getting-started"}},d={},u=[{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}],m={toc:u},c="wrapper";function g(e){let{components:t,...n}=e;return(0,r.kt)(c,(0,o.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h2",{id:"tldr"},"TL;DR"),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"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,r.kt)("a",{parentName:"p",href:"https://github.com/fleek-network/get.fleek.network"},"get.fleek.network")," tool."),(0,r.kt)("p",{parentName:"admonition"},"To use the automated script execute the following command in your server terminal and follow the instructions:"),(0,r.kt)("pre",{parentName:"admonition"},(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"curl -sS https://get.fleek.network/transfer_system_user_setup_ownership | bash\n")),(0,r.kt)("p",{parentName:"admonition"},"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,r.kt)("a",{parentName:"p",href:"https://discord.gg/fleekxyz"},"message us through our Discord"),".")),(0,r.kt)("h2",{id:"introduction"},"Introduction"),(0,r.kt)("p",null,"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."),(0,r.kt)("p",null,"Let's discuss the topic and open up a few ideas to help us improve the security of our server."),(0,r.kt)("h2",{id:"pre-requisites"},"Pre-requisites"),(0,r.kt)("p",null,"To follow the guide, you will need the following:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Familiarity with the command-line interface"),(0,r.kt)("li",{parentName:"ul"},"Have installed and set up the Lightning CLI and service")),(0,r.kt)("h2",{id:"ownership-of-lightning-cli-files"},"Ownership of Lightning CLI files"),(0,r.kt)("p",null,"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."),(0,r.kt)("p",null,"Our ",(0,r.kt)("a",{parentName:"p",href:"/docs/node/install"},"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,r.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/Sudo"},"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."),(0,r.kt)("p",null,"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."),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"A reference document about ",(0,r.kt)("a",{parentName:"p",href:"/references/Lightning%20CLI/file-permissions-and-ownership"},"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.")),(0,r.kt)("h2",{id:"systemd-service"},"Systemd Service"),(0,r.kt)("p",null,"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."),(0,r.kt)("p",null,"The recommended installation process features a ",(0,r.kt)("a",{parentName:"p",href:"https://www.freedesktop.org/software/systemd/man/systemd.service.html"},"systemd.service")," which is a resource that the system knows how to operate and manage by an administrator user."),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"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.")),(0,r.kt)("p",null,"If you have followed the installation recommendations, find the systemd service unit in the location ",(0,r.kt)("inlineCode",{parentName:"p"},"/etc/systemd/system/lightning.service")," (we are using Ubuntu Linux as an example to keep it short)."),(0,r.kt)("p",null,"Make sure that you have set up a ",(0,r.kt)("a",{parentName:"p",href:"/docs/node/install#systemd-service-setup"},"Systemd unit service"),", as recommended during the installation as this guide assumes you have one setup."),(0,r.kt)("h2",{id:"stop-the-service"},"Stop the service"),(0,r.kt)("p",null,"Before we proceed with any changes required for the migration, you'll have to stop the ",(0,r.kt)("inlineCode",{parentName:"p"},"lightning.service"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"systemctl stop lightning\n")),(0,r.kt)("admonition",{type:"note"},(0,r.kt)("p",{parentName:"admonition"},"For this guide, we are assuming that you are migrating ownership from ",(0,r.kt)("strong",{parentName:"p"},"root")," to a ",(0,r.kt)("strong",{parentName:"p"},"sudoer")," user. If not, you might be required to elevate privileges as ",(0,r.kt)("strong",{parentName:"p"},"sudo**")," where required. For example, ",(0,r.kt)("inlineCode",{parentName:"p"},"sudo systemctl stop lightning"),".")),(0,r.kt)("h2",{id:"clear-the-lightning-data"},"Clear the .lightning data"),(0,r.kt)("p",null,"Run the following command to clear the ",(0,r.kt)("inlineCode",{parentName:"p"},"/root/.lightning/data"),", as it can be quite large and we don't need to move it."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"sudo rm -rf /root/.lightning/data\n")),(0,r.kt)("h2",{id:"create-a-user"},"Create a user"),(0,r.kt)(i.ZP,{mdxType:"CreateAUser"}),(0,r.kt)("h2",{id:"move-lightning-system-and-source-code-directory-to-users-home"},"Move lightning system and source code directory to user's home"),(0,r.kt)("p",null,"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."),(0,r.kt)("p",null,"Run the command ",(0,r.kt)("inlineCode",{parentName:"p"},"pwd"),":"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"pwd\n")),(0,r.kt)("p",null,"The output would look like:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"/home/\n")),(0,r.kt)("p",null,"Given the username ",(0,r.kt)("strong",{parentName:"p"},"lgtn"),":"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"/home/lgtn\n")),(0,r.kt)("p",null,"You'll then move two directories:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"/root/.lightning")),(0,r.kt)("li",{parentName:"ul"},"The source code under the parent ",(0,r.kt)("inlineCode",{parentName:"li"},"/root/fleek-network"))),(0,r.kt)("h3",{id:"1-move-the-rootlightning-directory-from-one-user-to-the-other"},"1) Move the ",(0,r.kt)("inlineCode",{parentName:"h3"},"/root/.lightning")," directory from one user to the other"),(0,r.kt)("p",null,"For our demo, we have assumed ",(0,r.kt)("strong",{parentName:"p"},"root")," user to ",(0,r.kt)("strong",{parentName:"p"},"sudoer")," user named ",(0,r.kt)("strong",{parentName:"p"},"lgtn"),", thus that'll look like this:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"sudo mv /root/.lightning /home/lgtn/\n")),(0,r.kt)("h3",{id:"2-move-the-rootfleek-network-directory-from-one-user-to-the-other"},"2) Move the ",(0,r.kt)("inlineCode",{parentName:"h3"},"/root/fleek-network")," directory from one user to the other"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"sudo mv /root/fleek-network /home/lgtn/\n")),(0,r.kt)("h3",{id:"3-confirm-move-by-finding-both-directories"},"3) Confirm move by finding both directories"),(0,r.kt)("p",null,"In the user $HOME directory, you should be able to list the content of the directory and find the ",(0,r.kt)("inlineCode",{parentName:"p"},".lightning")," and ",(0,r.kt)("inlineCode",{parentName:"p"},"fleek-network")," directory."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"ls -la\n")),(0,r.kt)("p",null,"The output should be similar to the following."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"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")),(0,r.kt)("h2",{id:"change-ownership-of-files"},"Change ownership of files"),(0,r.kt)("p",null,"Once the directories and files are moved, they should have have the wrong ownership, which should be set to ",(0,r.kt)("strong",{parentName:"p"},"root:root"),". We'll now have to change the ownership of the directories and files recursively."),(0,r.kt)("p",null,"Change the ownership of ",(0,r.kt)("inlineCode",{parentName:"p"},"/home/lgtn/.lightning")," to the user ",(0,r.kt)("strong",{parentName:"p"},"lgtn")," as follows:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"sudo chown -R lgtn:lgtn .lightning\n")),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"Make sure that you use the ",(0,r.kt)("inlineCode",{parentName:"p"},"-R")," flag to have the ownership changes applied to the parent, the child directories and all the files.")),(0,r.kt)("p",null,"Change the ownership of ",(0,r.kt)("inlineCode",{parentName:"p"},"/home/lgtn/fleek-network")," to the user ",(0,r.kt)("strong",{parentName:"p"},"lgtn")," as follows:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"sudo chown -R lgtn:lgtn fleek-network\n")),(0,r.kt)("p",null,"Once completed, if you list the content of the directory the ownership should have changed from ",(0,r.kt)("inlineCode",{parentName:"p"},"root:root")," to ",(0,r.kt)("inlineCode",{parentName:"p"},"lgtn:lgtn"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"ls -la\n")),(0,r.kt)("p",null,"The output should be similar to the following."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"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")),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"Remember that we are using ",(0,r.kt)("strong",{parentName:"p"},"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,r.kt)("pre",{parentName:"admonition"},(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"whoami\n")),(0,r.kt)("p",{parentName:"admonition"},"For our demo, we'll assume that you understand that ",(0,r.kt)("strong",{parentName:"p"},"lgtn")," is the user we opted in for our demo.")),(0,r.kt)("h2",{id:"the-lgtn-symbolic-link-symlink"},"The lgtn symbolic link (symlink)"),(0,r.kt)("p",null,"We have the symbolic link that links the binary built from the source code, to the alias ",(0,r.kt)("strong",{parentName:"p"},"lgtn")," that's set under the ",(0,r.kt)("inlineCode",{parentName:"p"},"/usr/local/bin/lgtn")," pathname."),(0,r.kt)("p",null,"For example, you can find where that is linked to by running:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"ls -la $(which lgtn)\n")),(0,r.kt)("p",null,"On the output below, we can see that the ",(0,r.kt)("inlineCode",{parentName:"p"},"/usr/local/bin/lgtn")," points to ",(0,r.kt)("inlineCode",{parentName:"p"},"/root/fleek-network/lightning/target/release/lightning-node"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"lrwxrwxrwx 1 root root 64 Sep 11 15:48 /usr/local/bin/lgtn -> /root/fleek-network/lightning/target/release/lightning-node\n")),(0,r.kt)("p",null,"The target base path is ",(0,r.kt)("inlineCode",{parentName:"p"},"/root")," and we know that we've moved the source code directory to the user home ",(0,r.kt)("inlineCode",{parentName:"p"},"/home/lgtn"),". For this reason, we need to create a new symlink with the updated location of the binary file."),(0,r.kt)("p",null,"Unlink the symlink:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"sudo unlink /usr/local/bin/lgtn\n")),(0,r.kt)("p",null,"Create the symlink:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},'sudo ln -s "/home/lgtn/fleek-network/lightning/target/release/lightning-node" /usr/local/bin/lgtn\n')),(0,r.kt)("p",null,"If successful, you should be able to execute the command:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"lgtn help\n")),(0,r.kt)("p",null,"The output should look similar to:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"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")),(0,r.kt)("h2",{id:"update-the-systemd-service-unit"},"Update the Systemd service unit"),(0,r.kt)("p",null,"Open the file, its settings should be similar to the following:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"[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")),(0,r.kt)("p",null,"Since we opted in for the username ",(0,r.kt)("strong",{parentName:"p"},"lgtn")," for our demo, replaced ",(0,r.kt)("inlineCode",{parentName:"p"},"")," with ",(0,r.kt)("inlineCode",{parentName:"p"},"lgtn")," and it would look like:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"[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=TMPDIR=/var/tmp\n\n[Install]\nWantedBy=multi-user.target\n")),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"Notice the ",(0,r.kt)("inlineCode",{parentName:"p"},"ExecStart=")," which includes the flag ",(0,r.kt)("inlineCode",{parentName:"p"},"-c")," where the location of the user files is declared. Learn how to ",(0,r.kt)("a",{parentName:"p",href:"#update-the-configtoml-with-user-preferred-file-locations"},"update the config.toml")," to include the user-preferred file paths, e.g. declare the keystore pathname.")),(0,r.kt)("p",null,"Complete the step by reloading the daemon, to apply the newly created changes. You can do this by executing:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"sudo systemctl daemon-reload\n")),(0,r.kt)("h2",{id:"update-the-configtoml-with-user-preferred-file-locations"},"Update the config.toml with user-preferred file locations"),(0,r.kt)("p",null,"Open the ",(0,r.kt)("inlineCode",{parentName:"p"},"/home/lgtn/.lightning/config.toml")," file in your favorite text editor."),(0,r.kt)("p",null,"Replace every instance of ",(0,r.kt)("inlineCode",{parentName:"p"},"~")," (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,r.kt)("strong",{parentName:"p"},"sudo"),". Learn more about ",(0,r.kt)("a",{parentName:"p",href:"/references/Lightning%20CLI/file-permissions-and-ownership"},"file permissions and ownership")," by reading the reference document."),(0,r.kt)(s.ZP,{mdxType:"FindAndReplaceConfigWithUserPaths"}),(0,r.kt)("h2",{id:"start-the-service"},"Start the service"),(0,r.kt)("p",null,"At this stage, you should have migrated the essential files to the user home."),(0,r.kt)("p",null,"Ideally, you would now manage the service as the ",(0,r.kt)("inlineCode",{parentName:"p"},"user")," (as described in the ",(0,r.kt)("a",{parentName:"p",href:"/references/Systemd/user-service/"},"user service reference"),"). To keep our guide wider to all users, we'll prefix the commands with ",(0,r.kt)("strong",{parentName:"p"},"sudo"),", which elevates the permissions to ",(0,r.kt)("strong",{parentName:"p"},"root"),". But since we have provided the configuration file the ",(0,r.kt)("inlineCode",{parentName:"p"},"-c")," in our ",(0,r.kt)("a",{parentName:"p",href:"#systemd-service"},"systemd service"),", we'll have the user-preferred configuration options ruling. "),(0,r.kt)("p",null,"Start the service by running the command:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"sudo systemctl start lightning.service\n")),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"Find the timeline of events for the Lightning service by checking the log files. Learn about it in the section ",(0,r.kt)("a",{parentName:"p",href:"/docs/node/install#analyzing-log-messages"},"Log Messages"),".")),(0,r.kt)("p",null,"To learn more, visit the section ",(0,r.kt)("a",{parentName:"p",href:"/docs/node/install#use-systemctl-to-manage-systemd-service"},"Use Systemctl to manage the Lightning Service")),(0,r.kt)("h2",{id:"conclusion"},"Conclusion"),(0,r.kt)("p",null,"We started by giving a brief introduction to ownership of the Lightning CLI files."),(0,r.kt)("p",null,"Jumped through topics of Systemd service that helps the user manage the service in the Linux environment, which helps keep keeps track of all the processes and threads that are spawned."),(0,r.kt)("p",null,"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,r.kt)("strong",{parentName:"p"},"root")," user and a ",(0,r.kt)("strong",{parentName:"p"},"sudoer"),"."),(0,r.kt)("p",null,"Discover more about the project by ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/fleek-network/lightning"},"watching/contributing on GitHub"),", following us on ",(0,r.kt)("a",{parentName:"p",href:"https://twitter.com/fleek_net"},"Twitter"),", and joining ",(0,r.kt)("a",{parentName:"p",href:"https://discord.gg/fleekxyz"},"our community Discord")," for any updates."),(0,r.kt)(a.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida",mdxType:"Author"}))}g.isMDXComponent=!0},6733:(e,t,n)=>{n.d(t,{ZP:()=>s});var o=n(7462),r=(n(7294),n(3905));const a={toc:[]},i="wrapper";function s(e){let{components:t,...n}=e;return(0,r.kt)(i,(0,o.Z)({},a,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"We recommend creating a ",(0,r.kt)("inlineCode",{parentName:"p"},"non-root")," user with administrative privileges. It'll allow us to install any system requirements."),(0,r.kt)("p",null,"You can create a new user and add to the ",(0,r.kt)("strong",{parentName:"p"},"sudo")," group by running:"),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"For our example, we'll be using the name ",(0,r.kt)("inlineCode",{parentName:"p"},"lgtn")," but you can pick whichever you'd like. If you already have a ",(0,r.kt)("strong",{parentName:"p"},"sudoer")," account, you can skip this step.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"adduser lgtn\n")),(0,r.kt)("p",null,"After completing the ",(0,r.kt)("inlineCode",{parentName:"p"},"adduser")," steps, execute the ",(0,r.kt)("inlineCode",{parentName:"p"},"usermod")," to add the ",(0,r.kt)("inlineCode",{parentName:"p"},"user")," to the ",(0,r.kt)("strong",{parentName:"p"},"sudo")," group, as follows:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"usermod -aG sudo lgtn\n")),(0,r.kt)("p",null,"Switch to the new ",(0,r.kt)("strong",{parentName:"p"},"user")," by using the command:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"su lgtn\n")),(0,r.kt)("p",null,"Change the directory to the new user's home, as follows:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"cd /home/lgtn\n")))}s.isMDXComponent=!0},3242:(e,t,n)=>{n.d(t,{ZP:()=>s});var o=n(7462),r=(n(7294),n(3905));const a={toc:[]},i="wrapper";function s(e){let{components:t,...n}=e;return(0,r.kt)(i,(0,o.Z)({},a,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"In the ",(0,r.kt)("inlineCode",{parentName:"p"},"/home//.lightning/config.toml")," you'll find some and more of the following:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-toml"},'[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')),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"The configuration properties and values presented above are a shorter version of what you'll find on your ",(0,r.kt)("strong",{parentName:"p"},"configuration.toml"),". We keep it short to make it easier to follow, do not copy and paste.")),(0,r.kt)("p",null,"Find and replace all instances of ~ in the config file ",(0,r.kt)("inlineCode",{parentName:"p"},"/home//.lightning/config.toml"),". "),(0,r.kt)("p",null,"Here's an example of how to do it using ",(0,r.kt)("strong",{parentName:"p"},"sed"),":"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},'sed -i "s|~/.lightning|/home//.lightning|g" "/home//.lightning/config.toml"\n')),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"Replace the ",(0,r.kt)("inlineCode",{parentName:"p"},"")," with your username. For example, if you have followed the recommendation to ",(0,r.kt)("a",{parentName:"p",href:"/docs/node/install#create-a-user"},"create a user")," it would look like ",(0,r.kt)("inlineCode",{parentName:"p"},"/home/lgtn/.lightning/config.toml")," for the username ",(0,r.kt)("strong",{parentName:"p"},"lgtn"),".")),(0,r.kt)("p",null,"For example, if your username is ",(0,r.kt)("inlineCode",{parentName:"p"},"lgtn")," that'd look like this:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},'sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"\n')),(0,r.kt)("p",null,"Once modified, you can run a ",(0,r.kt)("inlineCode",{parentName:"p"},"cat")," to see the content of the files to confirm it has been updated."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"cat /home/lgtn/.lightning/config.toml\n")),(0,r.kt)("p",null,"For our example where we opted in for the username ",(0,r.kt)("inlineCode",{parentName:"p"},"lgtn")," that would look like:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-toml"},'[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')),(0,r.kt)("admonition",{title:"Warning",type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"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.")))}s.isMDXComponent=!0},2915:(e,t,n)=>{n.d(t,{ZP:()=>s});var o=n(7462),r=(n(7294),n(3905));const a={toc:[]},i="wrapper";function s(e){let{components:t,...n}=e;return(0,r.kt)(i,(0,o.Z)({},a,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"You have several ways of doing this:"),(0,r.kt)("ul",{parentName:"admonition"},(0,r.kt)("li",{parentName:"ul"},"Clone via HTTPS"),(0,r.kt)("li",{parentName:"ul"},"Clone via SSH"),(0,r.kt)("li",{parentName:"ul"},"Download via Github CLI"),(0,r.kt)("li",{parentName:"ul"},"Download the ",(0,r.kt)("a",{parentName:"li",href:"https://github.com/fleek-network/lightning/archive/refs/heads/main.zip"},"zip package")," from the repository")),(0,r.kt)("p",{parentName:"admonition"},"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.kt)("a",{parentName:"p",href:"https://docs.github.com/en/authentication/connecting-to-github-with-ssh"},"here"),"."),(0,r.kt)("pre",{parentName:"admonition"},(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"git clone -b testnet-alpha-0 https://github.com/fleek-network/lightning.git \n")),(0,r.kt)("p",{parentName:"admonition"},"Here's an example of what it'd look like when sticking to the recommended path location:"),(0,r.kt)("pre",{parentName:"admonition"},(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"git clone -b testnet-alpha-0 https://github.com/fleek-network/lightning.git ~/fleek-network/lightning\n"))))}s.isMDXComponent=!0},3872:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(7294);const r=e=>{let{image:t,name:n,title:r,url:a}=e;return o.createElement("section",{className:"author_card"},o.createElement("div",null,o.createElement("span",{className:"avatar"},o.createElement("a",{href:a,target:"_blank",alt:n},o.createElement("img",{src:t,alt:n}))),o.createElement("div",null,o.createElement("span",{className:"name"},o.createElement("a",{href:a,target:"_blank",alt:n},n)),o.createElement("span",{className:"title"},r),o.createElement("span",{className:"discord"},"Got questions? Find us on ",o.createElement("a",{href:"https://discord.gg/fleekxyz",target:"_blank"},"Discord!")))))}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[9854],{3905:(e,t,n)=>{n.d(t,{Zo:()=>h,kt:()=>c});var o=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=o.createContext({}),p=function(e){var t=o.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},h=function(e){var t=p(e.components);return o.createElement(l.Provider,{value:t},e.children)},d="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},m=o.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,l=e.parentName,h=s(e,["components","mdxType","originalType","parentName"]),d=p(n),m=r,c=d["".concat(l,".").concat(m)]||d[m]||u[m]||a;return n?o.createElement(c,i(i({ref:t},h),{},{components:n})):o.createElement(c,i({ref:t},h))}));function c(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,i=new Array(a);i[0]=m;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[d]="string"==typeof e?e:r,i[1]=s;for(var p=2;p{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>p,default:()=>g,frontMatter:()=>l,metadata:()=>h,toc:()=>u});var o=n(7462),r=(n(7294),n(3905)),a=n(3872),i=(n(2915),n(6733)),s=n(3242);const l={template:"post",draft:!1,hide_title:!0,title:"Transfering setup ownership",slug:"transfering-setup-ownership",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"]},p=void 0,h={unversionedId:"Node Operators/transfering-setup-ownership",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,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:1694622179,formattedLastUpdatedAt:"Sep 13, 2023",frontMatter:{template:"post",draft:!1,hide_title:!0,title:"Transfering setup ownership",slug:"transfering-setup-ownership",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:"Getting Started",permalink:"/guides/Node Operators/getting-started"}},d={},u=[{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}],m={toc:u},c="wrapper";function g(e){let{components:t,...n}=e;return(0,r.kt)(c,(0,o.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h2",{id:"tldr"},"TL;DR"),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"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,r.kt)("a",{parentName:"p",href:"https://github.com/fleek-network/get.fleek.network"},"get.fleek.network")," tool."),(0,r.kt)("p",{parentName:"admonition"},"To use the automated script execute the following command in your server terminal and follow the instructions:"),(0,r.kt)("pre",{parentName:"admonition"},(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"curl -sS https://get.fleek.network/transfer_system_user_setup_ownership | bash\n")),(0,r.kt)("p",{parentName:"admonition"},"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,r.kt)("a",{parentName:"p",href:"https://discord.gg/fleekxyz"},"message us through our Discord"),".")),(0,r.kt)("h2",{id:"introduction"},"Introduction"),(0,r.kt)("p",null,"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."),(0,r.kt)("p",null,"Let's discuss the topic and open up a few ideas to help us improve the security of our server."),(0,r.kt)("h2",{id:"pre-requisites"},"Pre-requisites"),(0,r.kt)("p",null,"To follow the guide, you will need the following:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Familiarity with the command-line interface"),(0,r.kt)("li",{parentName:"ul"},"Have installed and set up the Lightning CLI and service")),(0,r.kt)("h2",{id:"ownership-of-lightning-cli-files"},"Ownership of Lightning CLI files"),(0,r.kt)("p",null,"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."),(0,r.kt)("p",null,"Our ",(0,r.kt)("a",{parentName:"p",href:"/docs/node/install"},"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,r.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/Sudo"},"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."),(0,r.kt)("p",null,"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."),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"A reference document about ",(0,r.kt)("a",{parentName:"p",href:"/references/Lightning%20CLI/file-permissions-and-ownership"},"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.")),(0,r.kt)("h2",{id:"systemd-service"},"Systemd Service"),(0,r.kt)("p",null,"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."),(0,r.kt)("p",null,"The recommended installation process features a ",(0,r.kt)("a",{parentName:"p",href:"https://www.freedesktop.org/software/systemd/man/systemd.service.html"},"systemd.service")," which is a resource that the system knows how to operate and manage by an administrator user."),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"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.")),(0,r.kt)("p",null,"If you have followed the installation recommendations, find the systemd service unit in the location ",(0,r.kt)("inlineCode",{parentName:"p"},"/etc/systemd/system/lightning.service")," (we are using Ubuntu Linux as an example to keep it short)."),(0,r.kt)("p",null,"Make sure that you have set up a ",(0,r.kt)("a",{parentName:"p",href:"/docs/node/install#systemd-service-setup"},"Systemd unit service"),", as recommended during the installation as this guide assumes you have one setup."),(0,r.kt)("h2",{id:"stop-the-service"},"Stop the service"),(0,r.kt)("p",null,"Before we proceed with any changes required for the migration, you'll have to stop the ",(0,r.kt)("inlineCode",{parentName:"p"},"lightning.service"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"systemctl stop lightning\n")),(0,r.kt)("admonition",{type:"note"},(0,r.kt)("p",{parentName:"admonition"},"For this guide, we are assuming that you are migrating ownership from ",(0,r.kt)("strong",{parentName:"p"},"root")," to a ",(0,r.kt)("strong",{parentName:"p"},"sudoer")," user. If not, you might be required to elevate privileges as ",(0,r.kt)("strong",{parentName:"p"},"sudo**")," where required. For example, ",(0,r.kt)("inlineCode",{parentName:"p"},"sudo systemctl stop lightning"),".")),(0,r.kt)("h2",{id:"clear-the-lightning-data"},"Clear the .lightning data"),(0,r.kt)("p",null,"Run the following command to clear the ",(0,r.kt)("inlineCode",{parentName:"p"},"/root/.lightning/data"),", as it can be quite large and we don't need to move it."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"sudo rm -rf /root/.lightning/data\n")),(0,r.kt)("h2",{id:"create-a-user"},"Create a user"),(0,r.kt)(i.ZP,{mdxType:"CreateAUser"}),(0,r.kt)("h2",{id:"move-lightning-system-and-source-code-directory-to-users-home"},"Move lightning system and source code directory to user's home"),(0,r.kt)("p",null,"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."),(0,r.kt)("p",null,"Run the command ",(0,r.kt)("inlineCode",{parentName:"p"},"pwd"),":"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"pwd\n")),(0,r.kt)("p",null,"The output would look like:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"/home/\n")),(0,r.kt)("p",null,"Given the username ",(0,r.kt)("strong",{parentName:"p"},"lgtn"),":"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"/home/lgtn\n")),(0,r.kt)("p",null,"You'll then move two directories:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The ",(0,r.kt)("inlineCode",{parentName:"li"},"/root/.lightning")),(0,r.kt)("li",{parentName:"ul"},"The source code under the parent ",(0,r.kt)("inlineCode",{parentName:"li"},"/root/fleek-network"))),(0,r.kt)("h3",{id:"1-move-the-rootlightning-directory-from-one-user-to-the-other"},"1) Move the ",(0,r.kt)("inlineCode",{parentName:"h3"},"/root/.lightning")," directory from one user to the other"),(0,r.kt)("p",null,"For our demo, we have assumed ",(0,r.kt)("strong",{parentName:"p"},"root")," user to ",(0,r.kt)("strong",{parentName:"p"},"sudoer")," user named ",(0,r.kt)("strong",{parentName:"p"},"lgtn"),", thus that'll look like this:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"sudo mv /root/.lightning /home/lgtn/\n")),(0,r.kt)("h3",{id:"2-move-the-rootfleek-network-directory-from-one-user-to-the-other"},"2) Move the ",(0,r.kt)("inlineCode",{parentName:"h3"},"/root/fleek-network")," directory from one user to the other"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"sudo mv /root/fleek-network /home/lgtn/\n")),(0,r.kt)("h3",{id:"3-confirm-move-by-finding-both-directories"},"3) Confirm move by finding both directories"),(0,r.kt)("p",null,"In the user $HOME directory, you should be able to list the content of the directory and find the ",(0,r.kt)("inlineCode",{parentName:"p"},".lightning")," and ",(0,r.kt)("inlineCode",{parentName:"p"},"fleek-network")," directory."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"ls -la\n")),(0,r.kt)("p",null,"The output should be similar to the following."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"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")),(0,r.kt)("h2",{id:"change-ownership-of-files"},"Change ownership of files"),(0,r.kt)("p",null,"Once the directories and files are moved, they should have have the wrong ownership, which should be set to ",(0,r.kt)("strong",{parentName:"p"},"root:root"),". We'll now have to change the ownership of the directories and files recursively."),(0,r.kt)("p",null,"Change the ownership of ",(0,r.kt)("inlineCode",{parentName:"p"},"/home/lgtn/.lightning")," to the user ",(0,r.kt)("strong",{parentName:"p"},"lgtn")," as follows:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"sudo chown -R lgtn:lgtn .lightning\n")),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"Make sure that you use the ",(0,r.kt)("inlineCode",{parentName:"p"},"-R")," flag to have the ownership changes applied to the parent, the child directories and all the files.")),(0,r.kt)("p",null,"Change the ownership of ",(0,r.kt)("inlineCode",{parentName:"p"},"/home/lgtn/fleek-network")," to the user ",(0,r.kt)("strong",{parentName:"p"},"lgtn")," as follows:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"sudo chown -R lgtn:lgtn fleek-network\n")),(0,r.kt)("p",null,"Once completed, if you list the content of the directory the ownership should have changed from ",(0,r.kt)("inlineCode",{parentName:"p"},"root:root")," to ",(0,r.kt)("inlineCode",{parentName:"p"},"lgtn:lgtn"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"ls -la\n")),(0,r.kt)("p",null,"The output should be similar to the following."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"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")),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"Remember that we are using ",(0,r.kt)("strong",{parentName:"p"},"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,r.kt)("pre",{parentName:"admonition"},(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"whoami\n")),(0,r.kt)("p",{parentName:"admonition"},"For our demo, we'll assume that you understand that ",(0,r.kt)("strong",{parentName:"p"},"lgtn")," is the user we opted in for our demo.")),(0,r.kt)("h2",{id:"the-lgtn-symbolic-link-symlink"},"The lgtn symbolic link (symlink)"),(0,r.kt)("p",null,"We have the symbolic link that links the binary built from the source code, to the alias ",(0,r.kt)("strong",{parentName:"p"},"lgtn")," that's set under the ",(0,r.kt)("inlineCode",{parentName:"p"},"/usr/local/bin/lgtn")," pathname."),(0,r.kt)("p",null,"For example, you can find where that is linked to by running:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"ls -la $(which lgtn)\n")),(0,r.kt)("p",null,"On the output below, we can see that the ",(0,r.kt)("inlineCode",{parentName:"p"},"/usr/local/bin/lgtn")," points to ",(0,r.kt)("inlineCode",{parentName:"p"},"/root/fleek-network/lightning/target/release/lightning-node"),"."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"lrwxrwxrwx 1 root root 64 Sep 11 15:48 /usr/local/bin/lgtn -> /root/fleek-network/lightning/target/release/lightning-node\n")),(0,r.kt)("p",null,"The target base path is ",(0,r.kt)("inlineCode",{parentName:"p"},"/root")," and we know that we've moved the source code directory to the user home ",(0,r.kt)("inlineCode",{parentName:"p"},"/home/lgtn"),". For this reason, we need to create a new symlink with the updated location of the binary file."),(0,r.kt)("p",null,"Unlink the symlink:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"sudo unlink /usr/local/bin/lgtn\n")),(0,r.kt)("p",null,"Create the symlink:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},'sudo ln -s "/home/lgtn/fleek-network/lightning/target/release/lightning-node" /usr/local/bin/lgtn\n')),(0,r.kt)("p",null,"If successful, you should be able to execute the command:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"lgtn help\n")),(0,r.kt)("p",null,"The output should look similar to:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"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")),(0,r.kt)("h2",{id:"update-the-systemd-service-unit"},"Update the Systemd service unit"),(0,r.kt)("p",null,"Open the file, its settings should be similar to the following:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"[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")),(0,r.kt)("p",null,"Since we opted in for the username ",(0,r.kt)("strong",{parentName:"p"},"lgtn")," for our demo, replaced ",(0,r.kt)("inlineCode",{parentName:"p"},"")," with ",(0,r.kt)("inlineCode",{parentName:"p"},"lgtn")," and it would look like:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"[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=TMPDIR=/var/tmp\n\n[Install]\nWantedBy=multi-user.target\n")),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"Notice the ",(0,r.kt)("inlineCode",{parentName:"p"},"ExecStart=")," which includes the flag ",(0,r.kt)("inlineCode",{parentName:"p"},"-c")," where the location of the user files is declared. Learn how to ",(0,r.kt)("a",{parentName:"p",href:"#update-the-configtoml-with-user-preferred-file-locations"},"update the config.toml")," to include the user-preferred file paths, e.g. declare the keystore pathname.")),(0,r.kt)("p",null,"Complete the step by reloading the daemon, to apply the newly created changes. You can do this by executing:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"sudo systemctl daemon-reload\n")),(0,r.kt)("h2",{id:"update-the-configtoml-with-user-preferred-file-locations"},"Update the config.toml with user-preferred file locations"),(0,r.kt)("p",null,"Open the ",(0,r.kt)("inlineCode",{parentName:"p"},"/home/lgtn/.lightning/config.toml")," file in your favorite text editor."),(0,r.kt)("p",null,"Replace every instance of ",(0,r.kt)("inlineCode",{parentName:"p"},"~")," (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,r.kt)("strong",{parentName:"p"},"sudo"),". Learn more about ",(0,r.kt)("a",{parentName:"p",href:"/references/Lightning%20CLI/file-permissions-and-ownership"},"file permissions and ownership")," by reading the reference document."),(0,r.kt)(s.ZP,{mdxType:"FindAndReplaceConfigWithUserPaths"}),(0,r.kt)("h2",{id:"start-the-service"},"Start the service"),(0,r.kt)("p",null,"At this stage, you should have migrated the essential files to the user home."),(0,r.kt)("p",null,"Ideally, you would now manage the service as the ",(0,r.kt)("inlineCode",{parentName:"p"},"user")," (as described in the ",(0,r.kt)("a",{parentName:"p",href:"/references/Systemd/user-service/"},"user service reference"),"). To keep our guide wider to all users, we'll prefix the commands with ",(0,r.kt)("strong",{parentName:"p"},"sudo"),", which elevates the permissions to ",(0,r.kt)("strong",{parentName:"p"},"root"),". But since we have provided the configuration file the ",(0,r.kt)("inlineCode",{parentName:"p"},"-c")," in our ",(0,r.kt)("a",{parentName:"p",href:"#systemd-service"},"systemd service"),", we'll have the user-preferred configuration options ruling. "),(0,r.kt)("p",null,"Start the service by running the command:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"sudo systemctl start lightning.service\n")),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"Find the timeline of events for the Lightning service by checking the log files. Learn about it in the section ",(0,r.kt)("a",{parentName:"p",href:"/docs/node/install#analyzing-log-messages"},"Log Messages"),".")),(0,r.kt)("p",null,"To learn more, visit the section ",(0,r.kt)("a",{parentName:"p",href:"/docs/node/install#use-systemctl-to-manage-systemd-service"},"Use Systemctl to manage the Lightning Service")),(0,r.kt)("h2",{id:"conclusion"},"Conclusion"),(0,r.kt)("p",null,"We started by giving a brief introduction to ownership of the Lightning CLI files."),(0,r.kt)("p",null,"Jumped through topics of Systemd service that helps the user manage the service in the Linux environment, which helps keep keeps track of all the processes and threads that are spawned."),(0,r.kt)("p",null,"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,r.kt)("strong",{parentName:"p"},"root")," user and a ",(0,r.kt)("strong",{parentName:"p"},"sudoer"),"."),(0,r.kt)("p",null,"Discover more about the project by ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/fleek-network/lightning"},"watching/contributing on GitHub"),", following us on ",(0,r.kt)("a",{parentName:"p",href:"https://twitter.com/fleek_net"},"Twitter"),", and joining ",(0,r.kt)("a",{parentName:"p",href:"https://discord.gg/fleekxyz"},"our community Discord")," for any updates."),(0,r.kt)(a.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida",mdxType:"Author"}))}g.isMDXComponent=!0},6733:(e,t,n)=>{n.d(t,{ZP:()=>s});var o=n(7462),r=(n(7294),n(3905));const a={toc:[]},i="wrapper";function s(e){let{components:t,...n}=e;return(0,r.kt)(i,(0,o.Z)({},a,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"We recommend creating a ",(0,r.kt)("inlineCode",{parentName:"p"},"non-root")," user with administrative privileges. It'll allow us to install any system requirements."),(0,r.kt)("p",null,"You can create a new user and add to the ",(0,r.kt)("strong",{parentName:"p"},"sudo")," group by running:"),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"For our example, we'll be using the name ",(0,r.kt)("inlineCode",{parentName:"p"},"lgtn")," but you can pick whichever you'd like. If you already have a ",(0,r.kt)("strong",{parentName:"p"},"sudoer")," account, you can skip this step.")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"adduser lgtn\n")),(0,r.kt)("p",null,"After completing the ",(0,r.kt)("inlineCode",{parentName:"p"},"adduser")," steps, execute the ",(0,r.kt)("inlineCode",{parentName:"p"},"usermod")," to add the ",(0,r.kt)("inlineCode",{parentName:"p"},"user")," to the ",(0,r.kt)("strong",{parentName:"p"},"sudo")," group, as follows:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"usermod -aG sudo lgtn\n")),(0,r.kt)("p",null,"Switch to the new ",(0,r.kt)("strong",{parentName:"p"},"user")," by using the command:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"su lgtn\n")),(0,r.kt)("p",null,"Change the directory to the new user's home, as follows:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"cd /home/lgtn\n")))}s.isMDXComponent=!0},3242:(e,t,n)=>{n.d(t,{ZP:()=>s});var o=n(7462),r=(n(7294),n(3905));const a={toc:[]},i="wrapper";function s(e){let{components:t,...n}=e;return(0,r.kt)(i,(0,o.Z)({},a,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("p",null,"In the ",(0,r.kt)("inlineCode",{parentName:"p"},"/home//.lightning/config.toml")," you'll find some and more of the following:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-toml"},'[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')),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"The configuration properties and values presented above are a shorter version of what you'll find on your ",(0,r.kt)("strong",{parentName:"p"},"configuration.toml"),". We keep it short to make it easier to follow, do not copy and paste.")),(0,r.kt)("p",null,"Find and replace all instances of ~ in the config file ",(0,r.kt)("inlineCode",{parentName:"p"},"/home//.lightning/config.toml"),". "),(0,r.kt)("p",null,"Here's an example of how to do it using ",(0,r.kt)("strong",{parentName:"p"},"sed"),":"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},'sed -i "s|~/.lightning|/home//.lightning|g" "/home//.lightning/config.toml"\n')),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"Replace the ",(0,r.kt)("inlineCode",{parentName:"p"},"")," with your username. For example, if you have followed the recommendation to ",(0,r.kt)("a",{parentName:"p",href:"/docs/node/install#create-a-user"},"create a user")," it would look like ",(0,r.kt)("inlineCode",{parentName:"p"},"/home/lgtn/.lightning/config.toml")," for the username ",(0,r.kt)("strong",{parentName:"p"},"lgtn"),".")),(0,r.kt)("p",null,"For example, if your username is ",(0,r.kt)("inlineCode",{parentName:"p"},"lgtn")," that'd look like this:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},'sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"\n')),(0,r.kt)("p",null,"Once modified, you can run a ",(0,r.kt)("inlineCode",{parentName:"p"},"cat")," to see the content of the files to confirm it has been updated."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"cat /home/lgtn/.lightning/config.toml\n")),(0,r.kt)("p",null,"For our example where we opted in for the username ",(0,r.kt)("inlineCode",{parentName:"p"},"lgtn")," that would look like:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-toml"},'[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')),(0,r.kt)("admonition",{title:"Warning",type:"caution"},(0,r.kt)("p",{parentName:"admonition"},"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.")))}s.isMDXComponent=!0},2915:(e,t,n)=>{n.d(t,{ZP:()=>s});var o=n(7462),r=(n(7294),n(3905));const a={toc:[]},i="wrapper";function s(e){let{components:t,...n}=e;return(0,r.kt)(i,(0,o.Z)({},a,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("admonition",{type:"tip"},(0,r.kt)("p",{parentName:"admonition"},"You have several ways of doing this:"),(0,r.kt)("ul",{parentName:"admonition"},(0,r.kt)("li",{parentName:"ul"},"Clone via HTTPS"),(0,r.kt)("li",{parentName:"ul"},"Clone via SSH"),(0,r.kt)("li",{parentName:"ul"},"Download via Github CLI"),(0,r.kt)("li",{parentName:"ul"},"Download the ",(0,r.kt)("a",{parentName:"li",href:"https://github.com/fleek-network/lightning/archive/refs/heads/main.zip"},"zip package")," from the repository")),(0,r.kt)("p",{parentName:"admonition"},"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.kt)("a",{parentName:"p",href:"https://docs.github.com/en/authentication/connecting-to-github-with-ssh"},"here"),"."),(0,r.kt)("pre",{parentName:"admonition"},(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"git clone -b testnet-alpha-0 https://github.com/fleek-network/lightning.git \n")),(0,r.kt)("p",{parentName:"admonition"},"Here's an example of what it'd look like when sticking to the recommended path location:"),(0,r.kt)("pre",{parentName:"admonition"},(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"git clone -b testnet-alpha-0 https://github.com/fleek-network/lightning.git ~/fleek-network/lightning\n"))))}s.isMDXComponent=!0},3872:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(7294);const r=e=>{let{image:t,name:n,title:r,url:a}=e;return o.createElement("section",{className:"author_card"},o.createElement("div",null,o.createElement("span",{className:"avatar"},o.createElement("a",{href:a,target:"_blank",alt:n},o.createElement("img",{src:t,alt:n}))),o.createElement("div",null,o.createElement("span",{className:"name"},o.createElement("a",{href:a,target:"_blank",alt:n},n)),o.createElement("span",{className:"title"},r),o.createElement("span",{className:"discord"},"Got questions? Find us on ",o.createElement("a",{href:"https://discord.gg/fleekxyz",target:"_blank"},"Discord!")))))}}}]); \ No newline at end of file diff --git a/assets/js/2730e145.881a35b4.js b/assets/js/2730e145.1e14e9d9.js similarity index 99% rename from assets/js/2730e145.881a35b4.js rename to assets/js/2730e145.1e14e9d9.js index dbe20774d..886108c0f 100644 --- a/assets/js/2730e145.881a35b4.js +++ b/assets/js/2730e145.1e14e9d9.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[7147],{3905:(e,n,t)=>{t.d(n,{Zo:()=>p,kt:()=>h});var r=t(7294);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function o(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var l=r.createContext({}),d=function(e){var n=r.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},p=function(e){var n=d(e.components);return r.createElement(l.Provider,{value:n},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},u=r.forwardRef((function(e,n){var t=e.components,i=e.mdxType,a=e.originalType,l=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),c=d(t),u=i,h=c["".concat(l,".").concat(u)]||c[u]||m[u]||a;return t?r.createElement(h,o(o({ref:n},p),{},{components:t})):r.createElement(h,o({ref:n},p))}));function h(e,n){var t=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var a=t.length,o=new Array(a);o[0]=u;var s={};for(var l in n)hasOwnProperty.call(n,l)&&(s[l]=n[l]);s.originalType=e,s[c]="string"==typeof e?e:i,o[1]=s;for(var d=2;d{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>s,default:()=>u,frontMatter:()=>o,metadata:()=>l,toc:()=>p});var r=t(7462),i=(t(7294),t(3905)),a=t(3872);const o={title:"Permission denied (os error 13)",slug:"permission-denied-os-error-13",hide_title:!0,tags:["permissions"]},s=void 0,l={unversionedId:"Lightning CLI/permission-denied-os-error-13",id:"Lightning CLI/permission-denied-os-error-13",title:"Permission denied (os error 13)",description:"\x3c!--",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,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:1694621981,formattedLastUpdatedAt:"Sep 13, 2023",frontMatter:{title:"Permission denied (os error 13)",slug:"permission-denied-os-error-13",hide_title:!0,tags:["permissions"]},sidebar:"defaultSidebar",previous:{title:"Keys not found",permalink:"/references/Lightning CLI/keys-not-found"},next:{title:"Uninstall Lightning CLI",permalink:"/references/Lightning CLI/uninstall-lightning-cli"}},d={},p=[{value:"Ownership and file permissions",id:"ownership-and-file-permissions",level:2},{value:"Override the TMPDIR",id:"override-the-tmpdir",level:2}],c={toc:p},m="wrapper";function u(e){let{components:n,...t}=e;return(0,i.kt)(m,(0,r.Z)({},c,t,{components:n,mdxType:"MDXLayout"}),(0,i.kt)("h2",{id:"ownership-and-file-permissions"},"Ownership and file permissions"),(0,i.kt)("p",null,"When running the Lightning CLI, the user who's in control can delegate to ",(0,i.kt)("strong",{parentName:"p"},"root")," via ",(0,i.kt)("strong",{parentName:"p"},"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,i.kt)("a",{parentName:"p",href:"/references/Lightning%20CLI/keys-not-found"},"Keys not found"),", which illustrates a situation where a user gets an error message about the wrong location of a system path (keystore)."),(0,i.kt)("p",null,"Some of the reasons why the ",(0,i.kt)("inlineCode",{parentName:"p"},"Permission denied (os error 13)")," might occur are related to:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"The Fleek Network Lightning CLI process trying to write to a ",(0,i.kt)("inlineCode",{parentName:"li"},".lightning")," stored in a non permited location"),(0,i.kt)("li",{parentName:"ul"},"The Fleek Network Lightning CLI process trying to write to ",(0,i.kt)("inlineCode",{parentName:"li"},"/tmp"))),(0,i.kt)("p",null,"The most common issue can be fixed by reading the section ",(0,i.kt)("a",{parentName:"p",href:"#override-the-tmpdir"},"Override the TMPDIR"),"."),(0,i.kt)("h2",{id:"override-the-tmpdir"},"Override the TMPDIR"),(0,i.kt)("p",null,"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."),(0,i.kt)("p",null,"a) A permission denied error message"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-sh"},"Permission denied (os error 13)\n")),(0,i.kt)("p",null,"b) Rust panic error message which includes a permission denied"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-sh"},"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")),(0,i.kt)("p",null,"c) A trace showing the path where this has failed"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-sh"},'[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')),(0,i.kt)("admonition",{type:"tip"},(0,i.kt)("p",{parentName:"admonition"},"The ",(0,i.kt)("inlineCode",{parentName:"p"},"/tmp")," directory should have wide permissions for all applications, but to mitigate any permission issues the user can override the system environment ",(0,i.kt)("inlineCode",{parentName:"p"},"TMPDIR"),". For example, the ",(0,i.kt)("inlineCode",{parentName:"p"},"installer")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"update")," scripts override ",(0,i.kt)("inlineCode",{parentName:"p"},"TMPDIR")," environment variable to ",(0,i.kt)("inlineCode",{parentName:"p"},"/var/tmp")," setting it in the service unit ",(0,i.kt)("inlineCode",{parentName:"p"},"Environment="),".")),(0,i.kt)("p",null,"The Lightning CLI process is aware of the environment variable TMPDIR, which the operators can override as discussed in the reference for ",(0,i.kt)("a",{parentName:"p",href:"/references/Lightning%20CLI/update-cli-from-source-code/#update-the-systemd-service-unit"},"Update the System service unit"),"."),(0,i.kt)("p",null,"In short, it requires you to include an ",(0,i.kt)("inlineCode",{parentName:"p"},"Environment=")," value of ",(0,i.kt)("inlineCode",{parentName:"p"},"TMPDIR=/var/tmp")," as follows:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-sh"},"[Service]\n...\nStandardOutput=append:/var/log/lightning/output.log\nStandardError=append:/var/log/lightning/diagnostic.log\nEnvironment=TMPDIR=/var/tmp\n")),(0,i.kt)("admonition",{title:"attention",type:"caution"},(0,i.kt)("p",{parentName:"admonition"},"The ",(0,i.kt)("inlineCode",{parentName:"p"},"/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.")),(0,i.kt)(a.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida",mdxType:"Author"}))}u.isMDXComponent=!0},3872:(e,n,t)=>{t.d(n,{Z:()=>i});var r=t(7294);const i=e=>{let{image:n,name:t,title:i,url:a}=e;return r.createElement("section",{className:"author_card"},r.createElement("div",null,r.createElement("span",{className:"avatar"},r.createElement("a",{href:a,target:"_blank",alt:t},r.createElement("img",{src:n,alt:t}))),r.createElement("div",null,r.createElement("span",{className:"name"},r.createElement("a",{href:a,target:"_blank",alt:t},t)),r.createElement("span",{className:"title"},i),r.createElement("span",{className:"discord"},"Got questions? Find us on ",r.createElement("a",{href:"https://discord.gg/fleekxyz",target:"_blank"},"Discord!")))))}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[7147],{3905:(e,n,t)=>{t.d(n,{Zo:()=>p,kt:()=>h});var r=t(7294);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function o(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var l=r.createContext({}),d=function(e){var n=r.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},p=function(e){var n=d(e.components);return r.createElement(l.Provider,{value:n},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},u=r.forwardRef((function(e,n){var t=e.components,i=e.mdxType,a=e.originalType,l=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),c=d(t),u=i,h=c["".concat(l,".").concat(u)]||c[u]||m[u]||a;return t?r.createElement(h,o(o({ref:n},p),{},{components:t})):r.createElement(h,o({ref:n},p))}));function h(e,n){var t=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var a=t.length,o=new Array(a);o[0]=u;var s={};for(var l in n)hasOwnProperty.call(n,l)&&(s[l]=n[l]);s.originalType=e,s[c]="string"==typeof e?e:i,o[1]=s;for(var d=2;d{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>s,default:()=>u,frontMatter:()=>o,metadata:()=>l,toc:()=>p});var r=t(7462),i=(t(7294),t(3905)),a=t(3872);const o={title:"Permission denied (os error 13)",slug:"permission-denied-os-error-13",hide_title:!0,tags:["permissions"]},s=void 0,l={unversionedId:"Lightning CLI/permission-denied-os-error-13",id:"Lightning CLI/permission-denied-os-error-13",title:"Permission denied (os error 13)",description:"\x3c!--",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,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:1694622179,formattedLastUpdatedAt:"Sep 13, 2023",frontMatter:{title:"Permission denied (os error 13)",slug:"permission-denied-os-error-13",hide_title:!0,tags:["permissions"]},sidebar:"defaultSidebar",previous:{title:"Keys not found",permalink:"/references/Lightning CLI/keys-not-found"},next:{title:"Uninstall Lightning CLI",permalink:"/references/Lightning CLI/uninstall-lightning-cli"}},d={},p=[{value:"Ownership and file permissions",id:"ownership-and-file-permissions",level:2},{value:"Override the TMPDIR",id:"override-the-tmpdir",level:2}],c={toc:p},m="wrapper";function u(e){let{components:n,...t}=e;return(0,i.kt)(m,(0,r.Z)({},c,t,{components:n,mdxType:"MDXLayout"}),(0,i.kt)("h2",{id:"ownership-and-file-permissions"},"Ownership and file permissions"),(0,i.kt)("p",null,"When running the Lightning CLI, the user who's in control can delegate to ",(0,i.kt)("strong",{parentName:"p"},"root")," via ",(0,i.kt)("strong",{parentName:"p"},"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,i.kt)("a",{parentName:"p",href:"/references/Lightning%20CLI/keys-not-found"},"Keys not found"),", which illustrates a situation where a user gets an error message about the wrong location of a system path (keystore)."),(0,i.kt)("p",null,"Some of the reasons why the ",(0,i.kt)("inlineCode",{parentName:"p"},"Permission denied (os error 13)")," might occur are related to:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"The Fleek Network Lightning CLI process trying to write to a ",(0,i.kt)("inlineCode",{parentName:"li"},".lightning")," stored in a non permited location"),(0,i.kt)("li",{parentName:"ul"},"The Fleek Network Lightning CLI process trying to write to ",(0,i.kt)("inlineCode",{parentName:"li"},"/tmp"))),(0,i.kt)("p",null,"The most common issue can be fixed by reading the section ",(0,i.kt)("a",{parentName:"p",href:"#override-the-tmpdir"},"Override the TMPDIR"),"."),(0,i.kt)("h2",{id:"override-the-tmpdir"},"Override the TMPDIR"),(0,i.kt)("p",null,"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."),(0,i.kt)("p",null,"a) A permission denied error message"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-sh"},"Permission denied (os error 13)\n")),(0,i.kt)("p",null,"b) Rust panic error message which includes a permission denied"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-sh"},"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")),(0,i.kt)("p",null,"c) A trace showing the path where this has failed"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-sh"},'[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')),(0,i.kt)("admonition",{type:"tip"},(0,i.kt)("p",{parentName:"admonition"},"The ",(0,i.kt)("inlineCode",{parentName:"p"},"/tmp")," directory should have wide permissions for all applications, but to mitigate any permission issues the user can override the system environment ",(0,i.kt)("inlineCode",{parentName:"p"},"TMPDIR"),". For example, the ",(0,i.kt)("inlineCode",{parentName:"p"},"installer")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"update")," scripts override ",(0,i.kt)("inlineCode",{parentName:"p"},"TMPDIR")," environment variable to ",(0,i.kt)("inlineCode",{parentName:"p"},"/var/tmp")," setting it in the service unit ",(0,i.kt)("inlineCode",{parentName:"p"},"Environment="),".")),(0,i.kt)("p",null,"The Lightning CLI process is aware of the environment variable TMPDIR, which the operators can override as discussed in the reference for ",(0,i.kt)("a",{parentName:"p",href:"/references/Lightning%20CLI/update-cli-from-source-code/#update-the-systemd-service-unit"},"Update the System service unit"),"."),(0,i.kt)("p",null,"In short, it requires you to include an ",(0,i.kt)("inlineCode",{parentName:"p"},"Environment=")," value of ",(0,i.kt)("inlineCode",{parentName:"p"},"TMPDIR=/var/tmp")," as follows:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-sh"},"[Service]\n...\nStandardOutput=append:/var/log/lightning/output.log\nStandardError=append:/var/log/lightning/diagnostic.log\nEnvironment=TMPDIR=/var/tmp\n")),(0,i.kt)("admonition",{title:"attention",type:"caution"},(0,i.kt)("p",{parentName:"admonition"},"The ",(0,i.kt)("inlineCode",{parentName:"p"},"/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.")),(0,i.kt)(a.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida",mdxType:"Author"}))}u.isMDXComponent=!0},3872:(e,n,t)=>{t.d(n,{Z:()=>i});var r=t(7294);const i=e=>{let{image:n,name:t,title:i,url:a}=e;return r.createElement("section",{className:"author_card"},r.createElement("div",null,r.createElement("span",{className:"avatar"},r.createElement("a",{href:a,target:"_blank",alt:t},r.createElement("img",{src:n,alt:t}))),r.createElement("div",null,r.createElement("span",{className:"name"},r.createElement("a",{href:a,target:"_blank",alt:t},t)),r.createElement("span",{className:"title"},i),r.createElement("span",{className:"discord"},"Got questions? Find us on ",r.createElement("a",{href:"https://discord.gg/fleekxyz",target:"_blank"},"Discord!")))))}}}]); \ No newline at end of file diff --git a/assets/js/29b62a39.dc8b93e5.js b/assets/js/29b62a39.6283cecb.js similarity index 98% rename from assets/js/29b62a39.dc8b93e5.js rename to assets/js/29b62a39.6283cecb.js index 57686d0dc..a1319c8ef 100644 --- a/assets/js/29b62a39.dc8b93e5.js +++ b/assets/js/29b62a39.6283cecb.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[1498],{3905:(e,t,r)=>{r.d(t,{Zo:()=>l,kt:()=>m});var n=r(7294);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var c=n.createContext({}),d=function(e){var t=n.useContext(c),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},l=function(e){var t=d(e.components);return n.createElement(c.Provider,{value:t},e.children)},u="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},f=n.forwardRef((function(e,t){var r=e.components,o=e.mdxType,a=e.originalType,c=e.parentName,l=s(e,["components","mdxType","originalType","parentName"]),u=d(r),f=o,m=u["".concat(c,".").concat(f)]||u[f]||p[f]||a;return r?n.createElement(m,i(i({ref:t},l),{},{components:r})):n.createElement(m,i({ref:t},l))}));function m(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=r.length,i=new Array(a);i[0]=f;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s[u]="string"==typeof e?e:o,i[1]=s;for(var d=2;d{r.r(t),r.d(t,{assets:()=>d,contentTitle:()=>s,default:()=>f,frontMatter:()=>i,metadata:()=>c,toc:()=>l});var n=r(7462),o=(r(7294),r(3905));const a=r.p+"assets/images/banner-guides-cd76f6e8aac3594bb5d072a564e0e277.png",i={title:"About guides",hide_title:!0,sidebar_position:1,tags:["Guides","Help","Fleek Network"]},s=void 0,c={unversionedId:"index",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,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:1694621981,formattedLastUpdatedAt:"Sep 13, 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"}},d={},l=[],u={toc:l},p="wrapper";function f(e){let{components:t,...r}=e;return(0,o.kt)(p,(0,n.Z)({},u,r,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("img",{className:"banner",src:a}),(0,o.kt)("p",null,"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."),(0,o.kt)("p",null,"It differs from the ",(0,o.kt)("a",{parentName:"p",href:"/references"},"references")," documentation which serves as a quick direct breakdown of commands and processes without much explanation, as the name implies."),(0,o.kt)("p",null,"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."))}f.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[1498],{3905:(e,t,r)=>{r.d(t,{Zo:()=>l,kt:()=>m});var n=r(7294);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var c=n.createContext({}),d=function(e){var t=n.useContext(c),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},l=function(e){var t=d(e.components);return n.createElement(c.Provider,{value:t},e.children)},u="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},f=n.forwardRef((function(e,t){var r=e.components,o=e.mdxType,a=e.originalType,c=e.parentName,l=s(e,["components","mdxType","originalType","parentName"]),u=d(r),f=o,m=u["".concat(c,".").concat(f)]||u[f]||p[f]||a;return r?n.createElement(m,i(i({ref:t},l),{},{components:r})):n.createElement(m,i({ref:t},l))}));function m(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=r.length,i=new Array(a);i[0]=f;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s[u]="string"==typeof e?e:o,i[1]=s;for(var d=2;d{r.r(t),r.d(t,{assets:()=>d,contentTitle:()=>s,default:()=>f,frontMatter:()=>i,metadata:()=>c,toc:()=>l});var n=r(7462),o=(r(7294),r(3905));const a=r.p+"assets/images/banner-guides-cd76f6e8aac3594bb5d072a564e0e277.png",i={title:"About guides",hide_title:!0,sidebar_position:1,tags:["Guides","Help","Fleek Network"]},s=void 0,c={unversionedId:"index",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,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:1694622179,formattedLastUpdatedAt:"Sep 13, 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"}},d={},l=[],u={toc:l},p="wrapper";function f(e){let{components:t,...r}=e;return(0,o.kt)(p,(0,n.Z)({},u,r,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("img",{className:"banner",src:a}),(0,o.kt)("p",null,"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."),(0,o.kt)("p",null,"It differs from the ",(0,o.kt)("a",{parentName:"p",href:"/references"},"references")," documentation which serves as a quick direct breakdown of commands and processes without much explanation, as the name implies."),(0,o.kt)("p",null,"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."))}f.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/40aeb86f.0e787447.js b/assets/js/40aeb86f.62054c98.js similarity index 99% rename from assets/js/40aeb86f.0e787447.js rename to assets/js/40aeb86f.62054c98.js index b4da78cea..a8bb76f0a 100644 --- a/assets/js/40aeb86f.0e787447.js +++ b/assets/js/40aeb86f.62054c98.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[4402],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>m});var a=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=a.createContext({}),p=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},c=function(e){var t=p(e.components);return a.createElement(s.Provider,{value:t},e.children)},h="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,r=e.originalType,s=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),h=p(n),d=o,m=h["".concat(s,".").concat(d)]||h[d]||u[d]||r;return n?a.createElement(m,l(l({ref:t},c),{},{components:n})):a.createElement(m,l({ref:t},c))}));function m(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=n.length,l=new Array(r);l[0]=d;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[h]="string"==typeof e?e:o,l[1]=i;for(var p=2;p{n.d(t,{ZP:()=>i});var a=n(7462),o=(n(7294),n(3905));const r={toc:[]},l="wrapper";function i(e){let{components:t,...n}=e;return(0,o.kt)(l,(0,a.Z)({},r,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("p",null,"In the ",(0,o.kt)("inlineCode",{parentName:"p"},"/home//.lightning/config.toml")," you'll find some and more of the following:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-toml"},'[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')),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"The configuration properties and values presented above are a shorter version of what you'll find on your ",(0,o.kt)("strong",{parentName:"p"},"configuration.toml"),". We keep it short to make it easier to follow, do not copy and paste.")),(0,o.kt)("p",null,"Find and replace all instances of ~ in the config file ",(0,o.kt)("inlineCode",{parentName:"p"},"/home//.lightning/config.toml"),". "),(0,o.kt)("p",null,"Here's an example of how to do it using ",(0,o.kt)("strong",{parentName:"p"},"sed"),":"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},'sed -i "s|~/.lightning|/home//.lightning|g" "/home//.lightning/config.toml"\n')),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"Replace the ",(0,o.kt)("inlineCode",{parentName:"p"},"")," with your username. For example, if you have followed the recommendation to ",(0,o.kt)("a",{parentName:"p",href:"/docs/node/install#create-a-user"},"create a user")," it would look like ",(0,o.kt)("inlineCode",{parentName:"p"},"/home/lgtn/.lightning/config.toml")," for the username ",(0,o.kt)("strong",{parentName:"p"},"lgtn"),".")),(0,o.kt)("p",null,"For example, if your username is ",(0,o.kt)("inlineCode",{parentName:"p"},"lgtn")," that'd look like this:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},'sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"\n')),(0,o.kt)("p",null,"Once modified, you can run a ",(0,o.kt)("inlineCode",{parentName:"p"},"cat")," to see the content of the files to confirm it has been updated."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"cat /home/lgtn/.lightning/config.toml\n")),(0,o.kt)("p",null,"For our example where we opted in for the username ",(0,o.kt)("inlineCode",{parentName:"p"},"lgtn")," that would look like:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-toml"},'[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')),(0,o.kt)("admonition",{title:"Warning",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"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.")))}i.isMDXComponent=!0},3813:(e,t,n)=>{n.d(t,{ZP:()=>i});var a=n(7462),o=(n(7294),n(3905));const r={toc:[]},l="wrapper";function i(e){let{components:t,...n}=e;return(0,o.kt)(l,(0,a.Z)({},r,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"The flag ",(0,o.kt)("inlineCode",{parentName:"p"},"-c")," in the ",(0,o.kt)("inlineCode",{parentName:"p"},"lightning.service")," ",(0,o.kt)("strong",{parentName:"p"},"ExecStart"),", is to provide the toml configuration file path e.g. defaults to ",(0,o.kt)("inlineCode",{parentName:"p"},"~/.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,o.kt)("strong",{parentName:"p"},"user")," or ",(0,o.kt)("strong",{parentName:"p"},"sudoer"),". For example, a ",(0,o.kt)("strong",{parentName:"p"},"sudoer")," would have the ",(0,o.kt)("strong",{parentName:"p"},"configuration")," set to ",(0,o.kt)("inlineCode",{parentName:"p"},"/root/.lightning/config.toml")," or ",(0,o.kt)("inlineCode",{parentName:"p"},"/home/username/.lightning/config.toml")," depending on using ",(0,o.kt)("strong",{parentName:"p"},"sudo")," which might cause some confusion to some users.")))}i.isMDXComponent=!0},2300:(e,t,n)=>{n.d(t,{ZP:()=>i});var a=n(7462),o=(n(7294),n(3905));const r={toc:[]},l="wrapper";function i(e){let{components:t,...n}=e;return(0,o.kt)(l,(0,a.Z)({},r,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("p",null,"You should be following the ",(0,o.kt)("a",{parentName:"p",href:"/docs/node/install#create-a-user-1"},"create a user")," recommendation. For our example, we have the username ",(0,o.kt)("inlineCode",{parentName:"p"},"lgtn"),"."),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"If you have chosen a different username, replace ",(0,o.kt)("inlineCode",{parentName:"p"},"lgtn")," by the correct username you have selected.")),(0,o.kt)("p",null,"In the ",(0,o.kt)("inlineCode",{parentName:"p"},"config.toml")," you'll find some and more of the following:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-toml"},'[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')),(0,o.kt)("p",null,"Find and replace all instances of ",(0,o.kt)("inlineCode",{parentName:"p"},"~")," in the config file ",(0,o.kt)("inlineCode",{parentName:"p"},"/home/lgtn/.lightning/config.toml"),". Here's an example using ",(0,o.kt)("inlineCode",{parentName:"p"},"sed"),":"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},'sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"\n')),(0,o.kt)("admonition",{type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"The ",(0,o.kt)("inlineCode",{parentName:"p"},"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.")),(0,o.kt)("p",null,"Once changed, all the instances of ",(0,o.kt)("inlineCode",{parentName:"p"},"~/")," should be replaced by your user path e.g. ",(0,o.kt)("inlineCode",{parentName:"p"},"/home/lgtn/"),". For our example, the output would look like the following:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-toml"},'[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')))}i.isMDXComponent=!0},1054:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>c,default:()=>k,frontMatter:()=>p,metadata:()=>h,toc:()=>d});var a=n(7462),o=(n(7294),n(3905)),r=n(3872),l=n(2300),i=n(3813),s=n(3242);const p={title:"Update CLI from source code",slug:"update-cli-from-source-code",hide_title:!0,tags:["references","help","update","upgrade","fix"]},c=void 0,h={unversionedId:"Lightning CLI/update-cli-from-source-code",id:"Lightning CLI/update-cli-from-source-code",title:"Update CLI from source code",description:"\x3c!--",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,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:1694621981,formattedLastUpdatedAt:"Sep 13, 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 CLI",permalink:"/references/Lightning CLI/uninstall-lightning-cli"},next:{title:"Shutting down persistance",permalink:"/references/Systemd/shutting-down-persistance"}},u={},d=[{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 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}],m={toc:d},g="wrapper";function k(e){let{components:t,...n}=e;return(0,o.kt)(g,(0,a.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"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,o.kt)("pre",{parentName:"admonition"},(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"curl -sS https://get.fleek.network/update | bash\n"))),(0,o.kt)("h2",{id:"switch-to-the-installation-user"},"Switch to the installation user"),(0,o.kt)("p",null,"Switch to the username you've used throughout the installation process."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"su \n")),(0,o.kt)("p",null,"For example, if you used the username ",(0,o.kt)("inlineCode",{parentName:"p"},"lgtn")," it'll look like the following command:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"su lgtn\n")),(0,o.kt)("h2",{id:"change-directory-to-the-source-code"},"Change directory to the source code"),(0,o.kt)("p",null,"If you have installed it via the recommended process or instructions, then the default location where the ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/fleek-network/lightning"},"source code")," is stored is ",(0,o.kt)("inlineCode",{parentName:"p"},"~/fleek-network/lightning"),"."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"cd ~/fleek-network/lightning\n")),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"Notice that we use ",(0,o.kt)("inlineCode",{parentName:"p"},"~"),", which refers to ",(0,o.kt)("inlineCode",{parentName:"p"},"$HOME"),". You must use the username used for the installation process. For example, on ",(0,o.kt)("a",{parentName:"p",href:"/docs/node/requirements#server"},"Ubuntu")," if you use the username ",(0,o.kt)("inlineCode",{parentName:"p"},"lgtn"),", the pathname for ",(0,o.kt)("inlineCode",{parentName:"p"},"$HOME")," is ",(0,o.kt)("inlineCode",{parentName:"p"},"/home/lgtn"),".")),(0,o.kt)("h2",{id:"checkout-to-branch"},"Checkout to branch"),(0,o.kt)("p",null,"Make sure that you are checked in to the correct branch. For the current testnet phase that'd be ",(0,o.kt)("inlineCode",{parentName:"p"},"testnet-alpha-0"),". If you use any other branch name, your node will not function correctly. Use the branch name ",(0,o.kt)("inlineCode",{parentName:"p"},"testnet-alpha-0"),"."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"git checkout testnet-alpha-0\n")),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"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,o.kt)("a",{parentName:"p",href:"https://discord.gg/fleekxyz"},"Discord"),".")),(0,o.kt)("h2",{id:"pull-the-latest-changes"},"Pull the latest changes"),(0,o.kt)("p",null,"Before make sure that you stash or clear any changes you may have in the working directory, as otherwise, ",(0,o.kt)("inlineCode",{parentName:"p"},"git")," will let you know about local changes\u2013if you'd like to learn more about it read the ",(0,o.kt)("a",{parentName:"p",href:"https://git-scm.com/docs/git-stash"},"git stash document"),"."),(0,o.kt)("p",null,"A quick way to clean is to ",(0,o.kt)("inlineCode",{parentName:"p"},"stash")," the changes, for example:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"git stash \n")),(0,o.kt)("p",null,"To pull the latest changes use the ",(0,o.kt)("inlineCode",{parentName:"p"},"git pull")," command, as follows:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"git pull origin testnet-alpha-0\n")),(0,o.kt)("p",null,"Alternatively, to have to stash and pull, you can reset the repository to the origin."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"git fetch origin testnet-alpha-0\ngit reset --hard origin/testnet-alpha-0\ngit clean -f\n")),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"We are using the branch named ",(0,o.kt)("inlineCode",{parentName:"p"},"testnet-alpha-0"),", 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,o.kt)("inlineCode",{parentName:"p"},"main"),".")),(0,o.kt)("h2",{id:"build-binary-from-the-source"},"Build binary from the source"),(0,o.kt)("p",null,"To build the binary from the source code, we execute the cargo build command:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"cargo +stable build --release\n")),(0,o.kt)("h2",{id:"update-the-symlink"},"Update the symlink"),(0,o.kt)("p",null,"Start by removing the existing one:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},'sudo rm -f "/usr/local/bin/lgtn"\n')),(0,o.kt)("p",null,"Create a new symlink that links the new build binary to ",(0,o.kt)("inlineCode",{parentName:"p"},"/usr/local/bin/lgtn"),", as follows:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"sudo ln -s ~/fleek-network/lightning/target/release/lightning-node /usr/local/bin/lgtn\n")),(0,o.kt)("h2",{id:"set-user-path-in-configtoml"},"Set user path in config.toml"),(0,o.kt)(l.ZP,{mdxType:"SetUserPathInConfigToml"}),(0,o.kt)("h2",{id:"update-the-systemd-service-unit"},"Update the systemd service unit"),(0,o.kt)("p",null,"Open and edit the ",(0,o.kt)("inlineCode",{parentName:"p"},"/etc/systemd/system/lightning.service")," file."),(0,o.kt)("p",null,"1) Replace ",(0,o.kt)("inlineCode",{parentName:"p"},"")," with the username. For example, in the ",(0,o.kt)("a",{parentName:"p",href:"/docs/node/install#create-a-user"},"documentation")," we use the username ",(0,o.kt)("inlineCode",{parentName:"p"},"lgtn"),"."),(0,o.kt)("p",null,"2) Make sure that the ",(0,o.kt)("inlineCode",{parentName:"p"},"ExecStart")," is set correctly"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"[Unit]\nDescription=Fleek Network Node lightning service\n\n[Service]\nUser=\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=TMPDIR=/var/tmp\n\n[Install]\nWantedBy=multi-user.target\n")),(0,o.kt)(i.ZP,{mdxType:"NoteExecStartFlagCConfigPath"}),(0,o.kt)("p",null,"When complete make sure the file is saved. Followed by a systemctl daemon reload:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"sudo systemctl daemon-reload\n")),(0,o.kt)("h2",{id:"clear-the-data"},"Clear the data"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"rm -rf ~/.lightning/data\n")),(0,o.kt)("p",null,"Depending on how you control the system, this might need ",(0,o.kt)("strong",{parentName:"p"},"sudo"),"."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"sudo rm -rf ~/.lightning/data\n")),(0,o.kt)("h2",{id:"update-the-configtoml-with-user-home-path"},"Update the ",(0,o.kt)("inlineCode",{parentName:"h2"},"config.toml")," with user home path"),(0,o.kt)(s.ZP,{mdxType:"FindAndReplaceConfigWithUserPaths"}),(0,o.kt)("h2",{id:"restart-the-service"},"Restart the service"),(0,o.kt)("p",null,"Once the cargo build process is completed, you have to restart the service. We're assuming you are using non-root user as ",(0,o.kt)("a",{parentName:"p",href:"/docs/node/install#create-a-user"},"recommended"),", you won't use ",(0,o.kt)("strong",{parentName:"p"},"sudo")," to start the service. The command will look as follows:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"sudo systemctl restart lightning\n")),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"If you have installed the Fleek Network lightning manually, the ",(0,o.kt)("a",{parentName:"p",href:"/docs/node/install#systemd-service-setup"},"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.")),(0,o.kt)("h2",{id:"health-checkup"},"Health checkup"),(0,o.kt)("p",null,"Do a quick health check by running:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},'curl -w "\\p" localhost:4069/health\n')),(0,o.kt)("p",null,"If successful, you should get the response ",(0,o.kt)("inlineCode",{parentName:"p"},"OK"),", as follows:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"OK\n")),(0,o.kt)(r.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida",mdxType:"Author"}))}k.isMDXComponent=!0},3872:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(7294);const o=e=>{let{image:t,name:n,title:o,url:r}=e;return a.createElement("section",{className:"author_card"},a.createElement("div",null,a.createElement("span",{className:"avatar"},a.createElement("a",{href:r,target:"_blank",alt:n},a.createElement("img",{src:t,alt:n}))),a.createElement("div",null,a.createElement("span",{className:"name"},a.createElement("a",{href:r,target:"_blank",alt:n},n)),a.createElement("span",{className:"title"},o),a.createElement("span",{className:"discord"},"Got questions? Find us on ",a.createElement("a",{href:"https://discord.gg/fleekxyz",target:"_blank"},"Discord!")))))}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[4402],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>m});var a=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=a.createContext({}),p=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},c=function(e){var t=p(e.components);return a.createElement(s.Provider,{value:t},e.children)},h="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,r=e.originalType,s=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),h=p(n),d=o,m=h["".concat(s,".").concat(d)]||h[d]||u[d]||r;return n?a.createElement(m,l(l({ref:t},c),{},{components:n})):a.createElement(m,l({ref:t},c))}));function m(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=n.length,l=new Array(r);l[0]=d;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[h]="string"==typeof e?e:o,l[1]=i;for(var p=2;p{n.d(t,{ZP:()=>i});var a=n(7462),o=(n(7294),n(3905));const r={toc:[]},l="wrapper";function i(e){let{components:t,...n}=e;return(0,o.kt)(l,(0,a.Z)({},r,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("p",null,"In the ",(0,o.kt)("inlineCode",{parentName:"p"},"/home//.lightning/config.toml")," you'll find some and more of the following:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-toml"},'[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')),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"The configuration properties and values presented above are a shorter version of what you'll find on your ",(0,o.kt)("strong",{parentName:"p"},"configuration.toml"),". We keep it short to make it easier to follow, do not copy and paste.")),(0,o.kt)("p",null,"Find and replace all instances of ~ in the config file ",(0,o.kt)("inlineCode",{parentName:"p"},"/home//.lightning/config.toml"),". "),(0,o.kt)("p",null,"Here's an example of how to do it using ",(0,o.kt)("strong",{parentName:"p"},"sed"),":"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},'sed -i "s|~/.lightning|/home//.lightning|g" "/home//.lightning/config.toml"\n')),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"Replace the ",(0,o.kt)("inlineCode",{parentName:"p"},"")," with your username. For example, if you have followed the recommendation to ",(0,o.kt)("a",{parentName:"p",href:"/docs/node/install#create-a-user"},"create a user")," it would look like ",(0,o.kt)("inlineCode",{parentName:"p"},"/home/lgtn/.lightning/config.toml")," for the username ",(0,o.kt)("strong",{parentName:"p"},"lgtn"),".")),(0,o.kt)("p",null,"For example, if your username is ",(0,o.kt)("inlineCode",{parentName:"p"},"lgtn")," that'd look like this:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},'sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"\n')),(0,o.kt)("p",null,"Once modified, you can run a ",(0,o.kt)("inlineCode",{parentName:"p"},"cat")," to see the content of the files to confirm it has been updated."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"cat /home/lgtn/.lightning/config.toml\n")),(0,o.kt)("p",null,"For our example where we opted in for the username ",(0,o.kt)("inlineCode",{parentName:"p"},"lgtn")," that would look like:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-toml"},'[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')),(0,o.kt)("admonition",{title:"Warning",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"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.")))}i.isMDXComponent=!0},3813:(e,t,n)=>{n.d(t,{ZP:()=>i});var a=n(7462),o=(n(7294),n(3905));const r={toc:[]},l="wrapper";function i(e){let{components:t,...n}=e;return(0,o.kt)(l,(0,a.Z)({},r,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("admonition",{type:"note"},(0,o.kt)("p",{parentName:"admonition"},"The flag ",(0,o.kt)("inlineCode",{parentName:"p"},"-c")," in the ",(0,o.kt)("inlineCode",{parentName:"p"},"lightning.service")," ",(0,o.kt)("strong",{parentName:"p"},"ExecStart"),", is to provide the toml configuration file path e.g. defaults to ",(0,o.kt)("inlineCode",{parentName:"p"},"~/.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,o.kt)("strong",{parentName:"p"},"user")," or ",(0,o.kt)("strong",{parentName:"p"},"sudoer"),". For example, a ",(0,o.kt)("strong",{parentName:"p"},"sudoer")," would have the ",(0,o.kt)("strong",{parentName:"p"},"configuration")," set to ",(0,o.kt)("inlineCode",{parentName:"p"},"/root/.lightning/config.toml")," or ",(0,o.kt)("inlineCode",{parentName:"p"},"/home/username/.lightning/config.toml")," depending on using ",(0,o.kt)("strong",{parentName:"p"},"sudo")," which might cause some confusion to some users.")))}i.isMDXComponent=!0},2300:(e,t,n)=>{n.d(t,{ZP:()=>i});var a=n(7462),o=(n(7294),n(3905));const r={toc:[]},l="wrapper";function i(e){let{components:t,...n}=e;return(0,o.kt)(l,(0,a.Z)({},r,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("p",null,"You should be following the ",(0,o.kt)("a",{parentName:"p",href:"/docs/node/install#create-a-user-1"},"create a user")," recommendation. For our example, we have the username ",(0,o.kt)("inlineCode",{parentName:"p"},"lgtn"),"."),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"If you have chosen a different username, replace ",(0,o.kt)("inlineCode",{parentName:"p"},"lgtn")," by the correct username you have selected.")),(0,o.kt)("p",null,"In the ",(0,o.kt)("inlineCode",{parentName:"p"},"config.toml")," you'll find some and more of the following:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-toml"},'[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')),(0,o.kt)("p",null,"Find and replace all instances of ",(0,o.kt)("inlineCode",{parentName:"p"},"~")," in the config file ",(0,o.kt)("inlineCode",{parentName:"p"},"/home/lgtn/.lightning/config.toml"),". Here's an example using ",(0,o.kt)("inlineCode",{parentName:"p"},"sed"),":"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},'sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"\n')),(0,o.kt)("admonition",{type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"The ",(0,o.kt)("inlineCode",{parentName:"p"},"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.")),(0,o.kt)("p",null,"Once changed, all the instances of ",(0,o.kt)("inlineCode",{parentName:"p"},"~/")," should be replaced by your user path e.g. ",(0,o.kt)("inlineCode",{parentName:"p"},"/home/lgtn/"),". For our example, the output would look like the following:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-toml"},'[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')))}i.isMDXComponent=!0},1054:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>c,default:()=>k,frontMatter:()=>p,metadata:()=>h,toc:()=>d});var a=n(7462),o=(n(7294),n(3905)),r=n(3872),l=n(2300),i=n(3813),s=n(3242);const p={title:"Update CLI from source code",slug:"update-cli-from-source-code",hide_title:!0,tags:["references","help","update","upgrade","fix"]},c=void 0,h={unversionedId:"Lightning CLI/update-cli-from-source-code",id:"Lightning CLI/update-cli-from-source-code",title:"Update CLI from source code",description:"\x3c!--",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,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:1694622179,formattedLastUpdatedAt:"Sep 13, 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 CLI",permalink:"/references/Lightning CLI/uninstall-lightning-cli"},next:{title:"Shutting down persistance",permalink:"/references/Systemd/shutting-down-persistance"}},u={},d=[{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 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}],m={toc:d},g="wrapper";function k(e){let{components:t,...n}=e;return(0,o.kt)(g,(0,a.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"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,o.kt)("pre",{parentName:"admonition"},(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"curl -sS https://get.fleek.network/update | bash\n"))),(0,o.kt)("h2",{id:"switch-to-the-installation-user"},"Switch to the installation user"),(0,o.kt)("p",null,"Switch to the username you've used throughout the installation process."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"su \n")),(0,o.kt)("p",null,"For example, if you used the username ",(0,o.kt)("inlineCode",{parentName:"p"},"lgtn")," it'll look like the following command:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"su lgtn\n")),(0,o.kt)("h2",{id:"change-directory-to-the-source-code"},"Change directory to the source code"),(0,o.kt)("p",null,"If you have installed it via the recommended process or instructions, then the default location where the ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/fleek-network/lightning"},"source code")," is stored is ",(0,o.kt)("inlineCode",{parentName:"p"},"~/fleek-network/lightning"),"."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"cd ~/fleek-network/lightning\n")),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"Notice that we use ",(0,o.kt)("inlineCode",{parentName:"p"},"~"),", which refers to ",(0,o.kt)("inlineCode",{parentName:"p"},"$HOME"),". You must use the username used for the installation process. For example, on ",(0,o.kt)("a",{parentName:"p",href:"/docs/node/requirements#server"},"Ubuntu")," if you use the username ",(0,o.kt)("inlineCode",{parentName:"p"},"lgtn"),", the pathname for ",(0,o.kt)("inlineCode",{parentName:"p"},"$HOME")," is ",(0,o.kt)("inlineCode",{parentName:"p"},"/home/lgtn"),".")),(0,o.kt)("h2",{id:"checkout-to-branch"},"Checkout to branch"),(0,o.kt)("p",null,"Make sure that you are checked in to the correct branch. For the current testnet phase that'd be ",(0,o.kt)("inlineCode",{parentName:"p"},"testnet-alpha-0"),". If you use any other branch name, your node will not function correctly. Use the branch name ",(0,o.kt)("inlineCode",{parentName:"p"},"testnet-alpha-0"),"."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"git checkout testnet-alpha-0\n")),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"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,o.kt)("a",{parentName:"p",href:"https://discord.gg/fleekxyz"},"Discord"),".")),(0,o.kt)("h2",{id:"pull-the-latest-changes"},"Pull the latest changes"),(0,o.kt)("p",null,"Before make sure that you stash or clear any changes you may have in the working directory, as otherwise, ",(0,o.kt)("inlineCode",{parentName:"p"},"git")," will let you know about local changes\u2013if you'd like to learn more about it read the ",(0,o.kt)("a",{parentName:"p",href:"https://git-scm.com/docs/git-stash"},"git stash document"),"."),(0,o.kt)("p",null,"A quick way to clean is to ",(0,o.kt)("inlineCode",{parentName:"p"},"stash")," the changes, for example:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"git stash \n")),(0,o.kt)("p",null,"To pull the latest changes use the ",(0,o.kt)("inlineCode",{parentName:"p"},"git pull")," command, as follows:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"git pull origin testnet-alpha-0\n")),(0,o.kt)("p",null,"Alternatively, to have to stash and pull, you can reset the repository to the origin."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"git fetch origin testnet-alpha-0\ngit reset --hard origin/testnet-alpha-0\ngit clean -f\n")),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"We are using the branch named ",(0,o.kt)("inlineCode",{parentName:"p"},"testnet-alpha-0"),", 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,o.kt)("inlineCode",{parentName:"p"},"main"),".")),(0,o.kt)("h2",{id:"build-binary-from-the-source"},"Build binary from the source"),(0,o.kt)("p",null,"To build the binary from the source code, we execute the cargo build command:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"cargo +stable build --release\n")),(0,o.kt)("h2",{id:"update-the-symlink"},"Update the symlink"),(0,o.kt)("p",null,"Start by removing the existing one:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},'sudo rm -f "/usr/local/bin/lgtn"\n')),(0,o.kt)("p",null,"Create a new symlink that links the new build binary to ",(0,o.kt)("inlineCode",{parentName:"p"},"/usr/local/bin/lgtn"),", as follows:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"sudo ln -s ~/fleek-network/lightning/target/release/lightning-node /usr/local/bin/lgtn\n")),(0,o.kt)("h2",{id:"set-user-path-in-configtoml"},"Set user path in config.toml"),(0,o.kt)(l.ZP,{mdxType:"SetUserPathInConfigToml"}),(0,o.kt)("h2",{id:"update-the-systemd-service-unit"},"Update the systemd service unit"),(0,o.kt)("p",null,"Open and edit the ",(0,o.kt)("inlineCode",{parentName:"p"},"/etc/systemd/system/lightning.service")," file."),(0,o.kt)("p",null,"1) Replace ",(0,o.kt)("inlineCode",{parentName:"p"},"")," with the username. For example, in the ",(0,o.kt)("a",{parentName:"p",href:"/docs/node/install#create-a-user"},"documentation")," we use the username ",(0,o.kt)("inlineCode",{parentName:"p"},"lgtn"),"."),(0,o.kt)("p",null,"2) Make sure that the ",(0,o.kt)("inlineCode",{parentName:"p"},"ExecStart")," is set correctly"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"[Unit]\nDescription=Fleek Network Node lightning service\n\n[Service]\nUser=\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=TMPDIR=/var/tmp\n\n[Install]\nWantedBy=multi-user.target\n")),(0,o.kt)(i.ZP,{mdxType:"NoteExecStartFlagCConfigPath"}),(0,o.kt)("p",null,"When complete make sure the file is saved. Followed by a systemctl daemon reload:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"sudo systemctl daemon-reload\n")),(0,o.kt)("h2",{id:"clear-the-data"},"Clear the data"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"rm -rf ~/.lightning/data\n")),(0,o.kt)("p",null,"Depending on how you control the system, this might need ",(0,o.kt)("strong",{parentName:"p"},"sudo"),"."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"sudo rm -rf ~/.lightning/data\n")),(0,o.kt)("h2",{id:"update-the-configtoml-with-user-home-path"},"Update the ",(0,o.kt)("inlineCode",{parentName:"h2"},"config.toml")," with user home path"),(0,o.kt)(s.ZP,{mdxType:"FindAndReplaceConfigWithUserPaths"}),(0,o.kt)("h2",{id:"restart-the-service"},"Restart the service"),(0,o.kt)("p",null,"Once the cargo build process is completed, you have to restart the service. We're assuming you are using non-root user as ",(0,o.kt)("a",{parentName:"p",href:"/docs/node/install#create-a-user"},"recommended"),", you won't use ",(0,o.kt)("strong",{parentName:"p"},"sudo")," to start the service. The command will look as follows:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"sudo systemctl restart lightning\n")),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"If you have installed the Fleek Network lightning manually, the ",(0,o.kt)("a",{parentName:"p",href:"/docs/node/install#systemd-service-setup"},"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.")),(0,o.kt)("h2",{id:"health-checkup"},"Health checkup"),(0,o.kt)("p",null,"Do a quick health check by running:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},'curl -w "\\p" localhost:4069/health\n')),(0,o.kt)("p",null,"If successful, you should get the response ",(0,o.kt)("inlineCode",{parentName:"p"},"OK"),", as follows:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"OK\n")),(0,o.kt)(r.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida",mdxType:"Author"}))}k.isMDXComponent=!0},3872:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(7294);const o=e=>{let{image:t,name:n,title:o,url:r}=e;return a.createElement("section",{className:"author_card"},a.createElement("div",null,a.createElement("span",{className:"avatar"},a.createElement("a",{href:r,target:"_blank",alt:n},a.createElement("img",{src:t,alt:n}))),a.createElement("div",null,a.createElement("span",{className:"name"},a.createElement("a",{href:r,target:"_blank",alt:n},n)),a.createElement("span",{className:"title"},o),a.createElement("span",{className:"discord"},"Got questions? Find us on ",a.createElement("a",{href:"https://discord.gg/fleekxyz",target:"_blank"},"Discord!")))))}}}]); \ No newline at end of file diff --git a/assets/js/4d7007b2.6a6061fe.js b/assets/js/4d7007b2.95002077.js similarity index 98% rename from assets/js/4d7007b2.6a6061fe.js rename to assets/js/4d7007b2.95002077.js index 62be88348..102d1f128 100644 --- a/assets/js/4d7007b2.6a6061fe.js +++ b/assets/js/4d7007b2.95002077.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[6272],{3905:(e,r,t)=>{t.d(r,{Zo:()=>p,kt:()=>m});var n=t(7294);function o(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function i(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function a(e){for(var r=1;r=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var s=n.createContext({}),l=function(e){var r=n.useContext(s),t=r;return e&&(t="function"==typeof e?e(r):a(a({},r),e)),t},p=function(e){var r=l(e.components);return n.createElement(s.Provider,{value:r},e.children)},f="mdxType",u={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},d=n.forwardRef((function(e,r){var t=e.components,o=e.mdxType,i=e.originalType,s=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),f=l(t),d=o,m=f["".concat(s,".").concat(d)]||f[d]||u[d]||i;return t?n.createElement(m,a(a({ref:r},p),{},{components:t})):n.createElement(m,a({ref:r},p))}));function m(e,r){var t=arguments,o=r&&r.mdxType;if("string"==typeof e||o){var i=t.length,a=new Array(i);a[0]=d;var c={};for(var s in r)hasOwnProperty.call(r,s)&&(c[s]=r[s]);c.originalType=e,c[f]="string"==typeof e?e:o,a[1]=c;for(var l=2;l{t.r(r),t.d(r,{assets:()=>l,contentTitle:()=>c,default:()=>d,frontMatter:()=>a,metadata:()=>s,toc:()=>p});var n=t(7462),o=(t(7294),t(3905));const i=t.p+"assets/images/banner-references-a0368a847f1d60e338779105f44a9e9a.png",a={title:"About references",hide_title:!0,sidebar_position:1,tags:["References","Help"]},c=void 0,s={unversionedId:"index",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,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:1694621981,formattedLastUpdatedAt:"Sep 13, 2023",sidebarPosition:1,frontMatter:{title:"About references",hide_title:!0,sidebar_position:1,tags:["References","Help"]},sidebar:"defaultSidebar",next:{title:"Error building on ARM64",permalink:"/references/Lightning CLI/error-building-on-arm64"}},l={},p=[],f={toc:p},u="wrapper";function d(e){let{components:r,...t}=e;return(0,o.kt)(u,(0,n.Z)({},f,t,{components:r,mdxType:"MDXLayout"}),(0,o.kt)("img",{className:"banner",src:i}),(0,o.kt)("p",null,"The references provide concise instructions to interface with the system, broken down into commands or small pieces for quick reference."),(0,o.kt)("p",null,"It differs from ",(0,o.kt)("a",{parentName:"p",href:"/guides"},"Guides")," which is more descriptive or verbose when providing instructions and how-to's."),(0,o.kt)("p",null,"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."))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[6272],{3905:(e,r,t)=>{t.d(r,{Zo:()=>p,kt:()=>m});var n=t(7294);function o(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function i(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function a(e){for(var r=1;r=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var s=n.createContext({}),l=function(e){var r=n.useContext(s),t=r;return e&&(t="function"==typeof e?e(r):a(a({},r),e)),t},p=function(e){var r=l(e.components);return n.createElement(s.Provider,{value:r},e.children)},f="mdxType",u={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},d=n.forwardRef((function(e,r){var t=e.components,o=e.mdxType,i=e.originalType,s=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),f=l(t),d=o,m=f["".concat(s,".").concat(d)]||f[d]||u[d]||i;return t?n.createElement(m,a(a({ref:r},p),{},{components:t})):n.createElement(m,a({ref:r},p))}));function m(e,r){var t=arguments,o=r&&r.mdxType;if("string"==typeof e||o){var i=t.length,a=new Array(i);a[0]=d;var c={};for(var s in r)hasOwnProperty.call(r,s)&&(c[s]=r[s]);c.originalType=e,c[f]="string"==typeof e?e:o,a[1]=c;for(var l=2;l{t.r(r),t.d(r,{assets:()=>l,contentTitle:()=>c,default:()=>d,frontMatter:()=>a,metadata:()=>s,toc:()=>p});var n=t(7462),o=(t(7294),t(3905));const i=t.p+"assets/images/banner-references-a0368a847f1d60e338779105f44a9e9a.png",a={title:"About references",hide_title:!0,sidebar_position:1,tags:["References","Help"]},c=void 0,s={unversionedId:"index",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,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:1694622179,formattedLastUpdatedAt:"Sep 13, 2023",sidebarPosition:1,frontMatter:{title:"About references",hide_title:!0,sidebar_position:1,tags:["References","Help"]},sidebar:"defaultSidebar",next:{title:"Error building on ARM64",permalink:"/references/Lightning CLI/error-building-on-arm64"}},l={},p=[],f={toc:p},u="wrapper";function d(e){let{components:r,...t}=e;return(0,o.kt)(u,(0,n.Z)({},f,t,{components:r,mdxType:"MDXLayout"}),(0,o.kt)("img",{className:"banner",src:i}),(0,o.kt)("p",null,"The references provide concise instructions to interface with the system, broken down into commands or small pieces for quick reference."),(0,o.kt)("p",null,"It differs from ",(0,o.kt)("a",{parentName:"p",href:"/guides"},"Guides")," which is more descriptive or verbose when providing instructions and how-to's."),(0,o.kt)("p",null,"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."))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/5b6134d1.bb236a35.js b/assets/js/5b6134d1.56796de6.js similarity index 99% rename from assets/js/5b6134d1.bb236a35.js rename to assets/js/5b6134d1.56796de6.js index 10664ba7d..8c12eef0d 100644 --- a/assets/js/5b6134d1.bb236a35.js +++ b/assets/js/5b6134d1.56796de6.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[9752],{3905:(e,t,n)=>{n.d(t,{Zo:()=>h,kt:()=>c});var r=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=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 l=r.createContext({}),p=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},h=function(e){var t=p(e.components);return r.createElement(l.Provider,{value:t},e.children)},d="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},g=r.forwardRef((function(e,t){var n=e.components,o=e.mdxType,a=e.originalType,l=e.parentName,h=s(e,["components","mdxType","originalType","parentName"]),d=p(n),g=o,c=d["".concat(l,".").concat(g)]||d[g]||u[g]||a;return n?r.createElement(c,i(i({ref:t},h),{},{components:n})):r.createElement(c,i({ref:t},h))}));function c(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=n.length,i=new Array(a);i[0]=g;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[d]="string"==typeof e?e:o,i[1]=s;for(var p=2;p{n.d(t,{ZP:()=>s});var r=n(7462),o=(n(7294),n(3905));const a={toc:[]},i="wrapper";function s(e){let{components:t,...n}=e;return(0,o.kt)(i,(0,r.Z)({},a,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("p",null,"In the ",(0,o.kt)("inlineCode",{parentName:"p"},"/home//.lightning/config.toml")," you'll find some and more of the following:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-toml"},'[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')),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"The configuration properties and values presented above are a shorter version of what you'll find on your ",(0,o.kt)("strong",{parentName:"p"},"configuration.toml"),". We keep it short to make it easier to follow, do not copy and paste.")),(0,o.kt)("p",null,"Find and replace all instances of ~ in the config file ",(0,o.kt)("inlineCode",{parentName:"p"},"/home//.lightning/config.toml"),". "),(0,o.kt)("p",null,"Here's an example of how to do it using ",(0,o.kt)("strong",{parentName:"p"},"sed"),":"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},'sed -i "s|~/.lightning|/home//.lightning|g" "/home//.lightning/config.toml"\n')),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"Replace the ",(0,o.kt)("inlineCode",{parentName:"p"},"")," with your username. For example, if you have followed the recommendation to ",(0,o.kt)("a",{parentName:"p",href:"/docs/node/install#create-a-user"},"create a user")," it would look like ",(0,o.kt)("inlineCode",{parentName:"p"},"/home/lgtn/.lightning/config.toml")," for the username ",(0,o.kt)("strong",{parentName:"p"},"lgtn"),".")),(0,o.kt)("p",null,"For example, if your username is ",(0,o.kt)("inlineCode",{parentName:"p"},"lgtn")," that'd look like this:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},'sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"\n')),(0,o.kt)("p",null,"Once modified, you can run a ",(0,o.kt)("inlineCode",{parentName:"p"},"cat")," to see the content of the files to confirm it has been updated."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"cat /home/lgtn/.lightning/config.toml\n")),(0,o.kt)("p",null,"For our example where we opted in for the username ",(0,o.kt)("inlineCode",{parentName:"p"},"lgtn")," that would look like:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-toml"},'[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')),(0,o.kt)("admonition",{title:"Warning",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"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.")))}s.isMDXComponent=!0},5852:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>h,contentTitle:()=>l,default:()=>c,frontMatter:()=>s,metadata:()=>p,toc:()=>d});var r=n(7462),o=(n(7294),n(3905)),a=n(3872),i=n(3242);const s={title:"File permissions and Ownership",slug:"file-permissions-and-ownership",hide_title:!0,tags:["ownership","file permissions","sudoer","root"]},l=void 0,p={unversionedId:"Lightning CLI/file-permissions-and-ownership",id:"Lightning CLI/file-permissions-and-ownership",title:"File permissions and Ownership",description:"\x3c!--",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,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:1694621981,formattedLastUpdatedAt:"Sep 13, 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:"Keys not found",permalink:"/references/Lightning CLI/keys-not-found"}},h={},d=[{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}],u={toc:d},g="wrapper";function c(e){let{components:t,...n}=e;return(0,o.kt)(g,(0,r.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h2",{id:"ownership"},"Ownership"),(0,o.kt)("p",null,"The user who installs the Fleek Network Lightning CLI matters, as it can own or delegate ownership of the dependencies and applications being installed."),(0,o.kt)("p",null,"For example, if you have followed the install document recommendations and have:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"Created a user ",(0,o.kt)("strong",{parentName:"li"},"lgtn")),(0,o.kt)("li",{parentName:"ul"},"Switched to the user ",(0,o.kt)("strong",{parentName:"li"},"lgtn")),(0,o.kt)("li",{parentName:"ul"},"Executed the installation process as ",(0,o.kt)("strong",{parentName:"li"},"lgtn")," ")),(0,o.kt)("p",null,"You'll find that it owns the following directories under the user home (/home/lgtn):"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"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")),(0,o.kt)("p",null,"Above, we have the listing properties set as ",(0,o.kt)("strong",{parentName:"p"},"drwxrwxr-x")," and the ownership ",(0,o.kt)("strong",{parentName:"p"},"lgtn:lgtn"),"."),(0,o.kt)("p",null,"On the other hand, if you have done the installation process as ",(0,o.kt)("strong",{parentName:"p"},"root")," superuser, you'll find that:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"The location of the directories and files goes under the ",(0,o.kt)("inlineCode",{parentName:"li"},"/root")," pathname"),(0,o.kt)("li",{parentName:"ul"},"The ownership is set to ",(0,o.kt)("strong",{parentName:"li"},"root:root"))),(0,o.kt)("p",null,"Learn more about ",(0,o.kt)("a",{parentName:"p",href:"https://www.linuxfoundation.org/blog/blog/classic-sysadmin-understanding-linux-file-permissions"},"file permissions")," from the ",(0,o.kt)("a",{parentName:"p",href:"https://www.linuxfoundation.org/"},"Linux Foundation"),"."),(0,o.kt)("p",null,"To learn more about file permission on Linux, read the ",(0,o.kt)("a",{parentName:"p",href:"https://www.linuxfoundation.org/blog/blog/classic-sysadmin-understanding-linux-file-permissions"},"Understanding Linux File Permissions"),"."),(0,o.kt)("h2",{id:"using-sudo-to-delegate-permissions"},"Using sudo to delegate permissions"),(0,o.kt)("p",null,"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,o.kt)("strong",{parentName:"p"},"super user")," (root) or ",(0,o.kt)("strong",{parentName:"p"},"sudo"),"."),(0,o.kt)("p",null,"If a command is executed without ",(0,o.kt)("strong",{parentName:"p"},"sudo")," then the generated output goes onto the ",(0,o.kt)("strong",{parentName:"p"},"user")," home."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"lgtn keys generate\n")),(0,o.kt)("p",null,"Resulting in having the ",(0,o.kt)("strong",{parentName:"p"},"keystore")," saved onto ",(0,o.kt)("inlineCode",{parentName:"p"},"/home/username/.lightning/keystore"),"."),(0,o.kt)("p",null,"On the other hand, if a command is executed with ",(0,o.kt)("strong",{parentName:"p"},"sudo")," then the generated output is delegated to ",(0,o.kt)("strong",{parentName:"p"},"root")," directory."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"sudo lgtn keys generate\n")),(0,o.kt)("p",null,"Resulting in having the ",(0,o.kt)("strong",{parentName:"p"},"keystore")," saved onto ",(0,o.kt)("inlineCode",{parentName:"p"},"/root/.lightning/keystore"),"."),(0,o.kt)("h2",{id:"user-home-directory"},"User $HOME directory"),(0,o.kt)("p",null,"The home directory is a directory that contains the personal files of a particular user of the system. On Linux, the ",(0,o.kt)("inlineCode",{parentName:"p"},"$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."),(0,o.kt)("p",null,"For this reason, a user can change to the home directory by executing:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"cd $HOME\n")),(0,o.kt)("p",null,"A shorthand allows a user to refer to their home directory simply as ",(0,o.kt)("inlineCode",{parentName:"p"},"~")," (tilde), as follows:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"cd ~\n")),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"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,o.kt)("strong",{parentName:"p"},"root")," by the usage of ",(0,o.kt)("strong",{parentName:"p"},"sudo"),", this can help troubleshoot and explain the location of our files e.g. the keystore. In the section ",(0,o.kt)("a",{parentName:"p",href:"#set-the-locations-of-the-user-paths"},"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.")),(0,o.kt)("p",null,"To learn more about the user $HOME directory read the wikipedia ",(0,o.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/Home_directory"},"Home directory")," document."),(0,o.kt)("h2",{id:"set-the-locations-of-the-user-paths"},"Set the locations of the user paths"),(0,o.kt)(i.ZP,{mdxType:"FindAndReplaceConfigWithUserPaths"}),(0,o.kt)("h2",{id:"set-the-configuration-flag--c-on-the-service-unit-file"},"Set the configuration flag -c on the service unit file"),(0,o.kt)("p",null,"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,o.kt)("a",{parentName:"p",href:"/docs/node/install#systemd-service-setup"},"Systemd Service Setup")," install section."),(0,o.kt)("p",null,"Open and edit the ",(0,o.kt)("strong",{parentName:"p"},"/etc/systemd/system/lightning.service")," file."),(0,o.kt)("p",null,"1) Replace ",(0,o.kt)("inlineCode",{parentName:"p"},"")," with YOUR username. For example, in the documentation we use the username ",(0,o.kt)("strong",{parentName:"p"},"lgtn"),", which means we'd replace ",(0,o.kt)("inlineCode",{parentName:"p"},"User=")," with ",(0,o.kt)("inlineCode",{parentName:"p"},"User=lgtn"),"."),(0,o.kt)("p",null,"2) Make sure that the ExecStart is set correctly, including the ",(0,o.kt)("inlineCode",{parentName:"p"},"-c")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"[Unit]\nDescription=Fleek Network Node lightning service\n\n[Service]\nUser=\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")),(0,o.kt)("p",null,"For our example, as the username ",(0,o.kt)("strong",{parentName:"p"},"lgtn")," it would look like:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"[Unit]\nDescription=Fleek Network Node lightning service\n\n[Service]\nUser=lgtn\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")),(0,o.kt)("p",null,"When complete make sure the file is saved and the systemctl daemon is reloaded, as follows:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"sudo systemctl daemon-reload\n")),(0,o.kt)("p",null,"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,o.kt)("strong",{parentName:"p"},"root")," delegation."),(0,o.kt)(a.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida",mdxType:"Author"}))}c.isMDXComponent=!0},3872:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(7294);const o=e=>{let{image:t,name:n,title:o,url:a}=e;return r.createElement("section",{className:"author_card"},r.createElement("div",null,r.createElement("span",{className:"avatar"},r.createElement("a",{href:a,target:"_blank",alt:n},r.createElement("img",{src:t,alt:n}))),r.createElement("div",null,r.createElement("span",{className:"name"},r.createElement("a",{href:a,target:"_blank",alt:n},n)),r.createElement("span",{className:"title"},o),r.createElement("span",{className:"discord"},"Got questions? Find us on ",r.createElement("a",{href:"https://discord.gg/fleekxyz",target:"_blank"},"Discord!")))))}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[9752],{3905:(e,t,n)=>{n.d(t,{Zo:()=>h,kt:()=>c});var r=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=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 l=r.createContext({}),p=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},h=function(e){var t=p(e.components);return r.createElement(l.Provider,{value:t},e.children)},d="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},g=r.forwardRef((function(e,t){var n=e.components,o=e.mdxType,a=e.originalType,l=e.parentName,h=s(e,["components","mdxType","originalType","parentName"]),d=p(n),g=o,c=d["".concat(l,".").concat(g)]||d[g]||u[g]||a;return n?r.createElement(c,i(i({ref:t},h),{},{components:n})):r.createElement(c,i({ref:t},h))}));function c(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=n.length,i=new Array(a);i[0]=g;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[d]="string"==typeof e?e:o,i[1]=s;for(var p=2;p{n.d(t,{ZP:()=>s});var r=n(7462),o=(n(7294),n(3905));const a={toc:[]},i="wrapper";function s(e){let{components:t,...n}=e;return(0,o.kt)(i,(0,r.Z)({},a,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("p",null,"In the ",(0,o.kt)("inlineCode",{parentName:"p"},"/home//.lightning/config.toml")," you'll find some and more of the following:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-toml"},'[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')),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"The configuration properties and values presented above are a shorter version of what you'll find on your ",(0,o.kt)("strong",{parentName:"p"},"configuration.toml"),". We keep it short to make it easier to follow, do not copy and paste.")),(0,o.kt)("p",null,"Find and replace all instances of ~ in the config file ",(0,o.kt)("inlineCode",{parentName:"p"},"/home//.lightning/config.toml"),". "),(0,o.kt)("p",null,"Here's an example of how to do it using ",(0,o.kt)("strong",{parentName:"p"},"sed"),":"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},'sed -i "s|~/.lightning|/home//.lightning|g" "/home//.lightning/config.toml"\n')),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"Replace the ",(0,o.kt)("inlineCode",{parentName:"p"},"")," with your username. For example, if you have followed the recommendation to ",(0,o.kt)("a",{parentName:"p",href:"/docs/node/install#create-a-user"},"create a user")," it would look like ",(0,o.kt)("inlineCode",{parentName:"p"},"/home/lgtn/.lightning/config.toml")," for the username ",(0,o.kt)("strong",{parentName:"p"},"lgtn"),".")),(0,o.kt)("p",null,"For example, if your username is ",(0,o.kt)("inlineCode",{parentName:"p"},"lgtn")," that'd look like this:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},'sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"\n')),(0,o.kt)("p",null,"Once modified, you can run a ",(0,o.kt)("inlineCode",{parentName:"p"},"cat")," to see the content of the files to confirm it has been updated."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"cat /home/lgtn/.lightning/config.toml\n")),(0,o.kt)("p",null,"For our example where we opted in for the username ",(0,o.kt)("inlineCode",{parentName:"p"},"lgtn")," that would look like:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-toml"},'[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')),(0,o.kt)("admonition",{title:"Warning",type:"caution"},(0,o.kt)("p",{parentName:"admonition"},"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.")))}s.isMDXComponent=!0},5852:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>h,contentTitle:()=>l,default:()=>c,frontMatter:()=>s,metadata:()=>p,toc:()=>d});var r=n(7462),o=(n(7294),n(3905)),a=n(3872),i=n(3242);const s={title:"File permissions and Ownership",slug:"file-permissions-and-ownership",hide_title:!0,tags:["ownership","file permissions","sudoer","root"]},l=void 0,p={unversionedId:"Lightning CLI/file-permissions-and-ownership",id:"Lightning CLI/file-permissions-and-ownership",title:"File permissions and Ownership",description:"\x3c!--",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,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:1694622179,formattedLastUpdatedAt:"Sep 13, 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:"Keys not found",permalink:"/references/Lightning CLI/keys-not-found"}},h={},d=[{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}],u={toc:d},g="wrapper";function c(e){let{components:t,...n}=e;return(0,o.kt)(g,(0,r.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h2",{id:"ownership"},"Ownership"),(0,o.kt)("p",null,"The user who installs the Fleek Network Lightning CLI matters, as it can own or delegate ownership of the dependencies and applications being installed."),(0,o.kt)("p",null,"For example, if you have followed the install document recommendations and have:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"Created a user ",(0,o.kt)("strong",{parentName:"li"},"lgtn")),(0,o.kt)("li",{parentName:"ul"},"Switched to the user ",(0,o.kt)("strong",{parentName:"li"},"lgtn")),(0,o.kt)("li",{parentName:"ul"},"Executed the installation process as ",(0,o.kt)("strong",{parentName:"li"},"lgtn")," ")),(0,o.kt)("p",null,"You'll find that it owns the following directories under the user home (/home/lgtn):"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"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")),(0,o.kt)("p",null,"Above, we have the listing properties set as ",(0,o.kt)("strong",{parentName:"p"},"drwxrwxr-x")," and the ownership ",(0,o.kt)("strong",{parentName:"p"},"lgtn:lgtn"),"."),(0,o.kt)("p",null,"On the other hand, if you have done the installation process as ",(0,o.kt)("strong",{parentName:"p"},"root")," superuser, you'll find that:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"The location of the directories and files goes under the ",(0,o.kt)("inlineCode",{parentName:"li"},"/root")," pathname"),(0,o.kt)("li",{parentName:"ul"},"The ownership is set to ",(0,o.kt)("strong",{parentName:"li"},"root:root"))),(0,o.kt)("p",null,"Learn more about ",(0,o.kt)("a",{parentName:"p",href:"https://www.linuxfoundation.org/blog/blog/classic-sysadmin-understanding-linux-file-permissions"},"file permissions")," from the ",(0,o.kt)("a",{parentName:"p",href:"https://www.linuxfoundation.org/"},"Linux Foundation"),"."),(0,o.kt)("p",null,"To learn more about file permission on Linux, read the ",(0,o.kt)("a",{parentName:"p",href:"https://www.linuxfoundation.org/blog/blog/classic-sysadmin-understanding-linux-file-permissions"},"Understanding Linux File Permissions"),"."),(0,o.kt)("h2",{id:"using-sudo-to-delegate-permissions"},"Using sudo to delegate permissions"),(0,o.kt)("p",null,"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,o.kt)("strong",{parentName:"p"},"super user")," (root) or ",(0,o.kt)("strong",{parentName:"p"},"sudo"),"."),(0,o.kt)("p",null,"If a command is executed without ",(0,o.kt)("strong",{parentName:"p"},"sudo")," then the generated output goes onto the ",(0,o.kt)("strong",{parentName:"p"},"user")," home."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"lgtn keys generate\n")),(0,o.kt)("p",null,"Resulting in having the ",(0,o.kt)("strong",{parentName:"p"},"keystore")," saved onto ",(0,o.kt)("inlineCode",{parentName:"p"},"/home/username/.lightning/keystore"),"."),(0,o.kt)("p",null,"On the other hand, if a command is executed with ",(0,o.kt)("strong",{parentName:"p"},"sudo")," then the generated output is delegated to ",(0,o.kt)("strong",{parentName:"p"},"root")," directory."),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"sudo lgtn keys generate\n")),(0,o.kt)("p",null,"Resulting in having the ",(0,o.kt)("strong",{parentName:"p"},"keystore")," saved onto ",(0,o.kt)("inlineCode",{parentName:"p"},"/root/.lightning/keystore"),"."),(0,o.kt)("h2",{id:"user-home-directory"},"User $HOME directory"),(0,o.kt)("p",null,"The home directory is a directory that contains the personal files of a particular user of the system. On Linux, the ",(0,o.kt)("inlineCode",{parentName:"p"},"$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."),(0,o.kt)("p",null,"For this reason, a user can change to the home directory by executing:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"cd $HOME\n")),(0,o.kt)("p",null,"A shorthand allows a user to refer to their home directory simply as ",(0,o.kt)("inlineCode",{parentName:"p"},"~")," (tilde), as follows:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"cd ~\n")),(0,o.kt)("admonition",{type:"tip"},(0,o.kt)("p",{parentName:"admonition"},"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,o.kt)("strong",{parentName:"p"},"root")," by the usage of ",(0,o.kt)("strong",{parentName:"p"},"sudo"),", this can help troubleshoot and explain the location of our files e.g. the keystore. In the section ",(0,o.kt)("a",{parentName:"p",href:"#set-the-locations-of-the-user-paths"},"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.")),(0,o.kt)("p",null,"To learn more about the user $HOME directory read the wikipedia ",(0,o.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/Home_directory"},"Home directory")," document."),(0,o.kt)("h2",{id:"set-the-locations-of-the-user-paths"},"Set the locations of the user paths"),(0,o.kt)(i.ZP,{mdxType:"FindAndReplaceConfigWithUserPaths"}),(0,o.kt)("h2",{id:"set-the-configuration-flag--c-on-the-service-unit-file"},"Set the configuration flag -c on the service unit file"),(0,o.kt)("p",null,"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,o.kt)("a",{parentName:"p",href:"/docs/node/install#systemd-service-setup"},"Systemd Service Setup")," install section."),(0,o.kt)("p",null,"Open and edit the ",(0,o.kt)("strong",{parentName:"p"},"/etc/systemd/system/lightning.service")," file."),(0,o.kt)("p",null,"1) Replace ",(0,o.kt)("inlineCode",{parentName:"p"},"")," with YOUR username. For example, in the documentation we use the username ",(0,o.kt)("strong",{parentName:"p"},"lgtn"),", which means we'd replace ",(0,o.kt)("inlineCode",{parentName:"p"},"User=")," with ",(0,o.kt)("inlineCode",{parentName:"p"},"User=lgtn"),"."),(0,o.kt)("p",null,"2) Make sure that the ExecStart is set correctly, including the ",(0,o.kt)("inlineCode",{parentName:"p"},"-c")),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"[Unit]\nDescription=Fleek Network Node lightning service\n\n[Service]\nUser=\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")),(0,o.kt)("p",null,"For our example, as the username ",(0,o.kt)("strong",{parentName:"p"},"lgtn")," it would look like:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"[Unit]\nDescription=Fleek Network Node lightning service\n\n[Service]\nUser=lgtn\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")),(0,o.kt)("p",null,"When complete make sure the file is saved and the systemctl daemon is reloaded, as follows:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"sudo systemctl daemon-reload\n")),(0,o.kt)("p",null,"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,o.kt)("strong",{parentName:"p"},"root")," delegation."),(0,o.kt)(a.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida",mdxType:"Author"}))}c.isMDXComponent=!0},3872:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(7294);const o=e=>{let{image:t,name:n,title:o,url:a}=e;return r.createElement("section",{className:"author_card"},r.createElement("div",null,r.createElement("span",{className:"avatar"},r.createElement("a",{href:a,target:"_blank",alt:n},r.createElement("img",{src:t,alt:n}))),r.createElement("div",null,r.createElement("span",{className:"name"},r.createElement("a",{href:a,target:"_blank",alt:n},n)),r.createElement("span",{className:"title"},o),r.createElement("span",{className:"discord"},"Got questions? Find us on ",r.createElement("a",{href:"https://discord.gg/fleekxyz",target:"_blank"},"Discord!")))))}}}]); \ No newline at end of file diff --git a/assets/js/6be32138.4e91085e.js b/assets/js/6be32138.a0b47478.js similarity index 99% rename from assets/js/6be32138.4e91085e.js rename to assets/js/6be32138.a0b47478.js index 86d6317c1..84749158d 100644 --- a/assets/js/6be32138.4e91085e.js +++ b/assets/js/6be32138.a0b47478.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[3396],{3905:(e,t,i)=>{i.d(t,{Zo:()=>h,kt:()=>f});var o=i(7294);function n(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function r(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function a(e){for(var t=1;t=0||(n[i]=e[i]);return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}var s=o.createContext({}),c=function(e){var t=o.useContext(s),i=t;return e&&(i="function"==typeof e?e(t):a(a({},t),e)),i},h=function(e){var t=c(e.components);return o.createElement(s.Provider,{value:t},e.children)},p="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},u=o.forwardRef((function(e,t){var i=e.components,n=e.mdxType,r=e.originalType,s=e.parentName,h=l(e,["components","mdxType","originalType","parentName"]),p=c(i),u=n,f=p["".concat(s,".").concat(u)]||p[u]||m[u]||r;return i?o.createElement(f,a(a({ref:t},h),{},{components:i})):o.createElement(f,a({ref:t},h))}));function f(e,t){var i=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var r=i.length,a=new Array(r);a[0]=u;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[p]="string"==typeof e?e:n,a[1]=l;for(var c=2;c{i.r(t),i.d(t,{assets:()=>s,contentTitle:()=>a,default:()=>m,frontMatter:()=>r,metadata:()=>l,toc:()=>c});var o=i(7462),n=(i(7294),i(3905));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,l={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-09-13T16:19:41.000Z",formattedDate:"September 13, 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.355,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"]}},s={image:i(4221).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}],h={toc:c},p="wrapper";function m(e){let{components:t,...r}=e;return(0,n.kt)(p,(0,o.Z)({},h,r,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("p",null,"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."),(0,n.kt)("h2",{id:"background"},"Background"),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"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."),(0,n.kt)("h2",{id:"bloom-filters"},"Bloom Filters"),(0,n.kt)("p",null,"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.kt)("inlineCode",{parentName:"p"},"no")," or ",(0,n.kt)("inlineCode",{parentName:"p"},"yes,")," but rather ",(0,n.kt)("inlineCode",{parentName:"p"},"no")," or ",(0,n.kt)("inlineCode",{parentName:"p"},"probably.")," This ",(0,n.kt)("inlineCode",{parentName:"p"},"probably")," is quantified with the false positive rate. "),(0,n.kt)("p",null,"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.kt)("inlineCode",{parentName:"p"},"insert")," and ",(0,n.kt)("inlineCode",{parentName:"p"},"contains.")," "),(0,n.kt)("p",null,"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.kt)("br",{parentName:"p"}),"\n","To check whether or not an element is contained in the filter, the element is hashed k times with the different hash functions."),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"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. "),(0,n.kt)("p",null,"Since we also need a ",(0,n.kt)("inlineCode",{parentName:"p"},"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.kt)("inlineCode",{parentName:"p"},"remove")," operation comes at the cost of an increased memory footprint."),(0,n.kt)("p",null,"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."),(0,n.kt)("h2",{id:"cuckoo-filters"},"Cuckoo Filters"),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"They are space-efficient and can be used for approximate set membership queries. Cuckoo filters also support the operations ",(0,n.kt)("inlineCode",{parentName:"p"},"insert,")," ",(0,n.kt)("inlineCode",{parentName:"p"},"contains,")," and ",(0,n.kt)("inlineCode",{parentName:"p"},"remove,")," and have configurable false positive rates. "),(0,n.kt)("p",null,"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. "),(0,n.kt)("p",null,"The ",(0,n.kt)("inlineCode",{parentName:"p"},"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."),(0,n.kt)("p",null,"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. "),(0,n.kt)("p",null,"Although the insertion operation may perform a sequence of relocations, the amortized runtime is O(1). "),(0,n.kt)("p",null,"Most implementations of Cuckoo hash tables and, consequently, Cuckoo filters will use buckets that can hold multiple elements, as proposed in ","[3]","."),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"The fingerprint size is derived from the desired false positive rate.",(0,n.kt)("br",{parentName:"p"}),"\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."),(0,n.kt)("p",null,"Of course, we could store this hash somewhere, but the whole point of using fingerprints is to reduce the memory footprint of the filter."),(0,n.kt)("p",null,"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.kt)("br",{parentName:"p"}),"\n","For a given element x, the two candidate buckets are computed as follows: "),(0,n.kt)("p",null,(0,n.kt)("img",{src:i(9440).Z,width:"1324",height:"194"})),(0,n.kt)("p",null,"An important property of this technique is that h1(x) can also be computed from h2(x) and the fingerprint."),(0,n.kt)("h2",{id:"benchmarking"},"Benchmarking"),(0,n.kt)("p",null,"As this post mentioned, we are not aiming for a general comparison of Counting Bloom and Cuckoo filters."),(0,n.kt)("p",null,"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. "),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"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. "),(0,n.kt)("h2",{id:"experimental-setup"},"Experimental Setup"),(0,n.kt)("p",null,"We are using our own Counting Bloom filter ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/fleek-network/ursa/blob/483f4d56cbaa5e83182454d2c1db6f6af7c54912/crates/ursa-network/src/utils/bloom_filter.rs#L11"},"implementation")," and\n",(0,n.kt)("a",{parentName:"p",href:"https://github.com/sile/scalable_cuckoo_filter"},"this")," Cuckoo filter implementation in Rust (the ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/efficient/cuckoofilter"},"original")," implementation is in C++). All experiments\nwere 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."),(0,n.kt)("h2",{id:"memory-footprint"},"Memory Footprint"),(0,n.kt)("p",null,"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. "),(0,n.kt)("p",null,"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]","."),(0,n.kt)("p",null,(0,n.kt)("img",{src:i(5441).Z,width:"640",height:"480"})),(0,n.kt)("blockquote",null,(0,n.kt)("p",{parentName:"blockquote"},"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.")),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"The gap between Counting Bloom filters and Cuckoo filters grows as the false positive rate decreases. This is also consistent with experiments in ","[1]","."),(0,n.kt)("p",null,(0,n.kt)("img",{src:i(9844).Z,width:"640",height:"480"})),(0,n.kt)("blockquote",null,(0,n.kt)("p",{parentName:"blockquote"},"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.")),(0,n.kt)("h2",{id:"lookup-performance"},"Lookup Performance"),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"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. "),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"However, the performance difference is negligible."),(0,n.kt)("p",null,(0,n.kt)("img",{src:i(8915).Z,width:"640",height:"480"})),(0,n.kt)("blockquote",null,(0,n.kt)("p",{parentName:"blockquote"},"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.")),(0,n.kt)("h2",{id:"insertion-performance"},"Insertion Performance"),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"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. "),(0,n.kt)("p",null,(0,n.kt)("img",{src:i(989).Z,width:"640",height:"480"})),(0,n.kt)("blockquote",null,(0,n.kt)("p",{parentName:"blockquote"},"Figure 4: Insertion performance for different occupancy levels. The shaded region indicates the standard deviation.")),(0,n.kt)("h2",{id:"capacity-and-scaling"},"Capacity and Scaling"),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"For Bloom filters, the ",(0,n.kt)("inlineCode",{parentName:"p"},"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.kt)("inlineCode",{parentName:"p"},"insertion")," operation will return an error if more relocations are required. "),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"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. "),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"The proposed technique is also applicable to Cuckoo filters."),(0,n.kt)("h2",{id:"other-filters"},"Other Filters"),(0,n.kt)("p",null,"While we only looked at Bloom filters and Cuckoo filters, there are other AMQ filters that we want to mention here briefly:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("p",{parentName:"li"},"Quotient filters ","[5, 6]",": Compact hash tables that support insertion, lookup, and deletion. Less space-efficient than Bloom filters and Cuckoo filters. ")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("p",{parentName:"li"},"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. "))),(0,n.kt)("h2",{id:"conclusion"},"Conclusion"),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"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. "),(0,n.kt)("h3",{id:"references"},"References"),(0,n.kt)("p",null,"[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. "),(0,n.kt)("p",null,"[2]"," Rasmus Pagha and Flemming Friche Rodler. Cuckoo hashing. Journal of Algorithms, 51(2), pp. 122-144, 2004. "),(0,n.kt)("p",null,"[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. "),(0,n.kt)("p",null,"[4]"," Paulo S. Almeida, Carlos Baquero, Nuno Pregui\xe7a, and David Hutchison. Scalable Bloom Filters. Information Processing Letters, 101(6), pp. 255-261, 2007. "),(0,n.kt)("p",null,"[5]"," John G. Cleary. Compact hash tables using bidirectional linear probing. IEEE Transactions on Computers. 33(9), pp. 828-834, 1984. "),(0,n.kt)("p",null,"[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. "),(0,n.kt)("p",null,"[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."))}m.isMDXComponent=!0},4221:(e,t,i)=>{i.d(t,{Z:()=>o});const o=i.p+"assets/images/bloom-79da0db687b4fb2060758838b9c44513.png"},5441:(e,t,i)=>{i.d(t,{Z:()=>o});const o=i.p+"assets/images/capacity-size-5c2576bd69db0e5b510781e7cc1c5257.png"},9844:(e,t,i)=>{i.d(t,{Z:()=>o});const o=i.p+"assets/images/fp-rate-size-fbb54b2450b4a91e28c97d8adf0253e8.png"},989:(e,t,i)=>{i.d(t,{Z:()=>o});const o=i.p+"assets/images/insert-3ff48d4c63724adcf399f81b29607691.png"},8915:(e,t,i)=>{i.d(t,{Z:()=>o});const o=i.p+"assets/images/lookup-e36011237d8602b5f6c36fe5dd145bf5.png"},9440:(e,t,i)=>{i.d(t,{Z:()=>o});const o=i.p+"assets/images/math-formul-a247d4df475b26b1e7cbb2acfc0ab8c2.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[3396],{3905:(e,t,i)=>{i.d(t,{Zo:()=>h,kt:()=>f});var o=i(7294);function n(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function r(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function a(e){for(var t=1;t=0||(n[i]=e[i]);return n}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}var s=o.createContext({}),c=function(e){var t=o.useContext(s),i=t;return e&&(i="function"==typeof e?e(t):a(a({},t),e)),i},h=function(e){var t=c(e.components);return o.createElement(s.Provider,{value:t},e.children)},p="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},u=o.forwardRef((function(e,t){var i=e.components,n=e.mdxType,r=e.originalType,s=e.parentName,h=l(e,["components","mdxType","originalType","parentName"]),p=c(i),u=n,f=p["".concat(s,".").concat(u)]||p[u]||m[u]||r;return i?o.createElement(f,a(a({ref:t},h),{},{components:i})):o.createElement(f,a({ref:t},h))}));function f(e,t){var i=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var r=i.length,a=new Array(r);a[0]=u;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l[p]="string"==typeof e?e:n,a[1]=l;for(var c=2;c{i.r(t),i.d(t,{assets:()=>s,contentTitle:()=>a,default:()=>m,frontMatter:()=>r,metadata:()=>l,toc:()=>c});var o=i(7462),n=(i(7294),i(3905));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,l={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-09-13T16:22:59.000Z",formattedDate:"September 13, 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.355,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"]}},s={image:i(4221).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}],h={toc:c},p="wrapper";function m(e){let{components:t,...r}=e;return(0,n.kt)(p,(0,o.Z)({},h,r,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("p",null,"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."),(0,n.kt)("h2",{id:"background"},"Background"),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"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."),(0,n.kt)("h2",{id:"bloom-filters"},"Bloom Filters"),(0,n.kt)("p",null,"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.kt)("inlineCode",{parentName:"p"},"no")," or ",(0,n.kt)("inlineCode",{parentName:"p"},"yes,")," but rather ",(0,n.kt)("inlineCode",{parentName:"p"},"no")," or ",(0,n.kt)("inlineCode",{parentName:"p"},"probably.")," This ",(0,n.kt)("inlineCode",{parentName:"p"},"probably")," is quantified with the false positive rate. "),(0,n.kt)("p",null,"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.kt)("inlineCode",{parentName:"p"},"insert")," and ",(0,n.kt)("inlineCode",{parentName:"p"},"contains.")," "),(0,n.kt)("p",null,"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.kt)("br",{parentName:"p"}),"\n","To check whether or not an element is contained in the filter, the element is hashed k times with the different hash functions."),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"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. "),(0,n.kt)("p",null,"Since we also need a ",(0,n.kt)("inlineCode",{parentName:"p"},"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.kt)("inlineCode",{parentName:"p"},"remove")," operation comes at the cost of an increased memory footprint."),(0,n.kt)("p",null,"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."),(0,n.kt)("h2",{id:"cuckoo-filters"},"Cuckoo Filters"),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"They are space-efficient and can be used for approximate set membership queries. Cuckoo filters also support the operations ",(0,n.kt)("inlineCode",{parentName:"p"},"insert,")," ",(0,n.kt)("inlineCode",{parentName:"p"},"contains,")," and ",(0,n.kt)("inlineCode",{parentName:"p"},"remove,")," and have configurable false positive rates. "),(0,n.kt)("p",null,"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. "),(0,n.kt)("p",null,"The ",(0,n.kt)("inlineCode",{parentName:"p"},"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."),(0,n.kt)("p",null,"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. "),(0,n.kt)("p",null,"Although the insertion operation may perform a sequence of relocations, the amortized runtime is O(1). "),(0,n.kt)("p",null,"Most implementations of Cuckoo hash tables and, consequently, Cuckoo filters will use buckets that can hold multiple elements, as proposed in ","[3]","."),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"The fingerprint size is derived from the desired false positive rate.",(0,n.kt)("br",{parentName:"p"}),"\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."),(0,n.kt)("p",null,"Of course, we could store this hash somewhere, but the whole point of using fingerprints is to reduce the memory footprint of the filter."),(0,n.kt)("p",null,"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.kt)("br",{parentName:"p"}),"\n","For a given element x, the two candidate buckets are computed as follows: "),(0,n.kt)("p",null,(0,n.kt)("img",{src:i(9440).Z,width:"1324",height:"194"})),(0,n.kt)("p",null,"An important property of this technique is that h1(x) can also be computed from h2(x) and the fingerprint."),(0,n.kt)("h2",{id:"benchmarking"},"Benchmarking"),(0,n.kt)("p",null,"As this post mentioned, we are not aiming for a general comparison of Counting Bloom and Cuckoo filters."),(0,n.kt)("p",null,"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. "),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"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. "),(0,n.kt)("h2",{id:"experimental-setup"},"Experimental Setup"),(0,n.kt)("p",null,"We are using our own Counting Bloom filter ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/fleek-network/ursa/blob/483f4d56cbaa5e83182454d2c1db6f6af7c54912/crates/ursa-network/src/utils/bloom_filter.rs#L11"},"implementation")," and\n",(0,n.kt)("a",{parentName:"p",href:"https://github.com/sile/scalable_cuckoo_filter"},"this")," Cuckoo filter implementation in Rust (the ",(0,n.kt)("a",{parentName:"p",href:"https://github.com/efficient/cuckoofilter"},"original")," implementation is in C++). All experiments\nwere 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."),(0,n.kt)("h2",{id:"memory-footprint"},"Memory Footprint"),(0,n.kt)("p",null,"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. "),(0,n.kt)("p",null,"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]","."),(0,n.kt)("p",null,(0,n.kt)("img",{src:i(5441).Z,width:"640",height:"480"})),(0,n.kt)("blockquote",null,(0,n.kt)("p",{parentName:"blockquote"},"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.")),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"The gap between Counting Bloom filters and Cuckoo filters grows as the false positive rate decreases. This is also consistent with experiments in ","[1]","."),(0,n.kt)("p",null,(0,n.kt)("img",{src:i(9844).Z,width:"640",height:"480"})),(0,n.kt)("blockquote",null,(0,n.kt)("p",{parentName:"blockquote"},"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.")),(0,n.kt)("h2",{id:"lookup-performance"},"Lookup Performance"),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"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. "),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"However, the performance difference is negligible."),(0,n.kt)("p",null,(0,n.kt)("img",{src:i(8915).Z,width:"640",height:"480"})),(0,n.kt)("blockquote",null,(0,n.kt)("p",{parentName:"blockquote"},"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.")),(0,n.kt)("h2",{id:"insertion-performance"},"Insertion Performance"),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"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. "),(0,n.kt)("p",null,(0,n.kt)("img",{src:i(989).Z,width:"640",height:"480"})),(0,n.kt)("blockquote",null,(0,n.kt)("p",{parentName:"blockquote"},"Figure 4: Insertion performance for different occupancy levels. The shaded region indicates the standard deviation.")),(0,n.kt)("h2",{id:"capacity-and-scaling"},"Capacity and Scaling"),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"For Bloom filters, the ",(0,n.kt)("inlineCode",{parentName:"p"},"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.kt)("inlineCode",{parentName:"p"},"insertion")," operation will return an error if more relocations are required. "),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"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. "),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"The proposed technique is also applicable to Cuckoo filters."),(0,n.kt)("h2",{id:"other-filters"},"Other Filters"),(0,n.kt)("p",null,"While we only looked at Bloom filters and Cuckoo filters, there are other AMQ filters that we want to mention here briefly:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("p",{parentName:"li"},"Quotient filters ","[5, 6]",": Compact hash tables that support insertion, lookup, and deletion. Less space-efficient than Bloom filters and Cuckoo filters. ")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("p",{parentName:"li"},"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. "))),(0,n.kt)("h2",{id:"conclusion"},"Conclusion"),(0,n.kt)("p",null,"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."),(0,n.kt)("p",null,"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. "),(0,n.kt)("h3",{id:"references"},"References"),(0,n.kt)("p",null,"[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. "),(0,n.kt)("p",null,"[2]"," Rasmus Pagha and Flemming Friche Rodler. Cuckoo hashing. Journal of Algorithms, 51(2), pp. 122-144, 2004. "),(0,n.kt)("p",null,"[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. "),(0,n.kt)("p",null,"[4]"," Paulo S. Almeida, Carlos Baquero, Nuno Pregui\xe7a, and David Hutchison. Scalable Bloom Filters. Information Processing Letters, 101(6), pp. 255-261, 2007. "),(0,n.kt)("p",null,"[5]"," John G. Cleary. Compact hash tables using bidirectional linear probing. IEEE Transactions on Computers. 33(9), pp. 828-834, 1984. "),(0,n.kt)("p",null,"[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. "),(0,n.kt)("p",null,"[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."))}m.isMDXComponent=!0},4221:(e,t,i)=>{i.d(t,{Z:()=>o});const o=i.p+"assets/images/bloom-79da0db687b4fb2060758838b9c44513.png"},5441:(e,t,i)=>{i.d(t,{Z:()=>o});const o=i.p+"assets/images/capacity-size-5c2576bd69db0e5b510781e7cc1c5257.png"},9844:(e,t,i)=>{i.d(t,{Z:()=>o});const o=i.p+"assets/images/fp-rate-size-fbb54b2450b4a91e28c97d8adf0253e8.png"},989:(e,t,i)=>{i.d(t,{Z:()=>o});const o=i.p+"assets/images/insert-3ff48d4c63724adcf399f81b29607691.png"},8915:(e,t,i)=>{i.d(t,{Z:()=>o});const o=i.p+"assets/images/lookup-e36011237d8602b5f6c36fe5dd145bf5.png"},9440:(e,t,i)=>{i.d(t,{Z:()=>o});const o=i.p+"assets/images/math-formul-a247d4df475b26b1e7cbb2acfc0ab8c2.png"}}]); \ No newline at end of file diff --git a/assets/js/8a92e787.b12b85ea.js b/assets/js/8a92e787.5b9e0781.js similarity index 98% rename from assets/js/8a92e787.b12b85ea.js rename to assets/js/8a92e787.5b9e0781.js index 14b402c74..de1a706c3 100644 --- a/assets/js/8a92e787.b12b85ea.js +++ b/assets/js/8a92e787.5b9e0781.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[2517],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>m});var r=n(7294);function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(s[n]=e[n]);return s}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}var c=r.createContext({}),i=function(e){var t=r.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},u=function(e){var t=i(e.components);return r.createElement(c.Provider,{value:t},e.children)},d="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},g=r.forwardRef((function(e,t){var n=e.components,s=e.mdxType,a=e.originalType,c=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),d=i(n),g=s,m=d["".concat(c,".").concat(g)]||d[g]||p[g]||a;return n?r.createElement(m,o(o({ref:t},u),{},{components:n})):r.createElement(m,o({ref:t},u))}));function m(e,t){var n=arguments,s=t&&t.mdxType;if("string"==typeof e||s){var a=n.length,o=new Array(a);o[0]=g;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l[d]="string"==typeof e?e:s,o[1]=l;for(var i=2;i{n.r(t),n.d(t,{assets:()=>i,contentTitle:()=>l,default:()=>g,frontMatter:()=>o,metadata:()=>c,toc:()=>u});var r=n(7462),s=(n(7294),n(3905)),a=n(3872);const o={title:"Shutting down persistance",slug:"shutting-down-persistance",hide_title:!0,tags:["reference","shutdown","frozen","idle","service error","systemctl","systemd"]},l=void 0,c={unversionedId:"Systemd/shutting-down-persistance",id:"Systemd/shutting-down-persistance",title:"Shutting down persistance",description:"\x3c!--",source:"@site/references/Systemd/shutting-down-persistance.md",sourceDirName:"Systemd",slug:"/Systemd/shutting-down-persistance",permalink:"/references/Systemd/shutting-down-persistance",draft:!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:1694621981,formattedLastUpdatedAt:"Sep 13, 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:"Update CLI from source code",permalink:"/references/Lightning CLI/update-cli-from-source-code"},next:{title:"User service",permalink:"/references/Systemd/user-service"}},i={},u=[{value:"Systemd Service as frozen or idle",id:"systemd-service-as-frozen-or-idle",level:2}],d={toc:u},p="wrapper";function g(e){let{components:t,...n}=e;return(0,s.kt)(p,(0,r.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,s.kt)("h2",{id:"systemd-service-as-frozen-or-idle"},"Systemd Service as frozen or idle"),(0,s.kt)("p",null,"If you have a ",(0,s.kt)("inlineCode",{parentName:"p"},"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."),(0,s.kt)("p",null,"The logs should be similar to the following:"),(0,s.kt)("pre",null,(0,s.kt)("code",{parentName:"pre",className:"language-sh"},"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:4069\nShutting node down.\nShutting node down.\nShutting node down.\nShutting node down.\nShutting node down.\n")),(0,s.kt)("p",null,"To resolve this issue, start by executing a new ",(0,s.kt)("inlineCode",{parentName:"p"},"shutdown")," command as follows:"),(0,s.kt)("pre",null,(0,s.kt)("code",{parentName:"pre",className:"language-sh"},"systemctl stop lightning\n")),(0,s.kt)("p",null,"If you need to delegate to root, then use the ",(0,s.kt)("strong",{parentName:"p"},"sudo")," keyword, as follows:"),(0,s.kt)("pre",null,(0,s.kt)("code",{parentName:"pre",className:"language-sh"},"sudo systemctl stop lightning\n")),(0,s.kt)("p",null,"Once completed, clear the logs to avoid confusion as the log aggregates messages past and current."),(0,s.kt)("p",null,"Delete all the log files (output.log and diagnostic.log) by running:"),(0,s.kt)("pre",null,(0,s.kt)("code",{parentName:"pre",className:"language-sh"},"sudo rm -f /var/log/lightning/*.log\n")),(0,s.kt)("p",null,"Launch the service:"),(0,s.kt)("pre",null,(0,s.kt)("code",{parentName:"pre",className:"language-sh"},"systemctl start lightning\n")),(0,s.kt)("p",null,"If you need to delegate to root, then use the ",(0,s.kt)("strong",{parentName:"p"},"sudo")," keyword, as follows:"),(0,s.kt)("pre",null,(0,s.kt)("code",{parentName:"pre",className:"language-sh"},"sudo systemctl start lightning\n")),(0,s.kt)("p",null,"You can watch the log output of the service by running:"),(0,s.kt)("pre",null,(0,s.kt)("code",{parentName:"pre",className:"language-sh"},"tail -f /var/log/lightning/output.log\n")),(0,s.kt)("p",null,"The output should be similar to:"),(0,s.kt)("pre",null,(0,s.kt)("code",{parentName:"pre",className:"language-sh"},"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")),(0,s.kt)("p",null,"Alternatively, you can watch the diagnostic.log"),(0,s.kt)("pre",null,(0,s.kt)("code",{parentName:"pre",className:"language-sh"},"tail -f /var/log/lightning/diagnostic.log\n")),(0,s.kt)(a.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida",mdxType:"Author"}))}g.isMDXComponent=!0},3872:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(7294);const s=e=>{let{image:t,name:n,title:s,url:a}=e;return r.createElement("section",{className:"author_card"},r.createElement("div",null,r.createElement("span",{className:"avatar"},r.createElement("a",{href:a,target:"_blank",alt:n},r.createElement("img",{src:t,alt:n}))),r.createElement("div",null,r.createElement("span",{className:"name"},r.createElement("a",{href:a,target:"_blank",alt:n},n)),r.createElement("span",{className:"title"},s),r.createElement("span",{className:"discord"},"Got questions? Find us on ",r.createElement("a",{href:"https://discord.gg/fleekxyz",target:"_blank"},"Discord!")))))}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[2517],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>m});var r=n(7294);function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(s[n]=e[n]);return s}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}var c=r.createContext({}),i=function(e){var t=r.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},u=function(e){var t=i(e.components);return r.createElement(c.Provider,{value:t},e.children)},d="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},g=r.forwardRef((function(e,t){var n=e.components,s=e.mdxType,a=e.originalType,c=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),d=i(n),g=s,m=d["".concat(c,".").concat(g)]||d[g]||p[g]||a;return n?r.createElement(m,o(o({ref:t},u),{},{components:n})):r.createElement(m,o({ref:t},u))}));function m(e,t){var n=arguments,s=t&&t.mdxType;if("string"==typeof e||s){var a=n.length,o=new Array(a);o[0]=g;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l[d]="string"==typeof e?e:s,o[1]=l;for(var i=2;i{n.r(t),n.d(t,{assets:()=>i,contentTitle:()=>l,default:()=>g,frontMatter:()=>o,metadata:()=>c,toc:()=>u});var r=n(7462),s=(n(7294),n(3905)),a=n(3872);const o={title:"Shutting down persistance",slug:"shutting-down-persistance",hide_title:!0,tags:["reference","shutdown","frozen","idle","service error","systemctl","systemd"]},l=void 0,c={unversionedId:"Systemd/shutting-down-persistance",id:"Systemd/shutting-down-persistance",title:"Shutting down persistance",description:"\x3c!--",source:"@site/references/Systemd/shutting-down-persistance.md",sourceDirName:"Systemd",slug:"/Systemd/shutting-down-persistance",permalink:"/references/Systemd/shutting-down-persistance",draft:!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:1694622179,formattedLastUpdatedAt:"Sep 13, 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:"Update CLI from source code",permalink:"/references/Lightning CLI/update-cli-from-source-code"},next:{title:"User service",permalink:"/references/Systemd/user-service"}},i={},u=[{value:"Systemd Service as frozen or idle",id:"systemd-service-as-frozen-or-idle",level:2}],d={toc:u},p="wrapper";function g(e){let{components:t,...n}=e;return(0,s.kt)(p,(0,r.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,s.kt)("h2",{id:"systemd-service-as-frozen-or-idle"},"Systemd Service as frozen or idle"),(0,s.kt)("p",null,"If you have a ",(0,s.kt)("inlineCode",{parentName:"p"},"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."),(0,s.kt)("p",null,"The logs should be similar to the following:"),(0,s.kt)("pre",null,(0,s.kt)("code",{parentName:"pre",className:"language-sh"},"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:4069\nShutting node down.\nShutting node down.\nShutting node down.\nShutting node down.\nShutting node down.\n")),(0,s.kt)("p",null,"To resolve this issue, start by executing a new ",(0,s.kt)("inlineCode",{parentName:"p"},"shutdown")," command as follows:"),(0,s.kt)("pre",null,(0,s.kt)("code",{parentName:"pre",className:"language-sh"},"systemctl stop lightning\n")),(0,s.kt)("p",null,"If you need to delegate to root, then use the ",(0,s.kt)("strong",{parentName:"p"},"sudo")," keyword, as follows:"),(0,s.kt)("pre",null,(0,s.kt)("code",{parentName:"pre",className:"language-sh"},"sudo systemctl stop lightning\n")),(0,s.kt)("p",null,"Once completed, clear the logs to avoid confusion as the log aggregates messages past and current."),(0,s.kt)("p",null,"Delete all the log files (output.log and diagnostic.log) by running:"),(0,s.kt)("pre",null,(0,s.kt)("code",{parentName:"pre",className:"language-sh"},"sudo rm -f /var/log/lightning/*.log\n")),(0,s.kt)("p",null,"Launch the service:"),(0,s.kt)("pre",null,(0,s.kt)("code",{parentName:"pre",className:"language-sh"},"systemctl start lightning\n")),(0,s.kt)("p",null,"If you need to delegate to root, then use the ",(0,s.kt)("strong",{parentName:"p"},"sudo")," keyword, as follows:"),(0,s.kt)("pre",null,(0,s.kt)("code",{parentName:"pre",className:"language-sh"},"sudo systemctl start lightning\n")),(0,s.kt)("p",null,"You can watch the log output of the service by running:"),(0,s.kt)("pre",null,(0,s.kt)("code",{parentName:"pre",className:"language-sh"},"tail -f /var/log/lightning/output.log\n")),(0,s.kt)("p",null,"The output should be similar to:"),(0,s.kt)("pre",null,(0,s.kt)("code",{parentName:"pre",className:"language-sh"},"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")),(0,s.kt)("p",null,"Alternatively, you can watch the diagnostic.log"),(0,s.kt)("pre",null,(0,s.kt)("code",{parentName:"pre",className:"language-sh"},"tail -f /var/log/lightning/diagnostic.log\n")),(0,s.kt)(a.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida",mdxType:"Author"}))}g.isMDXComponent=!0},3872:(e,t,n)=>{n.d(t,{Z:()=>s});var r=n(7294);const s=e=>{let{image:t,name:n,title:s,url:a}=e;return r.createElement("section",{className:"author_card"},r.createElement("div",null,r.createElement("span",{className:"avatar"},r.createElement("a",{href:a,target:"_blank",alt:n},r.createElement("img",{src:t,alt:n}))),r.createElement("div",null,r.createElement("span",{className:"name"},r.createElement("a",{href:a,target:"_blank",alt:n},n)),r.createElement("span",{className:"title"},s),r.createElement("span",{className:"discord"},"Got questions? Find us on ",r.createElement("a",{href:"https://discord.gg/fleekxyz",target:"_blank"},"Discord!")))))}}}]); \ No newline at end of file diff --git a/assets/js/b2f554cd.2e81c054.js b/assets/js/b2f554cd.14c9aae2.js similarity index 99% rename from assets/js/b2f554cd.2e81c054.js rename to assets/js/b2f554cd.14c9aae2.js index 7cfdd0d6c..71fb9afca 100644 --- a/assets/js/b2f554cd.2e81c054.js +++ b/assets/js/b2f554cd.14c9aae2.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-09-13T16:19:41.000Z","formattedDate":"September 13, 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.355,"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"]}},"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 \\n[this](https://github.com/sile/scalable_cuckoo_filter) Cuckoo filter implementation in Rust (the [original](https://github.com/efficient/cuckoofilter) implementation is in C++). All experiments\\nwere 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-09-13T16:22:59.000Z","formattedDate":"September 13, 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.355,"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"]}},"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 \\n[this](https://github.com/sile/scalable_cuckoo_filter) Cuckoo filter implementation in Rust (the [original](https://github.com/efficient/cuckoofilter) implementation is in C++). All experiments\\nwere 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.9f0bdb59.js b/assets/js/b35f1b7f.26927af6.js similarity index 99% rename from assets/js/b35f1b7f.9f0bdb59.js rename to assets/js/b35f1b7f.26927af6.js index 3f27d8e62..262f4c4f1 100644 --- a/assets/js/b35f1b7f.9f0bdb59.js +++ b/assets/js/b35f1b7f.26927af6.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[7706],{3905:(e,t,r)=>{r.d(t,{Zo:()=>c,kt:()=>h});var s=r(7294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,s)}return r}function l(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var o=s.createContext({}),u=function(e){var t=s.useContext(o),r=t;return e&&(r="function"==typeof e?e(t):l(l({},t),e)),r},c=function(e){var t=u(e.components);return s.createElement(o.Provider,{value:t},e.children)},p="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return s.createElement(s.Fragment,{},t)}},d=s.forwardRef((function(e,t){var r=e.components,n=e.mdxType,a=e.originalType,o=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),p=u(r),d=n,h=p["".concat(o,".").concat(d)]||p[d]||m[d]||a;return r?s.createElement(h,l(l({ref:t},c),{},{components:r})):s.createElement(h,l({ref:t},c))}));function h(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var a=r.length,l=new Array(a);l[0]=d;var i={};for(var o in t)hasOwnProperty.call(t,o)&&(i[o]=t[o]);i.originalType=e,i[p]="string"==typeof e?e:n,l[1]=i;for(var u=2;u{r.r(t),r.d(t,{assets:()=>u,contentTitle:()=>i,default:()=>d,frontMatter:()=>l,metadata:()=>o,toc:()=>c});var s=r(7462),n=(r(7294),r(3905)),a=r(3872);const l={title:"User service",slug:"user-service",hide_title:!0,tags:["references","help","user service","unit","systemctl","systemd"]},i=void 0,o={unversionedId:"Systemd/user-service",id:"Systemd/user-service",title:"User service",description:"\x3c!--",source:"@site/references/Systemd/user-service.md",sourceDirName:"Systemd",slug:"/Systemd/user-service",permalink:"/references/Systemd/user-service",draft:!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:1694621981,formattedLastUpdatedAt:"Sep 13, 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"}},u={},c=[{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:"Systemd service control as --user",id:"systemd-service-control-as---user",level:2},{value:"Problem statement",id:"problem-statement",level:2}],p={toc:c},m="wrapper";function d(e){let{components:t,...r}=e;return(0,n.kt)(m,(0,s.Z)({},p,r,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("p",null,"A user should have the ability to run a Systemd user service unit without having to use ",(0,n.kt)("inlineCode",{parentName:"p"},"sudo")," to control it."),(0,n.kt)("h2",{id:"check---user-support"},"Check ",(0,n.kt)("inlineCode",{parentName:"h2"},"--user")," support"),(0,n.kt)("p",null,"Use the ",(0,n.kt)("inlineCode",{parentName:"p"},"--user")," flag when getting the list of unit files."),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"systemctl --user list-unit-files\n")),(0,n.kt)("p",null,"It should return a list of unit files."),(0,n.kt)("h2",{id:"put-the-service-unit-in-the-user-service"},"Put the service unit in the user service"),(0,n.kt)("p",null,"Create the Systemd user units directory:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"sudo mkdir -p /etc/systemd/system/user\n")),(0,n.kt)("p",null,"Move the ",(0,n.kt)("inlineCode",{parentName:"p"},"lightning.service")," to the system user unit service directory:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"mv /etc/systemd/system/lightning.service /etc/systemd/system/user/lightning.service\n")),(0,n.kt)("p",null,"Check the ",(0,n.kt)("strong",{parentName:"p"},"Load path when running in user mode (--user)")," in ",(0,n.kt)("a",{parentName:"p",href:"https://www.freedesktop.org/software/systemd/man/systemd.unit.html"},"Systemd unit")," for other alternative user paths, or to understand how it works to customize your server accordingly."),(0,n.kt)("p",null,"##\xa0Reload daemon"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"sudo systemctl daemon-reload\n")),(0,n.kt)("h2",{id:"systemd-service-control-as---user"},"Systemd service control as ",(0,n.kt)("inlineCode",{parentName:"h2"},"--user")),(0,n.kt)("p",null,"Reload the Systemctl daemon by executing the command:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"systemctl --user daemon-reload\n")),(0,n.kt)("p",null,"Enable the service for starting up on system boot:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"systemctl --user enable lightning.service\n")),(0,n.kt)("p",null,"Start the service by:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"systemctl --user start lightning\n")),(0,n.kt)("p",null,"Stop the service by:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"systemctl --user stop lightning\n")),(0,n.kt)("p",null,"Restart the service by:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"systemctl --user restart lightning\n")),(0,n.kt)("p",null,"Check the service status by:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"systemctl --user status lightning.service\n")),(0,n.kt)("h2",{id:"problem-statement"},"Problem statement"),(0,n.kt)("p",null,"On tests done in a DigitalOcean Ubuntu 22.x, we had setup user-level services which were operated with ",(0,n.kt)("inlineCode",{parentName:"p"},"--user"),". When the commands were executed as ",(0,n.kt)("inlineCode",{parentName:"p"},"--user")," it failed with:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"Failed to connect to bus: Operation not permitted (consider using --machine=@.host --user to connect to bus of other user)\n")),(0,n.kt)("p",null,"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:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"systemctl --user list-unit-files\n")),(0,n.kt)("p",null,"We'd get the error:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"Failed to connect to bus: Operation not permitted (consider using --machine=@.host --user to connect to bus of other user)\n")),(0,n.kt)("p",null,"For any of the supported user unit locations e.g. $HOME/.config/systemd/user as documented in ",(0,n.kt)("a",{parentName:"p",href:"https://www.freedesktop.org/software/systemd/man/systemd.unit.html"},"Systemd unit documentation"),", the result is the error above."),(0,n.kt)("p",null,"This is related to the load paths when running in user mode (--user), as described in the discussion ",(0,n.kt)("a",{parentName:"p",href:"https://unix.stackexchange.com/questions/224992/where-do-i-put-my-systemd-unit-file/367237#367237"},"here"),"."),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"User-dependent")),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"$XDG_CONFIG_HOME/systemd/user")," User configuration (only used when $XDG_CONFIG_HOME is set)"),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"$HOME/.config/systemd/user")," User configuration (only used when $XDG_CONFIG_HOME is not set)"),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"$XDG_RUNTIME_DIR/systemd/user")," Runtime units (only used when $XDG_RUNTIME_DIR is set)"),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"$XDG_DATA_HOME/systemd/user")," Units of packages that have been installed in the home directory (only used when $XDG_DATA_HOME is set)"),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"$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)"),(0,n.kt)("p",null,"For example, if we check the ",(0,n.kt)("inlineCode",{parentName:"p"},"$XDG_RUNTIME_DIR")," in a DigitalOcean box, we get the following output:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"/run/user/0\n")),(0,n.kt)("p",null,"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."),(0,n.kt)(a.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida",mdxType:"Author"}))}d.isMDXComponent=!0},3872:(e,t,r)=>{r.d(t,{Z:()=>n});var s=r(7294);const n=e=>{let{image:t,name:r,title:n,url:a}=e;return s.createElement("section",{className:"author_card"},s.createElement("div",null,s.createElement("span",{className:"avatar"},s.createElement("a",{href:a,target:"_blank",alt:r},s.createElement("img",{src:t,alt:r}))),s.createElement("div",null,s.createElement("span",{className:"name"},s.createElement("a",{href:a,target:"_blank",alt:r},r)),s.createElement("span",{className:"title"},n),s.createElement("span",{className:"discord"},"Got questions? Find us on ",s.createElement("a",{href:"https://discord.gg/fleekxyz",target:"_blank"},"Discord!")))))}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[7706],{3905:(e,t,r)=>{r.d(t,{Zo:()=>c,kt:()=>h});var s=r(7294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,s)}return r}function l(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var o=s.createContext({}),u=function(e){var t=s.useContext(o),r=t;return e&&(r="function"==typeof e?e(t):l(l({},t),e)),r},c=function(e){var t=u(e.components);return s.createElement(o.Provider,{value:t},e.children)},p="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return s.createElement(s.Fragment,{},t)}},d=s.forwardRef((function(e,t){var r=e.components,n=e.mdxType,a=e.originalType,o=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),p=u(r),d=n,h=p["".concat(o,".").concat(d)]||p[d]||m[d]||a;return r?s.createElement(h,l(l({ref:t},c),{},{components:r})):s.createElement(h,l({ref:t},c))}));function h(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var a=r.length,l=new Array(a);l[0]=d;var i={};for(var o in t)hasOwnProperty.call(t,o)&&(i[o]=t[o]);i.originalType=e,i[p]="string"==typeof e?e:n,l[1]=i;for(var u=2;u{r.r(t),r.d(t,{assets:()=>u,contentTitle:()=>i,default:()=>d,frontMatter:()=>l,metadata:()=>o,toc:()=>c});var s=r(7462),n=(r(7294),r(3905)),a=r(3872);const l={title:"User service",slug:"user-service",hide_title:!0,tags:["references","help","user service","unit","systemctl","systemd"]},i=void 0,o={unversionedId:"Systemd/user-service",id:"Systemd/user-service",title:"User service",description:"\x3c!--",source:"@site/references/Systemd/user-service.md",sourceDirName:"Systemd",slug:"/Systemd/user-service",permalink:"/references/Systemd/user-service",draft:!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:1694622179,formattedLastUpdatedAt:"Sep 13, 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"}},u={},c=[{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:"Systemd service control as --user",id:"systemd-service-control-as---user",level:2},{value:"Problem statement",id:"problem-statement",level:2}],p={toc:c},m="wrapper";function d(e){let{components:t,...r}=e;return(0,n.kt)(m,(0,s.Z)({},p,r,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("p",null,"A user should have the ability to run a Systemd user service unit without having to use ",(0,n.kt)("inlineCode",{parentName:"p"},"sudo")," to control it."),(0,n.kt)("h2",{id:"check---user-support"},"Check ",(0,n.kt)("inlineCode",{parentName:"h2"},"--user")," support"),(0,n.kt)("p",null,"Use the ",(0,n.kt)("inlineCode",{parentName:"p"},"--user")," flag when getting the list of unit files."),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"systemctl --user list-unit-files\n")),(0,n.kt)("p",null,"It should return a list of unit files."),(0,n.kt)("h2",{id:"put-the-service-unit-in-the-user-service"},"Put the service unit in the user service"),(0,n.kt)("p",null,"Create the Systemd user units directory:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"sudo mkdir -p /etc/systemd/system/user\n")),(0,n.kt)("p",null,"Move the ",(0,n.kt)("inlineCode",{parentName:"p"},"lightning.service")," to the system user unit service directory:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"mv /etc/systemd/system/lightning.service /etc/systemd/system/user/lightning.service\n")),(0,n.kt)("p",null,"Check the ",(0,n.kt)("strong",{parentName:"p"},"Load path when running in user mode (--user)")," in ",(0,n.kt)("a",{parentName:"p",href:"https://www.freedesktop.org/software/systemd/man/systemd.unit.html"},"Systemd unit")," for other alternative user paths, or to understand how it works to customize your server accordingly."),(0,n.kt)("p",null,"##\xa0Reload daemon"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"sudo systemctl daemon-reload\n")),(0,n.kt)("h2",{id:"systemd-service-control-as---user"},"Systemd service control as ",(0,n.kt)("inlineCode",{parentName:"h2"},"--user")),(0,n.kt)("p",null,"Reload the Systemctl daemon by executing the command:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"systemctl --user daemon-reload\n")),(0,n.kt)("p",null,"Enable the service for starting up on system boot:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"systemctl --user enable lightning.service\n")),(0,n.kt)("p",null,"Start the service by:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"systemctl --user start lightning\n")),(0,n.kt)("p",null,"Stop the service by:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"systemctl --user stop lightning\n")),(0,n.kt)("p",null,"Restart the service by:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"systemctl --user restart lightning\n")),(0,n.kt)("p",null,"Check the service status by:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"systemctl --user status lightning.service\n")),(0,n.kt)("h2",{id:"problem-statement"},"Problem statement"),(0,n.kt)("p",null,"On tests done in a DigitalOcean Ubuntu 22.x, we had setup user-level services which were operated with ",(0,n.kt)("inlineCode",{parentName:"p"},"--user"),". When the commands were executed as ",(0,n.kt)("inlineCode",{parentName:"p"},"--user")," it failed with:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"Failed to connect to bus: Operation not permitted (consider using --machine=@.host --user to connect to bus of other user)\n")),(0,n.kt)("p",null,"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:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"systemctl --user list-unit-files\n")),(0,n.kt)("p",null,"We'd get the error:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"Failed to connect to bus: Operation not permitted (consider using --machine=@.host --user to connect to bus of other user)\n")),(0,n.kt)("p",null,"For any of the supported user unit locations e.g. $HOME/.config/systemd/user as documented in ",(0,n.kt)("a",{parentName:"p",href:"https://www.freedesktop.org/software/systemd/man/systemd.unit.html"},"Systemd unit documentation"),", the result is the error above."),(0,n.kt)("p",null,"This is related to the load paths when running in user mode (--user), as described in the discussion ",(0,n.kt)("a",{parentName:"p",href:"https://unix.stackexchange.com/questions/224992/where-do-i-put-my-systemd-unit-file/367237#367237"},"here"),"."),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"User-dependent")),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"$XDG_CONFIG_HOME/systemd/user")," User configuration (only used when $XDG_CONFIG_HOME is set)"),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"$HOME/.config/systemd/user")," User configuration (only used when $XDG_CONFIG_HOME is not set)"),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"$XDG_RUNTIME_DIR/systemd/user")," Runtime units (only used when $XDG_RUNTIME_DIR is set)"),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"$XDG_DATA_HOME/systemd/user")," Units of packages that have been installed in the home directory (only used when $XDG_DATA_HOME is set)"),(0,n.kt)("p",null,(0,n.kt)("strong",{parentName:"p"},"$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)"),(0,n.kt)("p",null,"For example, if we check the ",(0,n.kt)("inlineCode",{parentName:"p"},"$XDG_RUNTIME_DIR")," in a DigitalOcean box, we get the following output:"),(0,n.kt)("pre",null,(0,n.kt)("code",{parentName:"pre",className:"language-sh"},"/run/user/0\n")),(0,n.kt)("p",null,"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."),(0,n.kt)(a.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida",mdxType:"Author"}))}d.isMDXComponent=!0},3872:(e,t,r)=>{r.d(t,{Z:()=>n});var s=r(7294);const n=e=>{let{image:t,name:r,title:n,url:a}=e;return s.createElement("section",{className:"author_card"},s.createElement("div",null,s.createElement("span",{className:"avatar"},s.createElement("a",{href:a,target:"_blank",alt:r},s.createElement("img",{src:t,alt:r}))),s.createElement("div",null,s.createElement("span",{className:"name"},s.createElement("a",{href:a,target:"_blank",alt:r},r)),s.createElement("span",{className:"title"},n),s.createElement("span",{className:"discord"},"Got questions? Find us on ",s.createElement("a",{href:"https://discord.gg/fleekxyz",target:"_blank"},"Discord!")))))}}}]); \ No newline at end of file diff --git a/assets/js/d1b78a4d.6f8ce6ef.js b/assets/js/d1b78a4d.b2d10f66.js similarity index 98% rename from assets/js/d1b78a4d.6f8ce6ef.js rename to assets/js/d1b78a4d.b2d10f66.js index 23a4d8c29..f0e9f1d03 100644 --- a/assets/js/d1b78a4d.6f8ce6ef.js +++ b/assets/js/d1b78a4d.b2d10f66.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[3023],{3905:(e,t,r)=>{r.d(t,{Zo:()=>m,kt:()=>f});var o=r(7294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function a(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var c=o.createContext({}),s=function(e){var t=o.useContext(c),r=t;return e&&(r="function"==typeof e?e(t):a(a({},t),e)),r},m=function(e){var t=s(e.components);return o.createElement(c.Provider,{value:t},e.children)},u="mdxType",g={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},p=o.forwardRef((function(e,t){var r=e.components,n=e.mdxType,i=e.originalType,c=e.parentName,m=l(e,["components","mdxType","originalType","parentName"]),u=s(r),p=n,f=u["".concat(c,".").concat(p)]||u[p]||g[p]||i;return r?o.createElement(f,a(a({ref:t},m),{},{components:r})):o.createElement(f,a({ref:t},m))}));function f(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var i=r.length,a=new Array(i);a[0]=p;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l[u]="string"==typeof e?e:n,a[1]=l;for(var s=2;s{r.r(t),r.d(t,{assets:()=>c,contentTitle:()=>a,default:()=>g,frontMatter:()=>i,metadata:()=>l,toc:()=>s});var o=r(7462),n=(r(7294),r(3905));const i={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,l={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-09-13T16:19:41.000Z",formattedDate:"September 13, 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.355,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"]}},c={image:r(4221).Z,authorsImageUrls:[void 0]},s=[],m={toc:s},u="wrapper";function g(e){let{components:t,...r}=e;return(0,n.kt)(u,(0,o.Z)({},m,r,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("p",null,"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."))}g.isMDXComponent=!0},4221:(e,t,r)=>{r.d(t,{Z:()=>o});const o=r.p+"assets/images/bloom-79da0db687b4fb2060758838b9c44513.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[3023],{3905:(e,t,r)=>{r.d(t,{Zo:()=>m,kt:()=>f});var o=r(7294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function a(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var c=o.createContext({}),s=function(e){var t=o.useContext(c),r=t;return e&&(r="function"==typeof e?e(t):a(a({},t),e)),r},m=function(e){var t=s(e.components);return o.createElement(c.Provider,{value:t},e.children)},u="mdxType",g={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},p=o.forwardRef((function(e,t){var r=e.components,n=e.mdxType,i=e.originalType,c=e.parentName,m=l(e,["components","mdxType","originalType","parentName"]),u=s(r),p=n,f=u["".concat(c,".").concat(p)]||u[p]||g[p]||i;return r?o.createElement(f,a(a({ref:t},m),{},{components:r})):o.createElement(f,a({ref:t},m))}));function f(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var i=r.length,a=new Array(i);a[0]=p;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l[u]="string"==typeof e?e:n,a[1]=l;for(var s=2;s{r.r(t),r.d(t,{assets:()=>c,contentTitle:()=>a,default:()=>g,frontMatter:()=>i,metadata:()=>l,toc:()=>s});var o=r(7462),n=(r(7294),r(3905));const i={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,l={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-09-13T16:22:59.000Z",formattedDate:"September 13, 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.355,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"]}},c={image:r(4221).Z,authorsImageUrls:[void 0]},s=[],m={toc:s},u="wrapper";function g(e){let{components:t,...r}=e;return(0,n.kt)(u,(0,o.Z)({},m,r,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("p",null,"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."))}g.isMDXComponent=!0},4221:(e,t,r)=>{r.d(t,{Z:()=>o});const o=r.p+"assets/images/bloom-79da0db687b4fb2060758838b9c44513.png"}}]); \ No newline at end of file diff --git a/assets/js/d7d81bf6.7c8121fa.js b/assets/js/d7d81bf6.573b7c91.js similarity index 99% rename from assets/js/d7d81bf6.7c8121fa.js rename to assets/js/d7d81bf6.573b7c91.js index a44fddb98..9c0209069 100644 --- a/assets/js/d7d81bf6.7c8121fa.js +++ b/assets/js/d7d81bf6.573b7c91.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[2918],{3905:(e,n,t)=>{t.d(n,{Zo:()=>u,kt:()=>f});var r=t(7294);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function l(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var s=r.createContext({}),c=function(e){var n=r.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):l(l({},n),e)),t},u=function(e){var n=c(e.components);return r.createElement(s.Provider,{value:n},e.children)},p="mdxType",g={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},d=r.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,u=o(e,["components","mdxType","originalType","parentName"]),p=c(t),d=a,f=p["".concat(s,".").concat(d)]||p[d]||g[d]||i;return t?r.createElement(f,l(l({ref:n},u),{},{components:t})):r.createElement(f,l({ref:n},u))}));function f(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,l=new Array(i);l[0]=d;var o={};for(var s in n)hasOwnProperty.call(n,s)&&(o[s]=n[s]);o.originalType=e,o[p]="string"==typeof e?e:a,l[1]=o;for(var c=2;c{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>l,default:()=>g,frontMatter:()=>i,metadata:()=>o,toc:()=>c});var r=t(7462),a=(t(7294),t(3905));const i={title:"Error building on ARM64",slug:"error-building-on-arm64",hide_title:!0,tags:["references","help","fix"]},l=void 0,o={unversionedId:"Lightning CLI/error-building-on-arm64",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,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:1694621981,formattedLastUpdatedAt:"Sep 13, 2023",frontMatter:{title:"Error building on ARM64",slug:"error-building-on-arm64",hide_title:!0,tags:["references","help","fix"]},sidebar:"defaultSidebar",previous:{title:"About references",permalink:"/references/"},next:{title:"Error linking with cc",permalink:"/references/Lightning CLI/error-linking-with-cc-failed-exist-status-1"}},s={},c=[{value:"Building on the ARM64 (aarch64)",id:"building-on-the-arm64-aarch64",level:2}],u={toc:c},p="wrapper";function g(e){let{components:n,...t}=e;return(0,a.kt)(p,(0,r.Z)({},u,t,{components:n,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"building-on-the-arm64-aarch64"},"Building on the ARM64 (aarch64)"),(0,a.kt)("p",null,"ARM64 platform has its own specifics, and currently consists of requiring ",(0,a.kt)("inlineCode",{parentName:"p"},"gcc"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"sudo apt install gcc\n")),(0,a.kt)("p",null,"On cargo build, the error ",(0,a.kt)("inlineCode",{parentName:"p"},"error: linking with "),"cc",(0,a.kt)("inlineCode",{parentName:"p"}," failed: exit status: 1")," occurs, as demonstrated in the output below:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"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")),(0,a.kt)("p",null,"As a result of the ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/ryssroad/fleek-aarch64-build"},"research")," by the community member ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/ryssroad"},"ryssroad"),", the following solution was shared."),(0,a.kt)("p",null,"Open the ",(0,a.kt)("inlineCode",{parentName:"p"},"cargo.toml")," file in ",(0,a.kt)("inlineCode",{parentName:"p"},"~/fleek-network/lightning/Cargo.toml")," and find the ",(0,a.kt)("inlineCode",{parentName:"p"},"lto")," key."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"lto = true\n")),(0,a.kt)("p",null,"Change the ",(0,a.kt)("inlineCode",{parentName:"p"},"lto")," key value from ",(0,a.kt)("inlineCode",{parentName:"p"},"true")," to ",(0,a.kt)("inlineCode",{parentName:"p"},"thin"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},'...\n[profile.release]\n# currently enabled, may increase build time, but runtime faster, can set to `"thin"`.\nlto = "thin"\n')),(0,a.kt)("p",null,"Set ",(0,a.kt)("inlineCode",{parentName:"p"},"RUSTFLAGS")," on build, as follows:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},'RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition" cargo +stable build --release \n')),(0,a.kt)("p",null,"Once the build completes, you should find the generated binary ",(0,a.kt)("inlineCode",{parentName:"p"},"lightning-node")," under the directory ",(0,a.kt)("inlineCode",{parentName:"p"},"~/fleek-network/lightning/target/release/lightning-node"),"."),(0,a.kt)("p",null,"As an example, execute:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"~/fleek-network/lightning/target/release/lightning-node help\n")),(0,a.kt)("p",null,"To find the help output:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"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")))}g.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[2918],{3905:(e,n,t)=>{t.d(n,{Zo:()=>u,kt:()=>f});var r=t(7294);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function l(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var s=r.createContext({}),c=function(e){var n=r.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):l(l({},n),e)),t},u=function(e){var n=c(e.components);return r.createElement(s.Provider,{value:n},e.children)},p="mdxType",g={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},d=r.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,u=o(e,["components","mdxType","originalType","parentName"]),p=c(t),d=a,f=p["".concat(s,".").concat(d)]||p[d]||g[d]||i;return t?r.createElement(f,l(l({ref:n},u),{},{components:t})):r.createElement(f,l({ref:n},u))}));function f(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,l=new Array(i);l[0]=d;var o={};for(var s in n)hasOwnProperty.call(n,s)&&(o[s]=n[s]);o.originalType=e,o[p]="string"==typeof e?e:a,l[1]=o;for(var c=2;c{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>l,default:()=>g,frontMatter:()=>i,metadata:()=>o,toc:()=>c});var r=t(7462),a=(t(7294),t(3905));const i={title:"Error building on ARM64",slug:"error-building-on-arm64",hide_title:!0,tags:["references","help","fix"]},l=void 0,o={unversionedId:"Lightning CLI/error-building-on-arm64",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,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:1694622179,formattedLastUpdatedAt:"Sep 13, 2023",frontMatter:{title:"Error building on ARM64",slug:"error-building-on-arm64",hide_title:!0,tags:["references","help","fix"]},sidebar:"defaultSidebar",previous:{title:"About references",permalink:"/references/"},next:{title:"Error linking with cc",permalink:"/references/Lightning CLI/error-linking-with-cc-failed-exist-status-1"}},s={},c=[{value:"Building on the ARM64 (aarch64)",id:"building-on-the-arm64-aarch64",level:2}],u={toc:c},p="wrapper";function g(e){let{components:n,...t}=e;return(0,a.kt)(p,(0,r.Z)({},u,t,{components:n,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"building-on-the-arm64-aarch64"},"Building on the ARM64 (aarch64)"),(0,a.kt)("p",null,"ARM64 platform has its own specifics, and currently consists of requiring ",(0,a.kt)("inlineCode",{parentName:"p"},"gcc"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"sudo apt install gcc\n")),(0,a.kt)("p",null,"On cargo build, the error ",(0,a.kt)("inlineCode",{parentName:"p"},"error: linking with "),"cc",(0,a.kt)("inlineCode",{parentName:"p"}," failed: exit status: 1")," occurs, as demonstrated in the output below:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"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")),(0,a.kt)("p",null,"As a result of the ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/ryssroad/fleek-aarch64-build"},"research")," by the community member ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/ryssroad"},"ryssroad"),", the following solution was shared."),(0,a.kt)("p",null,"Open the ",(0,a.kt)("inlineCode",{parentName:"p"},"cargo.toml")," file in ",(0,a.kt)("inlineCode",{parentName:"p"},"~/fleek-network/lightning/Cargo.toml")," and find the ",(0,a.kt)("inlineCode",{parentName:"p"},"lto")," key."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"lto = true\n")),(0,a.kt)("p",null,"Change the ",(0,a.kt)("inlineCode",{parentName:"p"},"lto")," key value from ",(0,a.kt)("inlineCode",{parentName:"p"},"true")," to ",(0,a.kt)("inlineCode",{parentName:"p"},"thin"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},'...\n[profile.release]\n# currently enabled, may increase build time, but runtime faster, can set to `"thin"`.\nlto = "thin"\n')),(0,a.kt)("p",null,"Set ",(0,a.kt)("inlineCode",{parentName:"p"},"RUSTFLAGS")," on build, as follows:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},'RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition" cargo +stable build --release \n')),(0,a.kt)("p",null,"Once the build completes, you should find the generated binary ",(0,a.kt)("inlineCode",{parentName:"p"},"lightning-node")," under the directory ",(0,a.kt)("inlineCode",{parentName:"p"},"~/fleek-network/lightning/target/release/lightning-node"),"."),(0,a.kt)("p",null,"As an example, execute:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"~/fleek-network/lightning/target/release/lightning-node help\n")),(0,a.kt)("p",null,"To find the help output:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-sh"},"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")))}g.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/d8be0e5a.46d824d6.js b/assets/js/d8be0e5a.eba8e2d5.js similarity index 53% rename from assets/js/d8be0e5a.46d824d6.js rename to assets/js/d8be0e5a.eba8e2d5.js index 46ddbee30..c67a16b07 100644 --- a/assets/js/d8be0e5a.46d824d6.js +++ b/assets/js/d8be0e5a.eba8e2d5.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[1706],{3905:(e,t,r)=>{r.d(t,{Zo:()=>p,kt:()=>f});var n=r(7294);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var s=n.createContext({}),c=function(e){var t=n.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):l(l({},t),e)),r},p=function(e){var t=c(e.components);return n.createElement(s.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},h=n.forwardRef((function(e,t){var r=e.components,i=e.mdxType,a=e.originalType,s=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),u=c(r),h=i,f=u["".concat(s,".").concat(h)]||u[h]||d[h]||a;return r?n.createElement(f,l(l({ref:t},p),{},{components:r})):n.createElement(f,l({ref:t},p))}));function f(e,t){var r=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=r.length,l=new Array(a);l[0]=h;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[u]="string"==typeof e?e:i,l[1]=o;for(var c=2;c{r.r(t),r.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>s,toc:()=>p});var n=r(7462),i=(r(7294),r(3905)),a=r(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"]},o=void 0,s={unversionedId:"Lightning CLI/error-linking-with-cc-failed",id:"Lightning CLI/error-linking-with-cc-failed",title:"Error linking with cc",description:"\x3c!--",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,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:1694621981,formattedLastUpdatedAt:"Sep 13, 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"}},c={},p=[{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}],u={toc:p},d="wrapper";function h(e){let{components:t,...r}=e;return(0,i.kt)(d,(0,n.Z)({},u,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h2",{id:"check-if-cpu-is-supported"},"Check if CPU is supported"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-sh"},"uname -i\n")),(0,i.kt)("admonition",{title:"WARNING",type:"caution"},(0,i.kt)("p",{parentName:"admonition"},"Given the ",(0,i.kt)("a",{parentName:"p",href:"https://docs.fleek.network/docs/node/requirements/#specs"},"CPU requirements"),", currently we're mainly supporting ",(0,i.kt)("inlineCode",{parentName:"p"},"GenuineIntel")," and there have been reports of failure to build the binary on ",(0,i.kt)("inlineCode",{parentName:"p"},"AMD"),". The `ARM64`` is a different architecture, thus not supported, but there has been some community contributions in that regard, find it ",(0,i.kt)("a",{parentName:"p",href:"/references/Lightning%20CLI/error-building-on-arm64"},"here"),"."),(0,i.kt)("p",{parentName:"admonition"},"Any contribution or feedback to provide support is appreciated. Feel free to let us know on our ",(0,i.kt)("a",{parentName:"p",href:"https://discord.gg/fleekxyz"},"Discord channel"),".")),(0,i.kt)("h2",{id:"linking-with-cc-error"},"Linking with cc error"),(0,i.kt)("p",null,"A user who finds the error ",(0,i.kt)("inlineCode",{parentName:"p"},"linking with cc failed"),", will have to install the required dependencies."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-sh"},"error: linking with `cc` failed: exit status: 1\nerror: could not compile `fleek-service-ping-example` (lib) due to previous error\n")),(0,i.kt)("h2",{id:"update"},"Update"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-sh"},"sudo apt-get update\n")),(0,i.kt)("h2",{id:"install-gcc"},"Install ",(0,i.kt)("inlineCode",{parentName:"h2"},"gcc"),":"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-sh"},"sudo apt-get install gcc\n")),(0,i.kt)("h2",{id:"remove-previous-installation-files"},"Remove previous installation files"),(0,i.kt)("p",null,"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,i.kt)("a",{parentName:"p",href:"/references/Lightning%20CLI/uninstall-lightning-cli"},"reference"),"."),(0,i.kt)("h2",{id:"run-the-installation-script"},"Run the installation script"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-sh"},"curl https://get.fleek.network | bash\n")),(0,i.kt)("p",null,"Alternatively, read the ",(0,i.kt)("a",{parentName:"p",href:"/docs/node/install#manual-installation"},"manual installation instructions")," for more information."),(0,i.kt)(a.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida",mdxType:"Author"}))}h.isMDXComponent=!0},3872:(e,t,r)=>{r.d(t,{Z:()=>i});var n=r(7294);const i=e=>{let{image:t,name:r,title:i,url:a}=e;return n.createElement("section",{className:"author_card"},n.createElement("div",null,n.createElement("span",{className:"avatar"},n.createElement("a",{href:a,target:"_blank",alt:r},n.createElement("img",{src:t,alt:r}))),n.createElement("div",null,n.createElement("span",{className:"name"},n.createElement("a",{href:a,target:"_blank",alt:r},r)),n.createElement("span",{className:"title"},i),n.createElement("span",{className:"discord"},"Got questions? Find us on ",n.createElement("a",{href:"https://discord.gg/fleekxyz",target:"_blank"},"Discord!")))))}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[1706],{3905:(e,t,r)=>{r.d(t,{Zo:()=>p,kt:()=>h});var n=r(7294);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var s=n.createContext({}),c=function(e){var t=n.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):l(l({},t),e)),r},p=function(e){var t=c(e.components);return n.createElement(s.Provider,{value:t},e.children)},u="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},f=n.forwardRef((function(e,t){var r=e.components,i=e.mdxType,a=e.originalType,s=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),u=c(r),f=i,h=u["".concat(s,".").concat(f)]||u[f]||d[f]||a;return r?n.createElement(h,l(l({ref:t},p),{},{components:r})):n.createElement(h,l({ref:t},p))}));function h(e,t){var r=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=r.length,l=new Array(a);l[0]=f;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[u]="string"==typeof e?e:i,l[1]=o;for(var c=2;c{r.r(t),r.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>f,frontMatter:()=>l,metadata:()=>s,toc:()=>p});var n=r(7462),i=(r(7294),r(3905)),a=r(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"]},o=void 0,s={unversionedId:"Lightning CLI/error-linking-with-cc-failed",id:"Lightning CLI/error-linking-with-cc-failed",title:"Error linking with cc",description:"\x3c!--",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,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:1694622179,formattedLastUpdatedAt:"Sep 13, 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"}},c={},p=[{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}],u={toc:p},d="wrapper";function f(e){let{components:t,...r}=e;return(0,i.kt)(d,(0,n.Z)({},u,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h2",{id:"check-if-cpu-is-supported"},"Check if CPU is supported"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-sh"},"uname -i\n")),(0,i.kt)("admonition",{title:"WARNING",type:"caution"},(0,i.kt)("p",{parentName:"admonition"},"Given the ",(0,i.kt)("a",{parentName:"p",href:"https://docs.fleek.network/docs/node/requirements/#specs"},"CPU requirements"),", currently we're mainly supporting ",(0,i.kt)("inlineCode",{parentName:"p"},"GenuineIntel")," and there have been reports of failure to build the binary on ",(0,i.kt)("inlineCode",{parentName:"p"},"AMD"),". The ",(0,i.kt)("inlineCode",{parentName:"p"},"ARM64")," is a different architecture, thus not supported, but there has been some community contributions in that regard, find it in the reference ",(0,i.kt)("a",{parentName:"p",href:"/references/Lightning%20CLI/error-building-on-arm64"},"error building on ARM64"),"."),(0,i.kt)("p",{parentName:"admonition"},"Any contribution or feedback to provide support is appreciated. Feel free to let us know on our ",(0,i.kt)("a",{parentName:"p",href:"https://discord.gg/fleekxyz"},"Discord channel"),".")),(0,i.kt)("h2",{id:"linking-with-cc-error"},"Linking with cc error"),(0,i.kt)("p",null,"A user who finds the error ",(0,i.kt)("inlineCode",{parentName:"p"},"linking with cc failed"),", will have to install the required dependencies."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-sh"},"error: linking with `cc` failed: exit status: 1\nerror: could not compile `fleek-service-ping-example` (lib) due to previous error\n")),(0,i.kt)("h2",{id:"update"},"Update"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-sh"},"sudo apt-get update\n")),(0,i.kt)("h2",{id:"install-gcc"},"Install ",(0,i.kt)("inlineCode",{parentName:"h2"},"gcc"),":"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-sh"},"sudo apt-get install gcc\n")),(0,i.kt)("h2",{id:"remove-previous-installation-files"},"Remove previous installation files"),(0,i.kt)("p",null,"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,i.kt)("a",{parentName:"p",href:"/references/Lightning%20CLI/uninstall-lightning-cli"},"reference"),"."),(0,i.kt)("h2",{id:"run-the-installation-script"},"Run the installation script"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-sh"},"curl https://get.fleek.network | bash\n")),(0,i.kt)("p",null,"Alternatively, read the ",(0,i.kt)("a",{parentName:"p",href:"/docs/node/install#manual-installation"},"manual installation instructions")," for more information."),(0,i.kt)(a.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida",mdxType:"Author"}))}f.isMDXComponent=!0},3872:(e,t,r)=>{r.d(t,{Z:()=>i});var n=r(7294);const i=e=>{let{image:t,name:r,title:i,url:a}=e;return n.createElement("section",{className:"author_card"},n.createElement("div",null,n.createElement("span",{className:"avatar"},n.createElement("a",{href:a,target:"_blank",alt:r},n.createElement("img",{src:t,alt:r}))),n.createElement("div",null,n.createElement("span",{className:"name"},n.createElement("a",{href:a,target:"_blank",alt:r},r)),n.createElement("span",{className:"title"},i),n.createElement("span",{className:"discord"},"Got questions? Find us on ",n.createElement("a",{href:"https://discord.gg/fleekxyz",target:"_blank"},"Discord!")))))}}}]); \ No newline at end of file diff --git a/assets/js/e1f64676.07efbc58.js b/assets/js/e1f64676.b8205fc9.js similarity index 99% rename from assets/js/e1f64676.07efbc58.js rename to assets/js/e1f64676.b8205fc9.js index e88374362..421f21a16 100644 --- a/assets/js/e1f64676.07efbc58.js +++ b/assets/js/e1f64676.b8205fc9.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[3120],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>d});var r=n(7294);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(l[n]=e[n]);return l}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}var s=r.createContext({}),c=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=c(e.components);return r.createElement(s.Provider,{value:t},e.children)},m="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},g=r.forwardRef((function(e,t){var n=e.components,l=e.mdxType,a=e.originalType,s=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),m=c(n),g=l,d=m["".concat(s,".").concat(g)]||m[g]||u[g]||a;return n?r.createElement(d,i(i({ref:t},p),{},{components:n})):r.createElement(d,i({ref:t},p))}));function d(e,t){var n=arguments,l=t&&t.mdxType;if("string"==typeof e||l){var a=n.length,i=new Array(a);i[0]=g;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[m]="string"==typeof e?e:l,i[1]=o;for(var c=2;c{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>g,frontMatter:()=>i,metadata:()=>s,toc:()=>p});var r=n(7462),l=(n(7294),n(3905)),a=n(3872);const i={title:"Uninstall Lightning CLI",slug:"uninstall-lightning-cli",hide_title:!0,tags:["References","Help","Uninstall","Remove","Delete","Clear","Clean"]},o=void 0,s={unversionedId:"Lightning CLI/uninstall-lightning-cli",id:"Lightning CLI/uninstall-lightning-cli",title:"Uninstall Lightning CLI",description:"\x3c!--",source:"@site/references/Lightning CLI/uninstall-lightning-cli.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/uninstall-lightning-cli",permalink:"/references/Lightning CLI/uninstall-lightning-cli",draft:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/uninstall-lightning-cli.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:1694621981,formattedLastUpdatedAt:"Sep 13, 2023",frontMatter:{title:"Uninstall Lightning CLI",slug:"uninstall-lightning-cli",hide_title:!0,tags:["References","Help","Uninstall","Remove","Delete","Clear","Clean"]},sidebar:"defaultSidebar",previous:{title:"Permission denied (os error 13)",permalink:"/references/Lightning CLI/permission-denied-os-error-13"},next:{title:"Update CLI from source code",permalink:"/references/Lightning CLI/update-cli-from-source-code"}},c={},p=[{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}],m={toc:p},u="wrapper";function g(e){let{components:t,...n}=e;return(0,l.kt)(u,(0,r.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,l.kt)("h2",{id:"remove-symlink"},"Remove symLink"),(0,l.kt)("p",null,"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,l.kt)("inlineCode",{parentName:"p"},"unlink"),":"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-sh"},"unlink /usr/local/bin/lgtn\n")),(0,l.kt)("h2",{id:"delete-the-local-source-code"},"Delete the local source code"),(0,l.kt)("p",null,"Delete the local source code which was copied from the remote ",(0,l.kt)("a",{parentName:"p",href:"https://github.com/fleek-network/lightning"},"repository"),". You can delete it recursively by:"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-sh"},"rm -r ~/fleek-network/lightning\n")),(0,l.kt)("p",null,"\ud83d\udca1 Use the flag ",(0,l.kt)("inlineCode",{parentName:"p"},"f")," to force remove by skipping any prompts, e.g. ",(0,l.kt)("inlineCode",{parentName:"p"},"rm -rf ")),(0,l.kt)("admonition",{type:"note"},(0,l.kt)("p",{parentName:"admonition"},"The default install location is ",(0,l.kt)("inlineCode",{parentName:"p"},"$HOME/fleek-network/lightning"),". If you have selected a different location to store the repository, change the target path.")),(0,l.kt)("h2",{id:"disable-the-systemd-service"},"Disable the systemd service"),(0,l.kt)("p",null,"To disable the Fleek Network Lightning Systemd's service, start by stopping the service."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-sh"},"sudo systemctl stop lightning.service\n")),(0,l.kt)("admonition",{type:"tip"},(0,l.kt)("p",{parentName:"admonition"},"You can replace ",(0,l.kt)("inlineCode",{parentName:"p"},"lightning.service")," by ",(0,l.kt)("inlineCode",{parentName:"p"},"lightning"),".")),(0,l.kt)("p",null,"Disable the lightning service"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-sh"},"sudo systemctl disable lightning.service\n")),(0,l.kt)("p",null,"If you have used the recommended procedures in the ",(0,l.kt)("a",{parentName:"p",href:"/docs/node/install"},"install")," documentation you'll have to remove the Systemd unit (file that defines the service)."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-sh"},"rm /etc/systemd/system/lightning.service\n")),(0,l.kt)("p",null,"Reload the Systemd service daemon"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-sh"},"sudo systemctl daemon-reload\n")),(0,l.kt)("h2",{id:"clear-the-lightning-config-directory"},"Clear the lightning config directory"),(0,l.kt)("p",null,"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."),(0,l.kt)("admonition",{title:"WARNING",type:"caution"},(0,l.kt)("p",{parentName:"admonition"},"Make sure to backup 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.")),(0,l.kt)("p",null,"Alternatively, instead of deleting you can move the files to a custom directory name such as",(0,l.kt)("inlineCode",{parentName:"p"},".lightning.backupDATESTAMP"),", e.g. the example below we've used the date ",(0,l.kt)("inlineCode",{parentName:"p"},"2023-09-06-1205")," as that was the time this text was written:"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-sh"},"mv ~/.lightning ~/.lightning.backup202309061205\n")),(0,l.kt)("p",null,"To clear the lightning config directory remove any files recursively by running the following command:"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-sh"},"rm -r ~/.lightning/*\n")),(0,l.kt)("p",null,"\ud83d\udca1 Use the flag ",(0,l.kt)("inlineCode",{parentName:"p"},"f")," to force remove by skipping any prompts, e.g. ",(0,l.kt)("inlineCode",{parentName:"p"},"rm -rf /*")),(0,l.kt)("p",null,"Alternatively, delete the ",(0,l.kt)("inlineCode",{parentName:"p"},"~/.lightning")," directory:"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-sh"},"rm -r ~/.lightning\n")),(0,l.kt)("h2",{id:"uninstall-cargo-and-rust"},"Uninstall Cargo and Rust"),(0,l.kt)("p",null,"To uninstall rustc, rustup and cargo run the following command:"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-sh"},"rustup self uninstall\n")),(0,l.kt)(a.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida",mdxType:"Author"}))}g.isMDXComponent=!0},3872:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(7294);const l=e=>{let{image:t,name:n,title:l,url:a}=e;return r.createElement("section",{className:"author_card"},r.createElement("div",null,r.createElement("span",{className:"avatar"},r.createElement("a",{href:a,target:"_blank",alt:n},r.createElement("img",{src:t,alt:n}))),r.createElement("div",null,r.createElement("span",{className:"name"},r.createElement("a",{href:a,target:"_blank",alt:n},n)),r.createElement("span",{className:"title"},l),r.createElement("span",{className:"discord"},"Got questions? Find us on ",r.createElement("a",{href:"https://discord.gg/fleekxyz",target:"_blank"},"Discord!")))))}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[3120],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>d});var r=n(7294);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(l[n]=e[n]);return l}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}var s=r.createContext({}),c=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=c(e.components);return r.createElement(s.Provider,{value:t},e.children)},m="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},g=r.forwardRef((function(e,t){var n=e.components,l=e.mdxType,a=e.originalType,s=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),m=c(n),g=l,d=m["".concat(s,".").concat(g)]||m[g]||u[g]||a;return n?r.createElement(d,i(i({ref:t},p),{},{components:n})):r.createElement(d,i({ref:t},p))}));function d(e,t){var n=arguments,l=t&&t.mdxType;if("string"==typeof e||l){var a=n.length,i=new Array(a);i[0]=g;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[m]="string"==typeof e?e:l,i[1]=o;for(var c=2;c{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>o,default:()=>g,frontMatter:()=>i,metadata:()=>s,toc:()=>p});var r=n(7462),l=(n(7294),n(3905)),a=n(3872);const i={title:"Uninstall Lightning CLI",slug:"uninstall-lightning-cli",hide_title:!0,tags:["References","Help","Uninstall","Remove","Delete","Clear","Clean"]},o=void 0,s={unversionedId:"Lightning CLI/uninstall-lightning-cli",id:"Lightning CLI/uninstall-lightning-cli",title:"Uninstall Lightning CLI",description:"\x3c!--",source:"@site/references/Lightning CLI/uninstall-lightning-cli.md",sourceDirName:"Lightning CLI",slug:"/Lightning CLI/uninstall-lightning-cli",permalink:"/references/Lightning CLI/uninstall-lightning-cli",draft:!1,editUrl:"https://github.com/fleek-network/fleek-network-docs/edit/main/references/Lightning CLI/uninstall-lightning-cli.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:1694622179,formattedLastUpdatedAt:"Sep 13, 2023",frontMatter:{title:"Uninstall Lightning CLI",slug:"uninstall-lightning-cli",hide_title:!0,tags:["References","Help","Uninstall","Remove","Delete","Clear","Clean"]},sidebar:"defaultSidebar",previous:{title:"Permission denied (os error 13)",permalink:"/references/Lightning CLI/permission-denied-os-error-13"},next:{title:"Update CLI from source code",permalink:"/references/Lightning CLI/update-cli-from-source-code"}},c={},p=[{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}],m={toc:p},u="wrapper";function g(e){let{components:t,...n}=e;return(0,l.kt)(u,(0,r.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,l.kt)("h2",{id:"remove-symlink"},"Remove symLink"),(0,l.kt)("p",null,"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,l.kt)("inlineCode",{parentName:"p"},"unlink"),":"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-sh"},"unlink /usr/local/bin/lgtn\n")),(0,l.kt)("h2",{id:"delete-the-local-source-code"},"Delete the local source code"),(0,l.kt)("p",null,"Delete the local source code which was copied from the remote ",(0,l.kt)("a",{parentName:"p",href:"https://github.com/fleek-network/lightning"},"repository"),". You can delete it recursively by:"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-sh"},"rm -r ~/fleek-network/lightning\n")),(0,l.kt)("p",null,"\ud83d\udca1 Use the flag ",(0,l.kt)("inlineCode",{parentName:"p"},"f")," to force remove by skipping any prompts, e.g. ",(0,l.kt)("inlineCode",{parentName:"p"},"rm -rf ")),(0,l.kt)("admonition",{type:"note"},(0,l.kt)("p",{parentName:"admonition"},"The default install location is ",(0,l.kt)("inlineCode",{parentName:"p"},"$HOME/fleek-network/lightning"),". If you have selected a different location to store the repository, change the target path.")),(0,l.kt)("h2",{id:"disable-the-systemd-service"},"Disable the systemd service"),(0,l.kt)("p",null,"To disable the Fleek Network Lightning Systemd's service, start by stopping the service."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-sh"},"sudo systemctl stop lightning.service\n")),(0,l.kt)("admonition",{type:"tip"},(0,l.kt)("p",{parentName:"admonition"},"You can replace ",(0,l.kt)("inlineCode",{parentName:"p"},"lightning.service")," by ",(0,l.kt)("inlineCode",{parentName:"p"},"lightning"),".")),(0,l.kt)("p",null,"Disable the lightning service"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-sh"},"sudo systemctl disable lightning.service\n")),(0,l.kt)("p",null,"If you have used the recommended procedures in the ",(0,l.kt)("a",{parentName:"p",href:"/docs/node/install"},"install")," documentation you'll have to remove the Systemd unit (file that defines the service)."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-sh"},"rm /etc/systemd/system/lightning.service\n")),(0,l.kt)("p",null,"Reload the Systemd service daemon"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-sh"},"sudo systemctl daemon-reload\n")),(0,l.kt)("h2",{id:"clear-the-lightning-config-directory"},"Clear the lightning config directory"),(0,l.kt)("p",null,"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."),(0,l.kt)("admonition",{title:"WARNING",type:"caution"},(0,l.kt)("p",{parentName:"admonition"},"Make sure to backup 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.")),(0,l.kt)("p",null,"Alternatively, instead of deleting you can move the files to a custom directory name such as",(0,l.kt)("inlineCode",{parentName:"p"},".lightning.backupDATESTAMP"),", e.g. the example below we've used the date ",(0,l.kt)("inlineCode",{parentName:"p"},"2023-09-06-1205")," as that was the time this text was written:"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-sh"},"mv ~/.lightning ~/.lightning.backup202309061205\n")),(0,l.kt)("p",null,"To clear the lightning config directory remove any files recursively by running the following command:"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-sh"},"rm -r ~/.lightning/*\n")),(0,l.kt)("p",null,"\ud83d\udca1 Use the flag ",(0,l.kt)("inlineCode",{parentName:"p"},"f")," to force remove by skipping any prompts, e.g. ",(0,l.kt)("inlineCode",{parentName:"p"},"rm -rf /*")),(0,l.kt)("p",null,"Alternatively, delete the ",(0,l.kt)("inlineCode",{parentName:"p"},"~/.lightning")," directory:"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-sh"},"rm -r ~/.lightning\n")),(0,l.kt)("h2",{id:"uninstall-cargo-and-rust"},"Uninstall Cargo and Rust"),(0,l.kt)("p",null,"To uninstall rustc, rustup and cargo run the following command:"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-sh"},"rustup self uninstall\n")),(0,l.kt)(a.Z,{name:"Helder Oliveira",image:"https://github.com/heldrida.png",title:"Software Developer + DX",url:"https://github.com/heldrida",mdxType:"Author"}))}g.isMDXComponent=!0},3872:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(7294);const l=e=>{let{image:t,name:n,title:l,url:a}=e;return r.createElement("section",{className:"author_card"},r.createElement("div",null,r.createElement("span",{className:"avatar"},r.createElement("a",{href:a,target:"_blank",alt:n},r.createElement("img",{src:t,alt:n}))),r.createElement("div",null,r.createElement("span",{className:"name"},r.createElement("a",{href:a,target:"_blank",alt:n},n)),r.createElement("span",{className:"title"},l),r.createElement("span",{className:"discord"},"Got questions? Find us on ",r.createElement("a",{href:"https://discord.gg/fleekxyz",target:"_blank"},"Discord!")))))}}}]); \ No newline at end of file diff --git a/assets/js/fd2b74dc.000281d2.js b/assets/js/fd2b74dc.69ce6d24.js similarity index 98% rename from assets/js/fd2b74dc.000281d2.js rename to assets/js/fd2b74dc.69ce6d24.js index a96bb4a7f..e4435917e 100644 --- a/assets/js/fd2b74dc.000281d2.js +++ b/assets/js/fd2b74dc.69ce6d24.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[4846],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>y});var r=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=r.createContext({}),c=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},d=function(e){var t=c(e.components);return r.createElement(l.Provider,{value:t},e.children)},p="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,o=e.mdxType,s=e.originalType,l=e.parentName,d=a(e,["components","mdxType","originalType","parentName"]),p=c(n),f=o,y=p["".concat(l,".").concat(f)]||p[f]||u[f]||s;return n?r.createElement(y,i(i({ref:t},d),{},{components:n})):r.createElement(y,i({ref:t},d))}));function y(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var s=n.length,i=new Array(s);i[0]=f;var a={};for(var l in t)hasOwnProperty.call(t,l)&&(a[l]=t[l]);a.originalType=e,a[p]="string"==typeof e?e:o,i[1]=a;for(var c=2;c{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>i,default:()=>u,frontMatter:()=>s,metadata:()=>a,toc:()=>c});var r=n(7462),o=(n(7294),n(3905));const s={title:"Keys not found",slug:"keys-not-found",hide_title:!0,tags:["keystore","lost keys","ownership","file permissions"]},i=void 0,a={unversionedId:"Lightning CLI/keys-not-found",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,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:1694621981,formattedLastUpdatedAt:"Sep 13, 2023",frontMatter:{title:"Keys not found",slug:"keys-not-found",hide_title:!0,tags:["keystore","lost keys","ownership","file permissions"]},sidebar:"defaultSidebar",previous:{title:"File permissions and Ownership",permalink:"/references/Lightning CLI/file-permissions-and-ownership"},next:{title:"Permission denied (os error 13)",permalink:"/references/Lightning CLI/permission-denied-os-error-13"}},l={},c=[{value:"Node key does not exist",id:"node-key-does-not-exist",level:2}],d={toc:c},p="wrapper";function u(e){let{components:t,...n}=e;return(0,o.kt)(p,(0,r.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h2",{id:"node-key-does-not-exist"},"Node key does not exist"),(0,o.kt)("p",null,'When watching the Fleek Network Lightning service log output, you find the "Node key does not exist" message placed recursively. As follows:'),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"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")),(0,o.kt)("p",null,"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,o.kt)("strong",{parentName:"p"},"root"),", the location of the keystore differs on runtime."),(0,o.kt)("p",null,"To learn more about how file permissions and ownership work, you're advised to read the reference document ",(0,o.kt)("a",{parentName:"p",href:"/references/Lightning%20CLI/file-permissions-and-ownership"},"here"),"."))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocta=self.webpackChunkdocta||[]).push([[4846],{3905:(e,t,n)=>{n.d(t,{Zo:()=>d,kt:()=>y});var r=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=r.createContext({}),c=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},d=function(e){var t=c(e.components);return r.createElement(l.Provider,{value:t},e.children)},p="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,o=e.mdxType,s=e.originalType,l=e.parentName,d=a(e,["components","mdxType","originalType","parentName"]),p=c(n),f=o,y=p["".concat(l,".").concat(f)]||p[f]||u[f]||s;return n?r.createElement(y,i(i({ref:t},d),{},{components:n})):r.createElement(y,i({ref:t},d))}));function y(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var s=n.length,i=new Array(s);i[0]=f;var a={};for(var l in t)hasOwnProperty.call(t,l)&&(a[l]=t[l]);a.originalType=e,a[p]="string"==typeof e?e:o,i[1]=a;for(var c=2;c{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>i,default:()=>u,frontMatter:()=>s,metadata:()=>a,toc:()=>c});var r=n(7462),o=(n(7294),n(3905));const s={title:"Keys not found",slug:"keys-not-found",hide_title:!0,tags:["keystore","lost keys","ownership","file permissions"]},i=void 0,a={unversionedId:"Lightning CLI/keys-not-found",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,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:1694622179,formattedLastUpdatedAt:"Sep 13, 2023",frontMatter:{title:"Keys not found",slug:"keys-not-found",hide_title:!0,tags:["keystore","lost keys","ownership","file permissions"]},sidebar:"defaultSidebar",previous:{title:"File permissions and Ownership",permalink:"/references/Lightning CLI/file-permissions-and-ownership"},next:{title:"Permission denied (os error 13)",permalink:"/references/Lightning CLI/permission-denied-os-error-13"}},l={},c=[{value:"Node key does not exist",id:"node-key-does-not-exist",level:2}],d={toc:c},p="wrapper";function u(e){let{components:t,...n}=e;return(0,o.kt)(p,(0,r.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h2",{id:"node-key-does-not-exist"},"Node key does not exist"),(0,o.kt)("p",null,'When watching the Fleek Network Lightning service log output, you find the "Node key does not exist" message placed recursively. As follows:'),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"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")),(0,o.kt)("p",null,"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,o.kt)("strong",{parentName:"p"},"root"),", the location of the keystore differs on runtime."),(0,o.kt)("p",null,"To learn more about how file permissions and ownership work, you're advised to read the reference document ",(0,o.kt)("a",{parentName:"p",href:"/references/Lightning%20CLI/file-permissions-and-ownership"},"here"),"."))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.992e80d5.js b/assets/js/runtime~main.350a97b3.js similarity index 78% rename from assets/js/runtime~main.992e80d5.js rename to assets/js/runtime~main.350a97b3.js index 5bfd1e91d..2f521fb10 100644 --- a/assets/js/runtime~main.992e80d5.js +++ b/assets/js/runtime~main.350a97b3.js @@ -1 +1 @@ -(()=>{"use strict";var e,f,d,c,a,b={},t={};function r(e){var f=t[e];if(void 0!==f)return f.exports;var d=t[e]={id:e,loaded:!1,exports:{}};return b[e].call(d.exports,d,d.exports,r),d.loaded=!0,d.exports}r.m=b,r.c=t,e=[],r.O=(f,d,c,a)=>{if(!d){var b=1/0;for(i=0;i=a)&&Object.keys(r.O).every((e=>r.O[e](d[o])))?d.splice(o--,1):(t=!1,a0&&e[i-1][2]>a;i--)e[i]=e[i-1];e[i]=[d,c,a]},r.n=e=>{var f=e&&e.__esModule?()=>e.default:()=>e;return r.d(f,{a:f}),f},d=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,c){if(1&c&&(e=this(e)),8&c)return e;if("object"==typeof e&&e){if(4&c&&e.__esModule)return e;if(16&c&&"function"==typeof e.then)return e}var a=Object.create(null);r.r(a);var b={};f=f||[null,d({}),d([]),d(d)];for(var t=2&c&&e;"object"==typeof t&&!~f.indexOf(t);t=d(t))Object.getOwnPropertyNames(t).forEach((f=>b[f]=()=>e[f]));return b.default=()=>e,r.d(a,b),a},r.d=(e,f)=>{for(var d in f)r.o(f,d)&&!r.o(e,d)&&Object.defineProperty(e,d,{enumerable:!0,get:f[d]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((f,d)=>(r.f[d](e,f),f)),[])),r.u=e=>"assets/js/"+({4:"779cc1e8",11:"3a6297ac",53:"935f2afb",71:"51f2bfad",173:"48e81e49",327:"b696d13b",373:"9f1c3232",382:"8def2dd5",402:"49b5e83d",441:"c7bd8086",469:"3b168dbd",533:"b2b675dd",551:"b4f44b9b",554:"7aba1839",555:"433ff3d6",572:"caaedc90",659:"5d08f08d",706:"719c0fd7",747:"155c1e74",801:"631037e5",807:"7ddc4283",814:"95f4d37c",920:"b8c37621",982:"f3d7f34e",1129:"8fe41007",1138:"64d03520",1263:"74ec46b4",1345:"c3f5dd14",1477:"b2f554cd",1498:"29b62a39",1563:"39e94577",1611:"fa7546af",1706:"d8be0e5a",1713:"a7023ddc",1837:"ce321ae3",1984:"51d5b592",2023:"d464210a",2027:"d1d29319",2114:"b5954e33",2126:"b40daf0f",2170:"02f62b30",2214:"399f21a8",2235:"3290fbc2",2240:"469c924f",2260:"4035650f",2386:"93df2695",2421:"86c3bd1d",2517:"8a92e787",2535:"814f3328",2702:"1c14429f",2800:"4247aede",2908:"48857ff6",2918:"d7d81bf6",2931:"ff80750d",3012:"aa81941d",3023:"d1b78a4d",3089:"a6aa9e1f",3116:"4061bfd3",3120:"e1f64676",3189:"2adfdcac",3218:"6ccb158e",3236:"cc9d5bf1",3237:"1df93b7f",3336:"84cbd6c9",3343:"09ac38f0",3396:"6be32138",3503:"af6a11bf",3608:"9e4087bc",3707:"f02c0d6e",3751:"3720c009",3863:"53ca291c",4013:"01a85c17",4034:"ec98ad91",4063:"44969bae",4121:"55960ee5",4327:"07f20919",4356:"a9a76bf7",4371:"f6a16de6",4402:"40aeb86f",4451:"3f3a03c1",4508:"35a7e2bf",4530:"2218035b",4534:"e26f0bf0",4541:"da8f35c6",4556:"68b99ecd",4679:"6e965365",4708:"e10957d6",4749:"616ee580",4785:"b03a0ac1",4788:"f6807fb4",4819:"85d6e74d",4826:"50f02954",4846:"fd2b74dc",4888:"f50a4147",4939:"b8466c91",5049:"9cc140f3",5075:"0dffb83e",5081:"4beaa780",5094:"763344b9",5120:"ffcb1b32",5136:"6cbb3cde",5280:"4ecc0a29",5318:"581d5240",5347:"f9537533",5466:"43ee1886",5522:"8428fe34",5530:"d16f6fc6",5602:"35230925",5649:"7b667a7f",5888:"da002ab0",6103:"ccc49370",6174:"0db90029",6223:"94e6476d",6272:"4d7007b2",6310:"cc8e0b88",6353:"7b9de75f",6362:"749619b5",6410:"514cab6e",6461:"f4fd4511",6601:"179183ba",6669:"3f90f51b",6696:"45e1a117",6699:"9bd69ffc",6788:"187c6361",6798:"fa69a7f4",6854:"8cf21e85",6926:"27528755",6939:"f3f8ecb0",6971:"c377a04b",6980:"b02525a9",7136:"a13e0645",7147:"2730e145",7154:"0e3f509c",7249:"153c226b",7310:"ffc337e7",7536:"6f8964f3",7563:"c222de09",7649:"0359c679",7706:"b35f1b7f",7796:"a50e2e4f",7804:"ecfddbd4",7813:"933a69d3",7918:"17896441",7920:"1a4e3797",7948:"41bffad9",8005:"82893666",8059:"84e08f43",8132:"2e0a4d25",8318:"9bca08cf",8427:"143de299",8567:"5ef0bdde",8610:"6875c492",8644:"dc2776f2",8747:"39574d2e",8754:"bea6e15b",8934:"0fbdd4ac",8942:"5ec90731",9021:"2baa5a9a",9188:"bd59af11",9267:"08dd5264",9320:"665f164c",9335:"00309d1b",9336:"3f0cec70",9395:"ce4635d7",9511:"4c027320",9513:"4a821728",9514:"1be78505",9735:"4ba7e5a3",9743:"fcc63351",9752:"5b6134d1",9804:"5d38c936",9847:"45c86e35",9854:"1d8a5d15",9924:"df203c0f",9995:"e331fbd7"}[e]||e)+"."+{4:"50687187",11:"e79b55ad",53:"a7206334",71:"a0a0a9d3",173:"3691aa4d",327:"5caf7689",373:"77d47975",382:"dbc6b935",402:"fb128734",441:"0e75ac0e",469:"cd5b76ca",533:"3685267b",551:"24b75469",554:"d99117a5",555:"fea9c756",572:"6856a750",659:"3c6e741c",706:"ee1a772c",747:"ff37e6d7",801:"85b42d25",807:"3c67cbbd",814:"7715ba3a",920:"bc6283bd",982:"ed914830",1129:"b0888b7a",1138:"528e46cf",1263:"91db891b",1345:"c7e3dcc3",1426:"58a14d8a",1477:"2e81c054",1498:"dc8b93e5",1563:"78ae37cb",1611:"58c1ff7b",1706:"46d824d6",1713:"e95d897a",1837:"bd881c9e",1984:"460cab55",2023:"31238def",2027:"44f741fe",2114:"5e80e979",2126:"f8f42c37",2170:"11304d9c",2214:"592e9f91",2235:"83ee952a",2240:"1b5727ea",2260:"c73efbe4",2386:"9f3a0ad3",2421:"2bbb3121",2517:"b12b85ea",2535:"d24f5f57",2702:"e287cb67",2800:"5c3cb26a",2908:"d7494b7e",2918:"7c8121fa",2931:"60cfb56e",3012:"b24331f3",3023:"6f8ce6ef",3089:"28469447",3116:"29aa95b8",3120:"07efbc58",3189:"52504d90",3218:"cf89fefc",3236:"8bf22a24",3237:"4902629f",3336:"3c01fe76",3343:"50c9a21b",3396:"4e91085e",3503:"f7b8257e",3608:"a9c67174",3707:"b38d52a9",3751:"a4574b8c",3863:"a32290cb",4013:"7d963c01",4034:"e542faf3",4063:"6a688f3f",4121:"619aa884",4327:"f450092b",4356:"b3b5e080",4371:"5f6f78af",4402:"0e787447",4451:"c14b64e9",4508:"56addf66",4530:"a68c5f9c",4534:"7fc3aec1",4541:"faa1df34",4556:"3b517092",4679:"4e5b6eb3",4708:"c579463f",4749:"b2e037d7",4785:"1e865949",4788:"02550875",4819:"6280433f",4826:"e1ddc441",4846:"000281d2",4888:"a665c138",4939:"b9b0588b",4972:"0a28dda3",5049:"0ebb050b",5075:"252d9d0a",5081:"d22ae778",5094:"cc98c74d",5120:"d819dc1a",5136:"6db4a7cc",5280:"8162b9d2",5318:"1deaf87b",5347:"1fc76593",5466:"adf41d5d",5522:"0509f320",5530:"39ae5847",5602:"029922e2",5649:"ae55a2ab",5888:"79cb2336",6048:"a0d2f860",6103:"084c8d77",6174:"cad44578",6223:"ea919340",6272:"6a6061fe",6310:"61c83c7a",6353:"eae69da7",6362:"49bf4efd",6410:"8d99f4b6",6461:"6739df39",6601:"b1c183e8",6669:"f6c63c45",6696:"4d0e696a",6699:"d62208b7",6788:"b8c530ea",6798:"1bb6f346",6854:"eb0c3500",6926:"02c044af",6939:"c4976496",6945:"bd8076fe",6971:"7e8e341d",6980:"456b9285",7136:"b94fc59c",7147:"881a35b4",7154:"b4227b3d",7249:"1739a1c9",7310:"0a5f07f1",7536:"0f47a8ee",7563:"ec3d20c2",7649:"8bd7c909",7706:"9f0bdb59",7796:"daaa737d",7804:"f15998ec",7813:"8d9acb55",7918:"1c8df702",7920:"3c1887b3",7948:"ff7e509c",8005:"944a7da5",8059:"441bf5d8",8105:"7cae6d1f",8132:"c0e06d1a",8318:"1474476a",8427:"1f104ef9",8567:"fbb18141",8610:"bfbc1fdc",8644:"ce90bb53",8747:"19d73c12",8754:"3f26b052",8894:"62e3afaa",8934:"fde097b1",8942:"f6a49b70",9021:"ea74f963",9188:"470c9730",9267:"f40c8864",9320:"2d52c96e",9335:"f429a9c9",9336:"f407843f",9395:"f1ccaf30",9511:"0ae961df",9513:"dade293e",9514:"b4afe812",9735:"b200060c",9743:"95962b55",9752:"bb236a35",9804:"df95f314",9847:"024ea152",9854:"211a6129",9924:"8ad14275",9995:"a4ef4152"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),c={},a="docta:",r.l=(e,f,d,b)=>{if(c[e])c[e].push(f);else{var t,o;if(void 0!==d)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var a=c[e];if(delete c[e],t.parentNode&&t.parentNode.removeChild(t),a&&a.forEach((e=>e(d))),f)return f(d)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/",r.gca=function(e){return e={17896441:"7918",27528755:"6926",35230925:"5602",82893666:"8005","779cc1e8":"4","3a6297ac":"11","935f2afb":"53","51f2bfad":"71","48e81e49":"173",b696d13b:"327","9f1c3232":"373","8def2dd5":"382","49b5e83d":"402",c7bd8086:"441","3b168dbd":"469",b2b675dd:"533",b4f44b9b:"551","7aba1839":"554","433ff3d6":"555",caaedc90:"572","5d08f08d":"659","719c0fd7":"706","155c1e74":"747","631037e5":"801","7ddc4283":"807","95f4d37c":"814",b8c37621:"920",f3d7f34e:"982","8fe41007":"1129","64d03520":"1138","74ec46b4":"1263",c3f5dd14:"1345",b2f554cd:"1477","29b62a39":"1498","39e94577":"1563",fa7546af:"1611",d8be0e5a:"1706",a7023ddc:"1713",ce321ae3:"1837","51d5b592":"1984",d464210a:"2023",d1d29319:"2027",b5954e33:"2114",b40daf0f:"2126","02f62b30":"2170","399f21a8":"2214","3290fbc2":"2235","469c924f":"2240","4035650f":"2260","93df2695":"2386","86c3bd1d":"2421","8a92e787":"2517","814f3328":"2535","1c14429f":"2702","4247aede":"2800","48857ff6":"2908",d7d81bf6:"2918",ff80750d:"2931",aa81941d:"3012",d1b78a4d:"3023",a6aa9e1f:"3089","4061bfd3":"3116",e1f64676:"3120","2adfdcac":"3189","6ccb158e":"3218",cc9d5bf1:"3236","1df93b7f":"3237","84cbd6c9":"3336","09ac38f0":"3343","6be32138":"3396",af6a11bf:"3503","9e4087bc":"3608",f02c0d6e:"3707","3720c009":"3751","53ca291c":"3863","01a85c17":"4013",ec98ad91:"4034","44969bae":"4063","55960ee5":"4121","07f20919":"4327",a9a76bf7:"4356",f6a16de6:"4371","40aeb86f":"4402","3f3a03c1":"4451","35a7e2bf":"4508","2218035b":"4530",e26f0bf0:"4534",da8f35c6:"4541","68b99ecd":"4556","6e965365":"4679",e10957d6:"4708","616ee580":"4749",b03a0ac1:"4785",f6807fb4:"4788","85d6e74d":"4819","50f02954":"4826",fd2b74dc:"4846",f50a4147:"4888",b8466c91:"4939","9cc140f3":"5049","0dffb83e":"5075","4beaa780":"5081","763344b9":"5094",ffcb1b32:"5120","6cbb3cde":"5136","4ecc0a29":"5280","581d5240":"5318",f9537533:"5347","43ee1886":"5466","8428fe34":"5522",d16f6fc6:"5530","7b667a7f":"5649",da002ab0:"5888",ccc49370:"6103","0db90029":"6174","94e6476d":"6223","4d7007b2":"6272",cc8e0b88:"6310","7b9de75f":"6353","749619b5":"6362","514cab6e":"6410",f4fd4511:"6461","179183ba":"6601","3f90f51b":"6669","45e1a117":"6696","9bd69ffc":"6699","187c6361":"6788",fa69a7f4:"6798","8cf21e85":"6854",f3f8ecb0:"6939",c377a04b:"6971",b02525a9:"6980",a13e0645:"7136","2730e145":"7147","0e3f509c":"7154","153c226b":"7249",ffc337e7:"7310","6f8964f3":"7536",c222de09:"7563","0359c679":"7649",b35f1b7f:"7706",a50e2e4f:"7796",ecfddbd4:"7804","933a69d3":"7813","1a4e3797":"7920","41bffad9":"7948","84e08f43":"8059","2e0a4d25":"8132","9bca08cf":"8318","143de299":"8427","5ef0bdde":"8567","6875c492":"8610",dc2776f2:"8644","39574d2e":"8747",bea6e15b:"8754","0fbdd4ac":"8934","5ec90731":"8942","2baa5a9a":"9021",bd59af11:"9188","08dd5264":"9267","665f164c":"9320","00309d1b":"9335","3f0cec70":"9336",ce4635d7:"9395","4c027320":"9511","4a821728":"9513","1be78505":"9514","4ba7e5a3":"9735",fcc63351:"9743","5b6134d1":"9752","5d38c936":"9804","45c86e35":"9847","1d8a5d15":"9854",df203c0f:"9924",e331fbd7:"9995"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(f,d)=>{var c=r.o(e,f)?e[f]:void 0;if(0!==c)if(c)d.push(c[2]);else if(/^(1303|532)$/.test(f))e[f]=0;else{var a=new Promise(((d,a)=>c=e[f]=[d,a]));d.push(c[2]=a);var b=r.p+r.u(f),t=new Error;r.l(b,(d=>{if(r.o(e,f)&&(0!==(c=e[f])&&(e[f]=void 0),c)){var a=d&&("load"===d.type?"missing":d.type),b=d&&d.target&&d.target.src;t.message="Loading chunk "+f+" failed.\n("+a+": "+b+")",t.name="ChunkLoadError",t.type=a,t.request=b,c[1](t)}}),"chunk-"+f,f)}},r.O.j=f=>0===e[f];var f=(f,d)=>{var c,a,b=d[0],t=d[1],o=d[2],n=0;if(b.some((f=>0!==e[f]))){for(c in t)r.o(t,c)&&(r.m[c]=t[c]);if(o)var i=o(r)}for(f&&f(d);n{"use strict";var e,f,d,a,c,b={},t={};function r(e){var f=t[e];if(void 0!==f)return f.exports;var d=t[e]={id:e,loaded:!1,exports:{}};return b[e].call(d.exports,d,d.exports,r),d.loaded=!0,d.exports}r.m=b,r.c=t,e=[],r.O=(f,d,a,c)=>{if(!d){var b=1/0;for(i=0;i=c)&&Object.keys(r.O).every((e=>r.O[e](d[o])))?d.splice(o--,1):(t=!1,c0&&e[i-1][2]>c;i--)e[i]=e[i-1];e[i]=[d,a,c]},r.n=e=>{var f=e&&e.__esModule?()=>e.default:()=>e;return r.d(f,{a:f}),f},d=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var c=Object.create(null);r.r(c);var b={};f=f||[null,d({}),d([]),d(d)];for(var t=2&a&&e;"object"==typeof t&&!~f.indexOf(t);t=d(t))Object.getOwnPropertyNames(t).forEach((f=>b[f]=()=>e[f]));return b.default=()=>e,r.d(c,b),c},r.d=(e,f)=>{for(var d in f)r.o(f,d)&&!r.o(e,d)&&Object.defineProperty(e,d,{enumerable:!0,get:f[d]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((f,d)=>(r.f[d](e,f),f)),[])),r.u=e=>"assets/js/"+({4:"779cc1e8",11:"3a6297ac",53:"935f2afb",71:"51f2bfad",173:"48e81e49",327:"b696d13b",373:"9f1c3232",382:"8def2dd5",402:"49b5e83d",441:"c7bd8086",469:"3b168dbd",533:"b2b675dd",551:"b4f44b9b",554:"7aba1839",555:"433ff3d6",572:"caaedc90",659:"5d08f08d",706:"719c0fd7",747:"155c1e74",801:"631037e5",807:"7ddc4283",814:"95f4d37c",920:"b8c37621",982:"f3d7f34e",1129:"8fe41007",1138:"64d03520",1263:"74ec46b4",1345:"c3f5dd14",1477:"b2f554cd",1498:"29b62a39",1563:"39e94577",1611:"fa7546af",1706:"d8be0e5a",1713:"a7023ddc",1837:"ce321ae3",1984:"51d5b592",2023:"d464210a",2027:"d1d29319",2114:"b5954e33",2126:"b40daf0f",2170:"02f62b30",2214:"399f21a8",2235:"3290fbc2",2240:"469c924f",2260:"4035650f",2386:"93df2695",2421:"86c3bd1d",2517:"8a92e787",2535:"814f3328",2702:"1c14429f",2800:"4247aede",2908:"48857ff6",2918:"d7d81bf6",2931:"ff80750d",3012:"aa81941d",3023:"d1b78a4d",3089:"a6aa9e1f",3116:"4061bfd3",3120:"e1f64676",3189:"2adfdcac",3218:"6ccb158e",3236:"cc9d5bf1",3237:"1df93b7f",3336:"84cbd6c9",3343:"09ac38f0",3396:"6be32138",3503:"af6a11bf",3608:"9e4087bc",3707:"f02c0d6e",3751:"3720c009",3863:"53ca291c",4013:"01a85c17",4034:"ec98ad91",4063:"44969bae",4121:"55960ee5",4327:"07f20919",4356:"a9a76bf7",4371:"f6a16de6",4402:"40aeb86f",4451:"3f3a03c1",4508:"35a7e2bf",4530:"2218035b",4534:"e26f0bf0",4541:"da8f35c6",4556:"68b99ecd",4679:"6e965365",4708:"e10957d6",4749:"616ee580",4785:"b03a0ac1",4788:"f6807fb4",4819:"85d6e74d",4826:"50f02954",4846:"fd2b74dc",4888:"f50a4147",4939:"b8466c91",5049:"9cc140f3",5075:"0dffb83e",5081:"4beaa780",5094:"763344b9",5120:"ffcb1b32",5136:"6cbb3cde",5280:"4ecc0a29",5318:"581d5240",5347:"f9537533",5466:"43ee1886",5522:"8428fe34",5530:"d16f6fc6",5602:"35230925",5649:"7b667a7f",5888:"da002ab0",6103:"ccc49370",6174:"0db90029",6223:"94e6476d",6272:"4d7007b2",6310:"cc8e0b88",6353:"7b9de75f",6362:"749619b5",6410:"514cab6e",6461:"f4fd4511",6601:"179183ba",6669:"3f90f51b",6696:"45e1a117",6699:"9bd69ffc",6788:"187c6361",6798:"fa69a7f4",6854:"8cf21e85",6926:"27528755",6939:"f3f8ecb0",6971:"c377a04b",6980:"b02525a9",7136:"a13e0645",7147:"2730e145",7154:"0e3f509c",7249:"153c226b",7310:"ffc337e7",7536:"6f8964f3",7563:"c222de09",7649:"0359c679",7706:"b35f1b7f",7796:"a50e2e4f",7804:"ecfddbd4",7813:"933a69d3",7918:"17896441",7920:"1a4e3797",7948:"41bffad9",8005:"82893666",8059:"84e08f43",8132:"2e0a4d25",8318:"9bca08cf",8427:"143de299",8567:"5ef0bdde",8610:"6875c492",8644:"dc2776f2",8747:"39574d2e",8754:"bea6e15b",8934:"0fbdd4ac",8942:"5ec90731",9021:"2baa5a9a",9188:"bd59af11",9267:"08dd5264",9320:"665f164c",9335:"00309d1b",9336:"3f0cec70",9395:"ce4635d7",9511:"4c027320",9513:"4a821728",9514:"1be78505",9735:"4ba7e5a3",9743:"fcc63351",9752:"5b6134d1",9804:"5d38c936",9847:"45c86e35",9854:"1d8a5d15",9924:"df203c0f",9995:"e331fbd7"}[e]||e)+"."+{4:"50687187",11:"e79b55ad",53:"a7206334",71:"a0a0a9d3",173:"3691aa4d",327:"5caf7689",373:"77d47975",382:"dbc6b935",402:"fb128734",441:"0e75ac0e",469:"cd5b76ca",533:"3685267b",551:"24b75469",554:"d99117a5",555:"fea9c756",572:"6856a750",659:"3c6e741c",706:"ee1a772c",747:"ff37e6d7",801:"85b42d25",807:"3c67cbbd",814:"7715ba3a",920:"bc6283bd",982:"ed914830",1129:"b0888b7a",1138:"528e46cf",1263:"91db891b",1345:"c7e3dcc3",1426:"58a14d8a",1477:"14c9aae2",1498:"6283cecb",1563:"78ae37cb",1611:"58c1ff7b",1706:"eba8e2d5",1713:"e95d897a",1837:"bd881c9e",1984:"460cab55",2023:"31238def",2027:"44f741fe",2114:"5e80e979",2126:"f8f42c37",2170:"11304d9c",2214:"592e9f91",2235:"83ee952a",2240:"1b5727ea",2260:"c73efbe4",2386:"9f3a0ad3",2421:"2bbb3121",2517:"5b9e0781",2535:"d24f5f57",2702:"5bbd228c",2800:"5c3cb26a",2908:"d7494b7e",2918:"573b7c91",2931:"60cfb56e",3012:"b24331f3",3023:"b2d10f66",3089:"28469447",3116:"29aa95b8",3120:"b8205fc9",3189:"52504d90",3218:"cf89fefc",3236:"8bf22a24",3237:"4902629f",3336:"3c01fe76",3343:"50c9a21b",3396:"a0b47478",3503:"f7b8257e",3608:"a9c67174",3707:"b38d52a9",3751:"a4574b8c",3863:"a32290cb",4013:"7d963c01",4034:"e542faf3",4063:"6a688f3f",4121:"619aa884",4327:"f450092b",4356:"b3b5e080",4371:"5f6f78af",4402:"62054c98",4451:"c14b64e9",4508:"56addf66",4530:"a68c5f9c",4534:"7fc3aec1",4541:"faa1df34",4556:"3b517092",4679:"4e5b6eb3",4708:"c579463f",4749:"b2e037d7",4785:"1e865949",4788:"02550875",4819:"6280433f",4826:"e1ddc441",4846:"69ce6d24",4888:"a665c138",4939:"b9b0588b",4972:"0a28dda3",5049:"0ebb050b",5075:"252d9d0a",5081:"d22ae778",5094:"cc98c74d",5120:"d819dc1a",5136:"6db4a7cc",5280:"8162b9d2",5318:"1deaf87b",5347:"1fc76593",5466:"adf41d5d",5522:"0509f320",5530:"39ae5847",5602:"029922e2",5649:"ae55a2ab",5888:"79cb2336",6048:"a0d2f860",6103:"084c8d77",6174:"cad44578",6223:"ea919340",6272:"95002077",6310:"61c83c7a",6353:"eae69da7",6362:"49bf4efd",6410:"8d99f4b6",6461:"6739df39",6601:"b1c183e8",6669:"f6c63c45",6696:"4d0e696a",6699:"d62208b7",6788:"b8c530ea",6798:"1bb6f346",6854:"eb0c3500",6926:"02c044af",6939:"c4976496",6945:"bd8076fe",6971:"7e8e341d",6980:"456b9285",7136:"b94fc59c",7147:"1e14e9d9",7154:"b4227b3d",7249:"1739a1c9",7310:"0a5f07f1",7536:"0f47a8ee",7563:"ec3d20c2",7649:"8bd7c909",7706:"26927af6",7796:"daaa737d",7804:"f15998ec",7813:"8d9acb55",7918:"1c8df702",7920:"3c1887b3",7948:"ff7e509c",8005:"944a7da5",8059:"441bf5d8",8105:"7cae6d1f",8132:"c0e06d1a",8318:"1474476a",8427:"1f104ef9",8567:"fbb18141",8610:"bfbc1fdc",8644:"ce90bb53",8747:"19d73c12",8754:"3f26b052",8894:"62e3afaa",8934:"fde097b1",8942:"f6a49b70",9021:"ea74f963",9188:"470c9730",9267:"f40c8864",9320:"2d52c96e",9335:"f429a9c9",9336:"f407843f",9395:"f1ccaf30",9511:"0ae961df",9513:"dade293e",9514:"b4afe812",9735:"b200060c",9743:"95962b55",9752:"56796de6",9804:"df95f314",9847:"024ea152",9854:"e64e862d",9924:"8ad14275",9995:"a4ef4152"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),a={},c="docta:",r.l=(e,f,d,b)=>{if(a[e])a[e].push(f);else{var t,o;if(void 0!==d)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var c=a[e];if(delete a[e],t.parentNode&&t.parentNode.removeChild(t),c&&c.forEach((e=>e(d))),f)return f(d)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/",r.gca=function(e){return e={17896441:"7918",27528755:"6926",35230925:"5602",82893666:"8005","779cc1e8":"4","3a6297ac":"11","935f2afb":"53","51f2bfad":"71","48e81e49":"173",b696d13b:"327","9f1c3232":"373","8def2dd5":"382","49b5e83d":"402",c7bd8086:"441","3b168dbd":"469",b2b675dd:"533",b4f44b9b:"551","7aba1839":"554","433ff3d6":"555",caaedc90:"572","5d08f08d":"659","719c0fd7":"706","155c1e74":"747","631037e5":"801","7ddc4283":"807","95f4d37c":"814",b8c37621:"920",f3d7f34e:"982","8fe41007":"1129","64d03520":"1138","74ec46b4":"1263",c3f5dd14:"1345",b2f554cd:"1477","29b62a39":"1498","39e94577":"1563",fa7546af:"1611",d8be0e5a:"1706",a7023ddc:"1713",ce321ae3:"1837","51d5b592":"1984",d464210a:"2023",d1d29319:"2027",b5954e33:"2114",b40daf0f:"2126","02f62b30":"2170","399f21a8":"2214","3290fbc2":"2235","469c924f":"2240","4035650f":"2260","93df2695":"2386","86c3bd1d":"2421","8a92e787":"2517","814f3328":"2535","1c14429f":"2702","4247aede":"2800","48857ff6":"2908",d7d81bf6:"2918",ff80750d:"2931",aa81941d:"3012",d1b78a4d:"3023",a6aa9e1f:"3089","4061bfd3":"3116",e1f64676:"3120","2adfdcac":"3189","6ccb158e":"3218",cc9d5bf1:"3236","1df93b7f":"3237","84cbd6c9":"3336","09ac38f0":"3343","6be32138":"3396",af6a11bf:"3503","9e4087bc":"3608",f02c0d6e:"3707","3720c009":"3751","53ca291c":"3863","01a85c17":"4013",ec98ad91:"4034","44969bae":"4063","55960ee5":"4121","07f20919":"4327",a9a76bf7:"4356",f6a16de6:"4371","40aeb86f":"4402","3f3a03c1":"4451","35a7e2bf":"4508","2218035b":"4530",e26f0bf0:"4534",da8f35c6:"4541","68b99ecd":"4556","6e965365":"4679",e10957d6:"4708","616ee580":"4749",b03a0ac1:"4785",f6807fb4:"4788","85d6e74d":"4819","50f02954":"4826",fd2b74dc:"4846",f50a4147:"4888",b8466c91:"4939","9cc140f3":"5049","0dffb83e":"5075","4beaa780":"5081","763344b9":"5094",ffcb1b32:"5120","6cbb3cde":"5136","4ecc0a29":"5280","581d5240":"5318",f9537533:"5347","43ee1886":"5466","8428fe34":"5522",d16f6fc6:"5530","7b667a7f":"5649",da002ab0:"5888",ccc49370:"6103","0db90029":"6174","94e6476d":"6223","4d7007b2":"6272",cc8e0b88:"6310","7b9de75f":"6353","749619b5":"6362","514cab6e":"6410",f4fd4511:"6461","179183ba":"6601","3f90f51b":"6669","45e1a117":"6696","9bd69ffc":"6699","187c6361":"6788",fa69a7f4:"6798","8cf21e85":"6854",f3f8ecb0:"6939",c377a04b:"6971",b02525a9:"6980",a13e0645:"7136","2730e145":"7147","0e3f509c":"7154","153c226b":"7249",ffc337e7:"7310","6f8964f3":"7536",c222de09:"7563","0359c679":"7649",b35f1b7f:"7706",a50e2e4f:"7796",ecfddbd4:"7804","933a69d3":"7813","1a4e3797":"7920","41bffad9":"7948","84e08f43":"8059","2e0a4d25":"8132","9bca08cf":"8318","143de299":"8427","5ef0bdde":"8567","6875c492":"8610",dc2776f2:"8644","39574d2e":"8747",bea6e15b:"8754","0fbdd4ac":"8934","5ec90731":"8942","2baa5a9a":"9021",bd59af11:"9188","08dd5264":"9267","665f164c":"9320","00309d1b":"9335","3f0cec70":"9336",ce4635d7:"9395","4c027320":"9511","4a821728":"9513","1be78505":"9514","4ba7e5a3":"9735",fcc63351:"9743","5b6134d1":"9752","5d38c936":"9804","45c86e35":"9847","1d8a5d15":"9854",df203c0f:"9924",e331fbd7:"9995"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(f,d)=>{var a=r.o(e,f)?e[f]:void 0;if(0!==a)if(a)d.push(a[2]);else if(/^(1303|532)$/.test(f))e[f]=0;else{var c=new Promise(((d,c)=>a=e[f]=[d,c]));d.push(a[2]=c);var b=r.p+r.u(f),t=new Error;r.l(b,(d=>{if(r.o(e,f)&&(0!==(a=e[f])&&(e[f]=void 0),a)){var c=d&&("load"===d.type?"missing":d.type),b=d&&d.target&&d.target.src;t.message="Loading chunk "+f+" failed.\n("+c+": "+b+")",t.name="ChunkLoadError",t.type=c,t.request=b,a[1](t)}}),"chunk-"+f,f)}},r.O.j=f=>0===e[f];var f=(f,d)=>{var a,c,b=d[0],t=d[1],o=d[2],n=0;if(b.some((f=>0!==e[f]))){for(a in t)r.o(t,a)&&(r.m[a]=t[a]);if(o)var i=o(r)}for(f&&f(d);n - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/blog/atom.xml b/blog/atom.xml index 65b68b404..23750c6d0 100644 --- a/blog/atom.xml +++ b/blog/atom.xml @@ -2,7 +2,7 @@ https://docs.fleek.network/blog Fleek Network Docs | Decentralized Edge Platform Blog - 2023-09-13T16:19:41.000Z + 2023-09-13T16:22:59.000Z https://github.com/jpmonette/feed Fleek Network Docs | Decentralized Edge Platform Blog @@ -12,7 +12,7 @@ <![CDATA[Bloom Filters and Cuckoo Filters for Cache Summarization]]> https://docs.fleek.network/blog/bloom-and-cuckoo-filters-for-cache-summarization - 2023-09-13T16:19:41.000Z + 2023-09-13T16:22:59.000Z 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.

Background

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.

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.

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.

Bloom Filters

A Bloom filter is a space-efficient probabilistic data structure that can be used to perform approximate set membership queries. The 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.

One of the convenient features of Bloom filters is that they can be configured to have a specific false positive rate. diff --git a/blog/bloom-and-cuckoo-filters-for-cache-summarization/index.html b/blog/bloom-and-cuckoo-filters-for-cache-summarization/index.html index d0f31d11d..3cd5d0dac 100644 --- a/blog/bloom-and-cuckoo-filters-for-cache-summarization/index.html +++ b/blog/bloom-and-cuckoo-filters-for-cache-summarization/index.html @@ -3,7 +3,7 @@ -Bloom Filters and Cuckoo Filters for Cache Summarization | Fleek Network Docs | Decentralized Edge Platform +Bloom Filters and Cuckoo Filters for Cache Summarization | Fleek Network Docs | Decentralized Edge Platform @@ -13,14 +13,14 @@ - +

-

Bloom Filters and Cuckoo Filters for Cache Summarization

· 11 min read
Matthias Wright

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.

Background

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.

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.

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.

Bloom Filters

A Bloom filter is a space-efficient probabilistic data structure that can be used to perform approximate set membership queries. +

Bloom Filters and Cuckoo Filters for Cache Summarization

· 11 min read
Matthias Wright

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.

Background

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.

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.

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.

Bloom Filters

A Bloom filter is a space-efficient probabilistic data structure that can be used to perform approximate set membership queries. The 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.

One of the convenient features of Bloom filters is that they can be configured to have a specific false positive rate. Of 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.

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. The 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).
@@ -43,7 +43,7 @@ Bloom filters and Cuckoo filters behave differently in this scenario.

For 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 relocations that will be performed for an insertion. The insertion operation will return an error if more relocations are required.

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.

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.

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.

The proposed technique is also applicable to Cuckoo filters.

Other Filters

While we only looked at Bloom filters and Cuckoo filters, there are other AMQ filters that we want to mention here briefly:

  • Quotient filters [5, 6]: Compact hash tables that support insertion, lookup, and deletion. Less space-efficient than Bloom filters and Cuckoo filters.

  • 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.

Conclusion

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.

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.

References

[1] Bin Fan, Dave G. Andersen, Michael Kaminsky, and Michael D. Mitzenmacher. Cuckoo Filter: Practically Better Than Bloom. In 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.

[2] Rasmus Pagha and Flemming Friche Rodler. Cuckoo hashing. Journal of Algorithms, 51(2), pp. 122-144, 2004.

[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.

[4] Paulo S. Almeida, Carlos Baquero, Nuno Preguiça, and David Hutchison. Scalable Bloom Filters. Information Processing Letters, 101(6), pp. 255-261, 2007.

[5] John G. Cleary. Compact hash tables using bidirectional linear probing. IEEE Transactions on Computers. 33(9), pp. 828-834, 1984.

[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.

[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/blog/feed.json b/blog/feed.json index 9057c3a8d..b8eb96696 100644 --- a/blog/feed.json +++ b/blog/feed.json @@ -10,7 +10,7 @@ "url": "https://docs.fleek.network/blog/bloom-and-cuckoo-filters-for-cache-summarization", "title": "Bloom Filters and Cuckoo Filters for Cache Summarization", "summary": "Summary of our experiment informing whether or not we should replace our implementation of Counting Bloom filters with Cuckoo filters.", - "date_modified": "2023-09-13T16:19:41.000Z", + "date_modified": "2023-09-13T16:22:59.000Z", "author": { "name": "Matthias Wright", "url": "https://github.com/matthias-wright" diff --git a/blog/index.html b/blog/index.html index d67c3afa0..fa5782259 100644 --- a/blog/index.html +++ b/blog/index.html @@ -13,15 +13,15 @@ - +
-
- +
+ \ No newline at end of file diff --git a/blog/rss.xml b/blog/rss.xml index 8de16229c..5d3274f07 100644 --- a/blog/rss.xml +++ b/blog/rss.xml @@ -4,7 +4,7 @@ Fleek Network Docs | Decentralized Edge Platform Blog https://docs.fleek.network/blog Fleek Network Docs | Decentralized Edge Platform Blog - Wed, 13 Sep 2023 16:19:41 GMT + Wed, 13 Sep 2023 16:22:59 GMT https://validator.w3.org/feed/docs/rss2.html https://github.com/jpmonette/feed en @@ -13,7 +13,7 @@ <![CDATA[Bloom Filters and Cuckoo Filters for Cache Summarization]]> https://docs.fleek.network/blog/bloom-and-cuckoo-filters-for-cache-summarization https://docs.fleek.network/blog/bloom-and-cuckoo-filters-for-cache-summarization - Wed, 13 Sep 2023 16:19:41 GMT + Wed, 13 Sep 2023 16:22:59 GMT 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.

Background

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.

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.

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.

Bloom Filters

A Bloom filter is a space-efficient probabilistic data structure that can be used to perform approximate set membership queries. The 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.

One of the convenient features of Bloom filters is that they can be configured to have a specific false positive rate. diff --git a/blog/tags/blog/index.html b/blog/tags/blog/index.html index 7d7e7069a..41f0db602 100644 --- a/blog/tags/blog/index.html +++ b/blog/tags/blog/index.html @@ -13,15 +13,15 @@ - +

-

One post tagged with "blog"

View All Tags
- +

One post tagged with "blog"

View All Tags
+ \ No newline at end of file diff --git a/blog/tags/content-routing/index.html b/blog/tags/content-routing/index.html index 91136617a..d8dd62a14 100644 --- a/blog/tags/content-routing/index.html +++ b/blog/tags/content-routing/index.html @@ -13,15 +13,15 @@ - +
-

One post tagged with "content routing"

View All Tags
- +

One post tagged with "content routing"

View All Tags
+ \ No newline at end of file diff --git a/blog/tags/engineering/index.html b/blog/tags/engineering/index.html index 6d691618e..46b2f2481 100644 --- a/blog/tags/engineering/index.html +++ b/blog/tags/engineering/index.html @@ -13,15 +13,15 @@ - +
-

One post tagged with "engineering"

View All Tags
- +

One post tagged with "engineering"

View All Tags
+ \ No newline at end of file diff --git a/blog/tags/fleek-network/index.html b/blog/tags/fleek-network/index.html index 7ccabb959..91425fab6 100644 --- a/blog/tags/fleek-network/index.html +++ b/blog/tags/fleek-network/index.html @@ -13,15 +13,15 @@ - +
-

One post tagged with "fleek network"

View All Tags
- +

One post tagged with "fleek network"

View All Tags
+ \ No newline at end of file diff --git a/blog/tags/index.html b/blog/tags/index.html index b4de4facc..df72bf7f4 100644 --- a/blog/tags/index.html +++ b/blog/tags/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/Core/developers/index.html b/docs/Core/developers/index.html index 2103b062d..ea98feb69 100644 --- a/docs/Core/developers/index.html +++ b/docs/Core/developers/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

Developers

info

This documentation is currently placeholder as the team prepares for an early testnet release around the month of August, where full documentation for node runners and services will release.

Developer in Fleek Network - Current State

As a developer, you will be able to build or use services running on Fleek Network's decentralized edge infrastructure.

This will be possible after our initial Testnet rollouts in August, and after we publish our Service Development Kit (SDK) for service development. Currently we are finalizing the core developments of the protocol and setting the foundations for the testnet release.

How can you Start Getting Involved Today?

  1. Get familiar with the project with our Whitepaper.
  2. Review our open-source codebase on Github.
  3. Learn about services in Fleek Network.
  4. Want to run a node? Join our community in Discord to get updates when possible.
  5. Or sign up to the newsletter on our website for updates.
- + \ No newline at end of file diff --git a/docs/Core/edge-nodes/index.html b/docs/Core/edge-nodes/index.html index 3d5943884..337a70375 100644 --- a/docs/Core/edge-nodes/index.html +++ b/docs/Core/edge-nodes/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

Edge Nodes

info

This documentation is currently placeholder as the team prepares for an early testnet release around the month of August, where full documentation for node runners and services will release.

Edge Nodes in Fleek Network - Current State

As a node operator, you will be able to run edge nodes for this testnet and contribute resources like bandwidth, CPU, and GPU to power services as the network's capabilities are tested.

Currently we are working towards our next milestone: the first early testnet in August 2023 - where onboarding node operators will begin to help conduct our different Testnet stages.

The node code on our Github is still experimental and the team is not incentivizing onboarding, but you are welcome to review and provide feedback at this stage regardless! Once again, once the Testnet begins, this will change and node operators will be involved.

How can you start getting involved today?

  1. Get familiar with the project with our Whitepaper.
  2. Review our open-source codebase on Github.
  3. Want to run a node? Join our community in Discord to get updates when possible.
  4. Or sign up to the newsletter on our website for updates.
- + \ No newline at end of file diff --git a/docs/Core/services/index.html b/docs/Core/services/index.html index 981b0f78e..b3e3d35ed 100644 --- a/docs/Core/services/index.html +++ b/docs/Core/services/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

Services

info

This documentation is currently placeholder as the team prepares for an early testnet release around the month of August, where full documentation for node runners and services will release.

Welcome to the services page, a brief overview of the concept of services, with use-case examples.

Services in Fleek Network

A service on Fleek Network is a modular piece of edge-enabled software that runs on (and utilizes the features of) the edge nodes, delivering unique functionality to its end users. These services could be considered as the user interface of the network.

Services inherit the following capabilities from the edge network:

  • Decentralized execution / cryptographic guarantees.
  • Geo-awareness of nodes and smart routing of work.
  • Edge-optimized latency and performance.

What can a service be? Any edge web service known today (CDN, SSR, Edge Compute, etc.) or Web3 service that could benefit from running on a decentralized edge (decentralized IPFS pinning, zkVM’s, EVMs and VMs as a service, sequencers).

Anyone can deploy services on the network, and any user/developer can interact/use services via their SDKs.

By deploying on Fleek Network services, protocols and builders can rely on a shared orchestration/performance edge layer, instead of having to either compromise and utilize web2 infrastructure, or complicate their core protocols and attempt to build edge-network-like enhancements individually.


Ideas for Services & Use-cases

These are some concepts that could explore and benefit from being built on a decentralized edge network like Fleek Network.


Web Services

Edge Functions

Edge compute comes in many flavors, and Fleek Network can support many serverless or edge compute functions. For example, cheap compute for simple JavaScript functions, Lambda, Deno or Cloudflare Workers-like compute. Fleek Network could also perform deterministic computation, consensus-based computation, ZK-computation, EVM computation. The network is non-opinionated to allow developers to define their compute service fully.

SSR/ISR

One applied edge compute use-case that can be built is Server-side Rendering (SSR) or Incremental Static Regeneration Service (ISR) on top of a container/serverless engine. Given the granularity of the content verification with Fleek Network's hashing, the streaming of particular pieces of data for the purpose aforementioned could be optimized and parallelized across multiple nodes, chunking pages of static sites and regenerating only where needed.

Hosting

While the backends in web3 apps are more decentralized, the frontends still remain quite centralized. Fleek Network provides a great opportunity to take a big step forward on this issue/topic. For example, a service that could be built is something that leverages the blockstore and IPFS content addressing to keep track of applications that are deployed with additional metadata.

It would essentially be the storage layer for frontends similar to how platforms like S3 or Netlify work. Hosting can further be extended by using the CDN and a compute service to add server-side rendering capabilities. The storage or processing for the hosting or SSR respectively could charge the client for the work performed and distribute rewards to the node operators.

CDN

A decentralized CDN is a big missing piece in the web3 infra stack. Every web3 protocol, middleware, service, and app needs and/or could benefit from content acceleration. While today most projects use Cloudflare in front of their stacks to optimize performance/latency, once Fleek Network launches, web3 projects could use the decentralized CDN service as a drop-in replacement to gain the web3 benefits without sacrificing on performance or cost.

The CDN service caches content based on usage, at the nodes that make the most sense for geo-based distribution of files (like a traditional CDN). It keeps track of requests serviced and charges the client and rewards the nodes based on the bandwidth served. The reputation system will track good CDN service and the routing will be determined based on that.

Container Orchestration

A decentralized orchestration service built on a content-addressable edge network can bring benefits in performance and delivery. A service could utilize the native content-addressing and Blake3 hashing/verified-data-streaming to partition large container image files and serve them at scale in a multi-region environment.

Fleek Network would act as a p2p CDN, serving container chunks in a parallelized, verified, and performant way - without sacrificing decentralization. A service similar in concept to Docker.

CRDT Databases

Database services in a decentralized edge platform with a content addressable core can benefit from the network's data deduplication and integrity characteristics.

Particularly a CRDT database service could be built to converge data from multiple edge locations replicas. Given all data is content addressed, their unique content hashes allow for easy differentiation and verification as the data is replicated.


Web3 Services

Blockchain Snapshots

Syncing a full node for other chains is a cpu intensive process and can take hours, days or weeks depending on the chain. Fleek Network’s internal blockchain uses content addressability to store snapshots of the chain head and uses the CDN to accelerate the entire state to the node to allow fast sync.

A service could be built that does the exact same thing, but for other chains. The service could automate storing the snapshot to always stay up to date to HEAD and deliver the entire state to a node that requests it, drastically reducing sync time.

Decentralized IPFS Pinning

Given the way Fleek Network works, all files/content on the network are content addressed (given a CID), and a mapping of the CID to origin(s) is stored in perpetuity. Combining that with the built-in (externally powered) file system that allows direct access to decentralized storage protocols (Filecoin, Arweave, etc.), as well as the CDN service , an IPFS pinning service could be built that provides the exact same service/experience as centralized IPFS pinning today, but using only decentralized infrastructure.

Not only that, but this version of IPFS pinning would be just as performant, cheaper (storing on web3 storage protocols is typically cheaper than cloud platforms), and with much better data security/availability guarantees. Even if the file ever fell off IPFS, Fleek Network would be able to retrieve it (so long as it’s still valid on at least 1 origin) since the network stores the IPFS CID to origin(s) mapping in perpetuity.

VM's (EVM, zkVM's, etc.)

A service that deploys a VM like one of the many zkVMs or the EVM is also possible. A service could provide compute in the zkVM and provide the zkSnark from the node that proves the correctness of the response.

Since the zkVM would be running on geo-distributed, intelligently routed edge nodes, the network could help ensure the zkVM computation is happening in close geographic proximity to the client to further optimize performance/latency.

Ephemeral Rollups

If you wanted a short lived rollup for something like an NFT mint event or a game/event, you could use Fleek Network to build/utilize a service that allows you to spawn ephemeral rollups that users could interact with for a certain amount of time (ex. mint window or game/event duration), and after that time elapses, the service could rollup the results to your smart contract.

This could help users avoid gas wars/high fees while providing instant finality during the duration of the event. And since the rollups would be running on the decentralized edge, they would be fault resistant and highly performant.

Proof Generation

With the rise of SNARKs/STARKs and the growing demand for performant and cost efficient proof generation, there could be compelling advantages to generating these proofs on the edge (closer to end users) in a decentralized way.

As an example, a hypothetical Groth16 service can read the setup parameters as files (using the file system) and generate a proof based on user specified public parameters. Support for other proving technologies can be built/utilized as separate services.

Alternative Sequencers

In the era of L2s, most use a centralized sequencer to post transactions to the L1s settlement contracts. These L2 networks cope with this layer of centralization by providing an alternate route around the sequencer by posting the transactions manually to the settlement contracts. The problem is, there is a reduction in block speeds users are accustomed to on an L2 and are then stuck with the L1s finalization times.

In Fleek Network a developer could provide a service that offers a decentralized alternative to an L2s sequencers that batches and posts them to the L1s settlement contract. This could then achieve L2 settlement times while still offering a decentralized path. Another benefit of this service is it could enable the end user to not need the L2 specific gas token to submit these transactions.

- + \ No newline at end of file diff --git a/docs/Open-source/code-of-conduct/index.html b/docs/Open-source/code-of-conduct/index.html index a8b04db7b..58eb2fe6f 100644 --- a/docs/Open-source/code-of-conduct/index.html +++ b/docs/Open-source/code-of-conduct/index.html @@ -13,7 +13,7 @@ - + @@ -48,7 +48,7 @@ 1.4 and 2.0, and was generated by contributing-gen.

- + \ No newline at end of file diff --git a/docs/Open-source/contributing/index.html b/docs/Open-source/contributing/index.html index 636d74255..cf7adb22d 100644 --- a/docs/Open-source/contributing/index.html +++ b/docs/Open-source/contributing/index.html @@ -13,7 +13,7 @@ - + @@ -24,7 +24,7 @@ Lightning Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to dev@fleek.network.

I Have a Question

info

If you want to ask a question, we assume that you have read the available Documentation.

Before you ask a question, it is best to search for existing Issues that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first.

If you then still feel the need to ask a question and need clarification, we recommend the following:

  • Open an Issue.
  • Provide as much context as you can about what you're running into.
  • Provide project and platform versions (rust, cargo, etc), depending on what seems relevant.

We will then take care of the issue as soon as possible.

I Want To Contribute

Legal Notice

When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license.

Reporting Bugs

Before Submitting a Bug Report

A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible.

  • Make sure that you are using the latest version.
  • Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the documentation. If you are looking for support, you might want to check this section).
  • To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the bug tracker.
  • Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue.
  • Collect information about the bug:
    • Stack trace (Traceback)
    • OS, Platform and Version (Linux, macOS, x86, ARM)
    • Version of the compiler, SDK, runtime environment, package manager, depending on what seems relevant.
    • Possibly your input and the output
    • Can you reliably reproduce the issue? And can you also reproduce it with older versions?

How Do I Submit a Good Bug Report?

info

You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to dev@fleek.network.

If you run into an issue with the project:

  • Open an Issue. (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.)
  • Explain the behavior you would expect and the actual behavior.
  • Please provide as much context as possible and describe the reproduction steps that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case.
  • Provide the information you collected in the previous section.

Once it's filed:

  • The project team will label the issue accordingly.
  • A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as needs-repro. Bugs with the needs-repro tag will not be addressed until they are reproduced.
  • If the team is able to reproduce the issue, it will be marked needs-fix, as well as possibly other tags (such as critical), and the issue will be left to be implemented by someone.

Suggesting Enhancements

This section guides you through submitting an enhancement suggestion for Lightning, including completely new features and minor improvements to existing functionality. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions.

Before Submitting an Enhancement

  • Make sure that you are using the latest version.
  • Read the documentation carefully and find out if the functionality is already covered, maybe by an individual configuration.
  • Perform a search to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
  • Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library.

How Do I Submit a Good Enhancement Suggestion?

Enhancement suggestions are tracked as GitHub issues.

  • Use a clear and descriptive title for the issue to identify the suggestion.
  • Provide a step-by-step description of the suggested enhancement in as many details as possible.
  • Describe the current behavior and explain which behavior you expected to see instead and why. At this point you can also tell which alternatives do not work for you.
  • Explain why this enhancement would be useful to most Lightning users. You may also want to point out the other projects that solved it better and which could serve as inspiration.

Workflow

The project is under heavy development to release the first version of the node and launch the testnet. Until then, the core team will be working from the main branch. PRs will be reviewed and treated case by case but the core team will commit directly to main for now.

Join The Project Team

Please visit our Discord to get in touch with us.

Attribution

This guide is based on the contributing-gen. Make your own!

- + \ No newline at end of file diff --git a/docs/Open-source/index.html b/docs/Open-source/index.html index fb1399612..e46f103a0 100644 --- a/docs/Open-source/index.html +++ b/docs/Open-source/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@
- + \ No newline at end of file diff --git a/docs/Open-source/repositories/index.html b/docs/Open-source/repositories/index.html index f69cf65d2..7af32222f 100644 --- a/docs/Open-source/repositories/index.html +++ b/docs/Open-source/repositories/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

Repositories

The Fleek Network's repositories contain a collection of source code, libraries, and other software artifacts that are used to build and maintain our products collaboratively.

These repositories are carefully managed and versioned to ensure that developers can easily collaborate and work together on code changes. They are also regularly audited to ensure that only high-quality software is included and that security vulnerabilities are quickly identified and addressed.

Overall, our open-source repositories are an essential part of our development process and help us deliver reliable and secure products to our community.

Find all our repositories on Github

- + \ No newline at end of file diff --git a/docs/contribute/index.html b/docs/contribute/index.html index 56f49e14b..d6f9a2e1d 100644 --- a/docs/contribute/index.html +++ b/docs/contribute/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/develop/client/index.html b/docs/develop/client/index.html index 6ed59ec59..0d4c1f3b8 100644 --- a/docs/develop/client/index.html +++ b/docs/develop/client/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/develop/json-rpc/index.html b/docs/develop/json-rpc/index.html index bb40efe0a..303cf85dc 100644 --- a/docs/develop/json-rpc/index.html +++ b/docs/develop/json-rpc/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/develop/overview/index.html b/docs/develop/overview/index.html index c26738770..db475b458 100644 --- a/docs/develop/overview/index.html +++ b/docs/develop/overview/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

Overview

Developers can create and utilize a multitude of Edge Services that inherit cryptographic and economically secured infrastructure. On top of geographic coverage guarantees, predictable costs and performance across all services running on the network.

- + \ No newline at end of file diff --git a/docs/develop/service-development/index.html b/docs/develop/service-development/index.html index 839f9c895..303fcc29d 100644 --- a/docs/develop/service-development/index.html +++ b/docs/develop/service-development/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index a154b7a31..d2576bbef 100644 --- a/docs/index.html +++ b/docs/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

Fleek Network is an open-source Edge Computing Platform to accelerate the development and execution of decentralized Web Services.

The system builds on a distributed network of Nodes, where services run within a fair and incentivized ecosystem constituted by an open community of developers and operators who can operate Nodes, build services that use the network’s resources, or consume Fleek Network services on the Edge.

Applications, platforms and protocols build and utilize decentralized services on Fleek Network to optimize performance and reduce dependency on centralized cloud providers. Developers can build faster and launch better products by offloading parts of the stack to the Edge to focus on core features.

tip

To participate in the alpha Testnet, you can begin by setting up and running nodes. Check the requirements and find the onboarding instructions to enable you to install a network node successfully.

info

The Fleek Network's documentation is organized as follows:

Documentation brief breakdown of the Fleek Network.

Engineering offers a deeper look into how our engineering team works, research, and technology behind Fleek Network.

Guides provide step-by-step instructions for performing specific tasks.

References section provides short materials for Fleek Network command-line interfaces (CLIs), and application programming interfaces (APIs) for managing the resources and development. It is assumed that you already have a basic understanding of important concepts.

Roadmap

We aim to bring computation to where demand is. You can find Fleek Network's public roadmap here.

Need help?

Be part of a community! Join the Fleek Network Discord if you want to ask a question, require help or exchange ideas.

Found an issue?

Issues can be reported in the correspondent repositories here and any other reports by messaging us on Discord.

- + \ No newline at end of file diff --git a/docs/learn/delivery-acknowledgements/index.html b/docs/learn/delivery-acknowledgements/index.html index 5861f92cf..2d2c1de88 100644 --- a/docs/learn/delivery-acknowledgements/index.html +++ b/docs/learn/delivery-acknowledgements/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

Overview

When a client signs a message, it creates a Delivery Acknowledgement that confirms a successful service computation delivery by a node. This process ensures the immutability and integrity of the message (the client cannot change or reverse it) and also includes metadata about the commodities consumed by the node during the service execution. This metadata helps in calculating the reward that the node will receive.

info

The Narwhal and Bullshark consensus primary transaction is the order of batched Delivery Acknowledgements. Every time a node serves a request, it gathers Delivery Acknowledgments that, upon submission, reward the node at the end of an epoch (which is approximately 24 hours).

To claim the reward and other fees, nodes can add received Delivery Acknowledgements to a local pool and periodically submit them in batches to reach a consensus. This process also ensures consistent updates to the client's balance in stablecoin.

The amounts deducted from all clients during an epoch, move to a payout pool which is distributed fairly to node account owners based on the work performed in the epoch.

For a more in-depth dive into Delivery Acknowledgements-related topics, it's advised to read the whitepaper. Also, a holistic version of the Network is available on our documentation site.

SNARKs (Non-interactive zero-knowledge proofs)

SNARKs is an acronym that stands for Succinct Non-interactive Argument of Knowledge. A SNARK is a cryptographic proof that allows one party to prove to another that it knows a secret without revealing the secret itself.

It's a product of encryption that makes direct communication between a prover and verifier needless, effectively removing any intermediaries.

note

A SNARK is a cryptographic proof that is utilized as an optimization for Delivery Acknowledgements. It's not a requirement to understand Delivery Acknowledgements. However, an important implementation detail for performance and message handling.

The periodic submission of Delivery Acknowledgements, allows us to leverage SNARK proofs recursively, aggregating many of these Delivery Acknowledgements. By batching, we lower the expenses associated with networking and computing power which would've been much higher if verified individually.

Optimization

The Fleek Network uses Narwhal as a DAG-mempool for transaction ordering (as total ordering or linear order) and Bullshark as the consensus engine.

tip

Read The Consensus Algorithm section, to learn more about Narwhal and Bullshark. Alternatively, check the whitepaper for more detailed information.

Total ordering is performed by a committee-based approach. The committee is formed from a subset of any valid staked node at the end of every epoch (about 24 hours). Integrity is met due to the node rotation that occurs at each period, reducing risks associated with nodes being compromised and affecting the committee's purity.

Since the number of Delivery Acknowledgements can be considerably high, only a few of these are handled by consensus. It rolls up the head and tail from the batch list and leverages Zero-Knowledge proofs recursively to validate them. By rolling up a smaller footprint, it optimizes data and network performance without compromising the security of the protocol.

In summary, a subset of Nodes forms a new committee at each Epoch, that does the transaction ordering of the workload computed and submitted by the remaining nodes performantly and securely.

Node vs. Client Process Flow

The process by which Delivery Acknowledgement works is that a node starts by sending an encrypted request to a client and once received, a signed Delivery Acknowledgement attests to it.

Upon Delivery Acknowledgment, the node should transmit an encryption key.

If a node fails to send a key after the client signs the Delivery Acknowledgement, the committee safeguards the user request interest by sending a valid rebuilt key back.

As a consequence of malicious behavior, the committee has the node slashed by the protocol-slashing mechanism penalizing dishonest participation while allowing the request flow to run smoothly for the betterment of the end-user experience.

note

The process ensures that nodes get paid for work performed and clients get the requests fulfilled. It helps achieve decentralization and trustworthiness as the process applies to any sort of client-server communication, such as Gateways. Also, considering the impact this might have on the network, a node encryption key response has a small impact performance of 300 milliseconds (0.3ms) of latency.

Content and Streaming Verifiability

A Delivery Acknowledgement message signing is deterministic, completely dependent on its inputs and the sequence of the instructions fulfilled which are strictly validated.

Thus, the entire network operates based on content addressing based on Blake3 hashing for efficient content identification and streaming verifiability. This ensures that the hash being requested is the one being served.

Learn more about it in the Content Addressing section.

Delivery Acknowledgement Customisation

A Service can have a custom configuration to specify how Delivery Acknowledgements should behave or work. Patterns and conventions should be expected to emerge from the Service builder community and best practices.

Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
- + \ No newline at end of file diff --git a/docs/learn/developers/index.html b/docs/learn/developers/index.html index 8ab6b45f5..c14c4e85c 100644 --- a/docs/learn/developers/index.html +++ b/docs/learn/developers/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

Developers

info

This documentation is currently placeholder as the team prepares for an early testnet release around the month of August, where full documentation for node runners and services will release.

Developer in Fleek Network - Current State

As a developer, you will be able to build or use services running on Fleek Network's decentralized edge infrastructure.

This will be possible after our initial Testnet rollouts in August, and after we publish our Service Development Kit (SDK) for service development. Currently we are finalizing the core developments of the protocol and setting the foundations for the testnet release.

How can you Start Getting Involved Today?

  1. Get familiar with the project with our Whitepaper.
  2. Review our open-source codebase on Github.
  3. Learn about services in Fleek Network.
  4. Want to run a node? Join our community in Discord to get updates when possible.
  5. Or sign up to the newsletter on our website for updates.
- + \ No newline at end of file diff --git a/docs/learn/introduction/index.html b/docs/learn/introduction/index.html index 82319d4a2..1ff7b820e 100644 --- a/docs/learn/introduction/index.html +++ b/docs/learn/introduction/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

Introduction

The Core of Fleek Network offers a foundational layer to enable developers to build and deploy Edge Services efficiently. It abstracts away the development complexities of consensus, cryptography, storage and peer-to-peer networking, etc, to simplify things conceptually. It frees developers and teams to focus on what matters the most to reach business goals.

In contrast, end users have access to network services on the edge, that provide different kinds of computation and data processing features.

We'll take a brief look into Why does it exist, How does it work, and learn about services, amongst other topics.

tip

For a deep dive into Fleek Network, check the whitepaper section.

Why does it exist?

Many Web3 products rely on the conventional models of centralized cloud infrastructure, due to the lack of corresponding alternatives.

Some of the most popular Web3 products rely on content delivery and edge computing provided by the monopolized cloud market. Unlike a decentralized system, the opposite is more vulnerable to attacks, as computation and data can be easily manipulated to suit the monopoly's business goals.

Meanwhile, blockchain technology has paved the way for a new era of decentralized cloud computing and data storage, offering a sustainable alternative to traditional centralized architectures.

The Fleek Network provides the alternative, paving the way to a decentralized edge computing future that is secure, transparent and accessible to everybody in the world.

Motivation

The Fleek Network team was motivated to create a decentralized Edge Platform due to the current infrastructure trends, user concerns and demands. The modern web is shifting from the cloud to the edge, which is a reflection of the internet's growing user base and the need for low latency for users worldwide.

This development is a crucial and necessary step towards significantly enhancing the reliability, efficiency, and decentralization of Web3 applications and platforms, such as the next iteration of the Fleek platform.

How does it work?

When a client requests a service, the protocol determines the best route to the nodes where the service replicas and workload are allocated.

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.

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.

Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
- + \ No newline at end of file diff --git a/docs/learn/ports/index.html b/docs/learn/ports/index.html index 551ff2088..1e2ffeaca 100644 --- a/docs/learn/ports/index.html +++ b/docs/learn/ports/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

The Node process requires the following ports:

  • RPC (port 4069)
  • Narwhal
    • Primary (port 8000)
    • Worker (port 8001)
    • Mempool (port 8002)

There’s a single worker at the protocol level. In the future, if a node is allowed to run >1 worker, the ports can look like (worker#X):

  • Narwhal
    • Worker (port 80X1)
    • Mempool (or 80X2)
required

The ports should be freed before launching the node process. Any blockers or firewalls should be configured to enable the ports.

Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
- + \ No newline at end of file diff --git a/docs/learn/services/index.html b/docs/learn/services/index.html index 4be59d8da..943901df1 100644 --- a/docs/learn/services/index.html +++ b/docs/learn/services/index.html @@ -13,7 +13,7 @@ - + @@ -22,7 +22,7 @@

Overview

A Fleek Network Service is a modular application that runs on nodes and allows users to perform well-defined functions or some specific tasks. Services are scalable and performant due to edge computation and networking features provided by the core principles of the network.

As a permissionless system, services are built by developers who are free to build and deploy them to run on the decentralized edge platform. Applications can be of any kind but are generally described as web services. These are cryptographically secure and run within a fair economically incentivized model. The services are hosted in user-managed resources and are highly available to customers and end-users in exchange for rewards.

A Service Development Toolkit (SDK) facilitates access to core APIs and resources for developers. Services run in a sandboxed environment (unable to access the host's processes, hardware and kernel directly) and are restricted to specific features such as cryptography, networking and storage. The service implementation source code is fully managed by the author(s), owner(s) and development team(s).

info

At an early stage, core services are statically linked to the node's binary process (Lightning). In the future, the Fleek Network protocol aims to load services dynamically.

Service Development Toolkit (SDK)

The Service Development Toolkit (SDK) abstracts the core protocol features, including the communication with the middleware which is done through an Inter-Process Communication (IPC) system. Any system-level programming language, such as C/C++, Go or Rust can establish a communication channel with the middleware. By using the toolkit, a Service builder accelerates the development process e.g. effectively enables nodes to generate Delivery Acknowledgements (SNARKs) that prove work completion which is used to determine rewards, along with other cryptographic commitments.

info

As discussed in The Network section, Delivery Acknowledgements include metadata about the commodities consumed by a node while executing or running a service. It also contains cryptographically secured metadata that are tamper-proof and used to determine the reward attributed to a node.

A commitment ensures clients receive the correct work output that is being requested, such as content, a computed response, etc. In addition to preventing malicious services from coercing a node into making false commitments. Likewise, the commitments generated by a node determine the bandwidth and computation served, amongst other commodities.

Handshake

The Handshake component is the entry point to external communications with a node. It enables clients to establish an encrypted communication session with the node and interact with services over a secure transport layer (TLS+TCP or QUIC). On establishing a client and node connection, public keys are exchanged and a lane is negotiated for the session. A Handshake is required for a client to access and interact with a service.

Service geographic distribution

The network takes care of infrastructure coverage, scalability, and incentivizing edge nodes to run services. It employs a range of algorithms to assign edge nodes in each geographic region to handle the work for each service, guaranteeing the most efficient route. Additionally, when a service experiences a surge in demand and scales up, any unused services are automatically downscaled. By dynamically allocating resources, it eliminates unnecessary resource usage and allows efficient garbage collection. All of this is achieved while maintaining optimal levels of trust, security, infrastructure coverage, and performance guarantees.

Resources as commodities

The hardware resources used by a service are packaged and measured as commodities. Includes things like bandwidth and CPU, along with their respective commodities such as GB(s) and CPU cycles. Delivery Acknowledgements detail the commodities used by a node during service execution. The data is used to reward the node based on the current pricing of those commodities set by the network governance.

Use-cases

Building on Fleek Network's Decentralized Edge Infrastructure unlocks various opportunities and advantages for Service builders, that empower them to implement most of the following concepts.

Traditional Services

Edge Functions

Edge computing comes in many flavors, and Fleek Network can support many serverless or edge computing functions. For example, low-cost computation for JavaScript functions, Lambda, runtimes or Cloudflare Workers-like computing. Can also perform deterministic computation, consensus-based computation, ZK-computation, and EVM computation. The network is non-opinionated and enables developers to refine their computing service in great detail.

SSR/ISR

One applied edge compute use-case that can be built is Server-side Rendering (SSR) or Incremental Static Regeneration Service (ISR) on top of a container/serverless engine. Given the granularity of content verification within the core's hashing, streaming of particular pieces of data can be optimized and parallelized across multiple nodes. Such as chunking pages of static sites and regenerating only where needed.

Hosting

Web3 apps are generally composed of a backend and a frontend stack. The backends are considerably decentralized but often have the client-side facing interface hosted into a central cloud provider. Given the desirability of content delivery acceleration services for a snappy user experience, that end customers demand. The Fleek Network takes a big step forward on this topic, as services can leverage the block store and content addressability (IPFS) for an application host provider.

As we have today with user stories like S3 or Netlify, a service can use Fleek Network as a storage layer for static sites. Similarly, a CDN or SSR can complement static site hosting by accelerating and dynamically computing user needs. In consequence, the reward mechanism would distribute rewards fairly to every actor in the computation and fulfillment of paying customers for these requests, e.g. service builder, node operator, etc.

CDN

A decentralized CDN is a big missing piece in the Web3 infra stack. Every protocol, middleware, service, and app can benefit from content acceleration. Today most projects use popular CDNs in front of their stacks for optimization and performance improvement e.g. availability and latency. A decentralized CDN built on Fleek Network can gain great notoriety in the blockchain and Web3 development communities, due to its benefits and principles, without sacrificing performance and cost of integration.

The dCDN service can cache content based on the user request and popularity, and put it in the speediest location based on the network reputation system, computation and routing response timings. Conceptually similar to a traditional CDN, but abstracting the geo-location that is usually specified by user-selected zones.

tip

While the network does not possess a specific concept of geography, it gains an implicit understanding of geographical proximity through the data it collects on latency and hop counts between nodes, which is a part of the reputation system.

Learn more about how Fleek Network behaves by reading the whitepaper.

Container Orchestration

A decentralized orchestration service built on a content-addressable edge network can bring benefits in performance and delivery. A service could utilize the native content-addressing and Blake3 hashing and verified data streaming to partition large container image files and serve them at scale in a multi-region environment.

Fleek Network can act as a p2p CDN, serving container chunks in a parallelized, verified, and performant way–without sacrificing decentralization. Similar to concepts that can be found in Docker image hosting, Docker Swarm clustering, etc.

CRDT Databases

Database services in a decentralized edge platform with a content addressable core can benefit from the network's data deduplication and integrity characteristics.

Particularly a CRDT database service could be built to converge data from multiple edge locations replicas. Given all data is content-addressed, unique content hashes allow for easy differentiation and verification as the data is replicated.

Web3 Services

Blockchain Snapshots

Interchain synchronization of a full-node history is CPU-intensive. Can take hours, days or weeks depending on blockchain technology. On Fleek Network's core, the internal blockchain is based on content addressability which stores snapshots of the state HEAD. It utilizes decentralized content acceleration for node entire-state synchronization for higher speed.

A service can be built that does a similar process for any chain. By automating snapshot storage timely and in-synchronization to the chain HEAD. It can deliver an entire state to a node rapidly.

Decentralized IPFS Pinning

All content on the Fleek Network is content addressed and referred to by the CID, which mapping of the CID to the origin is stored in perpetuity. Coupled with the built-in file system interlinked to decentralized storage protocols such as Arweave and Filecoin, an IPFS pinning service can be built. A pinning service for IPFS that provides the user experience we are accustomed to, but using decentralized infrastructure, which today's IPFS pinning services fail to offer.

Worth mentioning that an IPFS pinning service as such, would be cheaper and provide better availability, performance and security guarantees. For example, as the network stores the CID-to-origin mapping in perpetuity, even if an IPFS file is lost it can be easily retrieved if there's at least one origin.

VM's (EVM, zkVM's, etc.)

A service that deploys a virtual machine, such as many zk-VMs, or the EVM can be built and deployed to Fleek Network. It can provide compute in the zk-VM and provide the zk-SNARK from the node, proving the correctness of the response. In addition, the network routing can ensure that the zk-VM computation is happening in the closest proximity to the client based on latency and other network factors.

Ephemeral Rollups

The Fleek Network can be utilized as a short-term service platform for a variety of applications or side-chaining that compute state and roll it up to a smart contract. An NFT minting or game event that occurs during a short period, can roll up state to a smart contract after the event time elapses.

To help users mitigate gas costs and feeds while providing instant finality throughout an event. Consequently, roll-ups would run on a decentralized network, that is fault-resistant and highly performant.

Proof Generation

As a result of the rise of Zero-Knowledge proofs (SNARKs, STARKs) for performance and cost-efficient proof generation, there are benefits for computing them closer to end-users and in a decentralized manner which Fleek Network Edge Network entails.

For example, a hypothetical Groth16 service can read parameters from configuration files in a file system and generate a proof based on public user custom parameters.

Alternative Sequencers

As encountered by most sequencers that post transactions to Layer-1 settlement contracts (which are mostly done over centralized processes), Layer-2 networks bypass these by posting them manually. This causes long finalization times and a reduction in block speeds on Layer-1, which is contrary to what users are familiar with and find ordinary on Layer-2.

In Fleek Network, a service builder can offer an alternative to a Layer-2 sequencer, that is decentralized and more reliable by batching and posting to Layer-1 settlement contracts. With equivalent Layer-2 settlement times.

An additional benefit can be enabling end-user gasless transaction submissions by disregarding a Layer-2 gas token to submit transactions to Layer-1.

Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
- + \ No newline at end of file diff --git a/docs/learn/the-network/index.html b/docs/learn/the-network/index.html index 59ee23c33..95279684f 100644 --- a/docs/learn/the-network/index.html +++ b/docs/learn/the-network/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

Protocol

The Fleek Network is designed to deliver computation cheaper, faster and more efficiently than existing cloud providers by allowing anyone to offer computer resources for rewards. Including, secured information about who requested it on the network.

The Fleek Network is a proof-of-stake protocol, that takes advantage of Ethereum for staking, payments, governance and other economic features.

This is achieved by a combination of SNARKs (Succinct Non-interactive Argument of Knowledge), Narwhal and Bullshark consensus, including other cryptographic and economic guarantees to achieve a trustless decentralized and long-term sustainable environment.

It's important to keep track of these components to ensure that the system is running fairly. The protocol holds the state for the following:

  • Token Balances
  • Staking details
  • The Node Reputation
  • Data on how much work a Node has performed in a given epoch

As a decentralized network, the state of these is replicated across all of the distributed nodes in the network by forming a blockchain, in which consensus on transactions transmutes to the final immutable state.

The Consensus algorithm

Narwhal and Bullshark, are high-performant mempool and consensus engines by Mysten Labs. The Fleek Network uses Narwhal as a DAG-mempool for transaction ordering (as total ordering or linear order) and Bullshark as the consensus engine.

note

The primary transactions being ordered by the consensus algorithm is the batch of Delivery Acknowledgements stored in a local list of transactions before commitment to the blockchain (memory pool).

The Narwhal algorithm is based on the separation between the dissemination and transaction ordering to achieve high throughput in the blockchain system. The protocol achieves reliable dissemination and storage of causal histories of transactions. Narwhal tolerates an asynchronous network and maintains high performance despite failures.

Bullshark is a zero-message overhead consensus algorithm that handles transactions that require total ordering (linear ordering), and synchronization of the transactions between nodes and the global network state.

To put it simply, where Narwhal ensures data is submitted to consensus, Bullshark sorts out the order of the data.

Total ordering

Total ordering is performed by a committee-based approach. The committee is formed from a subset of any valid staked Node at the end of every epoch (about 24 hours). The integrity is met due to the Node rotation that occurs at each period, reducing risks associated with Nodes being compromised and affecting the committee purity. In summary, a subset of Nodes forms a new committee at each Epoch, that does the transaction ordering of the workload computed and submitted by the remaining Nodes.

The Edge Network

Edge computing is about processing data at the closest point of interaction, while cloud computing is about processing data in a data center.

Instead of resolving requests in the cloud, where roundtrip times are noticeable due to latency, the processing of requests is done at your closest convenience, which means getting you a quicker response and a better user experience.

Fleek Network's Edge computing is computing that's done at the speediest location to the user. Provided by Network Nodes that are favorably dispersed and operated by a diverse community.

The community members host and operate the Network Nodes, which form the Edge Platform, and contribute to an autonomous and decentralized network of web services.

Some of the resources provided by the network nodes are:

  • Disk Storage
  • Processing power (CPU Units)
  • Network bandwidth

The Edge Network aims to provide computational resources where a user most needs them.

Incentives and rewards

Fleek Network issues FLK–an ERC-20 fungible token created using the Ethereum Blockchain–which Node operators must stake to perform work on the network. On the other hand, developers and clients use stablecoins in a fair exchange for the commodities and resources consumed on the network.

warning

A Node Operator has to stake FLK to have a node participate in the Network. A node without FLK staken is referred to as a stakeless node. A stakeless node cannot contribute or participate in the network, as there would be no way to punish them for malicious behavior. Thus, all fully operational nodes in the network, without exception, have a stake.

A node is a process that runs on a machine that provides resources to the network. The resources are packaged as commodities. For instance:

  • Availability / Up-time
  • Bandwidth
  • CPU

These commodities are exchanged fairly and pricing is decided by the ecosystem and network governance. To ensure a stable and predictable income stream, the rewards awarded to Node Operators are predetermined at a stable rate (USD).

Service providers are rewarded in many ways, for instance, by fulfilling cache requests per bandwidth, and sharing cached data with other peers–as an incentive for a shared economy, therefore the more bandwidth served, the more tokens received.

When an epoch ends, which is about 24 hours, the rewards from all submitted Delivery Acknowledgements are distributed to the edge nodes.

Delivery Acknowledgements (SNARKs)

A Delivery Acknowledgement is a signed message by a client attesting that a node has successfully delivered a task to the client. These acknowledgments are instantly finalized locally and irreversible by the client.

The Delivery Acknowledgements are cryptographically secured and tamper-proof, meaning that the transaction contains irrefutable details about all parts involved in the transaction.

A Delivery Acknowledgement includes metadata about the commodities consumed by a node while executing or running a service. Also contains metadata that is used to determine the reward attributed to a Node.

tip

A Node provides the computational resources to the network and keeps track of doings in a list of Delivery Acknowledgements, on which the rewards mechanism is based at the end of each Epoch (about 24 hours).

Finally, Delivery Acknowledgements are gathered and batched by nodes before being submitted to the core protocol and committee as described in the consensus section.

To learn more, visit the section Delivery Acknowledgements.

Reputation system

The Fleek Network has a reputation system where nodes rate each other. The ratings are collected timely and an aggregation algorithm calculates the overall rate for each node at the end of every epoch.

Noteworthy, any reputation system that depends on players attributing rates to each other can be exploited. For prevention, a custom version of the EigenTrust algorithm is used to reduce dishonest and incorrect measurements.

Some other procedures where a node is rated are on the interactions between nodes while servicing. Meaning that a node earns a rate per service interaction.

The information is replicated across the network securely and cannot be tampered with and is a valuable and reliable source of knowledge for optimization tasks.

A few optimization tasks include:

  • Optimizing the network flow
  • Assigning services to nodes
  • Determining proximity

The reputation system is used to determine the service routing and work allocation.

Actors and their roles

The Fleek Network is a system where actors play important roles, namely:

  • Client
  • Developer
  • End-user
  • Node Operator

Each of these users has a huge role in contributing and participating in the network. They make it possible and lively by requesting resources, through usage, payments or by simply being a plain member of the community.

Client

The Client is a user that consumes data from the network, for instance:

  • A developer interested in using the CDN in an application
  • A media publisher wanting to accelerate access to media assets
  • A system administrator looking for instructions to troubleshoot the client library
  • A Solutions Architect looking for a quick overview of an alternative service for a centralized provider
  • Instructions to install and use the client library
  • A Web developer looking to decentralize an API service

A client is a paying customer for the commodities and resources consumed on the network, e.g. a CDN service customer who pays for bandwidth use, etc.

This type of user can:

  • Top up the account to have enough credit to exchange for service
  • Check the balance
  • Check the cost(s) of the service(s)
  • Many others (relative to the service offering that might be of a third-party provider)

Developer

The Developer is a knowledgeable user that enables the business logic and end-to-end experience to the end-user through applications or services. Take, for example:

  • Protocol development contributor
  • Service creator
  • Client library user
  • Contributions to the client libraries and tools
  • The library method and parameters references
  • Versions and features support

A developer is often described as a builder who enables the end-to-end experience in the Fleek Network. A builder that can work at the Service provider level, protocol development, core contributor and, amongst others, at a higher level, such as providing support and integrations of services in applications or third-party systems.

End-user

An End-user is someone to whom the data or computation output is ultimately delivered, among others:

  • Static assets, such as images rendered on a website
  • Image optimization output for a very particular size request
  • Server-side rendering
  • Data response provided via HTTP Gateway or RPC

The service outputs are for the end-user, but payment for the service is the responsibility of the client that manages the application or service the end-user interacts with.

Node operator

A Node Operator is a kind of system administrator who builds, configures, installs or maintains a node(s) in a server. To mention a few use cases:

  • Builds the node binary from source-code
  • Updates the source-code repository, which node is built on
  • Runs the installation wizard to setup a node
  • Installs the node manually
  • Configures the node
  • Secures the server

The Fleek Network works as a distributed system of nodes where each node operates and contributes to the system’s overall health and functionality with computational resources by network operation demand.

Nodes are set up to run on servers by operators. Operators are system administrators who build, configure, install and maintain the nodes in a server. Generally, a node is installed and runs on a computer or virtual private server (VPS) lent by a cloud service provider.

info

A server is a computer machine where a Node runs and can be located anywhere in the world.

The Node Operator is a critical system actor that is incentivized to manage one or many nodes. Ultimately making the Fleek Network what is about, a decentralized orchestration layer and infrastructure.

Any individual who's interested in learning can become a Node Operator by reading the documentation, or content made available by the network core team and community.

Multi-Service Support

The Fleek Network provides a base layer as the foundation of many Services. Simplicity at its core, it handles Proof-of-delivery and other client-node exchanges, such as user balance and rewards.

It's designed to allow anyone to create and deploy a custom service to the network, without the need for anyone's permission. The protocol slashing mechanisms help deter malicious behavior and penalize dishonest participants while allowing the service, a modular unit, to operate at maximum availability and performance.

Within a diverse ecosystem where node operators are free to choose which services to run, e.g. an operator might find popular services more appealing economically. Thus, the network is nonhomogenous, made up of different types of resource servers, requirements and services.

Abstraction and build blocks

Abstraction is conceptually useful in decentralized and distributed web service development because of how incredibly complex it can become and the speed at which developers have to react to the outside world. The core team put most of the complexity into well-defined building blocks.

The building blocks provide you with enough level of detail that the modern developer experience demands but with cryptographic, economical and security assurances for confident service development, amongst others.

The Fleek Network implementation is open source and freely available for consultation and contribution when more detail or refinement is required by the community and other observers.

Modular architecture

Lightning is the repository name containing the Fleek multi-service Edge Network implementation.

The project aims to provide a higher focus on engineering productivity from the get-go, an improvement over the original Ursa implementation, which was exclusively focused on CDN, one of many services Lightning offers support.

info

Lightning is the open-source Rust implementation of Fleek Network. The repository contains the source code for the implementation of Fleek Network at https://github.com/fleek-network/lightning.

Some of the main differences from Ursa’s implementation are:

  • The dynamic service loading approach
  • Decoupling of the network's core from the service implementation
  • Higher-level architecture that makes it easier to maintain and within reach of external contributors.

Lightning’s development approach is more open, which allows the community to build services and also helps the core team work on other features or services in parallel.

Repository

The repository contains the source code for the implementation of the Fleek Network and is located at https://github.com/fleek-network/lightning, a private repository that will go public after the whitepaper announcement and roadmap.

Directory structure

There are three top-level directories, namely lib , core and services.

Lib - These are open-source libraries created to help tackle the project features and packaged with a friendly license in the Rust ecosystem (MIT, Apache).

Core - The primary protocol implementation, where node crate contains the essential feature set or base functionality. Includes the interfaces crate, where the top-down specification of the project is located.

Services - A Service is a business logic provider built with the SDK (Service Development Kit). A service is decoupled from the core of the network and loaded dynamically [1] during the runtime using FFI (foreigner function interface).

draco
├── lib
│ ├── affair
│ ├── atomo
│ └── blake3-tree
├── core
│ ├── node
│ ├── interfaces
│ ├── application
│ ├── blockstore
│ ├── consensus
│ ├── handshake
│ ├── identity
│ ├── origin-arweave
│ ├── origin-filecoin
│ ├── origin-ipfs
│ ├── pod
│ ├── reputation
│ ├── rpc
│ └── sdk
└── services
└── cdn

Interfaces

The design pattern adopted for this software is highly inspired by the Object-Oriented model described by Alan Kay, which may be a bit different from OOP which grew to fame due to Java.

In a nutshell, this is similar to the same idea, and we represent different units of computation and process as objects that communicate with each other by message passing.

Identity on the Fleek Network

The identity on the Fleek Network is issued and controlled by individuals, which means that there aren't any central entities that issue, manage or control it for you. An identity is created without permission from anyone, and stored securely and privately.

caution

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.

The types of Identities found in the Fleek Network are used for:

  • Node (for BFT DAG consensus)
  • Node Network (for fast communication signatures)
  • Account Owner (any actor holding a balance on Fleek Network)

The Public-key cryptography used in the network identities are the following curves:

  • BLS12-381 is a pairing-friendly elliptic curve construction from the BLS family
  • Ed25519 is the EdDSA signature scheme using SHA-512 (SHA-2) and Curve25519
  • Secp256k1 is the Elliptic Curve Digital Signature Algorithm (ECDSA) used by Bitcoin and Ethereum

The identities are associated with the elliptic curves as follows:

  • A Node key (ConsensusPublicKey) is 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
  • A Node Networking key (NodePublicKey) is Ed25519 used for the speed and performance of the network communications
  • Account Owner keys are based on secp256k1, which corresponds to an Ethereum Address

Transactions can be signed by the Account Owner—an Ethereum key (secp256k1) owned by the user on an external wallet and initially required to bridge assets from L2—and Node identities

Node Networking with Narwhal utilizes the Node Network key (Ed25519) is much more efficient when dealing with a single signature instead of aggregated signatures.

Content addressability and verifiability

The way content is distributed, handled and stored defines how trustworthy's a protocol. Some of the primitives to achieve it has roots in linked data, immutability, verification and the semantic web.

On Fleek Network, you either hint about data packed into a format called a Content Archive (CAR) or an existing CID of a CAR file—which hash addresses are unique and universally addressable. The network never stores data, only a cache layer to existing storage as origins. For example, on HTTP PUT we're just telling the network that there's some origin it should care about and cache.

Some of the principles that help us provide guarantees to end-users require a high ability for content verification, as a consequence, the immutability of files is critical to the system.

info

To emphasize, immutability means the state of not changing, or being unable to change!

Immutability

Fleek Network deals with files in a manner where the content determines the address in which the user of the system can locate and verify it unquestionably. This is possible due to cryptography, in which the same data always produces the same hash deterministically.

  • A file whose content determines the hash, but is also impossible to invert it
  • Unable to reconstruct data from a hash
  • It's unique, not two files produce the same file or content
  • Any change in the content should always generate a completely different hash

In retrospect, what we have on the web today are files accessible via a URL address and the problem with this approach is that the content is not intrinsically tight to the address e.g. the content can change and the URL remains the same. That is the problematic way we access files on the web today, which we call "Location addressing", and the way we solve it for the web of tomorrow is called "Content addressing".

Content addressing

Content addressing is where we use a hash to access the content, and it allows us to verify that the content we received is the content we asked for. For this, we use a special hash called CID (Content Identifier), a cryptography hash function that maps input of arbitrary size to the output of a fixed size—the content identifiers are short, regardless of the size of the content, and the address does not tell us where the content is stored.

The entire network operates based on content addressing based on Blake3 hashing for efficient content identification and streaming verifiability.

info

The CID is a sort of string-like binary that is human-friendlier in comparison to the underlying binary, which is way longer.

info

Caching and deduplication are possible due to the immutability of content e.g. if content changes, let's say that an image has some new detail, the files share many of the same bytes. The amount of data we have to transfer to fetch is minimum, we'd only pull the difference. In today's web, we'd have to transfer both files in full, which is a worse path on resource allocation and performance.

Hash functions

The hash function for creating CIDs uses sha-256, but there is support for other hashing algorithms, such as sha1 (used by Git), sha2-256, sha3-255, blake2b-160, blake3, etc. Some older algorithms are proven not to be collision-free, so if algorithms can break, we have to switch the hash algorithm we use in the future! The problem with this switching of algorithms is the need to find a future-proof way of identifying the hash functions used to generate the hash, as well as the hash name.

Multihash is a protocol that comes into play to provide us with valuable metadata for future-proofing. In an attempt to summarize it, it's the composition of a hash placed at the end, a prefix, as a number to identify the algorithm used, and a number, to identify the hash name. Therefore, we'd start raising some questions. Without it, how would we get the data back without the ability to identify how it was encoded? Some users could use cbor, protocol buffers, json, etc, and there might be plenty of good reasons why for those choices. Maybe it's a compact binary encoding that is very efficient for storage, easy to work with, etc.

What's important is that it is the user's choice and why IPLD becomes useful for Fleek Network's use cases. A system for understanding and working with data that is made of a data model, codecs, tools for linking, and then a handful of other powerful features that help us develop a decentralized application.

Interplanetary linked data (IPLD)

Interplanetary linked data (IPLD) provides us with all the metadata prefixes to soothe the system needs, and provides us with the data model of the content-addressable web, as discussed earlier. IPLD is a set of conventions for creating decentralized data structures that are universally addressable and linkable.

A Distributed Hash Table (DHT) enables the network to store an IPLD or flexible mapping from any "immutable data pointer", such as a CID to its corresponding Blake3 hash. As mentioned in the Content Addressing section, the network operates over Blake3 hashing for efficient content handling.

info

These addressable and linkable data structures will allow us to do for data what URLs and links did for HTML web pages (Quote from IPLD).

Content Addressable aRchive (CAR)

The core of Fleek Network understands the IPLD CAR Content Addressable aRchive, which unpacks and traverses to cache individual files. The archive's content is hashed as Blake3, which Fleek Network uses to address all data coming and going into the network, regardless of their origin.

warning

Despite handling IPLD CAR files, it serves raw archive content to the client. In other words, if a request for a complete CAR came through a gateway, the gateway (as a client) would have to build the file from the streamed data before sending it as a response to the end user.

info

The ordering of blocks in a CAR is random, e.g. two different CAR files storing the same content. This causes the need to traverse the archive (DAG-PB/UnixFS) to store the CAR blocks as individual content.

HTTP PUT Request Origin

An Origin is a location where content originates from. In the context of Fleek Network, the origin has to be supported for the data retrieval to function, some examples of what will be supported are Arweave, Filecoin and IPFS. For instance, the first supported storage is IPFS and a user of Fleek Network should have the data pinned for IPFS somewhere to have it cached by the Fleek Network CDN service on an HTTP PUT request.

info

A Client-side library can provide helpers to upload to some origin, such as IPFS and call the HTTP PUT for the origin.

Binary process

The Fleek Network binary process is the program that's been compiled down to machine code that the computer's processor can understand and execute. The project source code repository from which the binary is compiled is called Lightning. Most node operators set up the nodes by running the install wizard, others do it manually. When a node operator runs a node, it means that the binary process is launched in the node operator's computer. It runs as a separate instance in memory, with its own set of resources and permissions. The Fleek Network binary is an essential component that contributes to the network formation, distribution and decentralization. It runs on a supported Linux operating system, enabling users to run a wide variety of computing services and perform complex tasks.

Ports

Amongst other resources, ports play the role of managing and organizing network traffic. The ports initiate and terminate network connections crucial for the node to operate in the Fleek Network. The operating system should have the ports enabled and open for the node to run successfully.

The Node process requires the following ports:

  • RPC (port 4069)
  • Pool (4200)
  • Handshake (6969)
  • Narwhal
    • Primary (port 18000)
    • Worker (port 18101)
    • Mempool (port 18102)

There’s a single worker at the protocol level. In the future, if a node is allowed to run >1 worker, the ports can look like (worker#X):

  • Narwhal
    • Worker (port 18X01)
    • Mempool (or 18X02)
required

The ports should be freed before launching the node process. Any blockers or firewalls should be configured to enable the ports.

JSON-RPC Interface

A JSON-RPC (JavaScript Object Notation Remote Procedure Call) is a protocol that enables communication between client and server applications. The Fleek Network JSON-RPC API enables JSON-RPC interaction with Fleek Network Node.

Fleek Network JSON-RPC API reference documentation is available at https://fleek-network.github.io/lightning/api-documentation.

Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
- + \ No newline at end of file diff --git a/docs/learn/token-and-economics/index.html b/docs/learn/token-and-economics/index.html index 570fc2f28..a0542bb22 100644 --- a/docs/learn/token-and-economics/index.html +++ b/docs/learn/token-and-economics/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

Overview

The Fleek Network runs on an incentivized economy model that rewards node operators who provide resources that form the network. Currently, the economic model is to be considered a first draft, subject to change based on the data and feedback collected throughout all phases of testnet. The purpose of sharing a first draft is to provide clarity to prospective node operators and developers interested in participating in any pre-mainnet activities. You can find the complete breakdown of this information in this article

The Utility Token

Fleek Network has a utility token named FLK, an ERC-20 token issued on Ethereum (L1). The Fleek Network interacts with it as native to the protocol, given that the token intent is user accessibility and familiarity, making the interactions in the system as frictionless as possible. To accomplish this, the network has a Proof-of-Consensus bridge that facilitates entry and exit from Fleek Network—a Zero Knowledge Proof (ZKP) bridge that enables token retrieval.

Stable token for payments

The primary income for Account Holders is derived from a set of stable cryptocurrencies, which are easily tradable and highly liquid. For example, node operators receive rewards from stable coins (USD rate), ensuring a stable and predictable income stream. Note, that the network employs an inflationary mechanism, providing additional rewards for stakeholders via the minting of FLK tokens.

Resource Pricing

To start, Fleek Network only plans to charge for bandwidth and CPU cycles consumed. Pricing will be set at the network level, and resources will be priced and paid for in USD-denominated stablecoins. The exact pricing methodology will be determined and finalized throughout the testnet phases based on different factors. Those factors include:

  • Cost data the Foundation collects from node operators during testnet
  • The final specs of the SDK (which will determine what data the protocol can verifiably collect from nodes and reliably charge for)

Please be aware, there will be no fees paid during any of the testnet phases, the above is solely for illustrative purposes to give nodes a better understanding of the current thinking and what the process to finalize resource pricing might look like. We will work collaboratively with node operators throughout testnet to fairly determine resource pricing to ensure appropriate node incentivization while offering competitive pricing to developers.

It’s also important to note that node operators are independent of the Foundation, the network, and each other. They are responsible for managing their own economics, including any taxes payable in any jurisdiction relevant to them due to their participation in the network.


The FLK Token:

FLK is a staking token that is an integral part of the Fleek Network. Nodes running the Fleek Network client software are required to obtain and stake FLK in order to participate in the network and to have the opportunity to earn fees for providing work. Below is some high-level information on the anticipated characteristics of the FLK token:

  • Stake amount per node is set/managed at the protocol level, and consistent across all nodes
  • Work is allocated based on location (latency) and reputation (performance)
  • Resources on the network are priced and paid by users in USD denominated stablecoins
    • Pricing of resources happens at the network level.
  • Nodes only receive rewards related to work they perform, based on resources used/consumed (including FLK rewards)
  • FLK rewards are paid out per epoch (~24 hours). The FLK reward pool for each epoch is split proportionally between nodes who performed work during that epoch, calculated by the amount of USD revenue each node earned compared to the total revenue earned during that epoch.
  • 20% of the total FLK token supply is set aside for staking/rewards. The actual rate of rewards/inflation will be algorithmically controlled and updated based on network usage and other factors such as the market price of FLK.

DISCLAIMER: All information in this post about the FLK token and other elements of the Fleek Network is being provided solely for informational purposes and does not constitute an offer to sell FLK tokens, or a request for such offers, in any jurisdiction. There are currently no plans to sell FLK tokens. If FLK tokens do become available, you should not rely on the information in this blog post in making purchasing decisions, as the blog post was not prepared for that purpose and there will be important additional information to consider. In addition, we will likely publish further blog posts with updated information about the platform launch.

ALTHOUGH THERE ARE NO PLANS TO SELL FLK TOKENS AT THIS TIME, FOR THE AVOIDANCE OF DOUBT, IF FLK TOKENS EVER WERE TO BE SOLD, THEY WOULD BE OFFERED FOR SALE ONLY OUTSIDE OF THE UNITED STATES TO NON‐U.S. PERSONS, PURSUANT TO THE PROVISIONS OF REGULATION S OF THE U.S. SECURITIES ACT OF 1933, AS AMENDED (THE “SECURITIES ACT”). THE OFFER AND SALE OF FLK TOKENS WILL NOT BE REGISTERED UNDER THE SECURITIES ACT, AND MAY NOT BE OFFERED OR SOLD IN THE UNITED STATES ABSENT REGISTRATION OR AN APPLICABLE EXEMPTION FROM THE REGISTRATION REQUIREMENTS.

Algorithmic Economic System

The TLDR of the current implementation being discussed is that the network will handle the economic system/inflation algorithmically, using a concept we are calling NME, which stands for [N]et present value (npv) [M]arket price [E]quillibrium.

The algorithmic economic system has several goals, listed below in order of priority:

  • Provide an opportunity for receiving consistent blended earnings to node operators based on their work in most market conditions
    • “Blended” means taking into account both the USD stablecoin fees that nodes are earning, as well as the FLK rewards they are earning (including factoring in the time-weighted average market price of FLK).
    • This means if network usage/revenue increases, FLK rewards will likely decrease, and vice versa. This also means that if the time-weighted average market price of FLK increases, nodes should reasonably expect that the amount of FLK rewards will decrease, but the value of FLK rewards received (in USD terms) will remain approximately the same.
  • Don’t overcompensate nodes, especially in times of market volatility
    • If the market price of FLK deviates from the NPV calculated in-protocol based on time-weighted average protocol-level revenue, nodes should reasonably expect that FLK rewards by number would be reduced.
  • Keep the network economy in equilibrium in most market conditions
  • Provide better incentives to node operators that are long-term aligned

The algorithm driving the above system will run autonomously in-protocol. However, we anticipate that certain parameters of the algorithm may be treated as parameters that can be adjusted/updated with a network governance proposal, as needed. We currently anticipate that the parameters that can be adjusted will be:

  • Maximum FLK inflation/reward rate
  • Resource pricing (bandwidth, compute, etc.)
  • Average cost of running a node
  • Target node margin rate
  • Stake amount (# of FLK) per node
  • Discount rate
  • Time-weighted average market price of FLK
  • Maximum stake lock time
  • Stake lock multiplier

Protocol-Owned Liquidity

In addition to the in-protocol algorithmic network economic system, the DAO/protocol will also manage 5% of the FLK token supply, which we anticipate will be set aside specifically to allow the community to take certain actions intended to provide long-term benefits to the network’s ecosystem and to help maintain the intended balance in the network economy. It will behave based on predetermined conditions and rules that are publicly auditable. The high level function would be the following:

  • Set limit asks to sell tranches of FLK tokens at different price levels in the event of a market price increase that deviates from NPV
  • Set limit buys to buy FLK tokens in the event of a price decrease where market price is lower than the current NPV

Benefits:

  • Helps keep the economic system in equilibrium by using protocol-owned FLK inventory to absorb volatility
  • Generates additional revenue for the protocol by capturing fees related to these activities
  • Provides better liquidity for node operators who might want to liquidate a portion of their FLK rewards
  • Smooths out volatility/price changes in periods of extreme market fear/greed

FLK Token Distribution

The following is an initial rough draft of the potential FLK token distribution, subject to adjustments or revisions.

Overall Distribution

OverallPercentage (%)
Community66%
Core Contributors (current and future)17%
Backers/Node operators17%
Total100%

Community Distribution

Community memberPercentage (%)
Staking and rewards20%
Ecosystem funds (Airdrop, grants, etc)20%
DAO10%
Foundation10%
Protocol Owned Liquidity5%
Pre-Mainnet Community1%
Total66%
- + \ No newline at end of file diff --git a/docs/node/Install/index.html b/docs/node/Install/index.html index 232b99105..344b7849f 100644 --- a/docs/node/Install/index.html +++ b/docs/node/Install/index.html @@ -13,7 +13,7 @@ - + @@ -22,7 +22,7 @@

This section describes how to install the Fleek Network Lightning on supported operating systems. The installation can be made quicker by running the assisted installer or by following the manual installation if you want a bit more control.

Warning

If you'd like to participate in the alpha Testnet, you have to go through the onboarding process. Check the requirements and find the onboarding instructions to enable you to proceed and install a network node successfully.

Assisted installer

The assisted installer is a script written in Bash (Unix shell) that is available as a curl command line.

Prerequesites

  • A basic knowledge of command line interface (CLI)
  • A supported Linux server

Connect to your server

Connect to the Linux server where the Node's going to be installed via SSH by opening a shell session there.

If you have set up a public SSH key for the machine, connecting to the server should be as simple as:

ssh <USERNAME>@<REMOTE_HOST>
info

Check the cloud provider for instructions to understand how to setup an ssh connection and connect to it remotely. Some other users might have local access to a supported Linux server. To keep this guide short, we'll assume you've rented a VPS from a cloud provider.

Create a user

We recommend creating a non-root user with administrative privileges. It'll allow us to install any system requirements.

You can create a new user and add to the sudo group by running:

tip

For our example, we'll be using the name lgtn but you can pick whichever you'd like. If you already have a sudoer account, you can skip this step.

adduser lgtn

After completing the adduser steps, execute the usermod to add the user to the sudo group, as follows:

usermod -aG sudo lgtn

Switch to the new user by using the command:

su lgtn

Change the directory to the new user's home, as follows:

cd /home/lgtn

Run the script for a quick install

Copy and paste it to the server host terminal and execute it to launch the assisted installation process, as follows:

curl https://get.fleek.network | bash

On success, you should be greeted by the following welcome screen:

⭐️ Fleek Network Lightning CLI installer ⭐️

zeeeeee-
z$$$$$$"
d$$$$$$"
d$$$$$P
d$$$$$P
$$$$$$"
.$$$$$$"
.$$$$$$"
4$$$$$$$$$$$$$"
z$$$$$$$$$$$$$"
"""""""3$$$$$"
z$$$$P
d$$$$"
.$$$$$"
z$$$$$"
z$$$$P
d$$$$$$$$$$"
*******$$$"
.$$$"
.$$"
4$P"
z$"
zP
z"
/

★★★★★★★★★ 🌍 Website https://fleek.network
★★★★★★★★★ 📚 Documentation https://docs.fleek.network
★★★★★★★★★ 💾 Git repository https://github.com/fleek-network/lightning
★★★★★★★★★ 🤖 Discord https://discord.gg/fleekxyz
★★★★★★★★★ 🐤 Twitter https://twitter.com/fleek_net
★★★★★★★★★ 🎨 Ascii art by https://www.asciiart.eu

...

Remaining output omitted for brevity, you'll not see this text line

Follow the installation wizard to have the Fleek Network Lightning CLI and service installed on the supported server.

After creating the service file, you should reload the Systemd process, to apply the newly created service. You can do this by executing:

After creating the service, launch the service by executing the following command:

sudo systemctl start lightning.service
tip

To learn more about Systemctl commands, visit the section Use Systemctl to manage the Lightning Service

tip

Find the timeline of events for the Lightning service by checking the log files. Learn about it in the section Log Messages.

Once the installation is complete, do a health check! Check the section Health Check to learn how to do a node health checkup.

About the process

The installation process is open source and transparent. The source is available in the get.fleek.network or the origin repository here.

info

"Get Fleek Network" is an attempt to make our software more accessible. By providing scripts to automate the installation process of our software, we believe that it can help improve the onboarding experience of our users.

The installer assists the node operator by automating the Lightning CLI build from the open-source code and setting up the system service. A node operator should use the assisted installer to ease onboarding, reduce repetition,

At a high level, the installer will:

  • Install required dependencies, e.g. rust toolchain
  • Pull the source code from the origin repository
  • Build the binary, e.g. a lightning CLI (lgtn) is compiled from source code
  • Setup a Systemd service named lightning
  • Provide instructions to launch, stop the Fleek network via the Systemd lightning service
tip

Remember that if you use the assisted installer, you won't have to do the manual installation process as described in the next section. On success, the assisted installer should provide the same result as following the manual instructions.

Manual installation

The following section will walk through the dependencies and Rust installation process for Linux. If you're on Windows, we recommend to setup Windows Subsystem Linux, reading the Ubuntu tutorial or picking another supported distro. The WSL will let you use Linux applications, utilities and bash command tools you'll find in the tutorial.

tip

We're only supporting Linux operating system (server edition). Find the list of supported OS here.

Prerequisites

To follow the guide, you will need the following:

  • Familiarity with the command-line interface
  • Git

You're required to have some experience with the command-line interface and have Git installed; Also, you should be happy to troubleshoot, since versions might differ from the time of writing and reading. Most times, a simple web search provides the best answers.

If you don't have Git installed, learn more about it and the instructions by reading the Git documentation.

Create a user

We recommend creating a non-root user with administrative privileges. It'll allow us to install any system requirements.

You can create a new user and add to the sudo group by running:

tip

For our example, we'll be using the name lgtn but you can pick whichever you'd like. If you already have a sudoer account, you can skip this step.

adduser lgtn

After completing the adduser steps, execute the usermod to add the user to the sudo group, as follows:

usermod -aG sudo lgtn

Switch to the new user by using the command:

su lgtn

Change the directory to the new user's home, as follows:

cd /home/lgtn

Install Rust with Rustup tool

Visit the Rust website getting started guide, to find, copy and run the Rustup tool for installation and version management.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
tip

curl is an application that is generally available in most OS, if missing install it. Find more here.

Alternatively, if you have installed Rust in the past, you may want to update it 👌.

rustup update

During the installation process, if asked about preferences, select the default option!

You can uninstall at any time with rustup self uninstall and
these changes will be reverted.

Current installation options:


default host triple: x86_64-unknown-linux-gnu
default toolchain: stable (default)
profile: default
modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
tip

Once complete, you'll have to restart your current shell or reload the "PATH" environment variable to include Cargo's bin directory $HOME/.cargo/bin. This is required to let you use "cargo" command globally.

To configure your current shell, run:

source "$HOME/.cargo/env"

From then on, the latest version of Cargo (Rust's build and package manager tool) should be installed. Learn more about Cargo, here.

Check the version to confirm's working correctly:

cargo --version

Here's the output we got (beware that our version might differ to yours, it's expected 😅).

cargo 1.65.0 (4bc8f24d3 2022-10-20)

Lightning installer rust dependencies

Rustup subcommands deal with toolchains, a collection of programs required to compile a Rust application.

rustup toolchain list

For example, on Linux Ubuntu we generally have it set to the default:

stable-x86_64-unknown-linux-gnu (default)

While on macOS:

stable-x86_64-apple-darwin (default)

Make sure you have Rustup set to the desired toolchain as default if required 💁‍♀️!

rustup default <TOOLCHAIN-LIST-NAME>
tip

Rust compilation is long and compiler caching can help speed things up immensely. The Lightning CLI project can be used to reduce the perceived compilation times.

Linux dependencies

On Linux (we'll stick with Ubuntu as the Linux distro example), start by updating the package information in the source list and then upgrade all the installed packages with the latest versions (do the equivalent for your Linux distro), as follows:

sudo apt-get update
sudo apt-get upgrade
tip

You can optionally pass the y flag to skip any user prompts e.g. sudo apt-get update -y to any remaining apt-get commands.

Install the build-essentials packages, necessary for compiling general software and for our use-case Lightning CLI.

sudo apt-get install build-essential

Followed by the required tools to compile the application (cmake, clang, pkg-config and libssl-dev ).

sudo apt-get install cmake clang pkg-config libssl-dev gcc-multilib
tip

For Debian, you should install gcc, as follows:

sudo apt-get update
sudo apt-get install gcc

Now install the Protobufer Compiler.

sudo apt-get install protobuf-compiler

Ensure the compiler version is 3+

protoc --version

Installing Lightning CLI

If you haven't already, clone the Fleek Network's Lightning repository to your machine.

tip

You have several ways of doing this:

  • Clone via HTTPS
  • Clone via SSH
  • Download via Github CLI
  • Download the zip package from the repository

We recommend HTTPS because it is the easiest to set up in the wild, and by users who are new to all this. Although, we strongly recommend using an SSH connection when interacting with GitHub. If you are to this and are interested read more about it here.

git clone -b testnet-alpha-0 https://github.com/fleek-network/lightning.git <DIRECTORY-NAME>

Here's an example of what it'd look like when sticking to the recommended path location:

git clone -b testnet-alpha-0 https://github.com/fleek-network/lightning.git ~/fleek-network/lightning

When git clone completes 👍, change directory to the project directory e.g. we cloned to the default name ~/fleek-network/lightning:

cd ~/fleek-network/lightning
note

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.

If you list (ls) the files in the directory, it should be similar to:

.
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── Cargo.lock
├── Cargo.toml
├── LICENSE
├── README.md
├── codecov.yml
├── core
├── docs
├── lib
├── lightning.toml
├── rust-toolchain
├── rustfmt.toml
├── services
└── target

At this point, you should be able to run the install command successfully.

caution

If you already had Rust installed, or the project before, and skipped instructions directly here, there might be case where you get errors. So, make sure to clear your work directory:

cargo clean
cargo update

Start the install process by running the command:

cargo build
tip

At the time of writing, Fleek Network lightning is under development, thus we're using the cargo build command. Alternatively, you're recommended to use the +stable, e.g. cargo +stable build.

The installation process is long, as it compiles the application binary for us from the source code.

🌈 Here's the output when successful! Note, that the output might differ slightly from time of writting.

    Finished release [optimized] target(s) in 11m 22s
Installing /root/.cargo/bin/lightning
Installed package `lightning v0.1.0 (/crates/lightning)` (executable `lightning`)
tip

Once Rust generates the binary lightning-node, you can find it in the project root target directory. Depending on the usage of +stable flag, the binary should be located at ~/fleek-network/lightning/target/debug/lightning-node or ~/fleek-network/lightning/target/release/lightning-node.

You can create an lgtn symbolic link to /usr/local/bin to make it available globally.

sudo ln -s "$HOME/fleek-network/lightning/target/release/lightning-node" /usr/local/bin/lgtn

After completing, you'll have the ability to type lgtn to execute the binary anywhere for your user account. Other users might find it better to copy or create an alias instead.

Run the lgtn help sub-command as a checkup:

Usage: lightning-node [OPTIONS] <COMMAND>

Commands:
run Start the node
keys Handle keys
print-config Print the loaded configuration
help Print this message or the help of the given subcommand(s)

Options:
-c, --config <CONFIG> Path to the toml configuration file [default: lightning.toml]
--with-mock-consensus Determines that we should be using the mock consensus backend
-v... Increases the level of verbosity (the max level is -vvv)
--log-location Print code location on console logs
-h, --help Print help
-V, --version Print version
caution

Beware that your output might differ a bit, as Lightning is in constant development. Note that you'll have to "re-install" every time you want to pull updates from the source repository, as the update at the time of writing is done manually and not automatically.

Key generator

Before starting the node, you should generate a public and private key.

lgtn keys generate

The keys will be generated and placed under the system directory ~/.lightning/keystore. The private key is the user's responsibility and no one else can generate or recover it for you, including Fleek Network or any team member. Your keys, your responsibility!

Set user path in config.toml

You should be following the create a user recommendation. For our example, we have the username lgtn.

tip

If you have chosen a different username, replace lgtn by the correct username you have selected.

In the config.toml you'll find some and more of the following:

[BLANK]

[application]
db_path = "~/.lightning/data/app_db"

[consensus]
store_path = "~/.lightning/data/narwhal_store"

[fsstore]
root = "~/.lightning/blockstore"

[resolver]
store_path = "~/.lightning/data/resolver_store"

[signer]
consensus_key_path = "~/.lightning/keystore/consensus.pem"
node_key_path = "~/.lightning/keystore/node.pem"

Find and replace all instances of ~ in the config file /home/lgtn/.lightning/config.toml. Here's an example using sed:

sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"
caution

The 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.

Once changed, all the instances of ~/ should be replaced by your user path e.g. /home/lgtn/. For our example, the output would look like the following:

[BLANK]

[application]
db_path = "/home/lgtn/.lightning/data/app_db"

[consensus]
store_path = "/home/lgtn/.lightning/data/narwhal_store"

[fsstore]
root = "/home/lgtn/.lightning/blockstore"

[resolver]
store_path = "/home/lgtn/.lightning/data/resolver_store"

[signer]
consensus_key_path = "/home/lgtn/.lightning/keystore/consensus.pem"
node_key_path = "/home/lgtn/.lightning/keystore/node.pem"

Set testnet in config.toml

Set the testnet attribute to true in the config.toml lcated in the path ~/.lightning/config.toml.

[application]
db_path = "~/.lightning/data/app_data"
mode = "Prod"
storage = "RocksDb"
testnet = true

...
tip

The configuration file should have more content, which was omitted here to keep it short and to the point. You're interested in the testnet property name only.

Start the node

Warning

To participate in the alpha Testnet, you have to through the onboarding process. Make sure you request access by following the onboarding instructions. If you fail to enable your node for testnet, it'll not run!

To start the node, you should execute the sub-command run. Noteworthy that while it launches the node, you're recommended to setup a systemd service to run it for a long period.

lgtn run
WARNING

We recommend setting up the process as a systemd service, as it's a long-running process. Instructions to setup a systemd service are available in the section Systemd Service Setup.

Great! You have successfully installed all the required packages, and libraries and have compiled and installed lightning. Check the section Health Check to learn how to do a node health checkup.

Systemd Service Setup

Create a new Systemd service file:

sudo touch /etc/systemd/system/lightning.service

Open the file and put the following content:

[Unit]
Description=Fleek Network Node lightning service

[Service]
User=lgtn
Type=simple
MemoryHigh=32G
RestartSec=15s
Restart=always
ExecStart=lgtn -c /home/lgtn/.lightning/config.toml run
StandardOutput=append:/var/log/lightning/output.log
StandardError=append:/var/log/lightning/diagnostic.log
Environment=TMPDIR=/var/tmp

[Install]
WantedBy=multi-user.target
caution

Notice that we're using lgnt as the username. If you have a different custom username change it accordingly. Beware that we've recommended using a non-root user, as described in the section create a user.

note

The flag -c in the lightning.service ExecStart, is to provide the toml configuration file path e.g. defaults to ~/.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 user or sudoer. For example, a sudoer would have the configuration set to /root/.lightning/config.toml or /home/username/.lightning/config.toml depending on using sudo which might cause some confusion to some users.

Change the file permissions for the service:

sudo chmod 644 /etc/systemd/system/lightning.service

After creating the service file, you should reload the Systemd process, to apply the newly created service. You can do this by executing:

sudo systemctl daemon-reload

To start the service at boot, use the enable command:

sudo systemctl enable lightning.service

Create the directory where the log message will be stored, as follows:

sudo mkdir -p /var/log/lightning

You may want to create empty placeholders for the stdout and stderr log files:

sudo touch /var/log/lightning/output.log
sudo touch /var/log/lightning/diagnostic.log
WARNING

We're assuming that you've created a new user and can start the service operating without sudo.

Start the service by:

sudo systemctl start lightning.service
tip

Find the timeline of events for the Lightning service by checking the log files. Learn about it in the section Log Messages.

To learn more, visit the section Use Systemctl to manage the Lightning Service

Health Check

A health check is a special API endpoint that's used to validate the status of a service. To do a health check of a Fleek Network node use the JSON RPC interface via the command line.

tip

We're going to use cURL, make sure that you have it installed otherwise install it in your operating system.

We'll send a request to the JSON RPC flk_ping method. Execute the following command:

$ curl -X POST -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"method": "flk_ping",
"params": [],
"id": 1
}' http://127.0.0.1:4069/rpc/v0

If the request is successful, you should get the result pong as follows:

{
"jsonrpc": "2.0",
"result": "pong",
"id": 1
}

To learn more about health checkups, read the section Health-check

Use Systemctl to manage Systemd Service

Learn how to enable, disable, start, stop the Systemd Service for Fleek Network. The service is set up by the Assisted installer (automatically), or manually (optional) as described in Manual installation.

Reload the Systemctl daemon by executing the command:

sudo systemctl daemon-reload

Enable the service for starting up on system boot:

sudo systemctl enable lightning.service
caution

You shouldn't have prefix the systemctl command with sudo when start/stop/status the service. Due to some VPS providers modifying the operating system, we had to present the examples prefixed with sudo for the wider audience. If you'd like to learn more about controlling Systemd services as a user check the reference Systemd user-service.

Start the service by:

sudo systemctl start lightning.service
tip

When naming the service, the *.service can be omitted. For this reason the command can be typed as follows:

sudo systemctl start lightning

Stop the service by:

sudo systemctl stop lightning

Restart the service by:

sudo systemctl restart lightning

Check the service status by:

sudo systemctl status lightning.service

Analyzing Log Messages

The service logs provide a timeline of events for the Lightning service that is valuable for troubleshooting when encountering issues. When issues arise, analyzing log files is the first thing a node operator needs to do.

To have the log message files (output.log and diagnostic.log), these have to be set up. If you have installed the Node via the Assisted installer, the logs are set up for you automatically.

You can watch the Node output by running the command:

tail -f /var/log/lightning/output.log

You can watch the Node diagnostics or errors by running the command:

tail -f /var/log/lightning/diagnostic.log
Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
- + \ No newline at end of file diff --git a/docs/node/configuration/index.html b/docs/node/configuration/index.html index 7d99588a7..1ce54baef 100644 --- a/docs/node/configuration/index.html +++ b/docs/node/configuration/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/node/diagnostics/index.html b/docs/node/diagnostics/index.html index 88b9b13dd..3366d49a4 100644 --- a/docs/node/diagnostics/index.html +++ b/docs/node/diagnostics/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/node/health-check/index.html b/docs/node/health-check/index.html index 2551e01e9..fc894b58a 100644 --- a/docs/node/health-check/index.html +++ b/docs/node/health-check/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

TL;DR: Run the command

A script is available to do and provide a health check overview:

curl -sS https://get.fleek.network/healthcheck | bash

Overview

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.

A Node operator or system administrator can communicate with the node to confirm the status at any time.

tip

We're using cURL, for the examples, thus make sure that you have it installed on your operating system.

Quick health check

Run a quick health check by sending a GET request to /health endpoint of RPC on port 4069.

curl -w "\p" localhost:4069/health

If successful, you should get the response OK, as follows:

OK

If you get an error, then it means that your node is not healthy.

JSON-RPC Health check

We'll send a request to the JSON RPC flk_ping method. Execute the following command:

$ curl -X POST -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"method": "flk_ping",
"params": [],
"id": 1
}' http://127.0.0.1:4069/rpc/v0

If the request is successful, you should get the result pong as follows:

{
"jsonrpc": "2.0",
"result": "pong",
"id": 1
}

Any other response, such as errors determine that the node is not healthy.

Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
- + \ No newline at end of file diff --git a/docs/node/overview/index.html b/docs/node/overview/index.html index 1d09fd106..bc64a090a 100644 --- a/docs/node/overview/index.html +++ b/docs/node/overview/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

Overview

This section provides instructions to help you build a Fleek Network Node, it's aimed at everybody willing to learn and cultivate knowledge as a Node operator.

tip

To participate in the alpha Testnet, you can begin by setting up and running nodes. Check the requirements and find the onboarding instructions to enable you to install a network node successfully.

Node operator


A Node Operator is represented as a system administrator who builds, installs or maintains one or many Nodes in a server or more.

Anyone willing to learn can become a Node operator, which will be enabled to set up and run a Node on their own at any time without the need for anyone's permission.

Amongst others, the use cases we try to cover are:

  • Server requirements
  • Installing the Node easily with the installation wizard
  • Building a Node binary from source code
  • Configuring the Node
  • Securing the server and identity
  • Updating the Node
  • Learning to troubleshoot
  • Understanding the Node log messages

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 Discord or by opening a PR in any of our repositories.

Ready? Start by checking the Server requirements

Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
- + \ No newline at end of file diff --git a/docs/node/requirements/index.html b/docs/node/requirements/index.html index 056cb892c..46dafd9de 100644 --- a/docs/node/requirements/index.html +++ b/docs/node/requirements/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

Requirements

This section provides the requirements for the server specifications on which the Fleek Network Node can be installed and run.

warning

Only 64-bits distributions are supported. Do not try to install it on a 32-bits operating system!

Server


The Fleek Network node binary is only supported by a Linux server. Currently, we are only providing support for the following distros:

  • Debian
  • Ubuntu
tip

Support for other OS will be made available soon, e.g. CentOS and Fedora. Any contributions to provide support for your favorite distro are welcomed! Feel free to open a PR in our repositories.

Because of the use of Linux containerization technology, other operating systems, such as FreeBSD, OpenBSD, MacOS, Windows and others are not supported.

If you don’t have a server or a spare machine, keep reading as we'll give you some hints on how to rent one, although we are not affiliated with any provider.

Ports

Amongst other resources, ports play the role of managing and organizing network traffic. The ports initiate and terminate network connections crucial for the node to operate in the Fleek Network. The operating system should have the ports enabled and open for the node to run successfully.

The Node process requires the following ports:

  • RPC (port 4069)
  • Pool (4200)
  • Handshake (6969)
  • Narwhal
    • Primary (port 18000)
    • Worker (port 18101)
    • Mempool (port 18102)

There’s a single worker at the protocol level. In the future, if a node is allowed to run >1 worker, the ports can look like (worker#X):

  • Narwhal
    • Worker (port 18X01)
    • Mempool (or 18X02)
required

The ports should be freed before launching the node process. Any blockers or firewalls should be configured to enable the ports.

Specs


The Fleek Network node binary is only supported on CPUs that adhere to the x86_64 architecture (64-bit).

A minimum of 32 GB of memory (RAM) is required and a reasonable amount of disk space for the installation and running processes, which at the minimum should be around 20 GB.

Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
- + \ No newline at end of file diff --git a/docs/node/testnet-onboarding/index.html b/docs/node/testnet-onboarding/index.html index 442dfdbe8..7055706cf 100644 --- a/docs/node/testnet-onboarding/index.html +++ b/docs/node/testnet-onboarding/index.html @@ -13,7 +13,7 @@ - + @@ -22,7 +22,7 @@

Testnet Onboarding

  1. Join our Discord server

    a) To get onboarded, go to the Fleek Network Nodes section and follow the instructions in the #access-guide channel

  2. Learn about the required server specifications on which the Fleek Network Node can be installed and run.

  3. Follow the instructions to install the node via the assisted installer (easy) or manually (advanced).

  4. In our Discord server, visit #access-form, run the node commands, and submit the information in the form.

Important

Live information should be checked in the Fleek Network node announcements Discord channel. Due to the number of requests and to improve the onboarding experience, the channel or forms might have offline periods. Check the node announcements for live updates, please!

  1. The team will review your application, allowing/listing your node if approved
info

When approved, you will be notified in the #access-approved channel on Discord and given the Node Operator role.

Important Discord Notes & Events:

  • All announcements for node operators will be sent to #node-announcements
  • You can ask for help in #troubleshooting, or chat with the team in the #node-operators channel
  • Every Friday at 3 pm EST, we will conduct Node Community Calls in #node-stage

Node whitelist verification

You might find it useful to run the following command to verify the status of the node whitelist status–since a node throws an error if not whitelisted, this can be verified by looking at and monitoring the diagnostic.log file manually, otherwise, use the method shared here.

1) Connect to the server terminal where the node is installed

2) Switch to the user account that was used to set up the node as recommended in the installation guide

3) Execute the following command

curl -sS https://get.fleek.network/whitelist | bash
tip

The node whitelist verification will verify the logs output to determine if the node has the "node whitelist" error. You can verify this manually by observing the diagnostic.log. To learn how to check the logs, read the section analyzing log messages.

danger

We are going to be whitlisting in waves at the beginning of every epoch. Epochs are currently 30 mins (as for this period of testnet). If you have updated the binary, run the node that you applied with. While your not whitelisted your node will be checking every 5 minutes and will start when whitelisted.

- + \ No newline at end of file diff --git a/docs/roadmap/index.html b/docs/roadmap/index.html index 9d0a6e9b1..41a8efc54 100644 --- a/docs/roadmap/index.html +++ b/docs/roadmap/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

Roadmap

Introduction

Instead of restricting our network architecture/capabilities to a CDN service, Fleek Network's core was redesigned to support a fully decentralized edge platform upon which many edge services e.g. CDN, serverless functions, amongst others, can be built. The new architecture separates each aspect of the network (blockchain - edge infrastructure - services) so that anyone can build new edge services on Fleek Network.

Several milestones were completed toward our next early Testnet goal: the whitepaper was launched, and the Github repo was published.

For a complete description of our testnet plans, road to mainnet, and testnet participation initiatives, read the following blog post.

Current state: Road to Testnet

Our current roadmap on the road to an early testnet stands as follows, currently in *Phase {0}:

Phases 0 to 5

Fleek Network will utilize a multi-phase approach to rolling out mainnet. The current high-level plan, set out below, depends on a variety of factors and may change in response to development timelines and/or data/feedback collected throughout the different phases.

  • Phase 0 (September 5th): Node Rollout
    • Initial network and node testing (performance, hardware specs, clustering, costs, metrics, etc.)
  • Phase 1 (mid-late September): SDK/Service Rollout
    • Introduce the SDK and test the building and utilizing of services on the network, as well as some optimizations based on Phase 0.
  • Phase 2 (October): Initial Economics Rollout
    • Introduce and test a more concrete version of the economic algorithm, including staking, pricing, and other elements/situations using test (valueless) tokens, as well as some optimizations based on Phase 1.
  • Phase 3 (November): Layer 2 Contracts Rollout
    • Introduce a test version of the aspects of the protocol that will live on an Ethereum L2 (staking, deposit and token contracts, communication between L2/FN, etc).
  • Phase 4 (December): Final Rollout
    • Introduce the final form of the first generation of the network, based on all data/feedback and optimizations throughout all the phases, and allow testing of what a realistic mainnet environment will be like.
  • Phase 5 (Q1 2024): Mainnet Launch

The goals for all stages involve completing and revising the following:

  • Network performance
  • Hardware/node specs
  • Sandboxing of services
  • Packaging and pricing of initial network resources/commodities
  • Parameters related to the FLK token
  • Security testing/auditing
  • Criteria for allocation of pre-mainnet community tokens

Mainnet

The mainnet release of Fleek Network will come with the arrival of a stable and end-to-end tested version of the protocol. Details on the transition to mainnet will be discussed later in the future.

We will continue to update this roadmap in the short and long term to reflect the different stages the network goes through.

- + \ No newline at end of file diff --git a/docs/tags/about/index.html b/docs/tags/about/index.html index dd56b1c44..e387c082a 100644 --- a/docs/tags/about/index.html +++ b/docs/tags/about/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/algorithms/index.html b/docs/tags/algorithms/index.html index 272576ea1..1d417dbd8 100644 --- a/docs/tags/algorithms/index.html +++ b/docs/tags/algorithms/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/architecture/index.html b/docs/tags/architecture/index.html index 34d4f40a0..f2b03314f 100644 --- a/docs/tags/architecture/index.html +++ b/docs/tags/architecture/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/awards/index.html b/docs/tags/awards/index.html index c8c83f245..def12a6db 100644 --- a/docs/tags/awards/index.html +++ b/docs/tags/awards/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/build/index.html b/docs/tags/build/index.html index d89082038..7bcd3d98b 100644 --- a/docs/tags/build/index.html +++ b/docs/tags/build/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

2 docs tagged with "build"

View All Tags

Install

The Fleek Network Lightning CLI installation walkthrough

- + \ No newline at end of file diff --git a/docs/tags/cdn/index.html b/docs/tags/cdn/index.html index bf9c60320..cf427ca66 100644 --- a/docs/tags/cdn/index.html +++ b/docs/tags/cdn/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

7 docs tagged with "CDN"

View All Tags

Developers

Welcome to the documentation site for Fleek Network, the decentralized content and application layer built on established decentralized storage protocols combined with high-speed caching and an effective delivery layer.

Developers

Welcome to the documentation site for Fleek Network, the decentralized content and application layer built on established decentralized storage protocols combined with high-speed caching and an effective delivery layer.

Edge Nodes

Welcome to the documentation site for Fleek Network, the decentralized content and application layer built on established decentralized storage protocols combined with high-speed caching and an effective delivery layer.

Install

The Fleek Network Lightning CLI installation walkthrough

Services

Welcome to the documentation site for Fleek Network, the decentralized content and application layer built on established decentralized storage protocols combined with high-speed caching and an effective delivery layer.

Services

A Fleek Network Service is a modular application that runs on nodes and allows users to perform well-defined functions or some specific tasks. Services are scalable and performant due to edge computation and networking features provided by the core principles of the network.

Whitepaper

Fleek Network's whitepaper and codebase.

- + \ No newline at end of file diff --git a/docs/tags/client/index.html b/docs/tags/client/index.html index a9188e0d3..f08f4e1d3 100644 --- a/docs/tags/client/index.html +++ b/docs/tags/client/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/code-of-conduct/index.html b/docs/tags/code-of-conduct/index.html index 0ee4b1a68..f2edae3a6 100644 --- a/docs/tags/code-of-conduct/index.html +++ b/docs/tags/code-of-conduct/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/codebase/index.html b/docs/tags/codebase/index.html index 01c24c76b..968cd3cca 100644 --- a/docs/tags/codebase/index.html +++ b/docs/tags/codebase/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/compile/index.html b/docs/tags/compile/index.html index cbb514177..eefb7c9a6 100644 --- a/docs/tags/compile/index.html +++ b/docs/tags/compile/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

One doc tagged with "compile"

View All Tags

Install

The Fleek Network Lightning CLI installation walkthrough

- + \ No newline at end of file diff --git a/docs/tags/configuration/index.html b/docs/tags/configuration/index.html index 11ac8b5cc..826f1eba0 100644 --- a/docs/tags/configuration/index.html +++ b/docs/tags/configuration/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/consensus/index.html b/docs/tags/consensus/index.html index 6677f1066..cfe42a55f 100644 --- a/docs/tags/consensus/index.html +++ b/docs/tags/consensus/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/contribute/index.html b/docs/tags/contribute/index.html index 80c10e4f1..be43e221d 100644 --- a/docs/tags/contribute/index.html +++ b/docs/tags/contribute/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/contributing/index.html b/docs/tags/contributing/index.html index bb8d3ff1b..2b778a056 100644 --- a/docs/tags/contributing/index.html +++ b/docs/tags/contributing/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/contributor/index.html b/docs/tags/contributor/index.html index 4f05b8a49..07d690cf1 100644 --- a/docs/tags/contributor/index.html +++ b/docs/tags/contributor/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/cryptoeconomics/index.html b/docs/tags/cryptoeconomics/index.html index 91274b7cf..3789b5a2c 100644 --- a/docs/tags/cryptoeconomics/index.html +++ b/docs/tags/cryptoeconomics/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/decentralization/index.html b/docs/tags/decentralization/index.html index 683036c45..795b5f8a9 100644 --- a/docs/tags/decentralization/index.html +++ b/docs/tags/decentralization/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/develop/index.html b/docs/tags/develop/index.html index 4ff756bc5..7bd9e6fb8 100644 --- a/docs/tags/develop/index.html +++ b/docs/tags/develop/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

One doc tagged with "develop"

View All Tags

Overview

Developers can create and utilize a multitude of Edge Services that inherit cryptographic and economically secured infrastructure. On top of geographic coverage guarantees, predictable costs and performance across all services running on the network.

- + \ No newline at end of file diff --git a/docs/tags/development/index.html b/docs/tags/development/index.html index aa740243c..bde23b53a 100644 --- a/docs/tags/development/index.html +++ b/docs/tags/development/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

One doc tagged with "development"

View All Tags

Services

A Fleek Network Service is a modular application that runs on nodes and allows users to perform well-defined functions or some specific tasks. Services are scalable and performant due to edge computation and networking features provided by the core principles of the network.

- + \ No newline at end of file diff --git a/docs/tags/diagnostics/index.html b/docs/tags/diagnostics/index.html index 1e88b263c..9d9afb4c4 100644 --- a/docs/tags/diagnostics/index.html +++ b/docs/tags/diagnostics/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/economics/index.html b/docs/tags/economics/index.html index a51801037..a426c1e12 100644 --- a/docs/tags/economics/index.html +++ b/docs/tags/economics/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/edge-network/index.html b/docs/tags/edge-network/index.html index 704ca6196..f718e20c2 100644 --- a/docs/tags/edge-network/index.html +++ b/docs/tags/edge-network/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/edge-platform/index.html b/docs/tags/edge-platform/index.html index c053033e4..5ccd8909e 100644 --- a/docs/tags/edge-platform/index.html +++ b/docs/tags/edge-platform/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

6 docs tagged with "Edge Platform"

View All Tags

About

Welcome to the documentation site for Fleek Network, the decentralized content and application layer built on established decentralized storage protocols combined with high-speed caching and an effective delivery layer.

Developers

Welcome to the documentation site for Fleek Network, the decentralized content and application layer built on established decentralized storage protocols combined with high-speed caching and an effective delivery layer.

Developers

Welcome to the documentation site for Fleek Network, the decentralized content and application layer built on established decentralized storage protocols combined with high-speed caching and an effective delivery layer.

Services

Welcome to the documentation site for Fleek Network, the decentralized content and application layer built on established decentralized storage protocols combined with high-speed caching and an effective delivery layer.

Services

A Fleek Network Service is a modular application that runs on nodes and allows users to perform well-defined functions or some specific tasks. Services are scalable and performant due to edge computation and networking features provided by the core principles of the network.

Whitepaper

Fleek Network's whitepaper and codebase.

- + \ No newline at end of file diff --git a/docs/tags/fleek-network/index.html b/docs/tags/fleek-network/index.html index d2f701451..883bc8009 100644 --- a/docs/tags/fleek-network/index.html +++ b/docs/tags/fleek-network/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

10 docs tagged with "Fleek Network"

View All Tags

About

Welcome to the documentation site for Fleek Network, the decentralized content and application layer built on established decentralized storage protocols combined with high-speed caching and an effective delivery layer.

Developers

Welcome to the documentation site for Fleek Network, the decentralized content and application layer built on established decentralized storage protocols combined with high-speed caching and an effective delivery layer.

Developers

Welcome to the documentation site for Fleek Network, the decentralized content and application layer built on established decentralized storage protocols combined with high-speed caching and an effective delivery layer.

Edge Nodes

Welcome to the documentation site for Fleek Network, the decentralized content and application layer built on established decentralized storage protocols combined with high-speed caching and an effective delivery layer.

Install

The Fleek Network Lightning CLI installation walkthrough

Roadmap

Fleek Network's high-level roadmap per stage. Devnet, Testnet, and Mainnet.

Services

Welcome to the documentation site for Fleek Network, the decentralized content and application layer built on established decentralized storage protocols combined with high-speed caching and an effective delivery layer.

Whitepaper

Fleek Network's whitepaper and codebase.

- + \ No newline at end of file diff --git a/docs/tags/getting-started/index.html b/docs/tags/getting-started/index.html index 87159c9ce..cdf01fb54 100644 --- a/docs/tags/getting-started/index.html +++ b/docs/tags/getting-started/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

2 docs tagged with "Getting Started"

View All Tags

Install

The Fleek Network Lightning CLI installation walkthrough

- + \ No newline at end of file diff --git a/docs/tags/git/index.html b/docs/tags/git/index.html index f79eb0a09..d610277a8 100644 --- a/docs/tags/git/index.html +++ b/docs/tags/git/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/guide/index.html b/docs/tags/guide/index.html index f510afa66..4bc1daa23 100644 --- a/docs/tags/guide/index.html +++ b/docs/tags/guide/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

7 docs tagged with "Guide"

View All Tags

About

Welcome to the documentation site for Fleek Network, the decentralized content and application layer built on established decentralized storage protocols combined with high-speed caching and an effective delivery layer.

Developers

Welcome to the documentation site for Fleek Network, the decentralized content and application layer built on established decentralized storage protocols combined with high-speed caching and an effective delivery layer.

Developers

Welcome to the documentation site for Fleek Network, the decentralized content and application layer built on established decentralized storage protocols combined with high-speed caching and an effective delivery layer.

Edge Nodes

Welcome to the documentation site for Fleek Network, the decentralized content and application layer built on established decentralized storage protocols combined with high-speed caching and an effective delivery layer.

Install

The Fleek Network Lightning CLI installation walkthrough

Services

Welcome to the documentation site for Fleek Network, the decentralized content and application layer built on established decentralized storage protocols combined with high-speed caching and an effective delivery layer.

Services

A Fleek Network Service is a modular application that runs on nodes and allows users to perform well-defined functions or some specific tasks. Services are scalable and performant due to edge computation and networking features provided by the core principles of the network.

- + \ No newline at end of file diff --git a/docs/tags/healthcheck/index.html b/docs/tags/healthcheck/index.html index f245cfcae..264fab850 100644 --- a/docs/tags/healthcheck/index.html +++ b/docs/tags/healthcheck/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/incentives/index.html b/docs/tags/incentives/index.html index 4c3378f3f..54f630628 100644 --- a/docs/tags/incentives/index.html +++ b/docs/tags/incentives/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/index.html b/docs/tags/index.html index c3dcd4e94..b51334932 100644 --- a/docs/tags/index.html +++ b/docs/tags/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/learn/index.html b/docs/tags/learn/index.html index 61d9a0168..76418b581 100644 --- a/docs/tags/learn/index.html +++ b/docs/tags/learn/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

7 docs tagged with "Learn"

View All Tags

About

Welcome to the documentation site for Fleek Network, the decentralized content and application layer built on established decentralized storage protocols combined with high-speed caching and an effective delivery layer.

Developers

Welcome to the documentation site for Fleek Network, the decentralized content and application layer built on established decentralized storage protocols combined with high-speed caching and an effective delivery layer.

Developers

Welcome to the documentation site for Fleek Network, the decentralized content and application layer built on established decentralized storage protocols combined with high-speed caching and an effective delivery layer.

Edge Nodes

Welcome to the documentation site for Fleek Network, the decentralized content and application layer built on established decentralized storage protocols combined with high-speed caching and an effective delivery layer.

Services

Welcome to the documentation site for Fleek Network, the decentralized content and application layer built on established decentralized storage protocols combined with high-speed caching and an effective delivery layer.

Services

A Fleek Network Service is a modular application that runs on nodes and allows users to perform well-defined functions or some specific tasks. Services are scalable and performant due to edge computation and networking features provided by the core principles of the network.

- + \ No newline at end of file diff --git a/docs/tags/manual/index.html b/docs/tags/manual/index.html index 2b106b633..3d03f6ce3 100644 --- a/docs/tags/manual/index.html +++ b/docs/tags/manual/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

One doc tagged with "manual"

View All Tags

Install

The Fleek Network Lightning CLI installation walkthrough

- + \ No newline at end of file diff --git a/docs/tags/node-status/index.html b/docs/tags/node-status/index.html index aa28df06a..c9c42dc25 100644 --- a/docs/tags/node-status/index.html +++ b/docs/tags/node-status/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/onboarding/index.html b/docs/tags/onboarding/index.html index 0d2c62848..2d3260d51 100644 --- a/docs/tags/onboarding/index.html +++ b/docs/tags/onboarding/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/open-source/index.html b/docs/tags/open-source/index.html index f9eabdf47..a0e73e57e 100644 --- a/docs/tags/open-source/index.html +++ b/docs/tags/open-source/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/permissionless/index.html b/docs/tags/permissionless/index.html index 41f8b106a..785b3033f 100644 --- a/docs/tags/permissionless/index.html +++ b/docs/tags/permissionless/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/phases/index.html b/docs/tags/phases/index.html index 443da7be5..1fd90da23 100644 --- a/docs/tags/phases/index.html +++ b/docs/tags/phases/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/pledge/index.html b/docs/tags/pledge/index.html index ad0a3108c..52a95bd26 100644 --- a/docs/tags/pledge/index.html +++ b/docs/tags/pledge/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/ports/index.html b/docs/tags/ports/index.html index 266f7f9d2..1889924ba 100644 --- a/docs/tags/ports/index.html +++ b/docs/tags/ports/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/protocol/index.html b/docs/tags/protocol/index.html index cd9863844..7c9d545fa 100644 --- a/docs/tags/protocol/index.html +++ b/docs/tags/protocol/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/repositories/index.html b/docs/tags/repositories/index.html index 13eadd0ab..ae33498fa 100644 --- a/docs/tags/repositories/index.html +++ b/docs/tags/repositories/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/repository/index.html b/docs/tags/repository/index.html index ecc395d2e..122bb9f6b 100644 --- a/docs/tags/repository/index.html +++ b/docs/tags/repository/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/reputation/index.html b/docs/tags/reputation/index.html index e3e7695d1..e3d3eff06 100644 --- a/docs/tags/reputation/index.html +++ b/docs/tags/reputation/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/requirements/index.html b/docs/tags/requirements/index.html index d3384e5f3..20fc36d10 100644 --- a/docs/tags/requirements/index.html +++ b/docs/tags/requirements/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/rewards/index.html b/docs/tags/rewards/index.html index a9dda8336..14a2c3dac 100644 --- a/docs/tags/rewards/index.html +++ b/docs/tags/rewards/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/roadmap/index.html b/docs/tags/roadmap/index.html index b7450618d..99d956324 100644 --- a/docs/tags/roadmap/index.html +++ b/docs/tags/roadmap/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

One doc tagged with "Roadmap"

View All Tags

Roadmap

Fleek Network's high-level roadmap per stage. Devnet, Testnet, and Mainnet.

- + \ No newline at end of file diff --git a/docs/tags/rpc/index.html b/docs/tags/rpc/index.html index 7d13f5a84..05062b068 100644 --- a/docs/tags/rpc/index.html +++ b/docs/tags/rpc/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/rust-dependencies/index.html b/docs/tags/rust-dependencies/index.html index 48f7875f6..2b3a5ff3e 100644 --- a/docs/tags/rust-dependencies/index.html +++ b/docs/tags/rust-dependencies/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

One doc tagged with "Rust dependencies"

View All Tags

Install

The Fleek Network Lightning CLI installation walkthrough

- + \ No newline at end of file diff --git a/docs/tags/sdk/index.html b/docs/tags/sdk/index.html index 729012497..68cb3655c 100644 --- a/docs/tags/sdk/index.html +++ b/docs/tags/sdk/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

One doc tagged with "sdk"

View All Tags

Services

A Fleek Network Service is a modular application that runs on nodes and allows users to perform well-defined functions or some specific tasks. Services are scalable and performant due to edge computation and networking features provided by the core principles of the network.

- + \ No newline at end of file diff --git a/docs/tags/server/index.html b/docs/tags/server/index.html index b3dd3a883..2aebaef68 100644 --- a/docs/tags/server/index.html +++ b/docs/tags/server/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/services/index.html b/docs/tags/services/index.html index 212436943..bdca4f3a1 100644 --- a/docs/tags/services/index.html +++ b/docs/tags/services/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

One doc tagged with "services"

View All Tags

Services

A Fleek Network Service is a modular application that runs on nodes and allows users to perform well-defined functions or some specific tasks. Services are scalable and performant due to edge computation and networking features provided by the core principles of the network.

- + \ No newline at end of file diff --git a/docs/tags/snar-ks/index.html b/docs/tags/snar-ks/index.html index dae609eeb..f152df53d 100644 --- a/docs/tags/snar-ks/index.html +++ b/docs/tags/snar-ks/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/snarks/index.html b/docs/tags/snarks/index.html index 3b23dcdac..1042ccd25 100644 --- a/docs/tags/snarks/index.html +++ b/docs/tags/snarks/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/standards/index.html b/docs/tags/standards/index.html index d5b31d8b4..2e62722a0 100644 --- a/docs/tags/standards/index.html +++ b/docs/tags/standards/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/testnet/index.html b/docs/tags/testnet/index.html index 2c6003c21..ce437b80a 100644 --- a/docs/tags/testnet/index.html +++ b/docs/tags/testnet/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/token/index.html b/docs/tags/token/index.html index 47e6e2bcc..439f450f1 100644 --- a/docs/tags/token/index.html +++ b/docs/tags/token/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/tokenomics/index.html b/docs/tags/tokenomics/index.html index 17259a45a..d5634b7ff 100644 --- a/docs/tags/tokenomics/index.html +++ b/docs/tags/tokenomics/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/toolkit/index.html b/docs/tags/toolkit/index.html index 7ce97a6d5..eb7d94047 100644 --- a/docs/tags/toolkit/index.html +++ b/docs/tags/toolkit/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

One doc tagged with "toolkit"

View All Tags

Services

A Fleek Network Service is a modular application that runs on nodes and allows users to perform well-defined functions or some specific tasks. Services are scalable and performant due to edge computation and networking features provided by the core principles of the network.

- + \ No newline at end of file diff --git a/docs/tags/verification/index.html b/docs/tags/verification/index.html index ff9d02635..41a2d288f 100644 --- a/docs/tags/verification/index.html +++ b/docs/tags/verification/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/whitepaper/index.html b/docs/tags/whitepaper/index.html index 1f85f772f..6edfb0b63 100644 --- a/docs/tags/whitepaper/index.html +++ b/docs/tags/whitepaper/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/docs/tags/wizard/index.html b/docs/tags/wizard/index.html index a08778f9a..70cedb9e1 100644 --- a/docs/tags/wizard/index.html +++ b/docs/tags/wizard/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

One doc tagged with "wizard"

View All Tags

Install

The Fleek Network Lightning CLI installation walkthrough

- + \ No newline at end of file diff --git a/docs/whitepaper/index.html b/docs/whitepaper/index.html index 6657afab1..7c3598670 100644 --- a/docs/whitepaper/index.html +++ b/docs/whitepaper/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

This section provides in-depth documentation and materials about the Fleek Network technology stack.

Whitepaper

The whitepaper outlines the technology that makes the Fleek Network Edge Computing Platform possible. It illustrates the foundation that makes it possible to reimagine the user experience for Decentralized Web Services and how to develop a fairer economy and ecosystem in collaboration with humans.

The latest whitepaper is available on this page, and it describes the protocol architecture, general operation, and characteristics.

- + \ No newline at end of file diff --git a/guides/Node Operators/getting-started/index.html b/guides/Node Operators/getting-started/index.html index c4dab70be..21d093bc6 100644 --- a/guides/Node Operators/getting-started/index.html +++ b/guides/Node Operators/getting-started/index.html @@ -13,7 +13,7 @@ - + @@ -21,8 +21,8 @@

Introduction

For this guide, we’ll 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 and making a request to a service to put and retrieve a .car files from the network.

For those seeking advanced knowledge:

tip

If you find any typos in our documentation, feel free to provide us feedback or contribute by opening a PR in our repository here.

Pre-requisites

To follow the guide, you will need the following:

  • Familiarity with the command-line interface
  • Git

Need a quick Fleek Network TL;DR?

Fleek Network is an open-source edge computing platform to accelerate the development and execution of the next generation of web services.

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.

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.

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.

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.

To get started, install a Network Node in a supported Linux server, such as Debian or Ubuntu (latest) by utilizing our simple assisted installer to help onboard as quickly as possible.

tip

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!

Once connected to the server, open a terminal window and execute the following command:

curl https://get.fleek.network | bash

Follow the install assistant recommendations to have the node ready without hassle and as quickly as possible.

Why is Fleek Network needed?

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.

How Does Fleek Network Work?

When a client requests a service, the protocol determines the best route to the nodes where the service replicas and workload are allocated.

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.

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.

Running a Node

A Fleek Network node can be built and run on your machine. It’s an open-source project and is open for contributions.

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.

tip

To set up Rust, packages and library dependencies can be tricky. The quickest is to visit the rustup.rs. Alternatively, if you haven't already, the build section has a manual installation document to help.

Clone the source code

We’ll 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.

note

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.

Start by cloning the repository located at https://github.com/fleek-network/lightning

tip

You have several ways of doing this:

  • Clone via HTTPS
  • Clone via SSH
  • Download via Github CLI
  • Download the zip package from the repository

We recommend HTTPS because it is the easiest to set up in the wild, and by users who are new to all this. -Although, we strongly recommend using an SSH connection when interacting with GitHub. If you are to this and are interested read more about it here.

git clone -b testnet-alpha-0 https://github.com/fleek-network/lightning.git <DIRECTORY-NAME>

Here's an example of what it'd look like when sticking to the recommended path location:

git clone -b testnet-alpha-0 https://github.com/fleek-network/lightning.git ~/fleek-network/lightning

Once the git clone completes, you’ll have the latest version at the time of cloning. You should use git to fetch or pull the latest versions consequently.

Dependencies

Install the required dependencies necessary for compiling general software and for our use-case Lightning CLI.

sudo apt-get install \
build-essential \
clang \
pkg-config \
libssl-dev \
gcc-multilib \
protobuf-compiler

Build

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 ~/fleek-network/lightning, as follows:

cd ~/fleek-network/lightning

Run the Rust package manager clean and update commands.

cargo clean
cargo update

Execute the install command to build and install the Fleek Network CLI.

cargo build

The install command uses the Rust compiler to build; It might take a while depending on how speedy is your machine.

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 ~/fleek-network/lightning/target/debug/lightning-node.

To avoid having to specify the pathname everytime, create a symbolic link to keep it short. Here we'll name the process as the global lgtn:

sudo ln -s "~/fleek-network/lightning/target/debug/lightning-node" /usr/local/bin/lgtn

Run the CLI with the flag version to confirm it's available globally.

lgtn --version

The output should look like:

Usage: lgtn [OPTIONS] <COMMAND>

Commands:
run Start the node
keys Handle keys
print-config Print the loaded configuration
dev-init-only Initialize the node without starting it
dev-dump-graph Dump the infusion graph of the node instance
help Print this message or the help of the given subcommand(s)

Options:
-c, --config <CONFIG> Path to the toml configuration file [default: ~/.lightning/config.toml]
--with-mock-consensus Determines that we should be using the mock consensus backend
-v... Increases the level of verbosity (the max level is -vvv)
--log-location Print code location on console logs
-h, --help Print help
-V, --version Print version

Node Launch

After building, the node can be launched by running the subcommand run:

lgtn run
tip

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.

Learn how to create a new Systemd service in the manual installation document.

Health check

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.

curl -w "\n" localhost:4069/health

If everything goes well, the response should be:

OK

Alternatively, use the JSON-RPC method flk_ping:

curl -s \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "flk_ping",
"params": [],
"id": 1
}' \
localhost:4069/rpc/v0

Which response should return the key result with value pong:

{
"jsonrpc": "2.0",
"result": "pong",
"id": 1
}

Next steps

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!

To avoid having to go through all the steps manually, we recommend reading our assisted installer document for quick onboarding.

Conclusion

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.

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.

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.

Finally, we do a quick health check to confirm the status of our node.

Discover more about the project by watching/contributing on GitHub, following us on Twitter, and joining our community Discord for any updates.

Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
- +Although, we strongly recommend using an SSH connection when interacting with GitHub. If you are to this and are interested read more about it here.

git clone -b testnet-alpha-0 https://github.com/fleek-network/lightning.git <DIRECTORY-NAME>

Here's an example of what it'd look like when sticking to the recommended path location:

git clone -b testnet-alpha-0 https://github.com/fleek-network/lightning.git ~/fleek-network/lightning

Once the git clone completes, you’ll have the latest version at the time of cloning. You should use git to fetch or pull the latest versions consequently.

Dependencies

Install the required dependencies necessary for compiling general software and for our use-case Lightning CLI.

sudo apt-get install \
build-essential \
clang \
pkg-config \
libssl-dev \
gcc-multilib \
protobuf-compiler

Build

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 ~/fleek-network/lightning, as follows:

cd ~/fleek-network/lightning

Run the Rust package manager clean and update commands.

cargo clean
cargo update

Execute the install command to build and install the Fleek Network CLI.

cargo build

The install command uses the Rust compiler to build; It might take a while depending on how speedy is your machine.

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 ~/fleek-network/lightning/target/debug/lightning-node.

To avoid having to specify the pathname everytime, create a symbolic link to keep it short. Here we'll name the process as the global lgtn:

sudo ln -s "~/fleek-network/lightning/target/debug/lightning-node" /usr/local/bin/lgtn

Run the CLI with the flag version to confirm it's available globally.

lgtn --version

The output should look like:

Usage: lgtn [OPTIONS] <COMMAND>

Commands:
run Start the node
keys Handle keys
print-config Print the loaded configuration
dev-init-only Initialize the node without starting it
dev-dump-graph Dump the infusion graph of the node instance
help Print this message or the help of the given subcommand(s)

Options:
-c, --config <CONFIG> Path to the toml configuration file [default: ~/.lightning/config.toml]
--with-mock-consensus Determines that we should be using the mock consensus backend
-v... Increases the level of verbosity (the max level is -vvv)
--log-location Print code location on console logs
-h, --help Print help
-V, --version Print version

Node Launch

After building, the node can be launched by running the subcommand run:

lgtn run
tip

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.

Learn how to create a new Systemd service in the manual installation document.

Health check

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.

curl -w "\n" localhost:4069/health

If everything goes well, the response should be:

OK

Alternatively, use the JSON-RPC method flk_ping:

curl -s \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "flk_ping",
"params": [],
"id": 1
}' \
localhost:4069/rpc/v0

Which response should return the key result with value pong:

{
"jsonrpc": "2.0",
"result": "pong",
"id": 1
}

Next steps

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!

To avoid having to go through all the steps manually, we recommend reading our assisted installer document for quick onboarding.

Conclusion

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.

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.

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.

Finally, we do a quick health check to confirm the status of our node.

Discover more about the project by watching/contributing on GitHub, following us on Twitter, and joining our community Discord for any updates.

Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
+ \ No newline at end of file diff --git a/guides/Node Operators/transfering-setup-ownership/index.html b/guides/Node Operators/transfering-setup-ownership/index.html index 1cea238ae..039b56656 100644 --- a/guides/Node Operators/transfering-setup-ownership/index.html +++ b/guides/Node Operators/transfering-setup-ownership/index.html @@ -13,15 +13,15 @@ - +
-

TL;DR

tip

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 get.fleek.network tool.

To use the automated script execute the following command in your server terminal and follow the instructions:

curl -sS https://get.fleek.network/transfer_system_user_setup_ownership | bash

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 message us through our Discord.

Introduction

Our Lightning CLI and Node process is run by a user, that has some sort of permissions–some 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.

Let's discuss the topic and open up a few ideas to help us improve the security of our server.

Pre-requisites

To follow the guide, you will need the following:

  • Familiarity with the command-line interface
  • Have installed and set up the Lightning CLI and service

Ownership of Lightning CLI files

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.

Our 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 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.

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.

tip

A reference document about 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.

Systemd Service

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.

The recommended installation process features a systemd.service which is a resource that the system knows how to operate and manage by an administrator user.

tip

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.

If you have followed the installation recommendations, find the systemd service unit in the location /etc/systemd/system/lightning.service (we are using Ubuntu Linux as an example to keep it short).

Make sure that you have set up a Systemd unit service, as recommended during the installation as this guide assumes you have one setup.

Stop the service

Before we proceed with any changes required for the migration, you'll have to stop the lightning.service.

systemctl stop lightning
note

For this guide, we are assuming that you are migrating ownership from root to a sudoer user. If not, you might be required to elevate privileges as sudo** where required. For example, sudo systemctl stop lightning.

Clear the .lightning data

Run the following command to clear the /root/.lightning/data, as it can be quite large and we don't need to move it.

sudo rm -rf /root/.lightning/data

Create a user

We recommend creating a non-root user with administrative privileges. It'll allow us to install any system requirements.

You can create a new user and add to the sudo group by running:

tip

For our example, we'll be using the name lgtn but you can pick whichever you'd like. If you already have a sudoer account, you can skip this step.

adduser lgtn

After completing the adduser steps, execute the usermod to add the user to the sudo group, as follows:

usermod -aG sudo lgtn

Switch to the new user by using the command:

su lgtn

Change the directory to the new user's home, as follows:

cd /home/lgtn

Move lightning system and source code directory to user's home

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.

Run the command pwd:

pwd

The output would look like:

/home/<USERNAME>

Given the username lgtn:

/home/lgtn

You'll then move two directories:

  • The /root/.lightning
  • The source code under the parent /root/fleek-network

1) Move the /root/.lightning directory from one user to the other

For our demo, we have assumed root user to sudoer user named lgtn, thus that'll look like this:

sudo mv /root/.lightning /home/lgtn/

2) Move the /root/fleek-network directory from one user to the other

sudo mv /root/fleek-network /home/lgtn/

3) Confirm move by finding both directories

In the user $HOME directory, you should be able to list the content of the directory and find the .lightning and fleek-network directory.

ls -la

The output should be similar to the following.

drwxr-x--- 6 lgtn lgtn  4096 Sep 12 13:51 .
drwxr-xr-x 3 root root 4096 Sep 11 12:28 ..
drwxrwxr-x 5 root root 4096 Sep 11 15:25 .lightning
drwxrwxr-x 3 root root 4096 Sep 11 12:28 fleek-network

Change ownership of files

Once the directories and files are moved, they should have have the wrong ownership, which should be set to root:root. We'll now have to change the ownership of the directories and files recursively.

Change the ownership of /home/lgtn/.lightning to the user lgtn as follows:

sudo chown -R lgtn:lgtn .lightning
tip

Make sure that you use the -R flag to have the ownership changes applied to the parent, the child directories and all the files.

Change the ownership of /home/lgtn/fleek-network to the user lgtn as follows:

sudo chown -R lgtn:lgtn fleek-network

Once completed, if you list the content of the directory the ownership should have changed from root:root to lgtn:lgtn.

ls -la

The output should be similar to the following.

drwxr-x--- 6 lgtn lgtn  4096 Sep 12 13:51 .
drwxr-xr-x 3 root root 4096 Sep 11 12:28 ..
drwxrwxr-x 5 lgtn lgtn 4096 Sep 11 15:25 .lightning
drwxrwxr-x 3 lgtn lgtn 4096 Sep 11 12:28 fleek-network
tip

Remember that we are using 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:

whoami

For our demo, we'll assume that you understand that lgtn is the user we opted in for our demo.

We have the symbolic link that links the binary built from the source code, to the alias lgtn that's set under the /usr/local/bin/lgtn pathname.

For example, you can find where that is linked to by running:

ls -la $(which lgtn)

On the output below, we can see that the /usr/local/bin/lgtn points to /root/fleek-network/lightning/target/release/lightning-node.

lrwxrwxrwx 1 root root 64 Sep 11 15:48 /usr/local/bin/lgtn -> /root/fleek-network/lightning/target/release/lightning-node

The target base path is /root and we know that we've moved the source code directory to the user home /home/lgtn. For this reason, we need to create a new symlink with the updated location of the binary file.

Unlink the symlink:

sudo unlink /usr/local/bin/lgtn

Create the symlink:

sudo ln -s "/home/lgtn/fleek-network/lightning/target/release/lightning-node" /usr/local/bin/lgtn

If successful, you should be able to execute the command:

lgtn help

The output should look similar to:

Usage: lgtn [OPTIONS] <COMMAND>

Commands:
run Start the node
keys Handle keys
print-config Print the loaded configuration
help Print this message or the help of the given subcommand(s)

Options:
-c, --config <CONFIG> Path to the toml configuration file [default: ~/.lightning/config.toml]
--with-mock-consensus Determines that we should be using the mock consensus backend
-v... Increases the level of verbosity (the max level is -vvv)
--log-location Print code location on console logs
-h, --help Print help
-V, --version Print version

Update the Systemd service unit

Open the file, its settings should be similar to the following:

[Unit]
Description=Fleek Network Node lightning service

[Service]
Type=simple
MemoryHigh=32G
RestartSec=15s
Restart=always
ExecStart=lgtn -c /home/<USERNAME>/.lightning/config.toml run
StandardOutput=append:/var/log/lightning/output.log
StandardError=append:/var/log/lightning/diagnostic.log
Environment=TMPDIR=/var/tmp

[Install]
WantedBy=multi-user.target

Since we opted in for the username lgtn for our demo, replaced <USERNAME> with lgtn and it would look like:

[Unit]
Description=Fleek Network Node lightning service

[Service]
Type=simple
MemoryHigh=32G
RestartSec=15s
Restart=always
ExecStart=lgtn -c /home/lgtn/.lightning/config.toml run
StandardOutput=append:/var/log/lightning/output.log
StandardError=append:/var/log/lightning/diagnostic.log
Environment=TMPDIR=/var/tmp

[Install]
WantedBy=multi-user.target
tip

Notice the ExecStart= which includes the flag -c where the location of the user files is declared. Learn how to update the config.toml to include the user-preferred file paths, e.g. declare the keystore pathname.

Complete the step by reloading the daemon, to apply the newly created changes. You can do this by executing:

sudo systemctl daemon-reload

Update the config.toml with user-preferred file locations

Open the /home/lgtn/.lightning/config.toml file in your favorite text editor.

Replace every instance of ~ (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 sudo. Learn more about file permissions and ownership by reading the reference document.

In the /home/<USERNAME>/.lightning/config.toml you'll find some and more of the following:

[BLANK]

[application]
db_path = "~/.lightning/data/app_db"

[consensus]
store_path = "~/.lightning/data/narwhal_store"

[fsstore]
root = "~/.lightning/blockstore"

[resolver]
store_path = "~/.lightning/data/resolver_store"

[signer]
consensus_key_path = "~/.lightning/keystore/consensus.pem"
node_key_path = "~/.lightning/keystore/node.pem"
tip

The configuration properties and values presented above are a shorter version of what you'll find on your configuration.toml. We keep it short to make it easier to follow, do not copy and paste.

Find and replace all instances of ~ in the config file /home/<USERNAME>/.lightning/config.toml.

Here's an example of how to do it using sed:

sed -i "s|~/.lightning|/home/<USERNAME>/.lightning|g" "/home/<USERNAME>/.lightning/config.toml"
tip

Replace the <USERNAME> with your username. For example, if you have followed the recommendation to create a user it would look like /home/lgtn/.lightning/config.toml for the username lgtn.

For example, if your username is lgtn that'd look like this:

sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"

Once modified, you can run a cat to see the content of the files to confirm it has been updated.

cat /home/lgtn/.lightning/config.toml

For our example where we opted in for the username lgtn that would look like:

[BLANK]

[application]
db_path = "~/.lightning/data/app_db"

[consensus]
store_path = "~/.lightning/data/narwhal_store"

[fsstore]
root = "~/.lightning/blockstore"

[resolver]
store_path = "~/.lightning/data/resolver_store"

[signer]
consensus_key_path = "~/.lightning/keystore/consensus.pem"
node_key_path = "~/.lightning/keystore/node.pem"
Warning

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.

Start the service

At this stage, you should have migrated the essential files to the user home.

Ideally, you would now manage the service as the user (as described in the user service reference). To keep our guide wider to all users, we'll prefix the commands with sudo, which elevates the permissions to root. But since we have provided the configuration file the -c in our systemd service, we'll have the user-preferred configuration options ruling.

Start the service by running the command:

sudo systemctl start lightning.service
tip

Find the timeline of events for the Lightning service by checking the log files. Learn about it in the section Log Messages.

To learn more, visit the section Use Systemctl to manage the Lightning Service

Conclusion

We started by giving a brief introduction to ownership of the Lightning CLI files.

Jumped through topics of Systemd service that helps the user manage the service in the Linux environment, which helps keep keeps track of all the processes and threads that are spawned.

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 root user and a sudoer.

Discover more about the project by watching/contributing on GitHub, following us on Twitter, and joining our community Discord for any updates.

Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
- +

TL;DR

tip

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 get.fleek.network tool.

To use the automated script execute the following command in your server terminal and follow the instructions:

curl -sS https://get.fleek.network/transfer_system_user_setup_ownership | bash

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 message us through our Discord.

Introduction

Our Lightning CLI and Node process is run by a user, that has some sort of permissions–some 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.

Let's discuss the topic and open up a few ideas to help us improve the security of our server.

Pre-requisites

To follow the guide, you will need the following:

  • Familiarity with the command-line interface
  • Have installed and set up the Lightning CLI and service

Ownership of Lightning CLI files

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.

Our 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 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.

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.

tip

A reference document about 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.

Systemd Service

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.

The recommended installation process features a systemd.service which is a resource that the system knows how to operate and manage by an administrator user.

tip

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.

If you have followed the installation recommendations, find the systemd service unit in the location /etc/systemd/system/lightning.service (we are using Ubuntu Linux as an example to keep it short).

Make sure that you have set up a Systemd unit service, as recommended during the installation as this guide assumes you have one setup.

Stop the service

Before we proceed with any changes required for the migration, you'll have to stop the lightning.service.

systemctl stop lightning
note

For this guide, we are assuming that you are migrating ownership from root to a sudoer user. If not, you might be required to elevate privileges as sudo** where required. For example, sudo systemctl stop lightning.

Clear the .lightning data

Run the following command to clear the /root/.lightning/data, as it can be quite large and we don't need to move it.

sudo rm -rf /root/.lightning/data

Create a user

We recommend creating a non-root user with administrative privileges. It'll allow us to install any system requirements.

You can create a new user and add to the sudo group by running:

tip

For our example, we'll be using the name lgtn but you can pick whichever you'd like. If you already have a sudoer account, you can skip this step.

adduser lgtn

After completing the adduser steps, execute the usermod to add the user to the sudo group, as follows:

usermod -aG sudo lgtn

Switch to the new user by using the command:

su lgtn

Change the directory to the new user's home, as follows:

cd /home/lgtn

Move lightning system and source code directory to user's home

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.

Run the command pwd:

pwd

The output would look like:

/home/<USERNAME>

Given the username lgtn:

/home/lgtn

You'll then move two directories:

  • The /root/.lightning
  • The source code under the parent /root/fleek-network

1) Move the /root/.lightning directory from one user to the other

For our demo, we have assumed root user to sudoer user named lgtn, thus that'll look like this:

sudo mv /root/.lightning /home/lgtn/

2) Move the /root/fleek-network directory from one user to the other

sudo mv /root/fleek-network /home/lgtn/

3) Confirm move by finding both directories

In the user $HOME directory, you should be able to list the content of the directory and find the .lightning and fleek-network directory.

ls -la

The output should be similar to the following.

drwxr-x--- 6 lgtn lgtn  4096 Sep 12 13:51 .
drwxr-xr-x 3 root root 4096 Sep 11 12:28 ..
drwxrwxr-x 5 root root 4096 Sep 11 15:25 .lightning
drwxrwxr-x 3 root root 4096 Sep 11 12:28 fleek-network

Change ownership of files

Once the directories and files are moved, they should have have the wrong ownership, which should be set to root:root. We'll now have to change the ownership of the directories and files recursively.

Change the ownership of /home/lgtn/.lightning to the user lgtn as follows:

sudo chown -R lgtn:lgtn .lightning
tip

Make sure that you use the -R flag to have the ownership changes applied to the parent, the child directories and all the files.

Change the ownership of /home/lgtn/fleek-network to the user lgtn as follows:

sudo chown -R lgtn:lgtn fleek-network

Once completed, if you list the content of the directory the ownership should have changed from root:root to lgtn:lgtn.

ls -la

The output should be similar to the following.

drwxr-x--- 6 lgtn lgtn  4096 Sep 12 13:51 .
drwxr-xr-x 3 root root 4096 Sep 11 12:28 ..
drwxrwxr-x 5 lgtn lgtn 4096 Sep 11 15:25 .lightning
drwxrwxr-x 3 lgtn lgtn 4096 Sep 11 12:28 fleek-network
tip

Remember that we are using 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:

whoami

For our demo, we'll assume that you understand that lgtn is the user we opted in for our demo.

We have the symbolic link that links the binary built from the source code, to the alias lgtn that's set under the /usr/local/bin/lgtn pathname.

For example, you can find where that is linked to by running:

ls -la $(which lgtn)

On the output below, we can see that the /usr/local/bin/lgtn points to /root/fleek-network/lightning/target/release/lightning-node.

lrwxrwxrwx 1 root root 64 Sep 11 15:48 /usr/local/bin/lgtn -> /root/fleek-network/lightning/target/release/lightning-node

The target base path is /root and we know that we've moved the source code directory to the user home /home/lgtn. For this reason, we need to create a new symlink with the updated location of the binary file.

Unlink the symlink:

sudo unlink /usr/local/bin/lgtn

Create the symlink:

sudo ln -s "/home/lgtn/fleek-network/lightning/target/release/lightning-node" /usr/local/bin/lgtn

If successful, you should be able to execute the command:

lgtn help

The output should look similar to:

Usage: lgtn [OPTIONS] <COMMAND>

Commands:
run Start the node
keys Handle keys
print-config Print the loaded configuration
help Print this message or the help of the given subcommand(s)

Options:
-c, --config <CONFIG> Path to the toml configuration file [default: ~/.lightning/config.toml]
--with-mock-consensus Determines that we should be using the mock consensus backend
-v... Increases the level of verbosity (the max level is -vvv)
--log-location Print code location on console logs
-h, --help Print help
-V, --version Print version

Update the Systemd service unit

Open the file, its settings should be similar to the following:

[Unit]
Description=Fleek Network Node lightning service

[Service]
Type=simple
MemoryHigh=32G
RestartSec=15s
Restart=always
ExecStart=lgtn -c /home/<USERNAME>/.lightning/config.toml run
StandardOutput=append:/var/log/lightning/output.log
StandardError=append:/var/log/lightning/diagnostic.log
Environment=TMPDIR=/var/tmp

[Install]
WantedBy=multi-user.target

Since we opted in for the username lgtn for our demo, replaced <USERNAME> with lgtn and it would look like:

[Unit]
Description=Fleek Network Node lightning service

[Service]
Type=simple
MemoryHigh=32G
RestartSec=15s
Restart=always
ExecStart=lgtn -c /home/lgtn/.lightning/config.toml run
StandardOutput=append:/var/log/lightning/output.log
StandardError=append:/var/log/lightning/diagnostic.log
Environment=TMPDIR=/var/tmp

[Install]
WantedBy=multi-user.target
tip

Notice the ExecStart= which includes the flag -c where the location of the user files is declared. Learn how to update the config.toml to include the user-preferred file paths, e.g. declare the keystore pathname.

Complete the step by reloading the daemon, to apply the newly created changes. You can do this by executing:

sudo systemctl daemon-reload

Update the config.toml with user-preferred file locations

Open the /home/lgtn/.lightning/config.toml file in your favorite text editor.

Replace every instance of ~ (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 sudo. Learn more about file permissions and ownership by reading the reference document.

In the /home/<USERNAME>/.lightning/config.toml you'll find some and more of the following:

[BLANK]

[application]
db_path = "~/.lightning/data/app_db"

[consensus]
store_path = "~/.lightning/data/narwhal_store"

[fsstore]
root = "~/.lightning/blockstore"

[resolver]
store_path = "~/.lightning/data/resolver_store"

[signer]
consensus_key_path = "~/.lightning/keystore/consensus.pem"
node_key_path = "~/.lightning/keystore/node.pem"
tip

The configuration properties and values presented above are a shorter version of what you'll find on your configuration.toml. We keep it short to make it easier to follow, do not copy and paste.

Find and replace all instances of ~ in the config file /home/<USERNAME>/.lightning/config.toml.

Here's an example of how to do it using sed:

sed -i "s|~/.lightning|/home/<USERNAME>/.lightning|g" "/home/<USERNAME>/.lightning/config.toml"
tip

Replace the <USERNAME> with your username. For example, if you have followed the recommendation to create a user it would look like /home/lgtn/.lightning/config.toml for the username lgtn.

For example, if your username is lgtn that'd look like this:

sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"

Once modified, you can run a cat to see the content of the files to confirm it has been updated.

cat /home/lgtn/.lightning/config.toml

For our example where we opted in for the username lgtn that would look like:

[BLANK]

[application]
db_path = "~/.lightning/data/app_db"

[consensus]
store_path = "~/.lightning/data/narwhal_store"

[fsstore]
root = "~/.lightning/blockstore"

[resolver]
store_path = "~/.lightning/data/resolver_store"

[signer]
consensus_key_path = "~/.lightning/keystore/consensus.pem"
node_key_path = "~/.lightning/keystore/node.pem"
Warning

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.

Start the service

At this stage, you should have migrated the essential files to the user home.

Ideally, you would now manage the service as the user (as described in the user service reference). To keep our guide wider to all users, we'll prefix the commands with sudo, which elevates the permissions to root. But since we have provided the configuration file the -c in our systemd service, we'll have the user-preferred configuration options ruling.

Start the service by running the command:

sudo systemctl start lightning.service
tip

Find the timeline of events for the Lightning service by checking the log files. Learn about it in the section Log Messages.

To learn more, visit the section Use Systemctl to manage the Lightning Service

Conclusion

We started by giving a brief introduction to ownership of the Lightning CLI files.

Jumped through topics of Systemd service that helps the user manage the service in the Linux environment, which helps keep keeps track of all the processes and threads that are spawned.

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 root user and a sudoer.

Discover more about the project by watching/contributing on GitHub, following us on Twitter, and joining our community Discord for any updates.

Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
+ \ No newline at end of file diff --git a/guides/index.html b/guides/index.html index b471a5047..181452cb0 100644 --- a/guides/index.html +++ b/guides/index.html @@ -13,15 +13,15 @@ - +
-

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.

It differs from the references documentation which serves as a quick direct breakdown of commands and processes without much explanation, as the name implies.

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.

- +

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.

It differs from the references documentation which serves as a quick direct breakdown of commands and processes without much explanation, as the name implies.

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.

+ \ No newline at end of file diff --git a/guides/tags/configuration/index.html b/guides/tags/configuration/index.html index 0ef5f89c7..c6531894b 100644 --- a/guides/tags/configuration/index.html +++ b/guides/tags/configuration/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

One doc tagged with "configuration"

View All Tags
- + \ No newline at end of file diff --git a/guides/tags/edge-computing/index.html b/guides/tags/edge-computing/index.html index a83e347c5..4c0f8257d 100644 --- a/guides/tags/edge-computing/index.html +++ b/guides/tags/edge-computing/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

One doc tagged with "Edge computing"

View All Tags

Getting Started

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!

- + \ No newline at end of file diff --git a/guides/tags/fleek-network/index.html b/guides/tags/fleek-network/index.html index 7dfcb9193..3d185f109 100644 --- a/guides/tags/fleek-network/index.html +++ b/guides/tags/fleek-network/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

One doc tagged with "Fleek Network"

View All Tags

About guides

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.

- + \ No newline at end of file diff --git a/guides/tags/getting-started/index.html b/guides/tags/getting-started/index.html index 1b1bb74f4..17af8f6e4 100644 --- a/guides/tags/getting-started/index.html +++ b/guides/tags/getting-started/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

One doc tagged with "Getting Started"

View All Tags

Getting Started

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!

- + \ No newline at end of file diff --git a/guides/tags/guide/index.html b/guides/tags/guide/index.html index be7b2858c..0b068b783 100644 --- a/guides/tags/guide/index.html +++ b/guides/tags/guide/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

2 docs tagged with "Guide"

View All Tags

Getting Started

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!

- + \ No newline at end of file diff --git a/guides/tags/guides/index.html b/guides/tags/guides/index.html index 336a4e122..aea7a0660 100644 --- a/guides/tags/guides/index.html +++ b/guides/tags/guides/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

One doc tagged with "Guides"

View All Tags

About guides

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.

- + \ No newline at end of file diff --git a/guides/tags/help/index.html b/guides/tags/help/index.html index bbce082f3..1bba7bb7d 100644 --- a/guides/tags/help/index.html +++ b/guides/tags/help/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

One doc tagged with "Help"

View All Tags

About guides

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.

- + \ No newline at end of file diff --git a/guides/tags/index.html b/guides/tags/index.html index 323c05046..ff8305d66 100644 --- a/guides/tags/index.html +++ b/guides/tags/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/guides/tags/ownership/index.html b/guides/tags/ownership/index.html index 17d72941c..6a4a76d0d 100644 --- a/guides/tags/ownership/index.html +++ b/guides/tags/ownership/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

One doc tagged with "ownership"

View All Tags
- + \ No newline at end of file diff --git a/guides/tags/setup/index.html b/guides/tags/setup/index.html index 6396e839c..a928d982b 100644 --- a/guides/tags/setup/index.html +++ b/guides/tags/setup/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

One doc tagged with "setup"

View All Tags
- + \ No newline at end of file diff --git a/guides/tags/transfer/index.html b/guides/tags/transfer/index.html index 257b978c6..e9fff4392 100644 --- a/guides/tags/transfer/index.html +++ b/guides/tags/transfer/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

One doc tagged with "transfer"

View All Tags
- + \ No newline at end of file diff --git a/index.html b/index.html index 043926100..a5946b6c0 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@
- + \ No newline at end of file diff --git a/references/Lightning CLI/error-building-on-arm64/index.html b/references/Lightning CLI/error-building-on-arm64/index.html index 74d6ba910..9e89e499a 100644 --- a/references/Lightning CLI/error-building-on-arm64/index.html +++ b/references/Lightning CLI/error-building-on-arm64/index.html @@ -13,15 +13,15 @@ - +
-

Building on the ARM64 (aarch64)

ARM64 platform has its own specifics, and currently consists of requiring gcc:

sudo apt install gcc

On cargo build, the error error: linking with cc failed: exit status: 1 occurs, as demonstrated in the output below:

error: linking with `cc` failed: exit status: 1
# ... wall of text
# ... the key error is ↴
= 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':
/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

As a result of the research by the community member ryssroad, the following solution was shared.

Open the cargo.toml file in ~/fleek-network/lightning/Cargo.toml and find the lto key.

lto = true

Change the lto key value from true to thin:

...
[profile.release]
# currently enabled, may increase build time, but runtime faster, can set to `"thin"`.
lto = "thin"

Set RUSTFLAGS on build, as follows:

RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition" cargo +stable build --release 

Once the build completes, you should find the generated binary lightning-node under the directory ~/fleek-network/lightning/target/release/lightning-node.

As an example, execute:

~/fleek-network/lightning/target/release/lightning-node help

To find the help output:

Usage: lightning-node [OPTIONS] <COMMAND>

Commands:
run Start the node
keys Handle keys
print-config Print the loaded configuration
help Print this message or the help of the given subcommand(s)

Options:
-c, --config <CONFIG> Path to the toml configuration file [default: ~/.lightning/config.toml]
--with-mock-consensus Determines that we should be using the mock consensus backend
-v... Increases the level of verbosity (the max level is -vvv)
--log-location Print code location on console logs
-h, --help Print help
-V, --version Print version
- +

Building on the ARM64 (aarch64)

ARM64 platform has its own specifics, and currently consists of requiring gcc:

sudo apt install gcc

On cargo build, the error error: linking with cc failed: exit status: 1 occurs, as demonstrated in the output below:

error: linking with `cc` failed: exit status: 1
# ... wall of text
# ... the key error is ↴
= 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':
/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

As a result of the research by the community member ryssroad, the following solution was shared.

Open the cargo.toml file in ~/fleek-network/lightning/Cargo.toml and find the lto key.

lto = true

Change the lto key value from true to thin:

...
[profile.release]
# currently enabled, may increase build time, but runtime faster, can set to `"thin"`.
lto = "thin"

Set RUSTFLAGS on build, as follows:

RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition" cargo +stable build --release 

Once the build completes, you should find the generated binary lightning-node under the directory ~/fleek-network/lightning/target/release/lightning-node.

As an example, execute:

~/fleek-network/lightning/target/release/lightning-node help

To find the help output:

Usage: lightning-node [OPTIONS] <COMMAND>

Commands:
run Start the node
keys Handle keys
print-config Print the loaded configuration
help Print this message or the help of the given subcommand(s)

Options:
-c, --config <CONFIG> Path to the toml configuration file [default: ~/.lightning/config.toml]
--with-mock-consensus Determines that we should be using the mock consensus backend
-v... Increases the level of verbosity (the max level is -vvv)
--log-location Print code location on console logs
-h, --help Print help
-V, --version Print version
+ \ No newline at end of file diff --git a/references/Lightning CLI/error-linking-with-cc-failed-exist-status-1/index.html b/references/Lightning CLI/error-linking-with-cc-failed-exist-status-1/index.html index 1febc0d46..c8b340a8b 100644 --- a/references/Lightning CLI/error-linking-with-cc-failed-exist-status-1/index.html +++ b/references/Lightning CLI/error-linking-with-cc-failed-exist-status-1/index.html @@ -13,15 +13,15 @@ - +
-

Check if CPU is supported

uname -i
WARNING

Given the CPU requirements, currently we're mainly supporting GenuineIntel and there have been reports of failure to build the binary on AMD. The `ARM64`` is a different architecture, thus not supported, but there has been some community contributions in that regard, find it here.

Any contribution or feedback to provide support is appreciated. Feel free to let us know on our Discord channel.

Linking with cc error

A user who finds the error linking with cc failed, will have to install the required dependencies.

error: linking with `cc` failed: exit status: 1
error: could not compile `fleek-service-ping-example` (lib) due to previous error

Update

sudo apt-get update

Install gcc:

sudo apt-get install gcc

Remove previous installation files

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 reference.

Run the installation script

curl https://get.fleek.network | bash

Alternatively, read the manual installation instructions for more information.

Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
- +

Check if CPU is supported

uname -i
WARNING

Given the CPU requirements, currently we're mainly supporting GenuineIntel and there have been reports of failure to build the binary on AMD. The ARM64 is a different architecture, thus not supported, but there has been some community contributions in that regard, find it in the reference error building on ARM64.

Any contribution or feedback to provide support is appreciated. Feel free to let us know on our Discord channel.

Linking with cc error

A user who finds the error linking with cc failed, will have to install the required dependencies.

error: linking with `cc` failed: exit status: 1
error: could not compile `fleek-service-ping-example` (lib) due to previous error

Update

sudo apt-get update

Install gcc:

sudo apt-get install gcc

Remove previous installation files

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 reference.

Run the installation script

curl https://get.fleek.network | bash

Alternatively, read the manual installation instructions for more information.

Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
+ \ No newline at end of file diff --git a/references/Lightning CLI/file-permissions-and-ownership/index.html b/references/Lightning CLI/file-permissions-and-ownership/index.html index 6d814f1e7..c9cc2dac5 100644 --- a/references/Lightning CLI/file-permissions-and-ownership/index.html +++ b/references/Lightning CLI/file-permissions-and-ownership/index.html @@ -13,15 +13,15 @@ - +
-

Ownership

The user who installs the Fleek Network Lightning CLI matters, as it can own or delegate ownership of the dependencies and applications being installed.

For example, if you have followed the install document recommendations and have:

  • Created a user lgtn
  • Switched to the user lgtn
  • Executed the installation process as lgtn

You'll find that it owns the following directories under the user home (/home/lgtn):

drwxr-x--- 6 lgtn lgtn  4096 Sep 12 10:27 .
drwxr-xr-x 3 root root 4096 Sep 11 12:28 ..
drwxrwxr-x 5 lgtn lgtn 4096 Sep 11 12:29 .cargo
drwxrwxr-x 5 lgtn lgtn 4096 Sep 11 15:25 .lightning
drwxrwxr-x 6 lgtn lgtn 4096 Sep 11 12:29 .rustup
drwxrwxr-x 3 lgtn lgtn 4096 Sep 11 12:28 fleek-network

Above, we have the listing properties set as drwxrwxr-x and the ownership lgtn:lgtn.

On the other hand, if you have done the installation process as root superuser, you'll find that:

  • The location of the directories and files goes under the /root pathname
  • The ownership is set to root:root

Learn more about file permissions from the Linux Foundation.

To learn more about file permission on Linux, read the Understanding Linux File Permissions.

Using sudo to delegate permissions

Consider file ownership and permissions to understand where the keystore is located. Take close attention when executing commands as an admin–with or without super user (root) or sudo.

If a command is executed without sudo then the generated output goes onto the user home.

lgtn keys generate

Resulting in having the keystore saved onto /home/username/.lightning/keystore.

On the other hand, if a command is executed with sudo then the generated output is delegated to root directory.

sudo lgtn keys generate

Resulting in having the keystore saved onto /root/.lightning/keystore.

User $HOME directory

The home directory is a directory that contains the personal files of a particular user of the system. On Linux, the $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.

For this reason, a user can change to the home directory by executing:

cd $HOME

A shorthand allows a user to refer to their home directory simply as ~ (tilde), as follows:

cd ~
tip

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 root by the usage of sudo, this can help troubleshoot and explain the location of our files e.g. the keystore. In the section 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.

To learn more about the user $HOME directory read the wikipedia Home directory document.

Set the locations of the user paths

In the /home/<USERNAME>/.lightning/config.toml you'll find some and more of the following:

[BLANK]

[application]
db_path = "~/.lightning/data/app_db"

[consensus]
store_path = "~/.lightning/data/narwhal_store"

[fsstore]
root = "~/.lightning/blockstore"

[resolver]
store_path = "~/.lightning/data/resolver_store"

[signer]
consensus_key_path = "~/.lightning/keystore/consensus.pem"
node_key_path = "~/.lightning/keystore/node.pem"
tip

The configuration properties and values presented above are a shorter version of what you'll find on your configuration.toml. We keep it short to make it easier to follow, do not copy and paste.

Find and replace all instances of ~ in the config file /home/<USERNAME>/.lightning/config.toml.

Here's an example of how to do it using sed:

sed -i "s|~/.lightning|/home/<USERNAME>/.lightning|g" "/home/<USERNAME>/.lightning/config.toml"
tip

Replace the <USERNAME> with your username. For example, if you have followed the recommendation to create a user it would look like /home/lgtn/.lightning/config.toml for the username lgtn.

For example, if your username is lgtn that'd look like this:

sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"

Once modified, you can run a cat to see the content of the files to confirm it has been updated.

cat /home/lgtn/.lightning/config.toml

For our example where we opted in for the username lgtn that would look like:

[BLANK]

[application]
db_path = "~/.lightning/data/app_db"

[consensus]
store_path = "~/.lightning/data/narwhal_store"

[fsstore]
root = "~/.lightning/blockstore"

[resolver]
store_path = "~/.lightning/data/resolver_store"

[signer]
consensus_key_path = "~/.lightning/keystore/consensus.pem"
node_key_path = "~/.lightning/keystore/node.pem"
Warning

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.

Set the configuration flag -c on the service unit file

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 Systemd Service Setup install section.

Open and edit the /etc/systemd/system/lightning.service file.

1) Replace <USERNAME> with YOUR username. For example, in the documentation we use the username lgtn, which means we'd replace User=<USERNAME> with User=lgtn.

2) Make sure that the ExecStart is set correctly, including the -c

[Unit]
Description=Fleek Network Node lightning service

[Service]
User=<USERNAME>
Type=simple
MemoryHigh=32G
RestartSec=15s
Restart=always
ExecStart=lgtn -c /home/<USERNAME>/.lightning/config.toml run
StandardOutput=append:/var/log/lightning/output.log
StandardError=append:/var/log/lightning/diagnostic.log
Environment=TMPDIR=/var/tmp

[Install]
WantedBy=multi-user.target

For our example, as the username lgtn it would look like:

[Unit]
Description=Fleek Network Node lightning service

[Service]
User=lgtn
Type=simple
MemoryHigh=32G
RestartSec=15s
Restart=always
ExecStart=lgtn -c /home/lgtn/.lightning/config.toml run
StandardOutput=append:/var/log/lightning/output.log
StandardError=append:/var/log/lightning/diagnostic.log
Environment=/var/tmp

[Install]
WantedBy=multi-user.target

When complete make sure the file is saved and the systemctl daemon is reloaded, as follows:

sudo systemctl daemon-reload

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 root delegation.

Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
- +

Ownership

The user who installs the Fleek Network Lightning CLI matters, as it can own or delegate ownership of the dependencies and applications being installed.

For example, if you have followed the install document recommendations and have:

  • Created a user lgtn
  • Switched to the user lgtn
  • Executed the installation process as lgtn

You'll find that it owns the following directories under the user home (/home/lgtn):

drwxr-x--- 6 lgtn lgtn  4096 Sep 12 10:27 .
drwxr-xr-x 3 root root 4096 Sep 11 12:28 ..
drwxrwxr-x 5 lgtn lgtn 4096 Sep 11 12:29 .cargo
drwxrwxr-x 5 lgtn lgtn 4096 Sep 11 15:25 .lightning
drwxrwxr-x 6 lgtn lgtn 4096 Sep 11 12:29 .rustup
drwxrwxr-x 3 lgtn lgtn 4096 Sep 11 12:28 fleek-network

Above, we have the listing properties set as drwxrwxr-x and the ownership lgtn:lgtn.

On the other hand, if you have done the installation process as root superuser, you'll find that:

  • The location of the directories and files goes under the /root pathname
  • The ownership is set to root:root

Learn more about file permissions from the Linux Foundation.

To learn more about file permission on Linux, read the Understanding Linux File Permissions.

Using sudo to delegate permissions

Consider file ownership and permissions to understand where the keystore is located. Take close attention when executing commands as an admin–with or without super user (root) or sudo.

If a command is executed without sudo then the generated output goes onto the user home.

lgtn keys generate

Resulting in having the keystore saved onto /home/username/.lightning/keystore.

On the other hand, if a command is executed with sudo then the generated output is delegated to root directory.

sudo lgtn keys generate

Resulting in having the keystore saved onto /root/.lightning/keystore.

User $HOME directory

The home directory is a directory that contains the personal files of a particular user of the system. On Linux, the $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.

For this reason, a user can change to the home directory by executing:

cd $HOME

A shorthand allows a user to refer to their home directory simply as ~ (tilde), as follows:

cd ~
tip

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 root by the usage of sudo, this can help troubleshoot and explain the location of our files e.g. the keystore. In the section 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.

To learn more about the user $HOME directory read the wikipedia Home directory document.

Set the locations of the user paths

In the /home/<USERNAME>/.lightning/config.toml you'll find some and more of the following:

[BLANK]

[application]
db_path = "~/.lightning/data/app_db"

[consensus]
store_path = "~/.lightning/data/narwhal_store"

[fsstore]
root = "~/.lightning/blockstore"

[resolver]
store_path = "~/.lightning/data/resolver_store"

[signer]
consensus_key_path = "~/.lightning/keystore/consensus.pem"
node_key_path = "~/.lightning/keystore/node.pem"
tip

The configuration properties and values presented above are a shorter version of what you'll find on your configuration.toml. We keep it short to make it easier to follow, do not copy and paste.

Find and replace all instances of ~ in the config file /home/<USERNAME>/.lightning/config.toml.

Here's an example of how to do it using sed:

sed -i "s|~/.lightning|/home/<USERNAME>/.lightning|g" "/home/<USERNAME>/.lightning/config.toml"
tip

Replace the <USERNAME> with your username. For example, if you have followed the recommendation to create a user it would look like /home/lgtn/.lightning/config.toml for the username lgtn.

For example, if your username is lgtn that'd look like this:

sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"

Once modified, you can run a cat to see the content of the files to confirm it has been updated.

cat /home/lgtn/.lightning/config.toml

For our example where we opted in for the username lgtn that would look like:

[BLANK]

[application]
db_path = "~/.lightning/data/app_db"

[consensus]
store_path = "~/.lightning/data/narwhal_store"

[fsstore]
root = "~/.lightning/blockstore"

[resolver]
store_path = "~/.lightning/data/resolver_store"

[signer]
consensus_key_path = "~/.lightning/keystore/consensus.pem"
node_key_path = "~/.lightning/keystore/node.pem"
Warning

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.

Set the configuration flag -c on the service unit file

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 Systemd Service Setup install section.

Open and edit the /etc/systemd/system/lightning.service file.

1) Replace <USERNAME> with YOUR username. For example, in the documentation we use the username lgtn, which means we'd replace User=<USERNAME> with User=lgtn.

2) Make sure that the ExecStart is set correctly, including the -c

[Unit]
Description=Fleek Network Node lightning service

[Service]
User=<USERNAME>
Type=simple
MemoryHigh=32G
RestartSec=15s
Restart=always
ExecStart=lgtn -c /home/<USERNAME>/.lightning/config.toml run
StandardOutput=append:/var/log/lightning/output.log
StandardError=append:/var/log/lightning/diagnostic.log
Environment=TMPDIR=/var/tmp

[Install]
WantedBy=multi-user.target

For our example, as the username lgtn it would look like:

[Unit]
Description=Fleek Network Node lightning service

[Service]
User=lgtn
Type=simple
MemoryHigh=32G
RestartSec=15s
Restart=always
ExecStart=lgtn -c /home/lgtn/.lightning/config.toml run
StandardOutput=append:/var/log/lightning/output.log
StandardError=append:/var/log/lightning/diagnostic.log
Environment=/var/tmp

[Install]
WantedBy=multi-user.target

When complete make sure the file is saved and the systemctl daemon is reloaded, as follows:

sudo systemctl daemon-reload

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 root delegation.

Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
+ \ No newline at end of file diff --git a/references/Lightning CLI/keys-not-found/index.html b/references/Lightning CLI/keys-not-found/index.html index 71de407dc..80608847c 100644 --- a/references/Lightning CLI/keys-not-found/index.html +++ b/references/Lightning CLI/keys-not-found/index.html @@ -13,15 +13,15 @@ - +
-

Node key does not exist

When watching the Fleek Network Lightning service log output, you find the "Node key does not exist" message placed recursively. As follows:

thread 'main' panicked at 'Node key does not exist. Use CLI to generate keys.', core/node/src/testnet_sync.rs:126:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'Node key does not exist. Use CLI to generate keys.', core/node/src/testnet_sync.rs:126:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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 root, the location of the keystore differs on runtime.

To learn more about how file permissions and ownership work, you're advised to read the reference document here.

- +

Node key does not exist

When watching the Fleek Network Lightning service log output, you find the "Node key does not exist" message placed recursively. As follows:

thread 'main' panicked at 'Node key does not exist. Use CLI to generate keys.', core/node/src/testnet_sync.rs:126:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'Node key does not exist. Use CLI to generate keys.', core/node/src/testnet_sync.rs:126:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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 root, the location of the keystore differs on runtime.

To learn more about how file permissions and ownership work, you're advised to read the reference document here.

+ \ No newline at end of file diff --git a/references/Lightning CLI/permission-denied-os-error-13/index.html b/references/Lightning CLI/permission-denied-os-error-13/index.html index 98e238c4d..6b4251157 100644 --- a/references/Lightning CLI/permission-denied-os-error-13/index.html +++ b/references/Lightning CLI/permission-denied-os-error-13/index.html @@ -13,15 +13,15 @@ - +
-

Ownership and file permissions

When running the Lightning CLI, the user who's in control can delegate to root via sudo. Depending on how the Fleek Networking Lightning CLI was installed, this might cause some confusion, which is better explained by reading the reference Keys not found, which illustrates a situation where a user gets an error message about the wrong location of a system path (keystore).

Some of the reasons why the Permission denied (os error 13) might occur are related to:

  • The Fleek Network Lightning CLI process trying to write to a .lightning stored in a non permited location
  • The Fleek Network Lightning CLI process trying to write to /tmp

The most common issue can be fixed by reading the section Override the TMPDIR.

Override the TMPDIR

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.

a) A permission denied error message

Permission denied (os error 13)

b) Rust panic error message which includes a permission denied

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
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
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
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
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
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
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
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
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
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

c) A trace showing the path where this has failed

[00007fcbe168e764] openat(AT_FDCWD, "/tmp/lightning.log", O_WRONLY|O_CREAT|O_APPEND|O_CLOEXEC, 0666) = -1 EACCES (Permission denied)
[00007fcbe168ea6f] write(2, "thread '", 8thread ') = 8
[00007fcbe168ea6f] write(2, "main", 4main) = 4
[00007fcbe168ea6f] write(2, "' panicked at '", 15' panicked at ') = 15
[00007fcbe168ea6f] write(2, "called `Result::unwrap()` on an "..., 114called `Result::unwrap()` on an `Err` value: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }) = 114
[00007fcbe168ea6f] write(2, "', ", 3', ) = 3
tip

The /tmp directory should have wide permissions for all applications, but to mitigate any permission issues the user can override the system environment TMPDIR. For example, the installer and update scripts override TMPDIR environment variable to /var/tmp setting it in the service unit Environment=.

The Lightning CLI process is aware of the environment variable TMPDIR, which the operators can override as discussed in the reference for Update the System service unit.

In short, it requires you to include an Environment= value of TMPDIR=/var/tmp as follows:

[Service]
...
StandardOutput=append:/var/log/lightning/output.log
StandardError=append:/var/log/lightning/diagnostic.log
Environment=TMPDIR=/var/tmp
attention

The /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.

Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
- +

Ownership and file permissions

When running the Lightning CLI, the user who's in control can delegate to root via sudo. Depending on how the Fleek Networking Lightning CLI was installed, this might cause some confusion, which is better explained by reading the reference Keys not found, which illustrates a situation where a user gets an error message about the wrong location of a system path (keystore).

Some of the reasons why the Permission denied (os error 13) might occur are related to:

  • The Fleek Network Lightning CLI process trying to write to a .lightning stored in a non permited location
  • The Fleek Network Lightning CLI process trying to write to /tmp

The most common issue can be fixed by reading the section Override the TMPDIR.

Override the TMPDIR

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.

a) A permission denied error message

Permission denied (os error 13)

b) Rust panic error message which includes a permission denied

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
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
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
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
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
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
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
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
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
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

c) A trace showing the path where this has failed

[00007fcbe168e764] openat(AT_FDCWD, "/tmp/lightning.log", O_WRONLY|O_CREAT|O_APPEND|O_CLOEXEC, 0666) = -1 EACCES (Permission denied)
[00007fcbe168ea6f] write(2, "thread '", 8thread ') = 8
[00007fcbe168ea6f] write(2, "main", 4main) = 4
[00007fcbe168ea6f] write(2, "' panicked at '", 15' panicked at ') = 15
[00007fcbe168ea6f] write(2, "called `Result::unwrap()` on an "..., 114called `Result::unwrap()` on an `Err` value: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }) = 114
[00007fcbe168ea6f] write(2, "', ", 3', ) = 3
tip

The /tmp directory should have wide permissions for all applications, but to mitigate any permission issues the user can override the system environment TMPDIR. For example, the installer and update scripts override TMPDIR environment variable to /var/tmp setting it in the service unit Environment=.

The Lightning CLI process is aware of the environment variable TMPDIR, which the operators can override as discussed in the reference for Update the System service unit.

In short, it requires you to include an Environment= value of TMPDIR=/var/tmp as follows:

[Service]
...
StandardOutput=append:/var/log/lightning/output.log
StandardError=append:/var/log/lightning/diagnostic.log
Environment=TMPDIR=/var/tmp
attention

The /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.

Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
+ \ No newline at end of file diff --git a/references/Lightning CLI/uninstall-lightning-cli/index.html b/references/Lightning CLI/uninstall-lightning-cli/index.html index 9d718f1d4..ecaba895c 100644 --- a/references/Lightning CLI/uninstall-lightning-cli/index.html +++ b/references/Lightning CLI/uninstall-lightning-cli/index.html @@ -13,15 +13,15 @@ - +
-

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 unlink:

unlink /usr/local/bin/lgtn

Delete the local source code

Delete the local source code which was copied from the remote repository. You can delete it recursively by:

rm -r ~/fleek-network/lightning

💡 Use the flag f to force remove by skipping any prompts, e.g. rm -rf <PATHNAME>

note

The default install location is $HOME/fleek-network/lightning. If you have selected a different location to store the repository, change the target path.

Disable the systemd service

To disable the Fleek Network Lightning Systemd's service, start by stopping the service.

sudo systemctl stop lightning.service
tip

You can replace lightning.service by lightning.

Disable the lightning service

sudo systemctl disable lightning.service

If you have used the recommended procedures in the install documentation you'll have to remove the Systemd unit (file that defines the service).

rm /etc/systemd/system/lightning.service

Reload the Systemd service daemon

sudo systemctl daemon-reload

Clear the lightning config directory

The Fleek Network lightning config directory is where the configuration, keystore–the location where your private key is hosted–and other system files are stored.

WARNING

Make sure to backup 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.

Alternatively, instead of deleting you can move the files to a custom directory name such as.lightning.backupDATESTAMP, e.g. the example below we've used the date 2023-09-06-1205 as that was the time this text was written:

mv ~/.lightning ~/.lightning.backup202309061205

To clear the lightning config directory remove any files recursively by running the following command:

rm -r ~/.lightning/*

💡 Use the flag f to force remove by skipping any prompts, e.g. rm -rf <PATHNAME>/*

Alternatively, delete the ~/.lightning directory:

rm -r ~/.lightning

Uninstall Cargo and Rust

To uninstall rustc, rustup and cargo run the following command:

rustup self uninstall
Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
- +

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 unlink:

unlink /usr/local/bin/lgtn

Delete the local source code

Delete the local source code which was copied from the remote repository. You can delete it recursively by:

rm -r ~/fleek-network/lightning

💡 Use the flag f to force remove by skipping any prompts, e.g. rm -rf <PATHNAME>

note

The default install location is $HOME/fleek-network/lightning. If you have selected a different location to store the repository, change the target path.

Disable the systemd service

To disable the Fleek Network Lightning Systemd's service, start by stopping the service.

sudo systemctl stop lightning.service
tip

You can replace lightning.service by lightning.

Disable the lightning service

sudo systemctl disable lightning.service

If you have used the recommended procedures in the install documentation you'll have to remove the Systemd unit (file that defines the service).

rm /etc/systemd/system/lightning.service

Reload the Systemd service daemon

sudo systemctl daemon-reload

Clear the lightning config directory

The Fleek Network lightning config directory is where the configuration, keystore–the location where your private key is hosted–and other system files are stored.

WARNING

Make sure to backup 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.

Alternatively, instead of deleting you can move the files to a custom directory name such as.lightning.backupDATESTAMP, e.g. the example below we've used the date 2023-09-06-1205 as that was the time this text was written:

mv ~/.lightning ~/.lightning.backup202309061205

To clear the lightning config directory remove any files recursively by running the following command:

rm -r ~/.lightning/*

💡 Use the flag f to force remove by skipping any prompts, e.g. rm -rf <PATHNAME>/*

Alternatively, delete the ~/.lightning directory:

rm -r ~/.lightning

Uninstall Cargo and Rust

To uninstall rustc, rustup and cargo run the following command:

rustup self uninstall
Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
+ \ No newline at end of file diff --git a/references/Lightning CLI/update-cli-from-source-code/index.html b/references/Lightning CLI/update-cli-from-source-code/index.html index 3b1233862..bc4988e7a 100644 --- a/references/Lightning CLI/update-cli-from-source-code/index.html +++ b/references/Lightning CLI/update-cli-from-source-code/index.html @@ -13,15 +13,15 @@ - +
-
tip

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:

curl -sS https://get.fleek.network/update | bash

Switch to the installation user

Switch to the username you've used throughout the installation process.

su <USERNAME>

For example, if you used the username lgtn it'll look like the following command:

su lgtn

Change directory to the source code

If you have installed it via the recommended process or instructions, then the default location where the source code is stored is ~/fleek-network/lightning.

cd ~/fleek-network/lightning
tip

Notice that we use ~, which refers to $HOME. You must use the username used for the installation process. For example, on Ubuntu if you use the username lgtn, the pathname for $HOME is /home/lgtn.

Checkout to branch

Make sure that you are checked in to the correct branch. For the current testnet phase that'd be testnet-alpha-0. If you use any other branch name, your node will not function correctly. Use the branch name testnet-alpha-0.

git checkout testnet-alpha-0
tip

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 Discord.

Pull the latest changes

Before make sure that you stash or clear any changes you may have in the working directory, as otherwise, git will let you know about local changes–if you'd like to learn more about it read the git stash document.

A quick way to clean is to stash the changes, for example:

git stash 

To pull the latest changes use the git pull command, as follows:

git pull origin testnet-alpha-0

Alternatively, to have to stash and pull, you can reset the repository to the origin.

git fetch origin testnet-alpha-0
git reset --hard origin/testnet-alpha-0
git clean -f
tip

We are using the branch named testnet-alpha-0, 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 main.

Build binary from the source

To build the binary from the source code, we execute the cargo build command:

cargo +stable build --release

Start by removing the existing one:

sudo rm -f "/usr/local/bin/lgtn"

Create a new symlink that links the new build binary to /usr/local/bin/lgtn, as follows:

sudo ln -s ~/fleek-network/lightning/target/release/lightning-node /usr/local/bin/lgtn

Set user path in config.toml

You should be following the create a user recommendation. For our example, we have the username lgtn.

tip

If you have chosen a different username, replace lgtn by the correct username you have selected.

In the config.toml you'll find some and more of the following:

[BLANK]

[application]
db_path = "~/.lightning/data/app_db"

[consensus]
store_path = "~/.lightning/data/narwhal_store"

[fsstore]
root = "~/.lightning/blockstore"

[resolver]
store_path = "~/.lightning/data/resolver_store"

[signer]
consensus_key_path = "~/.lightning/keystore/consensus.pem"
node_key_path = "~/.lightning/keystore/node.pem"

Find and replace all instances of ~ in the config file /home/lgtn/.lightning/config.toml. Here's an example using sed:

sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"
caution

The 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.

Once changed, all the instances of ~/ should be replaced by your user path e.g. /home/lgtn/. For our example, the output would look like the following:

[BLANK]

[application]
db_path = "/home/lgtn/.lightning/data/app_db"

[consensus]
store_path = "/home/lgtn/.lightning/data/narwhal_store"

[fsstore]
root = "/home/lgtn/.lightning/blockstore"

[resolver]
store_path = "/home/lgtn/.lightning/data/resolver_store"

[signer]
consensus_key_path = "/home/lgtn/.lightning/keystore/consensus.pem"
node_key_path = "/home/lgtn/.lightning/keystore/node.pem"

Update the systemd service unit

Open and edit the /etc/systemd/system/lightning.service file.

1) Replace <YOUR-USERNAME> with the username. For example, in the documentation we use the username lgtn.

2) Make sure that the ExecStart is set correctly

[Unit]
Description=Fleek Network Node lightning service

[Service]
User=<YOUR-USERNAME>
Type=simple
MemoryHigh=32G
RestartSec=15s
Restart=always
ExecStart=lgtn -c /home/lgtn/.lightning/config.toml run
StandardOutput=append:/var/log/lightning/output.log
StandardError=append:/var/log/lightning/diagnostic.log
Environment=TMPDIR=/var/tmp

[Install]
WantedBy=multi-user.target
note

The flag -c in the lightning.service ExecStart, is to provide the toml configuration file path e.g. defaults to ~/.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 user or sudoer. For example, a sudoer would have the configuration set to /root/.lightning/config.toml or /home/username/.lightning/config.toml depending on using sudo which might cause some confusion to some users.

When complete make sure the file is saved. Followed by a systemctl daemon reload:

sudo systemctl daemon-reload

Clear the data

rm -rf ~/.lightning/data

Depending on how you control the system, this might need sudo.

sudo rm -rf ~/.lightning/data

Update the config.toml with user home path

In the /home/<USERNAME>/.lightning/config.toml you'll find some and more of the following:

[BLANK]

[application]
db_path = "~/.lightning/data/app_db"

[consensus]
store_path = "~/.lightning/data/narwhal_store"

[fsstore]
root = "~/.lightning/blockstore"

[resolver]
store_path = "~/.lightning/data/resolver_store"

[signer]
consensus_key_path = "~/.lightning/keystore/consensus.pem"
node_key_path = "~/.lightning/keystore/node.pem"
tip

The configuration properties and values presented above are a shorter version of what you'll find on your configuration.toml. We keep it short to make it easier to follow, do not copy and paste.

Find and replace all instances of ~ in the config file /home/<USERNAME>/.lightning/config.toml.

Here's an example of how to do it using sed:

sed -i "s|~/.lightning|/home/<USERNAME>/.lightning|g" "/home/<USERNAME>/.lightning/config.toml"
tip

Replace the <USERNAME> with your username. For example, if you have followed the recommendation to create a user it would look like /home/lgtn/.lightning/config.toml for the username lgtn.

For example, if your username is lgtn that'd look like this:

sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"

Once modified, you can run a cat to see the content of the files to confirm it has been updated.

cat /home/lgtn/.lightning/config.toml

For our example where we opted in for the username lgtn that would look like:

[BLANK]

[application]
db_path = "~/.lightning/data/app_db"

[consensus]
store_path = "~/.lightning/data/narwhal_store"

[fsstore]
root = "~/.lightning/blockstore"

[resolver]
store_path = "~/.lightning/data/resolver_store"

[signer]
consensus_key_path = "~/.lightning/keystore/consensus.pem"
node_key_path = "~/.lightning/keystore/node.pem"
Warning

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.

Restart the service

Once the cargo build process is completed, you have to restart the service. We're assuming you are using non-root user as recommended, you won't use sudo to start the service. The command will look as follows:

sudo systemctl restart lightning
tip

If you have installed the Fleek Network lightning manually, the 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.

Health checkup

Do a quick health check by running:

curl -w "\p" localhost:4069/health

If successful, you should get the response OK, as follows:

OK
Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
- +
tip

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:

curl -sS https://get.fleek.network/update | bash

Switch to the installation user

Switch to the username you've used throughout the installation process.

su <USERNAME>

For example, if you used the username lgtn it'll look like the following command:

su lgtn

Change directory to the source code

If you have installed it via the recommended process or instructions, then the default location where the source code is stored is ~/fleek-network/lightning.

cd ~/fleek-network/lightning
tip

Notice that we use ~, which refers to $HOME. You must use the username used for the installation process. For example, on Ubuntu if you use the username lgtn, the pathname for $HOME is /home/lgtn.

Checkout to branch

Make sure that you are checked in to the correct branch. For the current testnet phase that'd be testnet-alpha-0. If you use any other branch name, your node will not function correctly. Use the branch name testnet-alpha-0.

git checkout testnet-alpha-0
tip

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 Discord.

Pull the latest changes

Before make sure that you stash or clear any changes you may have in the working directory, as otherwise, git will let you know about local changes–if you'd like to learn more about it read the git stash document.

A quick way to clean is to stash the changes, for example:

git stash 

To pull the latest changes use the git pull command, as follows:

git pull origin testnet-alpha-0

Alternatively, to have to stash and pull, you can reset the repository to the origin.

git fetch origin testnet-alpha-0
git reset --hard origin/testnet-alpha-0
git clean -f
tip

We are using the branch named testnet-alpha-0, 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 main.

Build binary from the source

To build the binary from the source code, we execute the cargo build command:

cargo +stable build --release

Start by removing the existing one:

sudo rm -f "/usr/local/bin/lgtn"

Create a new symlink that links the new build binary to /usr/local/bin/lgtn, as follows:

sudo ln -s ~/fleek-network/lightning/target/release/lightning-node /usr/local/bin/lgtn

Set user path in config.toml

You should be following the create a user recommendation. For our example, we have the username lgtn.

tip

If you have chosen a different username, replace lgtn by the correct username you have selected.

In the config.toml you'll find some and more of the following:

[BLANK]

[application]
db_path = "~/.lightning/data/app_db"

[consensus]
store_path = "~/.lightning/data/narwhal_store"

[fsstore]
root = "~/.lightning/blockstore"

[resolver]
store_path = "~/.lightning/data/resolver_store"

[signer]
consensus_key_path = "~/.lightning/keystore/consensus.pem"
node_key_path = "~/.lightning/keystore/node.pem"

Find and replace all instances of ~ in the config file /home/lgtn/.lightning/config.toml. Here's an example using sed:

sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"
caution

The 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.

Once changed, all the instances of ~/ should be replaced by your user path e.g. /home/lgtn/. For our example, the output would look like the following:

[BLANK]

[application]
db_path = "/home/lgtn/.lightning/data/app_db"

[consensus]
store_path = "/home/lgtn/.lightning/data/narwhal_store"

[fsstore]
root = "/home/lgtn/.lightning/blockstore"

[resolver]
store_path = "/home/lgtn/.lightning/data/resolver_store"

[signer]
consensus_key_path = "/home/lgtn/.lightning/keystore/consensus.pem"
node_key_path = "/home/lgtn/.lightning/keystore/node.pem"

Update the systemd service unit

Open and edit the /etc/systemd/system/lightning.service file.

1) Replace <YOUR-USERNAME> with the username. For example, in the documentation we use the username lgtn.

2) Make sure that the ExecStart is set correctly

[Unit]
Description=Fleek Network Node lightning service

[Service]
User=<YOUR-USERNAME>
Type=simple
MemoryHigh=32G
RestartSec=15s
Restart=always
ExecStart=lgtn -c /home/lgtn/.lightning/config.toml run
StandardOutput=append:/var/log/lightning/output.log
StandardError=append:/var/log/lightning/diagnostic.log
Environment=TMPDIR=/var/tmp

[Install]
WantedBy=multi-user.target
note

The flag -c in the lightning.service ExecStart, is to provide the toml configuration file path e.g. defaults to ~/.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 user or sudoer. For example, a sudoer would have the configuration set to /root/.lightning/config.toml or /home/username/.lightning/config.toml depending on using sudo which might cause some confusion to some users.

When complete make sure the file is saved. Followed by a systemctl daemon reload:

sudo systemctl daemon-reload

Clear the data

rm -rf ~/.lightning/data

Depending on how you control the system, this might need sudo.

sudo rm -rf ~/.lightning/data

Update the config.toml with user home path

In the /home/<USERNAME>/.lightning/config.toml you'll find some and more of the following:

[BLANK]

[application]
db_path = "~/.lightning/data/app_db"

[consensus]
store_path = "~/.lightning/data/narwhal_store"

[fsstore]
root = "~/.lightning/blockstore"

[resolver]
store_path = "~/.lightning/data/resolver_store"

[signer]
consensus_key_path = "~/.lightning/keystore/consensus.pem"
node_key_path = "~/.lightning/keystore/node.pem"
tip

The configuration properties and values presented above are a shorter version of what you'll find on your configuration.toml. We keep it short to make it easier to follow, do not copy and paste.

Find and replace all instances of ~ in the config file /home/<USERNAME>/.lightning/config.toml.

Here's an example of how to do it using sed:

sed -i "s|~/.lightning|/home/<USERNAME>/.lightning|g" "/home/<USERNAME>/.lightning/config.toml"
tip

Replace the <USERNAME> with your username. For example, if you have followed the recommendation to create a user it would look like /home/lgtn/.lightning/config.toml for the username lgtn.

For example, if your username is lgtn that'd look like this:

sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"

Once modified, you can run a cat to see the content of the files to confirm it has been updated.

cat /home/lgtn/.lightning/config.toml

For our example where we opted in for the username lgtn that would look like:

[BLANK]

[application]
db_path = "~/.lightning/data/app_db"

[consensus]
store_path = "~/.lightning/data/narwhal_store"

[fsstore]
root = "~/.lightning/blockstore"

[resolver]
store_path = "~/.lightning/data/resolver_store"

[signer]
consensus_key_path = "~/.lightning/keystore/consensus.pem"
node_key_path = "~/.lightning/keystore/node.pem"
Warning

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.

Restart the service

Once the cargo build process is completed, you have to restart the service. We're assuming you are using non-root user as recommended, you won't use sudo to start the service. The command will look as follows:

sudo systemctl restart lightning
tip

If you have installed the Fleek Network lightning manually, the 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.

Health checkup

Do a quick health check by running:

curl -w "\p" localhost:4069/health

If successful, you should get the response OK, as follows:

OK
Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
+ \ No newline at end of file diff --git a/references/Systemd/shutting-down-persistance/index.html b/references/Systemd/shutting-down-persistance/index.html index 5732d0bb0..6b2ef2dd3 100644 --- a/references/Systemd/shutting-down-persistance/index.html +++ b/references/Systemd/shutting-down-persistance/index.html @@ -13,15 +13,15 @@ - +
-

Systemd Service as frozen or idle

If you have a 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.

The logs should be similar to the following:

2023-09-11 18:02:07 | ERROR | lightning_consensus::consensus - core/consensus/src/consensus.rs:371 - node: XsE9KtedDRUGv22MLHvy8qcc52QsWGWJYY1LBnWhglg=
2023-09-11 18:02:07 | ERROR | lightning_consensus::consensus - core/consensus/src/consensus.rs:371 - node: zBmZaycvQsdFRfe0p5Rig/KgyYPD4yNKQTPDo7JrugM=
2023-09-11 18:02:07 | WARN | lightning_consensus::consensus - core/consensus/src/consensus.rs:373 - ##################
2023-09-11 18:02:07 | WARN | lightning_consensus::consensus - core/consensus/src/consensus.rs:374 - ********************************
RPC server starting up
listening on 0.0.0.0:4069
Shutting node down.
Shutting node down.
Shutting node down.
Shutting node down.
Shutting node down.

To resolve this issue, start by executing a new shutdown command as follows:

systemctl stop lightning

If you need to delegate to root, then use the sudo keyword, as follows:

sudo systemctl stop lightning

Once completed, clear the logs to avoid confusion as the log aggregates messages past and current.

Delete all the log files (output.log and diagnostic.log) by running:

sudo rm -f /var/log/lightning/*.log

Launch the service:

systemctl start lightning

If you need to delegate to root, then use the sudo keyword, as follows:

sudo systemctl start lightning

You can watch the log output of the service by running:

tail -f /var/log/lightning/output.log

The output should be similar to:

2023-09-12 13:53:51 | WARN  | lightning_consensus::consensus - core/consensus/src/consensus.rs:373 - ##################
2023-09-12 13:53:51 | WARN | lightning_consensus::consensus - core/consensus/src/consensus.rs:374 - ********************************

Alternatively, you can watch the diagnostic.log

tail -f /var/log/lightning/diagnostic.log
Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
- +

Systemd Service as frozen or idle

If you have a 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.

The logs should be similar to the following:

2023-09-11 18:02:07 | ERROR | lightning_consensus::consensus - core/consensus/src/consensus.rs:371 - node: XsE9KtedDRUGv22MLHvy8qcc52QsWGWJYY1LBnWhglg=
2023-09-11 18:02:07 | ERROR | lightning_consensus::consensus - core/consensus/src/consensus.rs:371 - node: zBmZaycvQsdFRfe0p5Rig/KgyYPD4yNKQTPDo7JrugM=
2023-09-11 18:02:07 | WARN | lightning_consensus::consensus - core/consensus/src/consensus.rs:373 - ##################
2023-09-11 18:02:07 | WARN | lightning_consensus::consensus - core/consensus/src/consensus.rs:374 - ********************************
RPC server starting up
listening on 0.0.0.0:4069
Shutting node down.
Shutting node down.
Shutting node down.
Shutting node down.
Shutting node down.

To resolve this issue, start by executing a new shutdown command as follows:

systemctl stop lightning

If you need to delegate to root, then use the sudo keyword, as follows:

sudo systemctl stop lightning

Once completed, clear the logs to avoid confusion as the log aggregates messages past and current.

Delete all the log files (output.log and diagnostic.log) by running:

sudo rm -f /var/log/lightning/*.log

Launch the service:

systemctl start lightning

If you need to delegate to root, then use the sudo keyword, as follows:

sudo systemctl start lightning

You can watch the log output of the service by running:

tail -f /var/log/lightning/output.log

The output should be similar to:

2023-09-12 13:53:51 | WARN  | lightning_consensus::consensus - core/consensus/src/consensus.rs:373 - ##################
2023-09-12 13:53:51 | WARN | lightning_consensus::consensus - core/consensus/src/consensus.rs:374 - ********************************

Alternatively, you can watch the diagnostic.log

tail -f /var/log/lightning/diagnostic.log
Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
+ \ No newline at end of file diff --git a/references/Systemd/user-service/index.html b/references/Systemd/user-service/index.html index 05a7746ac..9c81d3a9c 100644 --- a/references/Systemd/user-service/index.html +++ b/references/Systemd/user-service/index.html @@ -13,15 +13,15 @@ - +
-

A user should have the ability to run a Systemd user service unit without having to use sudo to control it.

Check --user support

Use the --user flag when getting the list of unit files.

systemctl --user list-unit-files

It should return a list of unit files.

Put the service unit in the user service

Create the Systemd user units directory:

sudo mkdir -p /etc/systemd/system/user

Move the lightning.service to the system user unit service directory:

mv /etc/systemd/system/lightning.service /etc/systemd/system/user/lightning.service

Check the Load path when running in user mode (--user) in Systemd unit for other alternative user paths, or to understand how it works to customize your server accordingly.

## Reload daemon

sudo systemctl daemon-reload

Systemd service control as --user

Reload the Systemctl daemon by executing the command:

systemctl --user daemon-reload

Enable the service for starting up on system boot:

systemctl --user enable lightning.service

Start the service by:

systemctl --user start lightning

Stop the service by:

systemctl --user stop lightning

Restart the service by:

systemctl --user restart lightning

Check the service status by:

systemctl --user status lightning.service

Problem statement

On tests done in a DigitalOcean Ubuntu 22.x, we had setup user-level services which were operated with --user. When the commands were executed as --user it failed with:

Failed to connect to bus: Operation not permitted (consider using --machine=<user>@.host --user to connect to bus of other user)

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:

systemctl --user list-unit-files

We'd get the error:

Failed to connect to bus: Operation not permitted (consider using --machine=<user>@.host --user to connect to bus of other user)

For any of the supported user unit locations e.g. $HOME/.config/systemd/user as documented in Systemd unit documentation, the result is the error above.

This is related to the load paths when running in user mode (--user), as described in the discussion here.

User-dependent

$XDG_CONFIG_HOME/systemd/user User configuration (only used when $XDG_CONFIG_HOME is set)

$HOME/.config/systemd/user User configuration (only used when $XDG_CONFIG_HOME is not set)

$XDG_RUNTIME_DIR/systemd/user Runtime units (only used when $XDG_RUNTIME_DIR is set)

$XDG_DATA_HOME/systemd/user Units of packages that have been installed in the home directory (only used when $XDG_DATA_HOME is set)

$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)

For example, if we check the $XDG_RUNTIME_DIR in a DigitalOcean box, we get the following output:

/run/user/0

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.

Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
- +

A user should have the ability to run a Systemd user service unit without having to use sudo to control it.

Check --user support

Use the --user flag when getting the list of unit files.

systemctl --user list-unit-files

It should return a list of unit files.

Put the service unit in the user service

Create the Systemd user units directory:

sudo mkdir -p /etc/systemd/system/user

Move the lightning.service to the system user unit service directory:

mv /etc/systemd/system/lightning.service /etc/systemd/system/user/lightning.service

Check the Load path when running in user mode (--user) in Systemd unit for other alternative user paths, or to understand how it works to customize your server accordingly.

## Reload daemon

sudo systemctl daemon-reload

Systemd service control as --user

Reload the Systemctl daemon by executing the command:

systemctl --user daemon-reload

Enable the service for starting up on system boot:

systemctl --user enable lightning.service

Start the service by:

systemctl --user start lightning

Stop the service by:

systemctl --user stop lightning

Restart the service by:

systemctl --user restart lightning

Check the service status by:

systemctl --user status lightning.service

Problem statement

On tests done in a DigitalOcean Ubuntu 22.x, we had setup user-level services which were operated with --user. When the commands were executed as --user it failed with:

Failed to connect to bus: Operation not permitted (consider using --machine=<user>@.host --user to connect to bus of other user)

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:

systemctl --user list-unit-files

We'd get the error:

Failed to connect to bus: Operation not permitted (consider using --machine=<user>@.host --user to connect to bus of other user)

For any of the supported user unit locations e.g. $HOME/.config/systemd/user as documented in Systemd unit documentation, the result is the error above.

This is related to the load paths when running in user mode (--user), as described in the discussion here.

User-dependent

$XDG_CONFIG_HOME/systemd/user User configuration (only used when $XDG_CONFIG_HOME is set)

$HOME/.config/systemd/user User configuration (only used when $XDG_CONFIG_HOME is not set)

$XDG_RUNTIME_DIR/systemd/user Runtime units (only used when $XDG_RUNTIME_DIR is set)

$XDG_DATA_HOME/systemd/user Units of packages that have been installed in the home directory (only used when $XDG_DATA_HOME is set)

$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)

For example, if we check the $XDG_RUNTIME_DIR in a DigitalOcean box, we get the following output:

/run/user/0

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.

Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on Discord!
+ \ No newline at end of file diff --git a/references/index.html b/references/index.html index 73d713826..cb425f35f 100644 --- a/references/index.html +++ b/references/index.html @@ -13,15 +13,15 @@ - +
-

The references provide concise instructions to interface with the system, broken down into commands or small pieces for quick reference.

It differs from Guides which is more descriptive or verbose when providing instructions and how-to's.

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.

- +

The references provide concise instructions to interface with the system, broken down into commands or small pieces for quick reference.

It differs from Guides which is more descriptive or verbose when providing instructions and how-to's.

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.

+ \ No newline at end of file diff --git a/references/tags/clean/index.html b/references/tags/clean/index.html index 5bce7ac74..f15169abe 100644 --- a/references/tags/clean/index.html +++ b/references/tags/clean/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/clear/index.html b/references/tags/clear/index.html index 8097d753b..f6e3fd1b3 100644 --- a/references/tags/clear/index.html +++ b/references/tags/clear/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/delete/index.html b/references/tags/delete/index.html index 78ccde84c..eec473e2b 100644 --- a/references/tags/delete/index.html +++ b/references/tags/delete/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/file-permissions/index.html b/references/tags/file-permissions/index.html index 5790fb10b..b7917da65 100644 --- a/references/tags/file-permissions/index.html +++ b/references/tags/file-permissions/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/fix/index.html b/references/tags/fix/index.html index 016f80b8a..263b838b8 100644 --- a/references/tags/fix/index.html +++ b/references/tags/fix/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/frozen/index.html b/references/tags/frozen/index.html index df47289cc..ea9613642 100644 --- a/references/tags/frozen/index.html +++ b/references/tags/frozen/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/help/index.html b/references/tags/help/index.html index b95c6d6bf..3b03a13fe 100644 --- a/references/tags/help/index.html +++ b/references/tags/help/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

6 docs tagged with "Help"

View All Tags

About references

The references provide concise instructions to interface with the system, broken down into commands or small pieces for quick reference.

- + \ No newline at end of file diff --git a/references/tags/idle/index.html b/references/tags/idle/index.html index a9c9a8444..f39841ad7 100644 --- a/references/tags/idle/index.html +++ b/references/tags/idle/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/index.html b/references/tags/index.html index fe399801c..f46db0e33 100644 --- a/references/tags/index.html +++ b/references/tags/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/keystore/index.html b/references/tags/keystore/index.html index 180696853..f8822cfe2 100644 --- a/references/tags/keystore/index.html +++ b/references/tags/keystore/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/lost-keys/index.html b/references/tags/lost-keys/index.html index a5e270a5c..a1bc339ed 100644 --- a/references/tags/lost-keys/index.html +++ b/references/tags/lost-keys/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/ownership/index.html b/references/tags/ownership/index.html index 325412a3e..145ca5417 100644 --- a/references/tags/ownership/index.html +++ b/references/tags/ownership/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/permissions/index.html b/references/tags/permissions/index.html index 892f9fc0c..9271c670a 100644 --- a/references/tags/permissions/index.html +++ b/references/tags/permissions/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/reference/index.html b/references/tags/reference/index.html index 228783efc..9ee04d8b7 100644 --- a/references/tags/reference/index.html +++ b/references/tags/reference/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/references/index.html b/references/tags/references/index.html index 361a6c5cd..f4dc299c0 100644 --- a/references/tags/references/index.html +++ b/references/tags/references/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@

6 docs tagged with "References"

View All Tags

About references

The references provide concise instructions to interface with the system, broken down into commands or small pieces for quick reference.

- + \ No newline at end of file diff --git a/references/tags/remove/index.html b/references/tags/remove/index.html index 4d6658c26..de00fa0fe 100644 --- a/references/tags/remove/index.html +++ b/references/tags/remove/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/root/index.html b/references/tags/root/index.html index 563666edb..23ff549cf 100644 --- a/references/tags/root/index.html +++ b/references/tags/root/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/service-error/index.html b/references/tags/service-error/index.html index 15d376874..5ee74f19a 100644 --- a/references/tags/service-error/index.html +++ b/references/tags/service-error/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/shutdown/index.html b/references/tags/shutdown/index.html index 1418d9e03..313a51da4 100644 --- a/references/tags/shutdown/index.html +++ b/references/tags/shutdown/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/sudoer/index.html b/references/tags/sudoer/index.html index f91f58ff9..051f1df65 100644 --- a/references/tags/sudoer/index.html +++ b/references/tags/sudoer/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/systemctl/index.html b/references/tags/systemctl/index.html index 6954054c7..26f5591e2 100644 --- a/references/tags/systemctl/index.html +++ b/references/tags/systemctl/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/systemd/index.html b/references/tags/systemd/index.html index 3cdbd4056..99f9e45db 100644 --- a/references/tags/systemd/index.html +++ b/references/tags/systemd/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/uninstall/index.html b/references/tags/uninstall/index.html index 559f5fd3b..7d9d80915 100644 --- a/references/tags/uninstall/index.html +++ b/references/tags/uninstall/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/unit/index.html b/references/tags/unit/index.html index 00c826ce7..3dddcd45f 100644 --- a/references/tags/unit/index.html +++ b/references/tags/unit/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/update/index.html b/references/tags/update/index.html index e2071e649..81f7b564d 100644 --- a/references/tags/update/index.html +++ b/references/tags/update/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/upgrade/index.html b/references/tags/upgrade/index.html index ee4060fe5..73b77ce62 100644 --- a/references/tags/upgrade/index.html +++ b/references/tags/upgrade/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/references/tags/user-service/index.html b/references/tags/user-service/index.html index 5e75fd463..53f58b352 100644 --- a/references/tags/user-service/index.html +++ b/references/tags/user-service/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/search/index.html b/search/index.html index 587c30228..015e490d7 100644 --- a/search/index.html +++ b/search/index.html @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + \ No newline at end of file