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