Docs and moving to new repo

This commit is contained in:
Mitra Ardron 2018-04-19 17:50:02 +10:00
parent 67cfd34a5d
commit ebd3433122
4 changed files with 17 additions and 8 deletions

10
API.md
View File

@ -24,7 +24,15 @@ Note: I am gradually (March2018) changing the API to take an opts {} dict which
The Transport layer provides a layer that is intended to be independent of the underlying storage/transport mechanism.
There is a class “Transport”, which should be subclassed for each supported transport and implement each of these functions, and there is a “Transports” class which manages the list of conencted transports, and directs api calls to them.
There are a set of classes:
* *Transport*: superclass of each supported transport,
* *TransportHTTP*: Connects to generic http servers, and handles contenthash: through a known gateway
* *TransportIPFS*: Connects to IPFS, currently via WebSocketsStar (WSS)
* *TransportYJS*: Implements shared lists, and dictionaries. Uses IPFS for transport
* *TransportWEBTORRENT*: Integrates to Feross's WebTorrent library
* *Transports*: manages the list of conencted transports, and directs api calls to them.
Calls are generally made through the Transports class which knows how to route them to underlying connections.
Documents are retrieved by a list of URLs, where in each URL, the left side helps identify the transport, and the right side can be the internal format of the underlying transport BUT must be identifiable e.g. ipfs:/ipfs/12345abc or https://gateway.dweb.me/content/contenthash/Qm..., this format will evolve if a standard URL for the decentralized space is defined.

View File

@ -5,7 +5,7 @@ General transport library for Decentralized Web handles multiple underlying tran
This library is part of a general project at the Internet Archive (archive.org)
to support the decentralized web.
###Goals
### Goals
* to allow a single API that can be used for most basic interactions with
decentralized transports.
* to support multiple URLs, on different transports, so that the (current) underlying unreliability
@ -54,4 +54,4 @@ var verbose = searchparams.get("verbose") || false;
See [example_block.html](./example_block.html) for an example of connecting, storing and retrieving.
See [API.md](./API.md) for the detailed API.

View File

@ -8,7 +8,7 @@
"node-fetch": false
},
"bugs": {
"url": "https://github.com/mitra42/dweb-transports/issues"
"url": "https://github.com/internetarchive/dweb-transports/issues"
},
"dependencies": {
"cids": "latest",
@ -31,14 +31,14 @@
"browserify": "^14.5.0",
"watchify": "^3.11.0"
},
"homepage": "https://github.com/mitra42/dweb-transports#readme",
"homepage": "https://github.com/internetarchive/dweb-transports#readme",
"keywords": [],
"license": "AGPL-3.0",
"main": "index.js",
"name": "dweb-transports",
"repository": {
"type": "git",
"url": "git://github.com/mitra42/dweb-transports.git"
"url": "git://github.com/internetarchive/dweb-transports.git"
},
"scripts": {
"bundle": "browserify ./index.js > ./dist/dweb_transports_bundle.js",

View File

@ -2,7 +2,8 @@
utils = {}; //utility functions
// ==== OBJECT ORIENTED JAVASCRIPT ===============
// This is a general purpose library of functions, the commented out ones come from other this libraries use in other places
// This is a general purpose library of functions,
//Parts of this file (consolearr, and createElement) are duplicated in dweb-transport; dweb-transports and dweb-objects repo
// Utility function to print a array of items but just show number and last.
utils.consolearr = (arr) => ((arr && arr.length >0) ? [arr.length+" items inc:", arr[arr.length-1]] : arr );
@ -40,7 +41,7 @@ utils.p_timeout = function(promise, ms, errorstr) {
}
utils.createElement = function(tag, attrs, children) { // Note arguments is set to tag, attrs, child1, child2 etc
// Note identical version in dweb-transport/js/utils.js and dweb-transports/utils.js
// Note identical version in dweb-transport/js/utils.js and dweb-transports/utils.js and dweb-objects/utils.js
var element = document.createElement(tag);
for (let name in attrs) {
let attrname = (name.toLowerCase() === "classname" ? "class" : name);