1 line
7.3 KiB
JavaScript
1 line
7.3 KiB
JavaScript
"use strict";(self.webpackChunkcanine_docs=self.webpackChunkcanine_docs||[]).push([[92],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>g});var a=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 l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},l=Object.keys(e);for(a=0;a<l.length;a++)n=l[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a<l.length;a++)n=l[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var o=a.createContext({}),c=function(e){var t=a.useContext(o),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=c(e.components);return a.createElement(o.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},p=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,l=e.originalType,o=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),p=c(n),g=r,m=p["".concat(o,".").concat(g)]||p[g]||d[g]||l;return n?a.createElement(m,i(i({ref:t},u),{},{components:n})):a.createElement(m,i({ref:t},u))}));function g(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=n.length,i=new Array(l);i[0]=p;var s={};for(var o in t)hasOwnProperty.call(t,o)&&(s[o]=t[o]);s.originalType=e,s.mdxType="string"==typeof e?e:r,i[1]=s;for(var c=2;c<l;c++)i[c]=n[c];return a.createElement.apply(null,i)}return a.createElement.apply(null,n)}p.displayName="MDXCreateElement"},8348:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>o,contentTitle:()=>i,default:()=>d,frontMatter:()=>l,metadata:()=>s,toc:()=>c});var a=n(7462),r=(n(7294),n(3905));const l={sidebar_position:2},i="Installing Canined",s={unversionedId:"nodes/nodes/installation",id:"nodes/nodes/installation",title:"Installing Canined",description:"Pre-Requisites",source:"@site/docs/nodes/nodes/2_installation.md",sourceDirName:"nodes/nodes",slug:"/nodes/nodes/installation",permalink:"/docs/nodes/nodes/installation",draft:!1,editUrl:"https://github.com/JackalLabs/canine-docs/blob/master/docs/nodes/nodes/2_installation.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Hardware",permalink:"/docs/nodes/nodes/hardware"},next:{title:"Joining Testnet",permalink:"/docs/nodes/nodes/testnet"}},o={},c=[{value:"Pre-Requisites",id:"pre-requisites",level:2},{value:"Installing Build Essentials",id:"installing-build-essentials",level:3},{value:"Installing Go",id:"installing-go",level:3},{value:"Building from Source",id:"building-from-source",level:2},{value:"Syncing to Current Height",id:"syncing-to-current-height",level:2},{value:"Versions for Sync",id:"versions-for-sync",level:3},{value:"Creating a Service",id:"creating-a-service",level:2}],u={toc:c};function d(e){let{components:t,...n}=e;return(0,r.kt)("wrapper",(0,a.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"installing-canined"},"Installing Canined"),(0,r.kt)("h2",{id:"pre-requisites"},"Pre-Requisites"),(0,r.kt)("p",null,"There are a few things needed before installing."),(0,r.kt)("h3",{id:"installing-build-essentials"},"Installing Build Essentials"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"sudo apt update\nsudo apt install build-essential\n")),(0,r.kt)("h3",{id:"installing-go"},"Installing Go"),(0,r.kt)("p",null,"Follow more in-depth instructions to install Go v1.19 or higher ",(0,r.kt)("a",{parentName:"p",href:"https://golang.org/doc/install"},"here"),"."),(0,r.kt)("p",null,"On Ububtu you can install it with:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"wget https://golang.org/dl/go1.19.3.linux-amd64.tar.gz\nsudo tar -C /usr/local -xzf go1.19.3.linux-amd64.tar.gz\n")),(0,r.kt)("p",null,"Add these lines to the end of ",(0,r.kt)("inlineCode",{parentName:"p"},"~/.profile"),":"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"export GOROOT=/usr/local/go\nexport GOPATH=$HOME/go\nexport GO111MODULE=on\nexport PATH=$PATH:/usr/local/go/bin:$HOME/go/bin\n")),(0,r.kt)("p",null,"Restarting the shell with youre profile settings or just rebasing them like so is required."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"source ~/.profile\n")),(0,r.kt)("h2",{id:"building-from-source"},"Building from Source"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"git clone https://github.com/JackalLabs/canine-chain.git\ncd canine-chain\ngit fetch\ngit checkout <VERSION>\n\nmake install\n")),(0,r.kt)("p",null,"From there you will be able to use ",(0,r.kt)("inlineCode",{parentName:"p"},"canined"),", ex:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"canined version\n")),(0,r.kt)("h2",{id:"syncing-to-current-height"},"Syncing to Current Height"),(0,r.kt)("p",null,"Get a snapshot ",(0,r.kt)("a",{parentName:"p",href:"http://snapshots.autostake.net/jackal-1/"},"here"),"."),(0,r.kt)("p",null,"For the sake of this guide, the snapshot we download is named ",(0,r.kt)("inlineCode",{parentName:"p"},"jackal.tar.lz4")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},"sudo snap install lz4\ncanined unsafe-reset-all --keep-addr-book\nlz4 -c -d jackal.tar.lz4 | tar -x -C $HOME/.canine\n")),(0,r.kt)("p",null,"Then start the chain again."),(0,r.kt)("h3",{id:"versions-for-sync"},"Versions for Sync"),(0,r.kt)("table",null,(0,r.kt)("thead",{parentName:"table"},(0,r.kt)("tr",{parentName:"thead"},(0,r.kt)("th",{parentName:"tr",align:null},"block height"),(0,r.kt)("th",{parentName:"tr",align:null},"canined version"))),(0,r.kt)("tbody",{parentName:"table"},(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"45381"),(0,r.kt)("td",{parentName:"tr",align:null},"1.1.2")),(0,r.kt)("tr",{parentName:"tbody"},(0,r.kt)("td",{parentName:"tr",align:null},"0"),(0,r.kt)("td",{parentName:"tr",align:null},"1.1.0")))),(0,r.kt)("h2",{id:"creating-a-service"},"Creating a Service"),(0,r.kt)("p",null,"You may want the daemon to run without you needing to supervise it. To turn the executable into a service follow these steps."),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-sh"},'cd $HOME\necho "[Unit]\nDescription=Jackal Node\nAfter=network-online.target\n[Service]\nUser=${USER}\nExecStart=$(which canined) start\nRestart=always\nRestartSec=3\nLimitNOFILE=4096\n[Install]\nWantedBy=multi-user.target\n" > canined.service\n\nsudo mv canined.service /lib/systemd/system/\nsudo systemctl enable canined.service\n\n# Starting the service\nsudo systemctl start canined.service\n\n# Restarting the service\nsudo systemctl daemon-reload\nsudo systemctl restart canined.service\n')))}d.isMDXComponent=!0}}]); |