The CN configuration is to create a data directory and set up several values in the configuration file
- 1.Create the CN data directory.
- 2.Install node key
- 3.Configure the CN with
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.
$ mkdir -p /var/kcnd/data
In order to operate a CN, a
nodekeyis 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
nodekeyinto the CN data directory. The way to create a
nodekeyis described in the 'Before You Install' section. The following command line copies the
nodekeyinto the CN data directory.
$ cp nodekey /var/kcnd/data
Configuration File Location:
- For the archive distribution, the config directory location defaults to
- For the package distribution, the config directory defaults to
You should update the the data directory environment variable
$DATA_DIRon the configuration file
As a reward of participating in the consensus of the Klaytn network, CN operator will receive KLAY. For this reason, it is required to set an address on the configuration file
The ways to create a new account are various, but the
kcnalso provides the functionality. You can check the help message with the following command.
$ kcn account new --help
One of the example of doing this procedure is as follows. First of all, you need to create a new account which the reward KLAY will be sent to.
$ kcn account new --datadir ~/kcnd_home
INFO[03/15,09:04:43 +09]  Setting connection type nodetype=cn conntype=-0
INFO[03/15,09:04:43 +09]  Maximum peer count KLAY=25 LES=0 total=25
INFO[03/15,09:04:43 +09]  SBN is disabled.
Your new account is locked with a password. Please give a password. Do not forget this password.
As a result of this, it will create the associated keystore on the path that you define. Next, you need to put the created address in the file
kcnd.conffile as follows.
Each CN maintains a copy of the network's chain data. If a node is out of sync, it can obtain this data from other nodes in the network -- a process known as syncing. When a new CN is first started, it must download the entire chain data from the network.
To accelerate this process, you may perform a fast sync by downloading a snapshot of the chain data before starting the CN. This can dramatically reduce the time the CN will spend syncing on first start.
$ tar -C ~/kcnd_home -xvf klaytn-cypress-chaindata-latest.tar.gz
$ tar -C ~/kcnd_home -xvf klaytn-baobab-chaindata-latest.tar.gz
After the data is extracted, you may start the CN normally.