fixed borked tab/space problems, damn ProjectBuilder doesn't come with reasonable...
[quix0rs-apt-p2p.git] / const.py
1 from twisted.internet.default import SelectReactor ## twistedmatrix.com
2
3 reactor = SelectReactor(installSignalHandlers=0)
4 from twisted.internet import main
5 main.installReactor(reactor)
6
7 # magic id to use before we know a peer's id
8 NULL_ID =  20 * '\0'
9
10 # Kademlia "K" constant
11 K = 8
12
13 # SHA1 is 160 bits long
14 HASH_LENGTH = 160
15
16
17 ### SEARCHING/STORING
18 # concurrent xmlrpc calls per find node/value request!
19 CONCURRENT_REQS = 4
20
21 # how many hosts to post to
22 STORE_REDUNDANCY = 3
23
24
25 ###  ROUTING TABLE STUFF
26 # how many times in a row a node can fail to respond before it's booted from the routing table
27 MAX_FAILURES = 3
28
29 # never ping a node more often than this
30 MIN_PING_INTERVAL = 60 * 15 # fifteen minutes
31
32 # refresh buckets that haven't been touched in this long
33 BUCKET_STALENESS = 60 # one hour
34
35
36 ###  KEY EXPIRER
37 # time before expirer starts running
38 KEINITIAL_DELAY = 15 # 15 seconds - to clean out old stuff in persistent db
39
40 # time between expirer runs
41 KE_DELAY = 60 * 60 # 1 hour
42
43 # expire entries older than this
44 KE_AGE = 60 * 60 * 24 # 24 hours