Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

immutable or mutable? #3

Closed
jbenet opened this issue Jun 4, 2015 · 10 comments
Closed

immutable or mutable? #3

jbenet opened this issue Jun 4, 2015 · 10 comments

Comments

@jbenet
Copy link
Contributor

jbenet commented Jun 4, 2015

@travisperson (without looking at the code on #2 yet)

  • is this a blob store where i can do put(k, v) and v = get(k) (that is backed by a merkledag), or one where i do obj = get(ipfsPath)?

  • One thing i'd be looking for is a read only blob store to the ipfs dag. (maybe thats why the test suite doesn't pass? mutability?)

  • Maybe a mutable version can use an ipns key? something like:

    var ipnsBlobStore = require('ipns-blob-store')
    var pivateKey = getMyPrivateKey(...)
    
    var ibs = ipnsBlobStore(privateKey) // instance based on name at hash(publicKey)
    ibs.put(k, v)
    v = ibs.get(k)
  • I wonder if the immutable ipfs only blob store is enough for pulling things out for reginabox? cc @bengl

/me takes a look at #2

@travisperson
Copy link
Member

The block store is immutable, #2 is mutable. You can remove keys and overwrite them. It's kind of a hacked together version of ipns, where each time you store a new value it updates the root dag (and soon all the entire path) always preserving the new hash. The hash is stored in the root_hash variable as well as passed back with each new blob stored. You can pass back any root hash and read from that state.

@jbenet
Copy link
Contributor Author

jbenet commented Jun 4, 2015

ahh so it behaves a bit like the new ipfs object patch ? I like that a lot actually.

@travisperson
Copy link
Member

Ya, soon it will act more like the ipfs object save @whyrusleeping was working on as you will be able to dive into the dag structure and update keys anywhere along the path.

@jbenet
Copy link
Contributor Author

jbenet commented Jul 4, 2015

hey @travisperson does this fully implement https://github.com/maxogden/abstract-blob-store now?

@travisperson
Copy link
Member

It does not, as you can't remove keys yet. The second PR allows for this, but it there are a few tests that are not passing completely, which I believe is due to a change in IPFS (as I'm pretty sure they were passing at some point, though maybe not).

I was running ipfs object stat on a path <hash>/linkname, it appears this doesn't work on master anymore (did this ever work?). To fix this we need to be able to either resolve paths or we'd need to manually traverse the structure in this lib, which is fine.

@jbenet
Copy link
Contributor Author

jbenet commented Jul 9, 2015

I was running ipfs object stat on a path <hash>/linkname, it appears this doesn't work on master anymore (did this ever work?).

it did -- ipfs/kubo#1446

@whyrusleeping
Copy link

ipfs/kubo#1475 <- should fix the issue

@jbenet
Copy link
Contributor Author

jbenet commented Sep 18, 2015

so, this might work now?

@daviddias
Copy link
Member

@jbenet @whyrusleeping it seems so, or I am missing something, but it does pass successfully all the abstract-blob-store tests

#2 (comment)

@daviddias
Copy link
Member

closing this one, "it works™" :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants