Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add some documentation + a python client
  • Loading branch information
almet committed Jan 24, 2012
1 parent 97cd999 commit fefc578
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
17 changes: 14 additions & 3 deletions Makefile
@@ -1,11 +1,22 @@
LIBHOSE = ../powerhose/powerhose/libhose/# FIXME (what's the correct way to handle libs?)
BIN = worker

all: copy-libhose protobuf
g++ -o worker worker.cpp tokencrypto.cpp response.pb.cc libhose.o -Wall -ansi -pedantic-errors -lcryptopp -lpthread -lzmq -lprotobuf
all: copy-libhose protobuf-cpp
g++ -o $(BIN) worker.cpp tokencrypto.cpp response.pb.cc libhose.o -Wall -ansi -pedantic-errors -lcryptopp -lpthread -lzmq -lprotobuf

copy-libhose:
cp $(LIBHOSE)libhose.o .
cp $(LIBHOSE)libhose.h .

protobuf:
protobuf-cpp:
protoc response.proto --cpp_out=.

serve: all
./$(BIN)&

protobuf-py:
protoc response.proto --python_out=.

consume: protobuf-py
python consumer.py

21 changes: 21 additions & 0 deletions README.rst
Expand Up @@ -14,3 +14,24 @@ When you compile the library, it generates a library and an executable binary.
The binary is meant to run with `powerhose
<http://github.com/tziade/powerhose>`_, and the exchanged messages are encoded
using protocol buffers.

How to run it?
==============

To run this code, you need to compile it. First, make sure that you have the
right version of Crypto++. What we are doing here is generating a derivated
secret from a key, using the HKDF algorithm provided by the patched version of
Crypto++.

Then, make sure you have the right libraries to run the project. You need to
install powerhose on your system and compile it. Once done that, running `make`
should be enough for building the code able to spawn the processes::

make serve&

You also need to start a consumer for this lib. This code ships with a python
consumer. You need to have the `pyzmq <http://pypi.python.org/pypi/pyzmq/2.1.11>`_
library installed as well as powerhose. If everything is correct, then you can
run the consumer by doing ::

make consume

0 comments on commit fefc578

Please sign in to comment.