HetimaTorrent supported mainlinedht.
a() {
KNode node = new KNode(new HetiSocketBuilderChrome(), verbose: true);
String localIp = "0.0.0.0";
KNode node = new KNode(new HetiSocketBuilderChrome(), verbose: true);
String localIp = "0.0.0.0";
int localPort = 28080;
//
//
node.start(ip: localIp, port: localPort).then((_) {
node.onGetPeerValue.listen((KGetPeerValue v) {
print("---onGetPeerValue ${v.ipAsString} ${v.port} ${v.infoHashAsString} ");
});
});
//
// initial node
String initailNodeIp = "0.0.0.0";
int initailNodePort = 38080;
node.addBootringNode(initailNodeIp, initailNodePort);
//
// search target
List<int> infoHash = new List.filled(20, 4);
node.startSearchValue(new KId(infoHash), 18080, getPeerOnly: true);
//
new Future.delayed(new Duration(minutes:30)).then((_){
print(node.rootingtable.toInfo());
return node.stop();
});
}
//
//
node.start(ip: localIp, port: localPort).then((_) {
node.onGetPeerValue.listen((KGetPeerValue v) {
print("---onGetPeerValue ${v.ipAsString} ${v.port} ${v.infoHashAsString} ");
});
});
//
// initial node
String initailNodeIp = "0.0.0.0";
int initailNodePort = 38080;
node.addBootringNode(initailNodeIp, initailNodePort);
//
// search target
List<int> infoHash = new List.filled(20, 4);
node.startSearchValue(new KId(infoHash), 18080, getPeerOnly: true);
//
new Future.delayed(new Duration(minutes:30)).then((_){
print(node.rootingtable.toInfo());
return node.stop();
});
}
Source- hetimatorrent
https://github.com/kyorohiro/dart_hetimatorrent
- heitnanet
https://github.com/kyorohiro/dart_hetimanet
- dht sample
https://github.com/kyorohiro/dart_hetimatorrent/tree/master/example/TorrentDHT
- bep5
http://www.bittorrent.org/beps/bep_0005.html
- Kademlia; A Peer-to-peer Information System Based on the XOR Metric.
http://pdos.csail.mit.edu/~petar/papers/maymounkov-kademlia-lncs.pdf
https://github.com/kyorohiro/dart_hetimatorrent
- heitnanet
https://github.com/kyorohiro/dart_hetimanet
- dht sample
https://github.com/kyorohiro/dart_hetimatorrent/tree/master/example/TorrentDHT
- bep5
http://www.bittorrent.org/beps/bep_0005.html
- Kademlia; A Peer-to-peer Information System Based on the XOR Metric.
http://pdos.csail.mit.edu/~petar/papers/maymounkov-kademlia-lncs.pdf