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
:. The address format can be one of the following:
IPv4 dotted decimal (
IPv4-mapped IPv6 (
Domain name (
port is used to make connections with peer nodes through TCP. In Klaytn, the default
32323 and the default
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 types of connections.
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
discport is omitted, it is set to the UDP port of
32323, same as the value of
kni://[email protected]:32323 # either single-channel or multi-channel peer with omitted subportkni://[email protected]:32323?subport=32324 # multi-channel peer
The next two shows KNI examples of nodes having
kni://[email protected]:32323?discport=30301 # either single-channel or multi-channel peer with omitted subportkni://[email protected]:32323?subport=32324&discport=30301 # multi-channel peer
If you want to know how to generate a KNI of a node, please refer to Node Key & Node URI Creation. The KNI scheme is used in node discovery protocol, setting
static-nodes.json file, addPeer API, bootnodes option and etc.