canine-docs/docs/nodes/nodes/2_installation.md
2022-10-27 09:35:06 -04:00

1.6 KiB

sidebar_position
2

Installing Canined

Pre-Requisites

There are a few things needed before installing.

Installing Build Essentials

sudo apt update
sudo apt install build-essential

Installing Go

Follow more in-depth instructions to install Go v1.18.2 or higher here.

On Ububtu you can install it with:

wget https://golang.org/dl/go1.18.2.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.18.2.linux-amd64.tar.gz

Add these lines to the end of ~/.profile:

export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin

Restarting the shell with youre profile settings or just rebasing them like so is required.

source ~/.profile

Building from Source

git clone https://github.com/JackalLabs/canine-chain.git
cd canine-chain
git fetch
git checkout <VERSION>

make install

From there you will be able to use canined, ex:

canined version

Creating a Service

You may want the daemon to run without you needing to supervise it. To turn the executable into a service follow these steps.

cd $HOME
echo "[Unit]
Description=Jackal Node
After=network-online.target
[Service]
User=${USER}
ExecStart=$(which canined) start
Restart=always
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target
" > canined.service

sudo mv canined.service /lib/systemd/system/
sudo systemctl enable canined.service

# Starting the service
sudo systemctl start canined.service

# Restarting the service
sudo systemctl daemon-reload
sudo systemctl restart canined.service