Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: use ipfs.add instead of files.add
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Nov 6, 2018
1 parent 7319c20 commit 6aa245f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/utils/with-mfs-root.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ const withMfsRoot = (ipfs, callback) => {

return waterfall([
// Store an empty node as the root
(next) => ipfs.files.add({
(next) => ipfs.add({
path: '/'
}, next),
// Turn the hash into a Buffer
([{hash}], next) => next(null, new CID(hash)),
([{ hash }], next) => next(null, new CID(hash)),
(cid, next) => repo.closed ? datastore.open((error) => next(error, cid)) : next(null, cid),
// Store the Buffer in the datastore
(cid, next) => datastore.put(MFS_ROOT_KEY, cid.buffer, (error) => next(error, cid))
Expand Down

0 comments on commit 6aa245f

Please sign in to comment.