-
-
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
refactored ipns records to point to paths #1093
Conversation
d4a9e34
to
9d03093
Compare
parts := strings.Split(txt, "/") | ||
if len(parts) < 3 { | ||
return "", ErrBadPath | ||
} |
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.
may want to do the parts := strings.Split(txt, "/")
part first, as it's faster than b58 decoding. maybe:
parts := strings.Split(txt, "/")
if len(parts) == 1 {
kp, err := ParseKeyToPath(txt)
if err == nil {
return kp, nil
}
}
if len(parts) < 3 {
return "", ErrBadPath
}
comments above o/ |
On Fri, Apr 17, 2015 at 11:48:58PM -0700, Jeromy Johnson wrote:
I don't know if there's a more current spec out there, or if there's ipfs=XLF2ipQ4jD3U … It looks like DNS service discovery (RFC 6763) prefers equals to QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD is supposed to be interpreted, so I'd suggest we drop that value in ipfs=QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD for the DNS TXT record format (but maybe this PR is about the symlink It's also a bit odd to use the same hash for both the IPFS and IPNS. ipfs=QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/foo (which asks for children of public key?). Basically, /ipns/ should ipns=QmbqDJaoZYoGNw4dz7FqFDCf6q9EcHoMBQtoGViVFw2qv7 Then: ipns=QmbqDJaoZYoGNw4dz7FqFDCf6q9EcHoMBQtoGViVFw2qv7 would be equivalent to: ipfs=ipfs=QmbqDJaoZYoGNw4dz7FqFDCf6q9EcHoMBQtoGViVFw2qv7 as it would be if there were multiple layers of mutable IPNS ipns=QmbqDJaoZYoGNw4dz7FqFDCf6q9EcHoMBQtoGViVFw2qv7 So I'd use different hashes for IPFS and IPNS: ipfs=QmVyS3iAy7mvDA2HqQWm2aqZDcGDH3bCRLFkEutfBWNBqN For symlinks stored in an IPFS filesystem or as IPNS values, it makes type IPFSSymbolicLink struct { and no name (that would be a key pointing to the symlink, not part of |
@wking the format of the DNS TXT record is now (after ipfs paper DRAFT 3 was written):
For example:
and it's general for non-ipfs use cases:
Of course, this needs both to catch cycles and a recursive lookup limit. Why relevant: jbenet/random-ideas#28 |
I addressed the comments above, but just realized that |
maybe it should be a test case |
I mean, the logic for even thinking about ipns isnt there yet. hasnt been implemented yet |
@whyrusleeping do you mean: handling a |
@jbenet no i mean, if i do:
It wont work. the resolver doesnt understand ipns |
@whyrusleeping ah right, not the basic resolver. |
not sure what the best way forward here is. because the ipns resolution stuff uses the straight ipfs resolver... so adding ipns into the path.Resolver directly may make things funky |
let's not do that. namesys package should probably have its own resolver? or how low-level do you need it? |
a3e1dbf
to
4b7a867
Compare
travis is awesome: https://travis-ci.org/ipfs/go-ipfs/jobs/59675730 but otherwise i think this is good to go |
ae0ab82
to
9bfd329
Compare
|
||
p = path.FromSegments(append(pathHead, extensions...)...) | ||
//p = path.RebasePath(path.FromSegments(extensions...), basePath) | ||
return resolveRecurse(n, path.FromSegments(append(respath.Segments(), extensions...)...), depth+1) |
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.
this is hard to read, maybe use vars?
newpathSeg := append(respath.Segments(), extensions...)
newpath := path.FromSegments(newpathSeg...)
return resolveRecurse(n, newpath, depth+1)
|
9bfd329
to
e53754f
Compare
@chriscool will do! |
i love these random little failures: https://travis-ci.org/ipfs/go-ipfs/jobs/59829161#L2957 reliable testing is hard to get right |
The failure is:
Maybe 10 seconds are not enough on Travis, or maybe something can be done so that ipfs daemon exits faster. |
We should probably take some time to investigate ipfs shutdown a little better, ten seconds should be enough |
@jbenet I beleive that i have addressed your concerns |
iptb is so useful. ❤️ |
LGTM, RFM. i think this needs to be rebased. |
Also changed the ipns dns resolution to use the "dnslink" format
167d747
to
6da12b5
Compare
refactored ipns records to point to paths
refactored ipns records to point to paths This commit was moved from ipfs/kubo@54cb80e
Also changed the ipns dns resolution to use the "dnslink" format