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 swarm connect with alternate address #412

Closed
1 task
btc opened this issue Dec 8, 2014 · 6 comments
Closed
1 task

ipfs swarm connect with alternate address #412

btc opened this issue Dec 8, 2014 · 6 comments
Labels
topic/libp2p Topic libp2p

Comments

@btc
Copy link
Contributor

btc commented Dec 8, 2014

ipfs swarm connect works as intended the first time it is executed with valid args:

go-ipfs (master) λ. ipfs swarm connect /ip4/104.236.176.52/tcp/4001/QmaQujMiKngVVV6nRQsGRU1HVKriU7aGzUzL695zG6nqeW
connect QmaQujMiKngVVV6nRQsGRU1HVKriU7aGzUzL695zG6nqeW success

woohoo!

Now, let's connect via udp over a port that we're pretty sure isn't exposed.

go-ipfs (master) λ. ipfs swarm connect /ip4/104.236.176.52/udp/4312312/QmaQujMiKngVVV6nRQsGRU1HVKriU7aGzUzL695zG6nqeW
connect QmaQujMiKngVVV6nRQsGRU1HVKriU7aGzUzL695zG6nqeW success

What's the desired behavior in this case?

a) command merely ensures that a connection exists between local node and the peer

  • b) command ensures that there's a connection over the specified protocol tcp/udp
@jbenet
Copy link
Member

jbenet commented Dec 8, 2014

that's not even a valid multiaddr (udp port) . it doesnt error out on parsing?

b) command ensures that there's a connection over the specified protocol tcp/udp

correct behavior. maybe should change output to include the addresses.

@btc
Copy link
Contributor Author

btc commented Dec 8, 2014

that's not even a valid multiaddr (udp port) . it doesnt error out on parsing?

  • nope. however, this will panic and take down the daemon:
ipfs swarm connect /ip4/104.236.176.52

@whyrusleeping
Copy link
Member

yeah, multiaddr likes to panic...

@jbenet
Copy link
Member

jbenet commented Dec 9, 2014

:( i'll fix it.

@jbenet
Copy link
Member

jbenet commented Jan 15, 2015

No longer panics (i fixed it), but the errors are unfriendly:

> ipfs swarm connect /ip4/1.2.3.4
Error: invalid peer address: protocol requires address, none given: ip4

> ipfs swarm connect /ip4/1.2.3.4/
Error: multihash too short. must be > 3 bytes

@jbenet
Copy link
Member

jbenet commented Jan 15, 2015

Also to correct my statement above:

that's not even a valid multiaddr (udp port) . it doesnt error out on parsing?

Sorry, /udp/<port> is totally a valid multiaddr. i mistook udp for utp. /utp/<port> is wrong, it would be: /udp/<port>/utp

@jbenet jbenet added this to the clean errors milestone Jan 15, 2015
@jbenet jbenet added the topic/libp2p Topic libp2p label Mar 28, 2015
@jbenet jbenet removed this from the clean errors milestone Mar 29, 2015
@aschmahmann aschmahmann mentioned this issue Aug 23, 2021
62 tasks
ariescodescream pushed a commit to ariescodescream/go-ipfs that referenced this issue Oct 23, 2021
…com/stretchr/testify-1.4.0

build(deps): bump github.com/stretchr/testify from 1.3.0 to 1.4.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/libp2p Topic libp2p
Projects
None yet
Development

No branches or pull requests

3 participants