-
Notifications
You must be signed in to change notification settings - Fork 37
Making resolve and IPLD service into a new package #58
Comments
The IPLD Service uses the BlockStore and BlockStore can use any blob-store implementation (fs, memory, indexedDB, etc) 👍 for having the resolver as a separate package. In fact, I just suggested that for the MerkleDAG as well minutes ago:) ipfs/js-ipfs#478 (comment) |
From the chat in IRC, @nicola is looking to have an IPLD sandbox so that it is easy to attach an in memory IPLD service, without having to do the 'IPFS Repo -> IPFS Block Service -> IPFS Dag Service' dance. |
The current interactions with the ipfs-repo are pretty minimal at this point, so we can abstract things out. We only use the blockservice, and from that we need three methods
So we would move the majority of this code into something called class IpfsIpldService extends IPLDService {
constructor (blockservice) {
super({
getStream (key) {
return blockservice.getStream(key, 'ipld')
},
putStream (cb) {
return pull(
pull.map((node) => new Block(node, 'ipld')),
blockservice.putStream(),
pull.onEnd(cb)
)
},
delete (key, cb) {
return blockservice.delete(key, cb)
}
})
}
} |
This is the modularity I was looking for :) |
This issue is no longer applicable. In fact the new version has what you were looking for, @nicola :) |
I am now writing some very demo code to show IPLD.
I run into the following:
js-ipld
does not resolve a path query, so for example, given an object (that I have in memory), I can't use merkle paths to point to any attribute.resolve(service, path)
)The text was updated successfully, but these errors were encountered: