KNI
Last updated
Last updated
KNI (Klaytn Network Identifier) is a URL scheme to identify a Klaytn node. Its syntax is shown below:
nodeID is a 512-bit public key corresponding to the node's private key. It is used to verify communication with peers on p2p network.
hostname describes the address of a node, located between @
and :
. The address format can be one of the following:
IPv4 dotted decimal (192.0.2.1
)
IPv6 ([2001:db8::68]
)
IPv4-mapped IPv6 ([2001:db8:3c4d:15::abcd:ef12]
)
Domain name (your.node.com
)
discport is used for checking if the known neighbors are reachable klaytn nodes and fetching their neighbors' addresses for new connections. Note that this is a UDP port. By default, the UDP port, or discport
, uses the same port with the TCP port. If the node uses a different port for discport
, it can be specified by the discport
query parameter.
The following two URLs shows a KNI example of a node having IP address 10.0.0.1
and TCP listening port 32323
and 32324
. If discport
is omitted, it is set to the UDP port of 32323
, same as the value of port
.
The next two shows KNI examples of nodes having discport
of 30301
.
port is used to make connections with peer nodes through TCP. In Klaytn, the default port
is 32323
and the default subport
is 32324
. Note that the default subport
is configured as port + 1
in kend.conf
. Depending on the number of TCP listening ports, Klaytn offers two .
If you want to know how to generate a KNI of a node, please refer to . The KNI scheme is used in node discovery protocol, , , and etc.