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