2007-04-20 06:43:47 +00:00
|
|
|
|
|
|
|
CODE OVERVIEW
|
|
|
|
|
|
|
|
A brief map to where the code lives in this distribution:
|
|
|
|
|
2007-09-21 21:12:26 +00:00
|
|
|
src/allmydata: the code for this project. When installed, this provides the
|
2007-12-03 21:52:42 +00:00
|
|
|
'allmydata' package. This includes a few pieces copied from
|
2007-09-21 21:12:26 +00:00
|
|
|
the PyCrypto package, in allmydata/Crypto/* .
|
2007-04-20 06:43:47 +00:00
|
|
|
|
|
|
|
Within src/allmydata/ :
|
|
|
|
|
|
|
|
interfaces.py: declaration of zope.interface-style Interfaces for most
|
|
|
|
components, also defines Foolscap RemoteInterfaces for
|
|
|
|
all remotely-accessible components
|
|
|
|
|
|
|
|
node.py: the base Node, which handles connection establishment and
|
|
|
|
application startup
|
|
|
|
|
2007-12-03 21:52:42 +00:00
|
|
|
client.py, introducer.py:
|
2007-06-28 00:11:06 +00:00
|
|
|
these are two specialized subclasses of Node, for users and the central
|
2007-12-03 21:52:42 +00:00
|
|
|
introducer, respectively. Each works by assembling a collection of services
|
|
|
|
underneath a top-level Node instance.
|
2007-04-20 06:43:47 +00:00
|
|
|
|
2007-12-03 21:52:42 +00:00
|
|
|
introducer.py: node introduction handlers, client and server
|
2007-04-20 06:43:47 +00:00
|
|
|
|
|
|
|
storageserver.py: provides storage services to other nodes
|
|
|
|
|
2007-09-21 21:12:26 +00:00
|
|
|
codec.py: low-level erasure coding, wraps the zfec library
|
2007-04-20 06:43:47 +00:00
|
|
|
|
|
|
|
encode.py: handles turning data into shares and blocks, computes hash trees
|
|
|
|
|
2007-09-21 21:12:26 +00:00
|
|
|
upload.py: upload server selection, reading data from upload sources
|
|
|
|
|
|
|
|
download.py: download server selection, share retrieval, decoding
|
2007-04-20 06:43:47 +00:00
|
|
|
|
2007-12-03 21:52:42 +00:00
|
|
|
dirnode2.py: implements the distributed directory nodes.
|
2007-04-20 06:43:47 +00:00
|
|
|
|
|
|
|
webish.py, web/*.xhtml: provides the web frontend, using a Nevow server
|
|
|
|
|
2007-06-28 00:11:06 +00:00
|
|
|
uri.py: URI packing/parsing routines
|
2007-04-20 06:43:47 +00:00
|
|
|
|
|
|
|
hashtree.py: Merkle hash tree classes
|
|
|
|
|
|
|
|
debugshell.py, manhole.py: SSH-connected python shell, for debug purposes
|
|
|
|
|
|
|
|
util/*.py: misc utility classes
|
|
|
|
|
|
|
|
test/*.py: unit tests
|
|
|
|
|
|
|
|
|
2007-12-03 21:52:42 +00:00
|
|
|
Both the client and the central introducer node runs as a tree of
|
2007-04-20 06:43:47 +00:00
|
|
|
(twisted.application.service) Service instances. The Foolscap "Tub" is one of
|
2007-06-28 00:11:06 +00:00
|
|
|
these. Client nodes have an Uploader service and a Downloader service that
|
2007-12-03 21:52:42 +00:00
|
|
|
turn data into URIs and back again.
|
2007-04-20 06:43:47 +00:00
|
|
|
|
|
|
|
The Uploader is given an "upload source" (which could be an open filehandle,
|
|
|
|
a filename on local disk, or even a string), and returns a Deferred that
|
|
|
|
fires with the URI once the upload is complete. The Downloader is given a URI
|
|
|
|
and a "download target" (an open filehandle, filename, or instructions to
|
|
|
|
provide a string), and fires a Deferred with a target-specific value when the
|
|
|
|
download is complete. The source/target API is intended to make it easy to
|
|
|
|
stream the incoming data to a media player or HTTP connection without having
|
|
|
|
to consume a lot of memory for buffering.
|
|
|
|
|