bmuller / kademlia

A DHT in Python using asyncio
http://kademlia.readthedocs.org
MIT License
830 stars 210 forks source link

Single node network #5

Closed rendaw closed 9 years ago

rendaw commented 9 years ago

It looks like the server doesn't work with a single node due to line https://github.com/bmuller/kademlia/blob/master/kademlia/network.py#L166

I haven't read the original paper, but is there any reason this has to happen? I was hoping to test locally with one instance in order to verify other (non DHT) parts of the program.

bmuller commented 9 years ago

I'm a little torn on this one, since it's a DHT and not a HT - but I think it might be useful to support single node networks. I'll fix that.

rendaw commented 9 years ago

It wasn't that difficult to work around once I realized what the issue was. Maybe just a note in the docs that running only one node won't work?

bmuller commented 9 years ago

K - added note in docs. I thought about it some more - and I think it should be a failure state if you are the only node in what should be a network. I'm only marginally convinced of this, though - so if you'd like, feel free to reopen with your thoughts.