-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
120 lines (81 loc) · 3.27 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
===============
exit-funding.py
===============
The `exit-funding.py` script is written as part as the effort to provide
financial support to torservers.net partner organizations.
This script will analyze archives of Tor network statuses in order to
share a monthly amount of money between organizations. Each share is
calculated using two factors
* how much bandwidth an organization have contributed to the network,
* the location of its exit nodes.
Usage
=====
./exit-funding YYYY-MM MONTHLY_AMOUNT
`YYYY-MM`
: The month for which the computation must be done.
`MONTHLY_AMOUNT`
: The round amount of euros shared between partners organization for
the given month.
The script will put *uncompressed* metrics data file in the `archives`
subdirectory. Watch out, this can take up more than a gigabyte of disk space!
The result of parsing metrics data will be cached. To start the parsing
process again, please remove the cache file named like
`archives/exit-funding-YYYY-MM.pickle`.
Installation
============
External dependencies:
* PrettyTable <https://code.google.com/p/prettytable/>
On a Debian system, issue the following command:
apt-get install python-prettytable
On anything else, the following should work:
pip install PrettyTable
Configuration
=============
The script will read its configuration from two files written
using the YAML format:
partners.yaml: partners organizations
-------------------------------------
The file `partners.yaml` contains a description of the partners organizations.
For each organization, a stanza must be added, e.g.:
zwibelfreunde:
name: Zwiebelfreunde e.V.
contacts:
- Torservers.net <support .AT. torservers .DOT. net>
*id*
: An identifier for the organization. Do not use fancy characters.
`name`
: The full name of the organization.
`contacts`
: A list of every string that can appear in the contact field for relays
run by the organization.
country-factors.yaml: incentive factors by countries
------------------------------------------------------
The file `country-factors.yaml` contains a table of country code and
their associated incentive factor.
Here's an excerpt:
cn: 2.127412
ru: 1.909634
nl: 0.885657
pt: 2.155738
Contact name is common identifier for the family. List of contact names for
each partners.
The scripts `country-factor-helper.py` and `exit-probability-factors.py`
are both attempts to produce country factor tables that depends on
the current exit probabilities of each country.
Misc. implementation notes
==========================
This script will use uncompressed archives from metrics.torproject.org.
Archives from metrics are compressed with bzip2. Due to limitations in Python,
parsing compressed metrics data with Stem is very very very slow. Using
uncompressed archives overcome this issue.
Authors and licensing information
=================================
`exit-funding.py`
: Copyright © Lunar <lunar@torproject.org>
Licensed under Expat (more commonly known as MIT)
`country-factors-helper.py`
: Copyright © Lunar <lunar@torproject.org>
Licensed under Expat (more commonly known as MIT)
`exit-probability-factors.py`
: Copyright © 2013 Isis Agora Lovecruft, The Tor Project, Inc.
Licensed under Three-clause BSD