Abstract Java Kademlia API.
This API mainly focuses on an abstraction layer for Kademlia Algorithm, allows you to implement the network and storage layer in any ways you want. However, DHT, node bootstrapping, and other communications logics are already implemented.
If you want to skip the network abstraction implementation, take a look at Kademlia Netty project.
- Allows peer GUID to be an
Integer
,Long
or evenBigInteger
- Automatically handles most of the operations related to GUID type
- Highly configurable
- There is an abstraction for most important things such as DHT repository or networking layer (where messages are sent and received)
- Other configurations can be passed through
NodeSettings
where the property names are clean and informative - Protocol can easily change by overriding the default
MessageHandlers
- There are many available
decorator
s so API is easily extendable
- It's written protocol based where all messages have
type
s, and you can register different handler for each message type. - Ping, Pong, Find node (+ bootstrapping), DHT (store & lookup) are already implemented
Using maven central
<dependency>
<groupId>io.ep2p</groupId>
<artifactId>kademlia-api</artifactId>
<version>5.1.2-RELEASE</version>
</dependency>
GitHub releases page only contains certain releases. See all maven releases in maven repository and choose the newest one there.
You can access the full documentation in our Hugo hosted website :)
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
Since this project is completely experimental (at least for now), I'd like to thank to some people around the internet that helped me gain some knowledge about Kademlia and its implementations beyond the paper. I know my implementation as a sample and abstract kademlia api, not most complete.
- A huge thank to Jakob Jenkov for his great tutorial on p2p network and kademlia.
- Stackoverflow Community
- Joshua Kissoon for his great explanation on Adding new nodes to Kademlia, building Kademlia routing tables
- Nawras for asking What exactly K-Bucket means in Kademlia DHT?
- Kasra Faghihi (@offbynull) for his very mathematical implementation of Kademlia.
- And a great shout out to SimGrid Team, for keeping history of their work on Kademlia which this repository is inspired by it to implement RoutingTables, Buckets and some more stuff.
In first video of EP2P lecture about Kademlia Algorithm, we are going to gain brief understanding about elements of Kademlia nodes, network structure and Distributed Hash Tables (DHT) in theory.
In this video we see some code example in Java for Kademlia API using an abstract library written by EP2P. (The code used in this video is out dated)