Build instructions
diff --git a/README b/README
index bb4b7da..ae56e13 100644
--- a/README
+++ b/README
@@ -2,26 +2,35 @@
NDN.JS: A javascript client library for Named Data Networking
--------------------------------------------------------------
-NDN.JS is the first native version of the NDN protocol written in JavaScript. It is wire format compatible with PARC's CCNx.
+NDN.JS is the first native version of the NDN protocol written in JavaScript. It is wire
+format compatible with PARC's CCNx.
The project by the UCLA NDN team - for more information on NDN, see
http://named-data.net/
http://ndn.ucla.edu/
-NDN.JS is open source under a license described in the file COPYING. While the license does not require it, we really would appreciate it if others would share their contributions to the library if they are willing to do so under the same license.
+NDN.JS is open source under a license described in the file COPYING. While the license
+does not require it, we really would appreciate it if others would share their
+contributions to the library if they are willing to do so under the same license.
---
-This is a young project, with minimal documentation that we are slowly enhancing. Please email Jeff Burke (jburke@remap.ucla.edu) with any questions.
+This is a young project, with minimal documentation that we are slowly enhancing. Please
+email Jeff Burke (jburke@remap.ucla.edu) with any questions.
-The primary goal of NDN.JS is to provide a pure Javascript implementation of the NDN API that enables developers to create browser-based applications using Named Data Networking. The approach requires no native code or signed Java applets, and thus can be delivered over the current web to modern browsers with no hassle for the end user.
+The primary goal of NDN.JS is to provide a pure Javascript implementation of the NDN API
+that enables developers to create browser-based applications using Named Data Networking.
+The approach requires no native code or signed Java applets, and thus can be delivered
+over the current web to modern browsers with no hassle for the end user.
Additional goals for the project:
-- Websockets transport (rather than TCP or UDP, which are not directly supported in Javascript).
+- Websockets transport (rather than TCP or UDP, which are not directly supported in
+Javascript).
- Relatively lightweight and compact, to enable efficient use on the web.
- Wire format compatible with PARC's CCNx implementation of NDN.
-The library currently requires a remote NDN daemon, and has been tested with ccnd, from the's CCNx package: http://ccnx.org/
+The library currently requires a remote NDN daemon, and has been tested with ccnd, from
+the's CCNx package: http://ccnx.org/
Currently, the library has two APIs for developers:
@@ -32,7 +41,11 @@
2. A Firefox plug-in, which implements an "ndn:/" url scheme
following CCNx repository conventions for file retrieval.
-By default, both parts of the library connect automatically to a set of proxies and hubs that are part of the NDN research project's testbed. http://named-data.net/testbed.html There are currently no restrictions on non-commercial, research-oriented data exchange on this testbed. (Contact jburke@remap.ucla.edu for more details.) The developer can also specify a local or remote ccnd as well, as an argument to the NDN constructor.
+By default, both parts of the library connect automatically to a set of proxies and hubs
+that are part of the NDN research project's testbed. http://named-data.net/testbed.html
+There are currently no restrictions on non-commercial, research-oriented data exchange on
+this testbed. (Contact jburke@remap.ucla.edu for more details.) The developer can also
+specify a local or remote ccnd as well, as an argument to the NDN constructor.
@@ -41,17 +54,25 @@
See files in js/ and examples in js/testing, js/examples
-NDN.JS currently supports expressing Interests (and receiving data) and publishing Data (that answers Interests). This includes encoding and decoding data packets as well as signing and verifying them using RSA keys.
+NDN.JS currently supports expressing Interests (and receiving data) and publishing Data
+(that answers Interests). This includes encoding and decoding data packets as well as
+signing and verifying them using RSA keys.
** NDN connectivity **
-The only way (for now) to get connectivity to other NDN nodes is via ccnd. For the Javascript API, a Websockets proxy that can communicate the target ccnd is currently required. Code for such a proxy (using Node.js) is in the wsproxy directory. It currently listens on port 9696 and passes messages (using either TCP or UDP) to ccnd on the same host.
+The only way (for now) to get connectivity to other NDN nodes is via ccnd. For the
+Javascript API, a Websockets proxy that can communicate the target ccnd is currently
+required. Code for such a proxy (using Node.js) is in the wsproxy directory. It
+currently listens on port 9696 and passes messages (using either TCP or UDP) to ccnd on
+the same host.
** Including the scripts in a web page **
To use NDN.JS in a web page, one of two scripts must be included using a <script> tag:
-1. ndn-js.js, a combined, compressed library designed for efficient distribution. It can be built using js/tools/build/make-js.sh This is used in examples/ndn-ping.html
+1. ndn-js.js, a combined, compressed library designed for efficient distribution. It can
+be built using js/tools/build/make-js.sh This is used in examples/ndn-ping.html
-2. Helper.js, which loads each component script independently. This is used in most of the tests in testing/
+2. Helper.js, which loads each component script independently. This is used in most of
+the tests in testing/
** Example **
A simple example of the current API to express an Interest and receive data:
@@ -71,7 +92,8 @@
return Closure.RESULT_OK;
};
-ndn.expressInterest(new Name("/ndn/ucla.edu/apps/ndn-js-test/hello.txt"), new AsyncGetClosure());
+ndn.expressInterest(new Name("/ndn/ucla.edu/apps/ndn-js-test/hello.txt"), new
+AsyncGetClosure());
FIREFOX ADD-ON FOR THE NDN PROTOCOL
@@ -79,7 +101,9 @@
See files in js/ndnProtocol
-NDN.JS includes a Firefox extension for the ndn protocol built using the Javascript library. It currently obtains NDN connectivity through the NDN testbed. (This is hard-coded.)
+NDN.JS includes a Firefox extension for the ndn protocol built using the Javascript
+library. It currently obtains NDN connectivity through the NDN testbed. (This is
+hard-coded.)
To install, either download
https://github.com/remap/ndn-js/blob/master/js/ndnProtocol.xpi
@@ -90,14 +114,17 @@
Firefox uses the protocol extension to load any URI starting with ndn, for example
ndn:/ndn/ucla.edu/apps/lwndn-test/trig-table
-When the page is loaded, Firefox updates the address bar with the full matched name from the retrieved content object including the version, but without the implicit digest or segment number (see below).
+When the page is loaded, Firefox updates the address bar with the full matched name from
+the retrieved content object including the version, but without the implicit digest or
+segment number (see below).
* Interest selectors in the ndn protocol:
-You can add interest selectors. For example, this uses 1 to select the "rightmost" child (latest version).
+You can add interest selectors. For example, this uses 1 to select the "rightmost" child
+(latest version).
ndn:/ndn/ucla.edu/apps/ndn-js-test/hello.txt?ndn.ChildSelector=1&key=value#ref
The browser loads the latest version and changes the address to:
@@ -120,7 +147,11 @@
* Multiple segments in the ndn protocol
-A URI for content with multiple segments is handled as follows. If the URI has a segment number, just retrieve that segment and return the content to the browser.
+A URI for content with multiple segments is handled as follows. If the URI has a segment
+number, just retrieve that segment and return the content to the browser.
-Otherwise look at the name in the returned ContentObject. If the returned name has no segment number, just return the content to the browser. If the name has a segment number which isn't 0, store it and express an interest for segment 0. Read segments in order and return each content to the browser as we go until we get the segment for FinalBlockID.
+Otherwise look at the name in the returned ContentObject. If the returned name has no
+segment number, just return the content to the browser. If the name has a segment number
+which isn't 0, store it and express an interest for segment 0. Read segments in order and
+return each content to the browser as we go until we get the segment for FinalBlockID.