-
-
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
add dns support inipfs p2p forward
and refactor code
#5533
Conversation
ipfs p2p forward
should accept full multiaddresses as target
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.
Fair enough.
ipfs p2p forward
should accept full multiaddresses as targetipfs p2p forward
and refactor code
b3ee63f
to
7db2efe
Compare
Hey @Stebalien , i have finished about this pr.If you have any time,please help me review it.Thx a lot. |
core/commands/p2p.go
Outdated
@@ -19,6 +19,8 @@ import ( | |||
ma "gx/ipfs/QmYmsdtJ3HsodkePE3eU3TsCaP2YvPZJ4LoXnNkDE5Tpt7/go-multiaddr" | |||
"gx/ipfs/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-libp2p-protocol" | |||
pstore "gx/ipfs/QmfAQMFpgDU2U4BXG64qVr8HSiictfWvkSBz7Y2oDj65st/go-libp2p-peerstore" | |||
madns "gx/ipfs/QmfXU2MhWoegxHoeMd3A2ytL2P6CY4FfqGWc23LTNWBwZt/go-multiaddr-dns" | |||
"time" |
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.
Move this to the top
core/commands/p2p.go
Outdated
if err != nil { | ||
return nil, err | ||
} | ||
if strings.Contains(mutiladdr.String(), "/ipfs/Qm") { |
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 wouldn't check for the Qm
prefix as that won't work with Ed keys. Also, we want to migrate form /ipfs/
to /p2p/
in near future so for compatibility this should just be if _, err := multiaddr.ValueForProtocol(ma.P_IPFS); err == nil {
core/commands/p2p.go
Outdated
targetAddressOptionName = "target-address" | ||
) | ||
|
||
var connectionTimeout = 10 * time.Second |
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 doesn't appear to be used anywhere but parseIpfsAddr
, so maybe call it resolveTimeout
?
1ce96f0
to
480d833
Compare
Thx a lot for your great advice @magik6k . I have update my pr please help me review again.And maybe there are something wrong with |
1ea140c
to
f8d955c
Compare
License: MIT Signed-off-by: Kejie Zhang <601172892@qq.com>
License: MIT Signed-off-by: Kejie Zhang <601172892@qq.com>
Fix #5524
License: MIT
Signed-off-by: Kejie Zhang 601172892@qq.com