go-car icon indicating copy to clipboard operation
go-car copied to clipboard

NewSelectiveCar should accept a dagservice

Open ribasushi opened this issue 5 years ago • 3 comments

See comment/resulting code here: https://github.com/ipfs/go-ipfs/commit/39b9c3a32b9bcc682

The core justification is the fact that the dagervice can do proper paralellizing etc within a session. The blockstore is "dumb", thus not a great primitive for an interface-API.

ribasushi avatar Mar 25 '20 22:03 ribasushi

it just needs an interface that implements Get(cid.Cid) (blocks.Block, error), it shouldn't be hard to make an adapter if that API doesn't fit already would it?

rvagg avatar Mar 26 '20 01:03 rvagg

NewSelectiveCar is a "thing with state", the adapter would be "something else with state" that keeps the session and other bits. I opened this issue based on conversation with @Stebalien, I will doublecheck I didn't mis-understand

ribasushi avatar Mar 26 '20 08:03 ribasushi

this might be a limitation in my Go knowledge but it seems to me that a special-case adapter could be provided here that handles that all on the calling side? or maybe that's just too clunky?

rvagg avatar Mar 27 '20 02:03 rvagg