The Implementation is meant to be self contained and very easy to setup and use. There are several tests (https://github.com/JoshuaKissoon/Kademlia/tree/master/src/kademlia/tests) which demonstrates the usage of the protocol and DHT.
There is a configuration file available in the kademlia.core package which have all settings used throughout the protocol, all of these settings are described in depth in the Configuration file.
All of Kademlia's sub-components (DHT, Node, Routing Table, Server, etc) are wrapped within the Kademlia object to simplify the usage of the protocol. To create an instance, simply call:
```Java
Kademlia kad1 = new Kademlia("OwnerName1", new NodeId("ASF45678947584567463"), 12049);
Kademlia kad2 = new Kademlia("OwnerName2", new NodeId(), 12057); // Random NodeId will be generated
```
Param 1: The Name of the owner of this instance, can be any name.
Param 2: A NodeId for this node
Param 3: The port on which this Kademlia instance will run on.
After this initialization phase, the 2 Kad instances will basically be 2 separate networks. Lets connect them so they'll be in the same network.
You may want to save the Node state when your application is shut down and Retrieve the Node state on startup to remove the need of rebuilding the Node State (Routing Table, DHT Content Entries, etc). Lets look at how we do this.
I am currently using this implementation of Kademlia in developing a Distributed Online Social Network Architecture, you can look at that project at https://github.com/JoshuaKissoon/DOSNA for more ideas on using Kademlia.