Go-ipfs: ipfs swarm connect should only use address provided in argument by default

Created on 31 Aug 2017  路  9Comments  路  Source: ipfs/go-ipfs

We need a way to tell ipfs swarm connect that it should only use the address we give to it. Too many times I try to connect to a peer with ipfs swarm connect /definitely/a/valid/address and get dial backoffed because ipfs tried 100 other addresses that we're the one i gave it. This is also important in testing other things, I want to test out relay stuff, but often times i try to connect to a peer via relay and get a normal tcp direct connection.

help wanted kinbug kinenhancement

Most helpful comment

Yeah, I think its fair to say that the current way the code works is buggy, and needs to be fixed.

All 9 comments

I'd expect ipfs swarm connect to only use the address we give it. To use any known address and/or the given address, I'd call ipfs swarm connect /ip4/.../tcp/.../ipfs/QmId /ipfs/QmId ... (that is, specify that we're willing to connect to the peer via any means necessary by passing an address without any route information).

Yeah, I think its fair to say that the current way the code works is buggy, and needs to be fixed.

potential duplicate of issue here: https://github.com/ipfs/go-ipfs/issues/3658

hey @whyrusleeping , Has this issue finished?If not , i am willing to do it.It maybe will help me learn more about swarm.

This has not been fixed. The current thinking is that we'll add some option to the context saying "only dial these addresses when connecting to this peer".

Hey @Stebalien , Thx for replying . You mean that I shold add a option such as --allow-others(the option name must not the best one,anther will be better) . This option can determine whether to connect to other nodes when use command ipfs swarm connect.WDYT?

SGTM. The tricky part will be wiring this all the way down to the swarm/network.

As for naming, maybe --routing=false or something like that? Really, that's what we're doing. We're turning peer routing off. However, that may not be explicit enough so I'm open to suggestions :smile:.

hey @Stebalien , should i clear all peer in peerstore when i use command --routing=false?

Ideally not, that's the tricky part. My current thinking is that we'd add options to the context. We'd probably want one to disable routing and one to explicitly specify which addresses we want to dial. However, I don't have any concrete ideas of how to implement that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Kubuxu picture Kubuxu  路  3Comments

Jorropo picture Jorropo  路  3Comments

djdv picture djdv  路  3Comments

0x6431346e picture 0x6431346e  路  3Comments

daviddias picture daviddias  路  3Comments