-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Use ResolveUnixfsOnce as default resolver. #4444
Conversation
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
This seems like a good opportunity to fix the IPLD/IPFS namespace problem. That is, we should be using |
@Stebalien actually it is |
This shouldn't have a default resolver. It should chose the resolver based on the protocol. However, looking into this, it looks like all the resolver code is a mess so this is probably the best fix for now. |
However, I am worried that this may break things. |
We agree that the resolver code is a mess. 😃 |
My worry here is that this will break things like that actually do really want the raw ipld resolver (like |
@whyrusleeping Unless I am missing something this will change the resolver not the output of |
Thats how i expect paths to be addressed with ipfs dag, since its a command that operates on the base ipld layer (and contains no unixfs context) |
@whyrusleeping I didn't know that was possible, but will add some tests cases for it |
@whyrusleeping so are you saying you want command like I am not sure I agree, because then we need to go through each command one by one and sort out which resolver to use for each. We might also want a I think we should have different syntax for resolving a raw dag vs a higher level path. Maybe something like. @Stebalien, and others, thought. As it stands right now |
The correct fix, as far as I know, is to differentiate between However, for now, we should probably have Resolve, unfortunately, is tricky. In this case, we really do need to look at the path prefix. If we have an IPNS link that points to |
@Stebalien I think the solution then is to make the default resolver also handle I will also see what I can do about cleaning up the code in general. |
I'd actually take a different approach.
That way, we handle all of these ambiguities at the edges. |
@Stebalien I think that is a good plan. My only concern is the performance cost of the extra allocation when prefixing plain CIDs with "/ipfs" only to have it immediately removed, but if it is not a frequent operation I doubt it will mater. I will see what I can make work, I am thinking that the resolver should take in a map that maps prefixed to protocol specific resolvers. |
Doing this at the edge should help. Also, allocations... go-ipfs... *snicker*.
Something like that. Personally, I was thinking of something more like a registry. There's a single |
I'm not sure I am following, what exactly do you mean by "at the edge". |
Superseded by the CoreAPI refactor. |
Might fix #4431