Details
NetStatus handles downloading network status documents and serving requests for server descriptors (needed for building paths and circuits). When instantiated, NetStatus immediately tries to download the most recent copies of the network consensus and the set of current server descriptors. NetStatus also takes care of automatically updating local copies of network status documents.
NetStatus:
- Uses V2Dir directory caches when possible, only falling back to directory authorities if we don’t know about any caches.
- Tries to use a cached copy of the consensus from the filesystem to initially figure out the V2Dir caches.
- Writes a copy of the consensus to the filesystem for later use.
- Uses stem to represent the consensus, consensus entries, and server descriptors.
- Does the actual document parsing in separate worker threads.
- Schedules the next document download
- Handles incoming requests for server descriptors by returning a deferred that fires when NetStatus has a good set of server descriptors
Bases: object
Download consensus and server descriptor documents.
Return a deferred which will callback with a dict mapping fingerprint->RelayDescriptor when we get a set of good descriptors.
Called back immediately if we already have server descriptors.
Returns: | twisted.internet.defer.Deferred that fires with a dict that maps fingerprints->RelayDescriptors |
---|