master
Feature
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 . In these case, the command should ipfs p2p forward <proto> /ip4/1.2.4.5/tcp/23131/ipfs/<peerID>automatically add the peer addresses to the peerstore so that they can be connected (right now, a manual resolve the addresses.swarm connect is required in advance).
This simplifies connecting to libp2p peers which are not part of the ipfs network or, particularly, the ipfs dht.
If no one grabs this soon, I'll do that in a spare moment
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
/ip4/1.2.4.5/tcp/23131/ipfs/
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.
@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.
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?
@kjzz yes, in principle, but we have some discussion about how painful it is to manually resolve in several places etc. https://github.com/ipfs/go-ipfs/pull/5535#issuecomment-425597268 maybe hold off a bit, as ideally this should be taken care of directly at libp2p-level.
Most helpful comment
@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.