-
Notifications
You must be signed in to change notification settings - Fork 54
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
Proposal: Multiblock encoder interface #175
Comments
I'm realizing now that above proposed API is not great and pretty much will never be sync because CIDs need to be computed in order to build a DAG. I think what would make more sense is to represent DAGs with clearly denoted block boundaries, however it would be difficult to generalize this and maybe it would be best not to. Maybe instead encoder interface could be expanded to allow recognizing what needs to be linked e.g. interface DAGIterator<T extends unknown = unknown> {
iterate <U>(data:T): IterableIterator<{ encoder: BlockEncoder<number, U>, data: U }>
} Such thing could be used to:
|
@Gozala I'm not quite following you on the last comment there; is it the order that's a problem? I get that that sync API is a problem, but beyond that why are you wanting to have an iterator of encoders? I don't quite see what problem that's solving. Also what is Also 2 .. it's kind of amusing to see you here, and in dag-ucan, essentially having to re-invent the whole ADL concept after we went through the dramas of disagreements in the IPLD team re their utility. I really think it'd be worth taking another look at whether there's a path to doing something sensible in JS on this front, and perhaps what you're getting at here is part of that (in Go, the write-side of ADLs are the least mature part, there's some messy mechanics and plumbing). I started tinkering with a new JS stack to try and better encompass these ideas a while back but it's been another one of those projects that get lost in the too-many-more-important-things-to-do rush. |
Problem is that
Yeah it is generic basically telling that type of js-multiformats/src/codecs/interface.ts Lines 4 to 8 in 9bcd7fe
Happy to amuse :P More seriously, we really need a way to represent things that span multiple blocks that can be packed into CAR(s) in a generic way. It does sound like ADLs, but then again they don't seem to have a very concrete definition. |
We're running into more and more cases where
BlockEncoder
interface just does not fit the bill:I am sure I'm forgetting some and we are likely to encounter more use cases where we want to turn some input into a DAG represented by many blocks. Which is why I would like to propose adopting following interfaces:
Such interfaces would cover all above use cases. Additionally we could make all our block codecs implement these interface too making them compatible.
The text was updated successfully, but these errors were encountered: