]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blob - README
storage: replace sqlite with in-share lease records
[tahoe-lafs/tahoe-lafs.git] / README
1 Welcome to the Allmydata-Tahoe project.  This project implements a secure,
2 distributed, fault-tolerant storage grid.  All of the source code is available 
3 under a Free Software licence.
4
5 The basic idea is that the data in this storage grid is spread over all
6 participating nodes, using an algorithm that can recover the data even if a
7 majority of the nodes are no longer available.
8
9 The interface to the storage grid allows you to store and fetch files, either
10 by self-authenticating cryptographic identifier or by filename and path.
11
12 See the web site for all kinds of information, news, and community
13 contributions, and prebuilt packages for Debian-like systems:
14
15 http://allmydata.org
16
17
18 LICENCE:
19
20  Tahoe is offered under the GNU General Public License (v2 or later), with
21  the added permission that, if you become obligated to release a derived work
22  under this licence (as per section 2.b), you may delay the fulfillment of
23  this obligation for up to 12 months.  If you are obligated to release code
24  under section 2.b of this licence, you are obligated to release it under
25  these same terms, including the 12-month grace period clause.  See the
26  COPYING file
27  for details.
28
29
30 GETTING PRECOMPILED BINARIES:
31
32 See http://allmydata.org .  Currently pre-compiled binaries are available
33 only for Debian or Ubuntu.  For any other platform you have to build it
34 yourself from source, which is what this text file is all about.
35
36
37 GETTING THE SOURCE CODE:
38
39 The code is available via darcs by running the following command:
40
41 darcs get http://allmydata.org/source/tahoe/trunk tahoe
42
43 This will create a directory named "tahoe" in the current working directory
44 and put a copy of the latest source code into it.  Later, if you want to get
45 any new changes, then cd into that directory and run the command "darcs
46 pull".
47
48 Tarballs of sources are available at:
49
50 http://allmydata.org/source/tahoe/
51
52
53 DEPENDENCIES:
54
55 Note: All of the following dependencies can probably be installed through
56 your standard package management tool if you are running on a modern Unix
57 operating system.
58
59 For example, on an debian-like system, you can do "sudo apt-get install
60 gcc make python-dev python-twisted python-nevow python-pyopenssl".
61
62  + a C compiler (language)
63
64  + GNU make (build tool)
65
66  + Python 2.4 or newer (tested against 2.4, and 2.5.1 -- on Windows-native 
67    Python 2.5 or higher is required), including development headers (language)
68
69    http://python.org/
70
71  + Python Twisted (tested against both 2.4 and 2.5) (network and operating
72    system integration library)
73
74    http://twistedmatrix.com/
75
76    You need the following subpackages, which are included in the default
77    Twisted distribution:
78
79    * core (the standard Twisted package)
80    * web, trial, conch
81
82    Twisted requires zope.interface, a copy of which is included in the
83    Twisted distribution.
84
85  + Python Nevow (0.9.18 or later) (web presentation language)
86
87    http://divmod.org/trac/wiki/DivmodNevow
88
89  + Python setuptools (build and distribution tool)
90
91    Note: The build process will automatically download and install setuptools
92    if it is not present.  However, if an old, incompatible version of
93    setuptools is present (< v0.6c6 on Cygwin, or < v0.6a9 on other
94    platforms), then the build will fail.
95
96    So if the build fails due to setuptools not being compatible, you can
97    either upgrade or uninstall your version of setuptools and try again.
98
99    http://peak.telecommunity.com/DevCenter/EasyInstall#installation-instructions
100
101  + Python PyOpenSSL (0.6 or later) (secure transport layer)
102
103    http://pyopenssl.sourceforge.net
104
105    To install PyOpenSSL on Windows-native, download this:
106    http://allmydata.org/source/pyOpenSSL-0.6.win32-py2.5.exe
107
108    To install PyOpenSSL on Windows-cygwin, install the OpenSSL development
109    libraries with the cygwin package management tool, then get the pyOpenSSL
110    source code, cd into it, and run "python ./setup.py install".
111
112  + the pywin32 package: only required on Windows
113
114    http://sourceforge.net/projects/pywin32/
115
116    (Tested with build 210, and known to not work with build 204.
117    Feedback with details of other builds is greatly appreciated)
118
119
120 Tahoe uses a few additional libraries which are included in this source
121 distribution for convenience. These will be automatically built when you type
122 'make', but if you have separate installations of them you may wish to modify
123 the makefile to use those in preference to the included versions. They
124 include Foolscap (a secure remote-object-invocation library) and zfec
125 (erasure coding). There are also pieces of PyCrypto copied into
126 allmydata.Crypto, modified to provide a faster CTR-mode API.
127
128
129 BUILDING:
130
131  Just type 'make' in the top-level tahoe directory.  This works on Windows
132  too, provided that you have the dependencies mentioned above.  (Either a
133  normal cygwin build or a mingw-style native build will be done by the
134  makefile, depending on whether the version of python that you have installed
135  is the Windows-native python or the cygwin python.)
136
137  If the desired version of 'python' is not already on your PATH, then type
138  'make PYTHON=/path/to/your/preferred/python'.
139
140  'make test-all' runs the unit test suites.  (This can take a long time on
141  slow computers.  There are a lot of tests and some of them do a lot of
142  public-key cryptography.)
143
144
145 INSTALLING:
146
147 There are three ways to do it: The Debian Way, The Python Way, and The
148 Running-In-Place Way.  Choose one:
149
150  The Debian Way:
151
152   The Debian Way is to build .deb files which you can then install with
153   "dpkg".
154
155   This requires certain debian packages (build-essential, fakeroot,
156   devscripts, debhelper, cdbs) to be installed first, since they are used to
157   construct the tahoe .deb files. A full list of these required packages can
158   be found in the "Build-Depends" line in the misc/DIST/debian/control in the
159   top-level tahoe directory (replacing the word DIST with etch, dapper, edgy,
160   or feisty as appropriate).
161
162   If you're running on a debian system, run 'make deb-etch', 'make deb-sid',
163   'make deb-edgy', or 'make deb-feisty' from within the tahoe top-level
164   directory to construct a debian package named 'allmydata-tahoe' which you
165   can then install with dpkg.
166
167  The Python Way:
168
169   Just run make install.  (This works on cygwin and Windows, too.)
170
171   In case you want to configure the location or other install options you can
172   learn how it is done here:
173
174   The Python Way is to execute "setup.py install" for each Python package.
175
176   You'll need to run "setup.py install" four separate times, one for each of
177   the four subpackages (allmydata, foolscap, simplejson, and zfec).
178
179     for PACKAGE in zfec foolscap simplejson; do
180       cd src/${PACKAGE} && python setup.py install && cd ../..
181     done
182
183     # the tahoe subpackage's setup.py script is in the root directory
184     PACKAGE=tahoe
185     python setup.py install
186
187  The Running-In-Place Way:
188
189   The Running-In-Place Way is to add a directory to your PYTHONPATH.
190
191   To run from a source tree (without installing first) just build it
192   (i.e. type 'make'), which will put all the necessary libraries into a local
193   directory named "./instdir/lib", which you can then add to your 
194   PYTHONPATH .  It will put executables into "./instdir/bin".
195
196
197 TESTING THAT IT IS PROPERLY INSTALLED
198
199  To test that all the modules got installed properly, cd to the root
200  directory of the tahoe source distribution (the directory which contains
201  this README file), start a python interpreter and import modules as follows.
202  If each one imports successfully instead of raising ImportError then it is
203  correctly installed.
204
205    % python
206    Python 2.4.4 (#2, Jan 13 2007, 17:50:26)
207    [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
208    Type "help", "copyright", "credits" or "license" for more information.
209    >>> import zfec
210    >>> import allmydata.Crypto
211    >>> import foolscap
212    >>> import allmydata.interfaces
213
214
215 RUNNING:
216
217  If you installed one of the debian packages constructed by "make deb-*", or
218  installed "The Python Way", then it creates an 'allmydata-tahoe' executable,
219  usually in /usr/bin . Else, you can find allmydata-tahoe in ./instdir/bin/ .
220  This tool is used to create, start, and stop nodes.  Each node lives in a
221  separate base directory, inside of which you can add files to configure and
222  control the node.  Nodes also read and write files within that directory.
223
224  A grid consists of a single central 'introducer and vdrive' node and one or
225  more 'client' nodes.  If you are joining an existing grid, the
226  introducer-and-vdrive node will already be running, and you'll just need to
227  create a client node.  If you're creating a brand new grid, you'll need to
228  create both an introducer-and-vdrive and a client (and then invite other
229  people to create their own client nodes and join your grid).
230
231  The introducer (-and-vdrive) node is constructed by running 'allmydata-tahoe
232  create-introducer --basedir $HERE'.  Once constructed, you can start the
233  introducer by running 'allmydata-tahoe start --basedir $HERE' (or, if you
234  are already in the introducer's base directory, just type 'allmydata-tahoe
235  start').  Inside that base directory, there will be a pair of files
236  'introducer.furl' and 'vdrive.furl'.  Make a copy of these, as they'll be
237  needed on the client nodes.
238
239  To construct a client node, pick a new working directory for it, then run
240  'allmydata-tahoe create-client --basedir $HERE'.  Copy the two .furl files
241  from the introducer into this new directory, then run 'allmydata-tahoe start
242  --basedir $HERE'.  After that, the client node should be off and running.
243  The first thing it will do is connect to the introducer and introduce itself
244  to all other nodes on the grid.  You can follow its progress by looking at
245  the $HERE/logs/twistd.log file.
246
247  To actually use the client, enable the web interface by writing a port
248  number (like "8080") into a file named $HERE/webport and then restarting the
249  node with 'allmydata-tahoe restart --basedir $HERE'. This will prompt the
250  client node to run a webserver on the desired port, through which you can
251  view, upload, download, and delete files. This 'webport' file is actually a
252  "strports specification", defined in
253  http://twistedmatrix.com/documents/current/api/twisted.application.strports.html
254  , so you can have it only listen on a local interface by writing
255  "tcp:8080:interface=127.0.0.1" to this file, or make it use SSL by writing
256  "ssl:8443:privateKey=mykey.pem:certKey=cert.pem" instead.
257
258  A client node directory can also be created without installing the code
259  first.  Just use 'make create-client', and a new directory named 'CLIENTDIR'
260  will be created inside the top of the source tree.  Copy the relevant .furl
261  files in, set the webport, then start the node by using 'make start-client'.
262  To stop it again, use 'make stop-client'.  Similar makefile targets exist
263  for making and running an introducer node.
264
265  If you are behind a firewall and you can configure your firewall to forward
266  TCP connections on a port to the computer running your Tahoe node, then you
267  can configure the Tahoe node to announce itself as being available on that
268  IP address and port.  The way to do this is to create a file named
269  $HERE/advertised_ip_addresses, in which you can put IP addresses and port numbers in
270  "dotted-quad:port" form, e.g. "209.97.232.113:1345".  You can put multiple
271  IP-address-and-port-number entries into this file, on separate lines.
272
273  There is a public grid available for testing.  Look at the wiki page
274  (http://allmydata.org) for the necessary .furl data.
275