Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

v27.0.0

Compare
Choose a tag to compare
@alanshaw alanshaw released this 28 Nov 12:02
· 284 commits to master since this release

Bug Fixes

  • also retry with misnemed format "dag-cbor" as "cbor" (#888) (348a144)
  • better input validation for add (#876) (315b7f7)
  • fix log.tail by calling add after listening for events (#882) (da35b0f)
  • handle peer-info validation errors (#887) (6e6d7a2), closes #885
  • updates ipld-dag-pb dep to version without .cid properties (#889) (ac30a82)

Code Refactoring

BREAKING CHANGES

  • the ipfs-api library has been renamed to ipfs-http-client.

Now install via npm install ipfs-http-client.

Note that in the browser build the object attached to window is now window.IpfsHttpClient.

License: MIT
Signed-off-by: Alan Shaw [email protected]

  • Object API refactor.

Object API methods that write DAG nodes now return a CID instead of a DAG node. Affected methods:

  • ipfs.object.new
  • ipfs.object.patch.addLink
  • ipfs.object.patch.appendData
  • ipfs.object.patch.rmLink
  • ipfs.object.patch.setData
  • ipfs.object.put

Example:

// Before
const dagNode = await ipfs.object.new()
// After
const cid = await ipfs.object.new() // now returns a CID
const dagNode = await ipfs.object.get(cid) // fetch the DAG node that was created

IMPORTANT: DAGNode instances, which are part of the IPLD dag-pb format have been refactored.

These instances no longer have multihash, cid or serialized properties.

This effects the following API methods that return these types of objects:

  • ipfs.object.get
  • ipfs.dag.get

See ipld/js-ipld-dag-pb#99 for more information.

License: MIT
Signed-off-by: Alan Shaw [email protected]

  • Files API methods add*, cat*, get* have moved from files to the root namespace.

Specifically, the following changes have been made:

  • ipfs.files.add => ipfs.add
  • ipfs.files.addPullStream => ipfs.addPullStream
  • ipfs.files.addReadableStream => ipfs.addReadableStream
  • ipfs.files.cat => ipfs.cat
  • ipfs.files.catPullStream => ipfs.catPullStream
  • ipfs.files.catReadableStream => ipfs.catReadableStream
  • ipfs.files.get => ipfs.get
  • ipfs.files.getPullStream => ipfs.getPullStream
  • ipfs.files.getReadableStream => ipfs.getReadableStream

Additionally, addFromFs, addFromUrl, addFromStream have moved from util to the root namespace:

  • ipfs.util.addFromFs => ipfs.addFromFs
  • ipfs.util.addFromUrl => ipfs.addFromUrl
  • ipfs.util.addFromStream => ipfs.addFromStream

License: MIT
Signed-off-by: Alan Shaw [email protected]