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

Commit

Permalink
fix: traverse-ipld-graphs (tree) example (#2088)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmc authored and Alan Shaw committed May 21, 2019
1 parent 63469ed commit b5c652f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/traverse-ipld-graphs/put.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ createNode((err, ipfs) => {
}
console.log(cid.toBaseEncodedString())
// should print:
// zdpuAzZSktMhXjJu5zneSFrg9ue5rLXKAMC9KLigqhQ7Q7vRm
// bafyreigsccjrxlioppkkzv27se4gxh2aygbxfnsobkaxxqiuni544uk66a
})
})
8 changes: 5 additions & 3 deletions examples/traverse-ipld-graphs/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ createNode((err, ipfs) => {
let node

try {
dagPB.DAGNode.create(someData)
node = dagPB.DAGNode.create(someData)
} catch (err) {
return cb(err)
}

ipfs.dag.put(node, { format: 'dag-pb', hashAlg: 'sha2-256' }, (err, cid) => {
if (err) {
cb(err)
return cb(err)
}
cidPBNode = cid
cb()
Expand Down Expand Up @@ -58,5 +58,7 @@ createNode((err, ipfs) => {
console.log(paths)
})
}
])
], (err) => {
console.error('Error:', err)
})
})

0 comments on commit b5c652f

Please sign in to comment.