Skip to content
This repository has been archived by the owner on Aug 3, 2021. It is now read-only.

Remove block api? #2

Open
achingbrain opened this issue Sep 7, 2018 · 3 comments
Open

Remove block api? #2

achingbrain opened this issue Sep 7, 2018 · 3 comments

Comments

@achingbrain
Copy link
Member

It looks like the DAG API does everything the block API does so perhaps we should remove the block API to lessen the conceptual overhead for the user.

https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/BLOCK.md
https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/DAG.md

@achingbrain achingbrain changed the title Deprecate block api? Remove block api? Sep 10, 2018
@ianopolous
Copy link

We only use the block api to put and get data, and also use block.stat.

@achingbrain
Copy link
Member Author

It's all encrypted blocks, right? What about using ipfs.dag.put with the raw codec instead of the block API? It's pretty much synonymous if you only care about buffers and it'd be great to expose the more modern bits of ipld like putting and getting multiple nodes (blocks) in one go.

The .stat thing is a gap that would have to be filled, but ipfs.files.stat(cid) works on arbitrary CIDs, not just MFS paths (in js-land at least) and will get you the same stats.

@ianopolous
Copy link

Our stuff is all encrypted and either raw or cbor format. I have memories of looking into using dag instead of block and deciding against it, but I don't remember those reasons now, apart it being unnecessary work for us. After some digging I've found this old issue which might be part of the reason: ipfs/kubo#3503

However, I have been thinking of essentially a minimal ipfs implementation that just implements the calls we use (for both security and simplicity reasons). That would only involve the following:
id
block.put
block.get
block.stat
pin.add
pin.update
pin.rm
refs
transaction.start (see ipfs/notes#106)
transaction.close

and the p2p http proxy at $gateway/p2p/$nodeid/http/

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

No branches or pull requests

2 participants