kademlia/docs/intro.rst

38 lines
1.2 KiB
ReStructuredText
Raw Normal View History

2015-01-05 19:44:39 +01:00
Installation
2015-01-05 16:32:24 +01:00
==================
2015-01-05 19:44:39 +01:00
The easiest (and best) way to install kademlia is through `pip <http://www.pip-installer.org/>`_::
$ pip install kademlia
Usage
=====
2018-01-02 20:17:36 +01:00
To start a new network, create the first node. Future nodes will connect to this first node (and any other nodes you know about) to create the network.
2015-01-05 19:44:39 +01:00
2018-01-02 20:17:36 +01:00
.. literalinclude:: ../examples/first_node.py
2015-01-05 19:44:39 +01:00
2018-01-02 20:17:36 +01:00
Here's an example of bootstrapping a new node against a known node and then setting a value:
.. literalinclude:: ../examples/set.py
2015-01-05 19:44:39 +01:00
.. note ::
You must have at least two nodes running to store values. If a node tries to store a value and there are no other nodes to provide redundancy, then it is an exception state.
2015-01-05 19:44:39 +01:00
Running Tests
=============
To run tests::
2018-01-02 20:17:36 +01:00
$ pip install -r dev-requirements.txt
$ python -m unittest
2015-01-05 19:44:39 +01:00
Fidelity to Original Paper
==========================
2015-06-04 23:58:01 +02:00
The current implementation should be an accurate implementation of all aspects of the paper except one - in Section 2.3 there is the requirement that the original publisher of a key/value republish it every 24 hours. This library does not do this (though you can easily do this manually).
2015-01-05 19:44:39 +01:00
.. _Twisted: https://twistedmatrix.com