Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

gdp-v1 / README.md @ master

History | View | Annotate | Download (3.77 KB)

1 346884d7 Nitesh Mor
# Introduction
2
3
This is a *prototype* implementation for an enhanced GDP protocol with some of
4
the actual security features (probably not at the moment, but should have it
5 8db6e95b Nitesh Mor
when it is a little more evolved). This prototype is **NOT** supposed to
6
be used in production.
7 346884d7 Nitesh Mor
8
# What's included?
9
10 fcb19b8c Nitesh Mor
It included a barebones client, log-server and a router implementation. For the
11 9c19a4b6 Nitesh Mor
moment, there is no disk storage; all the data is stored just in memory. There
12
is also a general routing framework, although needs substantial work.
13 346884d7 Nitesh Mor
14
# Seeing it in action
15
16 9c19a4b6 Nitesh Mor
Assuming you have some the required dependencies installed, just running `make`
17
will run some basic tests.
18
19 346884d7 Nitesh Mor
20
## Install the pre-requisites
21
22 8db6e95b Nitesh Mor
* Python: Tested with Python 2.7. Mostly tested with CPython, but a few
23
  components have better performance with PyPy.
24
  (Python 3 doesn't work. Yes, I know Python 2.7 is to be deprecated.) 
25 346884d7 Nitesh Mor
* Twisted: An event-driven networking engine for python
26 8db6e95b Nitesh Mor
* pyca/cryptography OR M2Crypto: cryptographic routines library. You
27
  probably only need only one.
28 5e710fe0 Nitesh Mor
* networkx: A graph manipulation library.
29
* pydot: [optional] for visualization of graphs.
30
* graphviz: [optional] for visualization of graphs
31 5cc5d1dc Nitesh Mor
* protobuf: Protobuf python library. Make sure you use C++ implementation, or
32 8db6e95b Nitesh Mor
  else you will get terrible performance. **FIXME**
33
* protoc: Protocol buffer compiler. This comes as part of ProtoBuf
34 216de85e Nitesh Mor
* make: We use makefiles for some automation.
35 92e933a2 Nitesh Mor
* pytest: For running the tests (a recent-ish version)
36
* pytest-profiling: For profiling of the code
37 8db6e95b Nitesh Mor
* yappi: Yet Another Python Profiler. This is only needed if you want to
38
  do any profiling.
39 346884d7 Nitesh Mor
40 9c19a4b6 Nitesh Mor
## Compilation (Yes, we need it)
41 346884d7 Nitesh Mor
42
We need to generate the necessary Python code from ProtoBuf definitions. For
43 9c19a4b6 Nitesh Mor
this, simply run `make protobuf` from the top directory.
44
45 eb664bf8 Nitesh Mor
46 8db6e95b Nitesh Mor
## Package list for EC2 Ubuntu 16.04/18.04
47 eb664bf8 Nitesh Mor
48
A little extraneous, but that's okay
49
50
    sudo apt-get install build-essential
51
52
For CPython
53
54
    sudo apt-get install python python-dev
55
    curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
56
    python get-pip.py --user
57
    python -m pip install --user twisted
58
    python -m pip install --user cryptography
59 5e710fe0 Nitesh Mor
    python -m pip install --user networkx
60
    sudo apt-get install graphviz
61
    python -m pip install --user pydot
62 8fb1d8bc Nitesh Mor
    sudp apt-get install libssl-dev
63 8db6e95b Nitesh Mor
    python -m pip install --user M2Crypto
64 eb664bf8 Nitesh Mor
    python -m pip install --user pytest
65
    python -m pip install --user hiredis
66 8fb1d8bc Nitesh Mor
    python -m pip install --user pytest-profiling
67
68 5e710fe0 Nitesh Mor
69 8fb1d8bc Nitesh Mor
Notes:
70
71
* libssl-dev is needed for M2Crypto.
72
* You need to install pytest-profiling at the end. As of 05/2019,
73
  pytest-profiling doesn't work with the latest 'pytest'. Installing
74
  it at the end will downgrade 'pytest' to an older version, which
75
  should work as expected.
76 eb664bf8 Nitesh Mor
77
For PyPy (pypy in the repositories is too old).
78 8fb1d8bc Nitesh Mor
*(Use at your own risk. This may not work completely)*
79 eb664bf8 Nitesh Mor
80
    wget https://bitbucket.org/pypy/pypy/downloads/pypy2-v6.0.0-linux64.tar.bz2
81
    mv pypy2-v6.0.0-linux64.tar.bz2 /opt
82
    cd /opt
83
    sudo tar -xf pypy2-v6.0.0-linux64.tar.bz2
84
    sudo ln -s /opt/pypy2-v6.0.0-linux64/bin/pypy /usr/bin/pypy
85
    pypy get-pip.py --user
86
    pypy -m pip install --user twisted
87
    sudo apt-get install libssl-dev
88
    pypy -m pip install --user cryptography
89 1dc81adf Nitesh Mor
    pypy -m pip install --user networkx
90 5e710fe0 Nitesh Mor
    sudo apt-get install graphviz
91
    python -m pip install --user pydot
92 eb664bf8 Nitesh Mor
    pypy -m pip install --user pytest
93
    pypy -m pip install --user hiredis
94 8fb1d8bc Nitesh Mor
    pypy -m pip install --user pytest-profiling
95 eb664bf8 Nitesh Mor
96
For protobuf
97
98
    sudo ./install-protobuf.sh
99 8db6e95b Nitesh Mor
    wget https://github.com/protocolbuffers/protobuf/releases/download/v3.7.0/protobuf-python-3.7.0.tar.gz
100
    tar xzf protobuf-python-3.7.0.tar.gz
101
    cd protobuf-3.7.0/python
102 eb664bf8 Nitesh Mor
    sudo python setup.py install
103
    sudo python setup.py install --cpp_implementation
104
    sudo pypy setup.py install
105
    sudo pypy setup.py install --cpp_implementation