Skip to content
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

add support for IPLD over IPNS #5602

Closed
wants to merge 1 commit into from
Closed

add support for IPLD over IPNS #5602

wants to merge 1 commit into from

Conversation

Stebalien
Copy link
Member

It's not perfect but at least ipfs name resolve can resolve IPNS records pointing to IPLD paths. ipfs dag get /ipns still doesn't work but we can make it work once we switch to CoreAPI.

I thought this would be difficult, apparently not...

It's not *perfect* but at least `ipfs name resolve` can resolve IPNS records
pointing to IPLD paths. `ipfs dag get /ipns` still doesn't work but we
can *make* it work once we switch to CoreAPI.

License: MIT
Signed-off-by: Steven Allen <[email protected]>
@ghost ghost assigned Stebalien Oct 15, 2018
@ghost ghost added the status/in-progress In progress label Oct 15, 2018
@@ -25,15 +25,6 @@ func resolve(ctx context.Context, r resolver, name string, options *opts.Resolve
}
log.Debugf("resolved %s to %s", name, p.String())

if strings.HasPrefix(p.String(), "/ipfs/") {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed this check to "is not /ipns/". That way, we continue resolving until we can no longer resolve.

if !strings.HasPrefix(name, "/") {
return path.ParsePath("/ipfs/" + name)
}
// TODO: Forbid this case.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't do this now but I'd rather require complete paths (forbidding a raw "Qm..."). However, that'll be a harder change.

@magik6k
Copy link
Member

magik6k commented Oct 16, 2018

This code is mostly rewritten in #5404. We should also consider dropping the prefixes thing as it's always hard coded to /ipns/ anyways.

@Stebalien Stebalien added the status/blocked Unable to be worked further until needs are met label Oct 16, 2018
@Stebalien
Copy link
Member Author

Let's block this on that PR then.

@Stebalien Stebalien mentioned this pull request Oct 16, 2018
4 tasks
@Stebalien
Copy link
Member Author

Fixed in #5404.

@Stebalien Stebalien closed this Oct 18, 2018
@ghost ghost removed the status/in-progress In progress label Oct 18, 2018
@Stebalien Stebalien deleted the feat/ipns-ipld branch October 18, 2018 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/blocked Unable to be worked further until needs are met
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants