1 from twisted.internet.default import SelectReactor ## twistedmatrix.com
3 reactor = SelectReactor(installSignalHandlers=0)
5 from twisted.internet import main
6 main.installReactor(reactor)
10 import twisted.names.client
11 reactor.installResolver(twisted.names.client.theResolver)
13 print "no resolv.conf!"
15 # magic id to use before we know a peer's id
18 # Kademlia "K" constant, this should be an even number
21 # SHA1 is 160 bits long
24 # checkpoint every this many seconds
25 CHECKPOINT_INTERVAL = 60 * 15 # fifteen minutes
29 # concurrent xmlrpc calls per find node/value request!
32 # how many hosts to post to
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
40 # never ping a node more often than this
41 MIN_PING_INTERVAL = 60 * 15 # fifteen minutes
43 # refresh buckets that haven't been touched in this long
44 BUCKET_STALENESS = 60 # one hour
48 # time before expirer starts running
49 KEINITIAL_DELAY = 15 # 15 seconds - to clean out old stuff in persistent db
51 # time between expirer runs
52 KE_DELAY = 60 * 60 # 1 hour
54 # expire entries older than this
55 KE_AGE = 60 * 60 * 24 # 24 hours