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

ipfs p2p forward should accept full multiaddresses as target (not only /ipfs/<peerID>) #5524

Closed
hsanjuan opened this issue Sep 26, 2018 · 5 comments
Labels
help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature

Comments

@hsanjuan
Copy link
Contributor

hsanjuan commented Sep 26, 2018

Version information:

master

Type:

Feature

Description:

ipfs p2p forward takes an */ipfs/<peerID> multi-address as target. This assumes the given peer is routable.

However, sometimes it would be useful to do ipfs p2p forward <proto> /dnsaddr/mypeer or ipfs p2p forward <proto> /ip4/1.2.4.5/tcp/23131/ipfs/<peerID>. In these case, the command should automatically add the peer addresses to the peerstore so that they can be connected (right now, a manual swarm connect is required in advance). resolve the addresses.

This simplifies connecting to libp2p peers which are not part of the ipfs network or, particularly, the ipfs dht.

@hsanjuan hsanjuan changed the title ipfs p2p forward should accept full multiaddresses as target (not only ipfs) ipfs p2p forward should accept full multiaddresses as target (not only /ipfs/<peerID>) Sep 26, 2018
@magik6k magik6k added help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature labels Sep 26, 2018
@magik6k
Copy link
Member

magik6k commented Sep 26, 2018

If no one grabs this soon, I'll do that in a spare moment

@kjzz
Copy link
Contributor

kjzz commented Sep 28, 2018

Hey @magik6k @Stebalien , can i help you do for this?I am interested in this issue.

sometimes it would be useful to do ipfs p2p forward /dnsaddr/mypeer or ipfs p2p forward
<proto> /ip4/1.2.4.5/tcp/23131/ipfs/<peerID>

Can you explain it to me?Thx a lot.I am confusing about this.

And as i known, we can use command ipfs p2p forward /x/_testing /ip4/127.0.0.1/tcp/4567 /ip4/127.0.0.1/tcp/23131/ipfs/<peer id> and ipfs p2p forward /x/_testing /ip4/127.0.0.1/tcp/4567 /dnsaddr/bootstrap.libp2p.io/ipfs/<peer id> to connect right now.

@hsanjuan
Copy link
Contributor Author

@kjzz you're right, it already takes a full multiaddress and adds it to the peerstore before forwarding so that should work. What doesn't work is resolving /dns*/ first. Sorry for the confusion here.

@kjzz
Copy link
Contributor

kjzz commented Sep 29, 2018

Thx for replying @hsanjuan , so you mean that we should support command such as ipfs p2p forward /x/_testing /ip4/127.0.0.1/tcp/4567 /dnsaddr/bootstrap.libp2p.io?
And before forwarding , we should use resolve function to get all multiaddrs?Then add them all to peer store?

@hsanjuan
Copy link
Contributor Author

@kjzz yes, in principle, but we have some discussion about how painful it is to manually resolve in several places etc. #5535 (comment) maybe hold off a bit, as ideally this should be taken care of directly at libp2p-level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

3 participants