I am looking for opensource implementations of Kademlia DHT in C/C++. It must be lightweight and crossplatform (win/linux/mac).
It must be able to post information to DHT and retrieve it.
OpenDHT is a lightweight Kademlia DHT in C++11. The API is very simple :
dht::DhtRunner node;
// Launch a dht node on a new thread, using a
// generated RSA key pair, and listen on port 4222.
node.run(4222, dht::crypto::generateIdentity(), true);
// Join the network through any running node,
// here using a known bootstrap node.
node.bootstrap("bootstrap.jami.net", "4222");
// put some data on the dht
std::vector<uint8_t> some_data(5, 10);
node.put("unique_key", some_data);
It supports compiling with LLVM or GCC on OS X, Linux and Windows.
LibTorrent's Kademlia DHT is written in C++ and is well documented.
Here is example code with immutable and mutable get/put operations: https://github.com/arvidn/libtorrent/blob/master/tools/dht_put.cpp
What's wrong with maidsafe-dht ?
You could try bitdht used by retroshare.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With