1 ## Copyright 2002-2003 Andrew Loewenstern, All Rights Reserved
2 # see LICENSE.txt for license information
4 from twisted.internet.default import SelectReactor ## twistedmatrix.com
6 reactor = SelectReactor()
8 from twisted.internet import main
9 main.installReactor(reactor)
13 import twisted.names.client
14 reactor.installResolver(twisted.names.client.theResolver)
16 print "no resolv.conf!"
18 # magic id to use before we know a peer's id
21 # Kademlia "K" constant, this should be an even number
24 # SHA1 is 160 bits long
27 # checkpoint every this many seconds
28 CHECKPOINT_INTERVAL = 60 * 15 # fifteen minutes
32 # concurrent xmlrpc calls per find node/value request!
35 # how many hosts to post to
39 ### ROUTING TABLE STUFF
40 # how many times in a row a node can fail to respond before it's booted from the routing table
43 # never ping a node more often than this
44 MIN_PING_INTERVAL = 60 * 15 # fifteen minutes
46 # refresh buckets that haven't been touched in this long
47 BUCKET_STALENESS = 60 # one hour
51 # time before expirer starts running
52 KEINITIAL_DELAY = 15 # 15 seconds - to clean out old stuff in persistent db
54 # time between expirer runs
55 KE_DELAY = 60 * 60 # 1 hour
57 # expire entries older than this
58 KE_AGE = 60 * 60 * 24 # 24 hours