1 from twisted.internet.default import SelectReactor ## twistedmatrix.com
3 reactor = SelectReactor(installSignalHandlers=0)
5 from twisted.internet import main
6 main.installReactor(reactor)
9 import twisted.names.client
10 reactor.installResolver(twisted.names.client.theResolver)
12 print "no resolv.conf!"
14 # magic id to use before we know a peer's id
17 # Kademlia "K" constant, this should be an even number
20 # SHA1 is 160 bits long
23 # checkpoint every this many seconds
24 CHECKPOINT_INTERVAL = 60 * 15 # fifteen minutes
28 # concurrent xmlrpc calls per find node/value request!
31 # how many hosts to post to
35 ### ROUTING TABLE STUFF
36 # how many times in a row a node can fail to respond before it's booted from the routing table
39 # never ping a node more often than this
40 MIN_PING_INTERVAL = 60 * 15 # fifteen minutes
42 # refresh buckets that haven't been touched in this long
43 BUCKET_STALENESS = 60 # one hour
47 # time before expirer starts running
48 KEINITIAL_DELAY = 15 # 15 seconds - to clean out old stuff in persistent db
50 # time between expirer runs
51 KE_DELAY = 60 * 60 # 1 hour
53 # expire entries older than this
54 KE_AGE = 60 * 60 * 24 # 24 hours