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

Commit b5b166b

Browse files
committed
wip
1 parent 6faab2e commit b5b166b

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/core/components/dag.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
'use strict'
2+
3+
const promisify = require('promisify-es6')
4+
const dagPB = require('ipld-dag-pb')
5+
const CID = require('cids')
6+
// const mh = require('multihashes')
7+
8+
module.exports = function object (self) {
9+
return {
10+
put: promisify((dagNode, multicodec, hashAlg, callback) => {
11+
// TODO
12+
// serialize
13+
// get right hash
14+
// generate cid
15+
// put in IPLD Resolver
16+
17+
/*
18+
self._ipldResolver.put({
19+
node: node,
20+
cid: new CID(node.multihash)
21+
}
22+
*/
23+
}),
24+
get: promisify((cid, callback) => {
25+
self.ipldResolver.get(cid, callback)
26+
}),
27+
resolve: promisify((cid, path, callback) => {
28+
// TODO
29+
})
30+
}
31+
}

0 commit comments

Comments
 (0)