You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
refactor: object APIs write methods now return CIDs (#1730)
For the back story on this change, please see: ipfs-inactive/interface-js-ipfs-core#388 (review)
BREAKING CHANGE: Object API refactor.
Object API methods that write DAG nodes now return a [CID](https://www.npmjs.com/package/cids) 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:
```js
// Before
const dagNode = await ipfs.object.new()
```
```js
// 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]>
Copy file name to clipboardExpand all lines: README.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -186,7 +186,7 @@ Commands:
186
186
187
187
### IPFS Daemon
188
188
189
-
The IPFS Daemon exposes the API defined [`http-api-spec`](https://github.com./ipfs/http-api-spec). You can use any of the IPFS HTTP-API client libraries with it, such as: [js-ipfs-api](https://github.com./ipfs/js-ipfs-api).
189
+
The IPFS Daemon exposes the API defined [`http-api-spec`](https://github.com./ipfs/http-api-spec). You can use any of the IPFS HTTP-API client libraries with it, such as: [js-ipfs-http-client](https://github.com./ipfs/js-ipfs-http-client).
190
190
191
191
If you want a programmatic way to spawn a IPFS Daemon using JavaScript, check out [ipfsd-ctl module](https://github.com./ipfs/js-ipfsd-ctl)
192
192
@@ -884,7 +884,7 @@ Listing of the main packages used in the IPFS ecosystem. There are also three sp
0 commit comments