1 ## Copyright 2002-2003 Andrew Loewenstern, All Rights Reserved
2 # see LICENSE.txt for license information
5 from twisted.internet.default import SelectReactor ## twistedmatrix.com
7 reactor = SelectReactor()
9 from twisted.internet import main
10 main.installReactor(reactor)
14 import twisted.names.client
15 reactor.installResolver(twisted.names.client.theResolver)
17 print "no resolv.conf!"
19 from twisted.internet import reactor
21 # magic id to use before we know a peer's id
24 # Kademlia "K" constant, this should be an even number
27 # SHA1 is 160 bits long
30 # checkpoint every this many seconds
31 CHECKPOINT_INTERVAL = 60 * 15 # fifteen minutes
35 # concurrent xmlrpc calls per find node/value request!
38 # how many hosts to post to
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
46 # never ping a node more often than this
47 MIN_PING_INTERVAL = 60 * 15 # fifteen minutes
49 # refresh buckets that haven't been touched in this long
50 BUCKET_STALENESS = 60 * 60 # one hour
54 # time before expirer starts running
55 KEINITIAL_DELAY = 15 # 15 seconds - to clean out old stuff in persistent db
57 # time between expirer runs
58 KE_DELAY = 60 * 20 # 20 minutes
60 # expire entries older than this
61 KE_AGE = 60 * 60 # 60 minutes