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

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Dec 13, 2016
1 parent 6faab2e commit b5b166b
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/core/components/dag.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
'use strict'

const promisify = require('promisify-es6')
const dagPB = require('ipld-dag-pb')
const CID = require('cids')
// const mh = require('multihashes')

module.exports = function object (self) {
return {
put: promisify((dagNode, multicodec, hashAlg, callback) => {
// TODO
// serialize
// get right hash
// generate cid
// put in IPLD Resolver

/*
self._ipldResolver.put({
node: node,
cid: new CID(node.multihash)
}
*/
}),
get: promisify((cid, callback) => {
self.ipldResolver.get(cid, callback)
}),
resolve: promisify((cid, path, callback) => {
// TODO
})
}
}

0 comments on commit b5b166b

Please sign in to comment.