d81ecbd45f021de20eebd6c2c3faca37240a0f94
[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, this should be an even number
11 K = 8
12
13 # SHA1 is 160 bits long
14 HASH_LENGTH = 160
15
16 # checkpoint every this many seconds
17 CHECKPOINT_INTERVAL = 60 * 15 # fifteen minutes
18
19
20 ### SEARCHING/STORING
21 # concurrent xmlrpc calls per find node/value request!
22 CONCURRENT_REQS = 4
23
24 # how many hosts to post to
25 STORE_REDUNDANCY = 3
26
27
28 ###  ROUTING TABLE STUFF
29 # how many times in a row a node can fail to respond before it's booted from the routing table
30 MAX_FAILURES = 3
31
32 # never ping a node more often than this
33 MIN_PING_INTERVAL = 60 * 15 # fifteen minutes
34
35 # refresh buckets that haven't been touched in this long
36 BUCKET_STALENESS = 60 # one hour
37
38
39 ###  KEY EXPIRER
40 # time before expirer starts running
41 KEINITIAL_DELAY = 15 # 15 seconds - to clean out old stuff in persistent db
42
43 # time between expirer runs
44 KE_DELAY = 60 * 60 # 1 hour
45
46 # expire entries older than this
47 KE_AGE = 60 * 60 * 24 # 24 hours