]> git.mxchange.org Git - quix0rs-apt-p2p.git/blob - const.py
58d539ec56ea1723b1a90be03786958fb2fa014c
[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
20 # magic id to use before we know a peer's id
21 NULL_ID =  20 * '\0'
22
23 # Kademlia "K" constant, this should be an even number
24 K = 8
25
26 # SHA1 is 160 bits long
27 HASH_LENGTH = 160
28
29 # checkpoint every this many seconds
30 CHECKPOINT_INTERVAL = 60 * 15 # fifteen minutes
31
32
33 ### SEARCHING/STORING
34 # concurrent xmlrpc calls per find node/value request!
35 CONCURRENT_REQS = 4
36
37 # how many hosts to post to
38 STORE_REDUNDANCY = 3
39
40
41 ###  ROUTING TABLE STUFF
42 # how many times in a row a node can fail to respond before it's booted from the routing table
43 MAX_FAILURES = 3
44
45 # never ping a node more often than this
46 MIN_PING_INTERVAL = 60 * 15 # fifteen minutes
47
48 # refresh buckets that haven't been touched in this long
49 BUCKET_STALENESS = 60 * 60 # one hour
50
51
52 ###  KEY EXPIRER
53 # time before expirer starts running
54 KEINITIAL_DELAY = 15 # 15 seconds - to clean out old stuff in persistent db
55
56 # time between expirer runs
57 KE_DELAY = 60 * 20 # 20 minutes
58
59 # expire entries older than this
60 KE_AGE = 60 * 60 # 60 minutes