Add a section to the docsite about node administration, cover attachment upload/download.

This commit is contained in:
Mike Hearn 2016-03-04 16:15:32 +01:00
parent d26b06c35c
commit 4fd4a348cb
2 changed files with 42 additions and 0 deletions

View File

@ -28,6 +28,7 @@ Read on to learn:
data-model
messaging
running-the-trading-demo
node-administration
.. toctree::
:maxdepth: 2

View File

@ -0,0 +1,41 @@
Node administration
===================
When a node is running, it exposes an embedded web server that lets you monitor it, upload and download attachments,
access a REST API and so on.
Uploading and downloading attachments
-------------------------------------
Attachments are files that add context to and influence the behaviour of transactions. They are always identified by
hash and they are public, in that they propagate through the network to wherever they are needed.
All attachments are zip files. Thus to upload a file to the ledger you must first wrap it into a zip (or jar) file. Then
you can upload it by running this command from a UNIX terminal:
.. sourcecode:: shell
curl -F myfile=@path/to/my/file.zip http://localhost:31338/attachments/upload
The attachment will be identified by the SHA-256 hash of the contents, which you can get by doing:
.. sourcecode:: shell
shasum -a 256 file.zip
on a Mac or by using ``sha256sum`` on Linux. Alternatively, check the node logs. There is presently no way to manage
attachments from a GUI.
An attachment may be downloaded by fetching:
.. sourcecode:: shell
http://localhost:31338/attachments/DECD098666B9657314870E192CED0C3519C2C9D395507A238338F8D003929DE9
where DECD... is of course replaced with the hash identifier of your own attachment. Because attachments are always
containers, you can also fetch a specific file within the attachment by appending its path, like this:
.. sourcecode:: shell
http://localhost:31338/attachments/DECD098666B9657314870E192CED0C3519C2C9D395507A238338F8D003929DE9/path/within/zip.txt