congress

U.S. Congressional metadata (beta; more coming soon)


License
MIT
Install
pip install congress==0.0a1.dev1

Documentation

Congress
========

Congress is my haphazard attempt at a Kademlia-like library for building
P2P overlay networks, which isn't anything original. I like Entangled, but hate
Twisted, so I used pyev, which I find to be much less ambitious and not as
big in the hips.


Requirements
============

* http://github.com/lysol/dogfood
  - Requires jsonlib, Cython

Prereqs on Ubuntu:
  sudo apt-get install python-dev cython libev-dev distutils
  sudo easy_install pyev jsonlib
  git clone git://github.com/lysol/dogfood.git
  git clone git://github.com/lysol/congress.git
  cd dogfood/
  sudo python setup.py install
  cd ../congress
  sudo python setup.py install

Usage
=====

python -m congress.congress --host 127.0.0.1 --port 16800 --ctl 19800 \
    --peer 1.2.3.4 16800 --debug

Debug will spit out a LOT of information.

You can also use the class on its own, but you'll have to either tie your
code into the libev event loop, or use the folowing libev flags:
    node._loop.loop(flags=pyev.EVLOOP_ONCE | pyev.EVLOOP_NOWAIT)
inside of your own event loop.

When using the rpc_get method, you must provide a callback that accepts
the original key and value. Presently there is no expiration of tuples,
but if this happens it will become a configurable option.

At some point there will be more storage options, as well as the ability
to reuse the node's ID, if desired, which is more in-line with the Kademlia
spec.

Control Port
============
nc or telnet to the port defined in --ctl, at localhost.

Commands
 * listpeers
 * store key val
 * get key
 * peer host port