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

dial attempt failed: protocol not supported #221

Closed
lzl124631x opened this issue Jan 8, 2019 · 4 comments
Closed

dial attempt failed: protocol not supported #221

lzl124631x opened this issue Jan 8, 2019 · 4 comments

Comments

@lzl124631x
Copy link

lzl124631x commented Jan 8, 2019

I'm trying to setup my own peer discovery, but when I try to use my node (almost the same as the chat-with-rendezvous) to connect bootnode, I got dial attempt failed: <peer.ID Qm*xL1oRV> --> <peer.ID Qm*hjxBgo> dial attempt failed: protocol not supported from the following code:

go func() {
	defer wg.Done()
	if err := host.Connect(ctx, *peerinfo); err != nil {
		logger.Warning(err)
	} else {
		logger.Info("Connection established with bootstrap node:", *peerinfo)
	}
}()

This error was thrown in swarm_dial.go dialAddr. But I don't understand what the protocol means here.

  • It shouldn't be the protocolID used in Stream, since it's before trying to set up the stream.
  • Was it talking about protocol like TCP?
@Stebalien
Copy link
Member

What options are you passing to libp2p.New?

@lzl124631x
Copy link
Author

lzl124631x commented Jan 8, 2019

Oh, you remind me that I used NoSecure for my own node, but the chat example node is not using that. Will this cause issue?

The config for my node:

libp2p.New(context.Background(),
		libp2p.ListenAddrs(sourceAddr),
		libp2p.NoSecurity, // The security (signature generation and verification) is, for now, taken care by ourselves.
	)

@lzl124631x
Copy link
Author

@Stebalien It works if I also add libp2p.NoSecurity to the bootnode. Thanks for the hint! I've been checking the peer discovery related code but didn't realize the issue is at the very beginning.

I hope we can refine the error message so that we can easily pinpoint the issue, e.g. dial failed due to incompatible security setup.

@Stebalien
Copy link
Member

Oh, you remind me that I used NoSecure for my own node, but the chat example node is not using that. Will this cause issue?

libp2p/go-libp2p-transport-upgrader#11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants