diff --git a/.gitignore b/.gitignore index d477879..ecd220d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules /package-lock.json data.json /radata/ +yarn.lock diff --git a/API.md b/API.md index 3796824..69965b0 100644 --- a/API.md +++ b/API.md @@ -147,6 +147,16 @@ sig Signature data structure (see below - contains url, date, signedby, s signature - verifiable signature of date+urls signedby - url of data structure (typically CommonList) holding public key used for the signature ``` +##### seed({directoryPath=undefined, fileRelativePath=undefined, ipfsHash=undefined, urlToFile=undefined}, cb) +Seed the file to any transports that can handle it. +``` +ipfsHash: When passed as a parameter, its checked against whatever IPFS calculates. + Its reported, but not an error if it doesn't match. (the cases are complex, for example the file might have been updated). +urlFile: The URL where that file is available, this is to enable transports (e.g. IPFS) that just map an internal id to a URL. +directoryPath: Absolute path to the directory, for transports that think in terms of directories (e.g. WebTorrent) + this is the unit corresponding to a torrent, and should be where the torrent file will be found or should be built +fileRelativePath: Path (relative to directoryPath) to the file to be seeded. +``` ##### p_rawlist(url) Fetch all the objects in a list, these are identified by the url of the public key used for signing. @@ -239,14 +249,26 @@ returns: Dictionary of Key:Value pairs, note take care if this could ``` ### Transports - other functions -##### static async p_f_createReadStream(url, {wanturl}) +##### static async p_f_createReadStream(url, {wanturl, preferredTransports=[] }) Provide a function of the form needed by