Configuration
The CN configuration is to create a data directory and set up several values in the configuration file kcnd.conf
.
Create the CN data directory.
Install node key
Configure the CN with
kcnd.conf
.
CN Data 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.
Install Node Key
In order to operate a CN, a 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 nodekey
into the CN data directory. The way to create a nodekey
is described in the 'Before You Install' section. The following command line copies the nodekey
into the CN data directory.
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/
.
Add Data Directory
You should update the data directory environment variable $DATA_DIR
on the configuration file kcnd.conf
.
Setup Rewardbase
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 kcnd.conf
.
The ways to create a new account are various, but the kcn
also provides the functionality. You can check the help message with the following command.
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.
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.conf
file as follows.
Keep in mind that the keystore and the password that you created is significantly important, so you must be careful to manage them. See more details about kcnd.conf
on the Configuration File section.
Fast Sync (Optional)
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.
Download the latest chaindata snapshot from the Cypress snapshot archive or Baobab snapshot archive. Before starting kcnd
, extract the snapshot inside the DATA_DIR you configured in kcnd.conf
.
For example:
Or,
After the data is extracted, you may start the CN normally.
You can refer to detailed information in the Chaindata change
Last updated