Hi Nick. The control spec has GETINFO options to fetch a microdescriptor via its fingerprint or nickname ('md/id/' and 'md/name/') but no method for getting them all (like 'ns/all' or 'desc/all-recent').
Processing all descriptors is a pretty common need, hence the priority (feel free to lower it if appropriate). In the meantime I'll hack around this in stem by having controller read microdescriptors from the data directory.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
I'm assuming it's not a problem for you that microdescriptors don't tell you which microdescriptor they are unless you compute their SHA256 themselves? That is, unless you know the corresponding entry from the consensus networkstatus, you won't know which microdesc is which node.
I'm assuming it's not a problem for you that microdescriptors don't tell you which microdescriptor they are unless you compute their SHA256 themselves?
It's not ideal. I was a bit sad yesterday when I realized that they lack the fingerprint since it changes simple tasks like 'tell me all of the exits' from...
for desc in controller.get_microdescriptors(): if desc.exit_policy.is_exiting_allowed(): print "%s is an exit" % desc.fingerprint
... to...
exit_onion_keys = set()for desc in controller.get_microdescriptors(): if desc.exit_policy.is_exiting_allowed(): exit_onion_keys.add(desc.onion_key)for desc in controller.get_network_statuses(): if desc.digest in exit_onion_keys: print "%s is an exit" % desc.fingerprint
FWIW, that's almost right, but the thing that you have in the networkstatus is not a digest of the onion key, but rather a digest of the microdescriptor. So you have to do something like :
for desc in controller.get_microdescriptors(): if desc.exit_policy.is_exiting_allowed(): exit_digests.add(sha256(str(desc.text))) # or whatever this is calledfor desc in controller.get_network_statuses(): if desc.digest in exit_digests: print "%s is an exit" % desc.fingerprint