-
Notifications
You must be signed in to change notification settings - Fork 108
Spec out DagPB path resolution #55
Comments
Proposal: Simplicity over UXGiven that others are, hopefully at least, not using this format, we could just say that all paths must use link indices. We'll need to write a helper function to resolve named links. |
Proposal: Named xor UnnamedIf we require that all links in an object either be named or unnamed, we can redefine the structure to either have a map of link names to links or an array of unnamed links. The question is, do we ever mix named links with unnamed links? |
Re So with them both supporting |
The biggest issue here is that you then can't path through named links named "Links" or "Data". Hence I propose (that's from a JS perspective as we have this clear distinction here, not sure about the Go side): IPLD only implements pathing on the structure aka By default the DAG API will only support the structured pathing (this would be a breaking change for go-ipfs). Though we could still allow There will be no way to combine the pathing of both ways. This way there won't be a naming conflict and you can even path through named linkes called "Links". |
These 2 levels were once called resolvers and transformations and both were part of IPLD. |
seems to me that (a) this hasn't been a problem discovered by JS consumers and (b) if we're really the only consumer, via IPFS + UnixFSv1, then it doesn't really matter as long as IPFS doesn't need a link named Wouldn't it be a more traumatic exercise to rip out |
If you add a directory called
|
Currently, we're playing it fast-and-loose with DagPB path resolution. For context, the structure of DagPB IPLD objects is currently defined to be:
Given this structure, the correct path to
QmId
would be/Links/0/Hash
. However, this isn't very usable.js-ipfs actually supports this pathing scheme. However, it also supports pathing by name (
/Links/thing/Hash
). While nice and usable, this is technically transforming the object.go-ipfs uses the pathing scheme
/thing
. That is, it treats the object as if it were a single map of names to CIDs (for the purposes of pathing). This is obviously problematic from an IPLD standpoint as many of the fields aren't addressable.So, we need a scheme that's both consistent between implementations and consistent with other IPLD formats.
Given that we're basically the only real consumer of this format, I believe we have a bit of flexibility.
By the way, @diasdavid, your code organization is 💯. (despite the fact that you're using JavaScript)
The text was updated successfully, but these errors were encountered: