Install Proxy Nodes
Download
You can download the latest version of the kpn on Download page.
Installation
Linux Archive Distribution
The archive file consists of the executable binary and the configuration file structured as follows.
Note: Do NOT alter the file structure or file name. If you change it, the node may not function correctly.
- bin |- kpn |- kpnd- conf |- kpnd.conf
| File Name | File Description |
|---|---|
| bin/kpn | PN executable file |
| bin/kpnd | PN start/termination script file |
| conf/kpnd.conf | PN configuration file |
The installation is the uncompression of the downloaded package where you want to install the package.
$ tar zxf kpn-vX.X.X-linux-amd64.tar.gz
Or,
$ tar zxf kpn-baobab-vX.X.X-linux-amd64.tar.gz
Note: it is recommended that the uncompressed directory kpn-linux-amd64/bin path should be added to the environment variable $PATH to run the kpn and kpnd globally. As an example,
$ export PATH=$PATH:~/downloaded/path/kpn-linux-amd64/bin
The other sections assume that the path is added to the variable.
RPM Distribution (RHEL/CentOS/Fedora)
You can install the downloaded RPM file with the following yum command.
$ yum install kpnd-vX.X.X.el7.x86_64.rpm
Or,
$ yum install kpnd-baobab-vX.X.X.el7.x86_64.rpm
Install from Kaia Yum Repo
Alternatively, you can install kpnd from the Kaia Yum repo, run:
$ sudo curl -o /etc/yum.repos.d/kaia.repo https://packages.kaia.io/config/rhel/7/kaia.repo && sudo yum install kpnd
hoặc
$ sudo curl -o /etc/yum.repos.d/kaia.repo https://packages.kaia.io/config/rhel/9-stream/kaia.repo && sudo yum cài đặt kpnd
Installed Location
The installed files are located as follows.
| File Name | Location |
|---|---|
| kpn | /usr/bin/kpn |
| kpnd.conf | /etc/kpnd/conf/kpnd.conf |
Configuration
The PN configuration is to create a data directory and set up several values in the configuration file kpnd.conf.
- Create a PN Data Directory
- Install node key
- Install
static-node.json - Configure the PN with
kpnd.conf.
PN Data Directory Creation
Considering the fact that the size of Kaia blockchain data is always increased, it is recommended to use a big enough storage. You may need to create the directory on your desired path.
$ mkdir -p /var/kpnd/data
Install Node Key
In order to operate a PN, a nodekey is required. The KPN binary will create a new one for you if you do not have it. If you have one, you need to put your nodekey into the PN data directory. The way to create a nodekey is in the "Before You Install" section. The following command line copies the nodekey into the PN data directory.
$ cp nodekey /var/kpnd/data
Install static-nodes.json
The static-nodes.json should be created from the PN operator. It contains the addresses that your PN is connected to. It is recommended to add the addresses including your CN and a PN from another Core Cell. Please contact to the Kaia official email for more details (bootstrap@klaytn.com for Mainnet or baobab@klaytn.com for Kairos).
static-nodes.json
[ "kni://4f2f47f3bf35a2c576d3345e6e9c49b147d510c05832d2458709f63c3c90c76ead205975d944ed65e77dd4c6f63ebe1ef21d60da95952bc1e200e7487f4d9e1b@10.11.2.101:32323?discport=0&ntype=cn", "kni://8dee912aeda2ccfaa4fe421f015d4d75c2e3fd4aab75fa399b42767caad33531e57f3356b4a4af374593e33ec4320e1325aa2390a7be2489fa6b5724894680eb@10.11.2.102:32323?discport=0&ntype=pn"]
The node URI of the PN is in the "Before You Install" section. (Note: This IP address is different from CN public IP.) The following command line copies the static-nodes.json file into the PN data directory.
$ cp static-nodes.json /var/kpnd/data
Update the Configuration File
Configuration File Location:
- For the archive distribution, the config directory location defaults to
$INSTALL_PATH/kpn-linux-amd64/conf/. - For the package distribution, the config directory defaults to
/etc/kpnd/conf/.
Add Data Directory
Bạn nên cập nhật biến môi trường thư mục dữ liệu $DATA_DIR trong tệp cấu hình kpnd.conf.
...DATA_DIR=/var/kpnd/data...
(Optional) Download Chaindata Snapshot
Synching from the genesis block is time-consuming. You may use Chaindata Snapshot to skip the Full Sync process.