Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

gdp-v1 / README.md @ master

History | View | Annotate | Download (3.77 KB)

Introduction

This is a prototype implementation for an enhanced GDP protocol with some of the actual security features (probably not at the moment, but should have it when it is a little more evolved). This prototype is NOT supposed to be used in production.

What's included?

It included a barebones client, log-server and a router implementation. For the moment, there is no disk storage; all the data is stored just in memory. There is also a general routing framework, although needs substantial work.

Seeing it in action

Assuming you have some the required dependencies installed, just running make will run some basic tests.

Install the pre-requisites

  • Python: Tested with Python 2.7. Mostly tested with CPython, but a few components have better performance with PyPy. (Python 3 doesn't work. Yes, I know Python 2.7 is to be deprecated.)
  • Twisted: An event-driven networking engine for python
  • pyca/cryptography OR M2Crypto: cryptographic routines library. You probably only need only one.
  • networkx: A graph manipulation library.
  • pydot: [optional] for visualization of graphs.
  • graphviz: [optional] for visualization of graphs
  • protobuf: Protobuf python library. Make sure you use C++ implementation, or else you will get terrible performance. FIXME
  • protoc: Protocol buffer compiler. This comes as part of ProtoBuf
  • make: We use makefiles for some automation.
  • pytest: For running the tests (a recent-ish version)
  • pytest-profiling: For profiling of the code
  • yappi: Yet Another Python Profiler. This is only needed if you want to do any profiling.

Compilation (Yes, we need it)

We need to generate the necessary Python code from ProtoBuf definitions. For this, simply run make protobuf from the top directory.

Package list for EC2 Ubuntu 16.04/18.04

A little extraneous, but that's okay

sudo apt-get install build-essential

For CPython

sudo apt-get install python python-dev
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py --user
python -m pip install --user twisted
python -m pip install --user cryptography
python -m pip install --user networkx
sudo apt-get install graphviz
python -m pip install --user pydot
sudp apt-get install libssl-dev
python -m pip install --user M2Crypto
python -m pip install --user pytest
python -m pip install --user hiredis
python -m pip install --user pytest-profiling

Notes:

  • libssl-dev is needed for M2Crypto.
  • You need to install pytest-profiling at the end. As of 05/2019, pytest-profiling doesn't work with the latest 'pytest'. Installing it at the end will downgrade 'pytest' to an older version, which should work as expected.

For PyPy (pypy in the repositories is too old). (Use at your own risk. This may not work completely)

wget https://bitbucket.org/pypy/pypy/downloads/pypy2-v6.0.0-linux64.tar.bz2
mv pypy2-v6.0.0-linux64.tar.bz2 /opt
cd /opt
sudo tar -xf pypy2-v6.0.0-linux64.tar.bz2
sudo ln -s /opt/pypy2-v6.0.0-linux64/bin/pypy /usr/bin/pypy
pypy get-pip.py --user
pypy -m pip install --user twisted
sudo apt-get install libssl-dev
pypy -m pip install --user cryptography
pypy -m pip install --user networkx
sudo apt-get install graphviz
python -m pip install --user pydot
pypy -m pip install --user pytest
pypy -m pip install --user hiredis
pypy -m pip install --user pytest-profiling

For protobuf

sudo ./install-protobuf.sh
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.7.0/protobuf-python-3.7.0.tar.gz
tar xzf protobuf-python-3.7.0.tar.gz
cd protobuf-3.7.0/python
sudo python setup.py install
sudo python setup.py install --cpp_implementation
sudo pypy setup.py install
sudo pypy setup.py install --cpp_implementation