[英]C++ implementation of DHT
OpenDHT is a lightweight Kademlia DHT in C++11. OpenDHT是 C++11 中的轻量级 Kademlia DHT。 The API is very simple:
API 非常简单:
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.它支持在 OS X、Linux 和 Windows 上使用 LLVM 或 GCC 编译。
LibTorrent's Kademlia DHT is written in C++ and is well documented. LibTorrent 的 Kademlia DHT 是用 C++ 编写的,并且有据可查。
Here is example code with immutable and mutable get/put operations: https://github.com/arvidn/libtorrent/blob/master/tools/dht_put.cpp这是具有不可变和可变 get/put 操作的示例代码: https://github.com/arvidn/libtorrent/blob/master/tools/dht_put.cpp
I have found a BitTorrent DHT library , used by Transmission.我找到了传输使用的BitTorrent DHT 库。 It is written in pure C, but it can be easily used from C++.
它是用纯 C 编写的,但可以从 C++ 轻松使用。
I am using it in my C++ project.我在我的 C++ 项目中使用它。 It works well but requires an external cryptographic hash and randomization functions.
它运行良好,但需要外部加密 hash 和随机化功能。
What's wrong with maidsafe-dht ? maidsafe-dht有什么问题?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.