Coder Social home page Coder Social logo

pydht's Introduction

pydht

Python implementation of the Kademlia DHT data store.

Useful for distributing a key-value store in a decentralized manner.

To create a new DHT swarm, just call DHT() with the host and port that you will listen on. To join an existing DHT swarm, also provide bootstrap host and port numbers of any existing node. The nodes will discover the rest of the swarm as appropriate during usage.

Example - A two-node DHT:

>>> from pydht import DHT
>>> host1, port1 = 'localhost', 3000
>>> dht1 = DHT(host1, port1)
>>>
>>> host2, port2 = 'localhost', 3001
>>> dht2 = DHT(host2, port2, boot_host=host1, boot_port=port1)
>>>
>>> dht1["my_key"] = [u"My", u"json-serializable", u"Object"]
>>>
>>> print dht2["my_key"]
[u'My', u'json-serializable', u'Object']

pydht's People

Contributors

isaaczafuta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pydht's Issues

Successive key retrieval error on 2 node DHT

After storing the key in the DHT (a two node DHT with one the bootstrap node), retrieving the key randomly raises KeyError. For example, if you store a key and then run a program like 5 - 20 times to retrieve that same key it will randomly fail. Why would that be? Is the DHT not 100% reliable / not redistributing keys?

(I'm not an expert on DHTs so maybe this is normal but worth checking out.)

repo description is misleading

The description “Python implementation of the Kademlia DHT data store” is misleading. This is not a compliant implementation.

Bootstraping nodes

Hi, thanks for you work.
Does your library support bootstraping nodes from a "tracker"?
I saw in example that you connect directly to a known and already existing node, but what if we don't know the node?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.