Option 2 - Linux Archive
2. Linux Archive Distribution
** Please refer to the document page for more details: https://docs.kaia.io/nodes/core-cell/install/install-consensus-nodes/ ** Skip this page if you installed kcnd with 2-A. Option 1 - Kaia Yum Repo.
The archive file consists of the executable binary and the configuration file structured as follows.
kcn-linux-amd64
├── bin
│ ├── kcn # CN executable file
│ └── kcnd # CN start/termination script file
└── conf
└── kcnd.conf # CN configuration fileDo NOT alter the file structure or file name. If you change it, the node may not function correctly.
Download the latest version of kcn from the Download page, and uncompress it where you want to install the package. The commands below look up the latest release version from the Kaia GitHub releases and download it.
** In this workshop, <DOWNLOADED_PATH> means the directory where you download and uncompress the archive. The kcn-linux-amd64 directory is created under it.
$ cd <DOWNLOADED_PATH>
$ VERSION=$(curl -s https://api.github.com/repos/kaiachain/kaia/releases/latest | grep '"tag_name"' | cut -d'"' -f4)
$ echo $VERSION
$ curl -fLO https://packages.kaia.io/kaia/${VERSION}/kcn-${VERSION}-0-linux-amd64.tar.gz
$ tar zxf kcn-${VERSION}-0-linux-amd64.tar.gz
$ export PATH=$PATH:<DOWNLOADED_PATH>/kcn-linux-amd64/bin
$ kcn version** It is recommended to add <DOWNLOADED_PATH>/kcn-linux-amd64/bin to the environment variable $PATH (e.g. in ~/.bashrc) to run kcn and kcnd globally. The other pages assume that the path is added to the variable.
| File Name | Location |
|---|---|
| kcn | <DOWNLOADED_PATH>/kcn-linux-amd64/bin/kcn |
| kcnd.conf | <DOWNLOADED_PATH>/kcn-linux-amd64/conf/kcnd.conf |
(Optional) Register kcnd as a systemd service
With the archive distribution, kcnd is not registered as a service, so it does not start automatically after reboot. If you want to manage kcnd with systemctl like Option 1, create /etc/systemd/system/kcnd.service as follows.
[Unit]
Description=kcnd Service
[Service]
Type=forking
ExecStart=<DOWNLOADED_PATH>/kcn-linux-amd64/bin/kcnd start
ExecStop=<DOWNLOADED_PATH>/kcn-linux-amd64/bin/kcnd stop
# kcnd writes the kcn process ID to $DATA_DIR/kcnd.pid
PIDFile=/kaia/kcnd/data/kcnd.pid
[Install]
WantedBy=multi-user.target** Replace <DOWNLOADED_PATH> with your actual path. PIDFile must match DATA_DIR in kcnd.conf (see 4-B. Node Configuration).
Enable the service.
$ sudo systemctl daemon-reload
$ sudo systemctl enable kcnd.service** Do not start kcnd yet. It will be started in 5-A. Start the Kaia service after the chaindata and kcnd.conf are ready.
If you finish this step, please click the next button > on the right side of this page.