Remove all the airhook stuff.
[quix0rs-apt-p2p.git] / const.py
1 ## Copyright 2002-2003 Andrew Loewenstern, All Rights Reserved
2 # see LICENSE.txt for license information
3
4 """
5 from twisted.internet.default import SelectReactor ## twistedmatrix.com
6
7 reactor = SelectReactor()
8
9 from twisted.internet import main
10 main.installReactor(reactor)
11
12
13 try:
14     import twisted.names.client
15     reactor.installResolver(twisted.names.client.theResolver)
16 except IOError:
17     print "no resolv.conf!"
18 """
19 from twisted.internet import reactor
20
21 # magic id to use before we know a peer's id
22 NULL_ID =  20 * '\0'
23
24 # Kademlia "K" constant, this should be an even number
25 K = 8
26
27 # SHA1 is 160 bits long
28 HASH_LENGTH = 160
29
30 # checkpoint every this many seconds
31 CHECKPOINT_INTERVAL = 60 * 15 # fifteen minutes
32
33
34 ### SEARCHING/STORING
35 # concurrent xmlrpc calls per find node/value request!
36 CONCURRENT_REQS = 4
37
38 # how many hosts to post to
39 STORE_REDUNDANCY = 3
40
41
42 ###  ROUTING TABLE STUFF
43 # how many times in a row a node can fail to respond before it's booted from the routing table
44 MAX_FAILURES = 3
45
46 # never ping a node more often than this
47 MIN_PING_INTERVAL = 60 * 15 # fifteen minutes
48
49 # refresh buckets that haven't been touched in this long
50 BUCKET_STALENESS = 60 * 60 # one hour
51
52
53 ###  KEY EXPIRER
54 # time before expirer starts running
55 KEINITIAL_DELAY = 15 # 15 seconds - to clean out old stuff in persistent db
56
57 # time between expirer runs
58 KE_DELAY = 60 * 20 # 20 minutes
59
60 # expire entries older than this
61 KE_AGE = 60 * 60 # 60 minutes