Klaytn Configuration


The CN configuration is to create a data directory and set up several values in the configuration file.

  • Create the data/log directory.
  • Install node key.
  • Configure the CN(PN) with kcnd.conf (kpnd.conf).

1. Data, Log Directory Creation

Considering the fact that the size of Klaytn 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.


1) CN

$ mkdir -p /var/kcnd/data
$ mkdir -p /var/kcnd/logs

2) PN

$ mkdir -p /var/kpnd/data
$ mkdir -p /var/kpnd/logs

2. Install Nodekey

Nodekey is your Private key what you generate with Klay Tool.

CCN

In order to operate a node, a nodekey is required. The KCN(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 data directory.

$ vi /var/kcnd/data/nodekey
$ cp nodekey /var/kcnd/data
Set the PN node in the same way.



3. Install BLS-Nodekey for CN only

BLS-Nodekey is your Private key what you generate with Klay Tool.

CN

In order to operate a node, a bls-nodekey is required. The KCN binary will create a new one for you if you do not have it.
If you have one, you need to put your bls-nodekey into the data directory.

$ vi /var/kcnd/data/bls-nodekey
$ cp bls-nodekey /var/kcnd/data



4. Update the Configuration File

Configuration File Location:

For the archive distribution, the config directory location defaults to $INSTALL_PATH/kcn-linux-amd64/conf/.
For the package distribution, the config directory defaults to /etc/kcnd/conf/.

1) Add configuration for CN
# NETWORK=""
NETWORK_ID=6336
DATA_DIR=/var/kcnd/data  # path where you created in #1
LOG_DIR=/var/kcnd/logs # path where you created in #1
NO_DISCOVER=0
BOOTNODES=""
REWARDBASE="" # ADD YOUR REWARDS ADDRESS GENERATED BY KEYTOOL
ADDITIONAL="--state.trie-cache-limit 5000 --state.live-pruning"
2) Add configuration for PN
# NETWORK=""
NETWORK_ID=6336
DATA_DIR=/var/kpnd/data  # path where you created in #1
LOG_DIR=/var/kpnd/logs # path where you created in #1
NO_DISCOVER=1
BOOTNODES=""
ADDITIONAL="--state.trie-cache-limit 5000 --state.live-pruning"





You can check the more information for installation on the page below.




If you finish this step, please click the next button > on the right side of this page.