我正在寻找C/C++中Kademlia分布式哈希表的开源实现。它必须是轻量级的和跨平台的(win/linux/mac)。
它必须能够将信息发布到分布式哈希表并检索它。
发布于 2011-06-08 23:52:21
maidsafe-dht有什么问题?
发布于 2015-04-07 05:03:15
OpenDHT是C++11中的轻量级Kademlia分布式哈希表,接口非常简单:
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);支持OS X、Linux和Windows上的LLVM或GCC编译。
发布于 2018-09-28 13:29:39
LibTorrent的Kademlia DHT是用C++编写的,并且有很好的文档记录。
下面是包含不可变和可变get/put操作的示例代码:https://github.com/arvidn/libtorrent/blob/master/tools/dht_put.cpp
https://stackoverflow.com/questions/6281543
复制相似问题