Status: [ready to use]. [active maintainance]. Playground (sample runnable project) available here.
Implementation of kademlia API DHT using:
- Netty (as HTTP/1.1 server for each node, including
ConnectionInfo
withhost
andport
) - OKHttp (as
RequestSender
implementation) - (Kademlia Gson Serialization)
This library uses BigInteger
as Node IDs and NettyConnectionInfo
as implementation of ConnectionInfo
interafce.
However, it is still abstract, therefore you should implement some parts that are mentioned in kademlia API such as:
- DHT Repository
- Mechanism to persist and reload Routing Table
- You still need to configure
NodeSettings
. Default one may not be suitable for you. - You need to implement
KeyHasGenerator
. This is used for bounding the key sizes to network size before storing messages.
There are few working examples in tests directory.
Main example has everything for you to start understanding how this library works. It creates 2 nodes and stores data in DHT.
Custom DTO Example
is on top of previous example, but this time we are serializing and storing a different DTO object called Person
instead of a simple String.
Using maven:
<dependency>
<groupId>io.ep2p</groupId>
<artifactId>kademlia-netty</artifactId>
<version>0.3.2-RELEASE</version>
</dependency>
Coffee has a cost 😄
Any sort of small or large donations can be a motivation in maintaining this repository and related repositories.
- ETH:
0x5F120228C12e2C6923AfDeb0e811d74160166d90
- TRC20:
TJjw5n26KFBqkJQbs7eKdxkVuk4pvJdFzE
- BTC:
bc1qmtewrl7srjrkl8t4z5vantuqkz086srj4clzh3
Cheers