-
-
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
Fully resolve ipfs paths down to its final hash #1320
Conversation
Given an ipfs path, this will resolve it down to it's furthest point.
@@ -84,6 +84,23 @@ Resolve the value of another name recursively: | |||
return | |||
} | |||
|
|||
if len(output.Segments()) > 2 { | |||
merkNode, err := n.Resolver.ResolvePath(n.Context(), output) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm gonna use merkNode
from now on.
what case wasnt being handled previously? |
Given a path after a hash it would just return the same input and not actually do anything.
After
fixed copy paste error This was because ResolveN just called parsePath and make a Path out of the input and didn't actually do anything else. I was going to put this logic under ResolveN, but I don't have access to the node. However, it might be important that these steps take place there instead. |
cc @wking |
also the output |
I want this feature (see also #1082), but I'm not currently clear on Because as far as path-resolution goes, it doesn't matter if we're |
Copy and paste error, it it's not there when ran. |
I like the functionality that this command has in this PR. |
i must be really out of the loop. Didnt this command used to be |
@travisperson i think full resolution should be under a |
i think there's many parts here:
(this is over-exhaustive to show that there may be many different sort of names to resolve) today, we have 6.) under i'd like:
2., 4., 5. could have their own tools / distinctions down the road, but not common enough (or not even implemented yet) (hit return too early) |
(btw, |
Prior to this PR, the resolve command did nothing for ipfs paths, it just returned the same input. As it is, it's not really a recursive resolve, unless you only want it to resolve a single folder at a time, such as:
|
On Wed, Jun 03, 2015 at 12:12:25AM -0700, Juan Batiz-Benet wrote:
I responded in #1307 to keep the intended interface conversation in |
On Wed, Jun 03, 2015 at 12:30:33AM -0700, Juan Batiz-Benet wrote:
Spun off into #1328. |
On Wed, Jun 03, 2015 at 12:54:25AM -0700, Travis Person wrote:
This is how I think a non-recursive Merkle-link lookup should work, so With the Merkle DAG:
Then:
But I'd also like to see support for symlink objects with arbitrary /ipns//child Then we could have: With the Merkle DAG:
And the DHT-namesys entries:
Then:
Besides the link through IPNS space, this also shows the non-recursive |
yes, i like that resolve sequence.
Yes, that looks right to me. the links are a bit tricky. we need to think carefully how to "symlink" from a merkledag object to an ipns mutable record safely. The nice replicated dag guarantees are a bit broken if we dont do it carefully. btw, dm (mazieres) pointed out to me that getting symlinks right was going to be hard. :)
yes agreed with this. this is actually similar to how git traverses |
@travisperson clear on next things to do? |
On Wed, Jun 03, 2015 at 02:32:47PM -0700, Juan Batiz-Benet wrote:
Symlinks are #1104. Their impact here is just: if we want links out
Spun off into ipfs/specs#10. |
@whyrusleeping can be closed |
(here goes) |
Given an ipfs path, this will resolve it down to it's furthest point.
Tests to come.