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

undefined: libp2p.NoEncryption error prevents application to compile and run #14

Closed
grempe opened this issue Jun 11, 2018 · 3 comments
Closed

Comments

@grempe
Copy link

grempe commented Jun 11, 2018

From blog post:

https://medium.com/coinmonks/code-a-simple-p2p-blockchain-in-go-46662601f417

If not commented out, this line breaks compilation of the sample program:

https://github.com/mycoralhealth/blockchain-tutorial/blob/master/p2p/main.go#L74

linter declares undefined libp2p.NoEncryption

Trying to run it results in:

$ go run main.go -l 10000 -secio
# command-line-arguments
./main.go:75:23: undefined: libp2p.NoEncryption

Commenting it out allows the program to run as expected.

@nosequeldeebee
Copy link
Owner

It looks like go-libp2p did indeed remove that method: https://godoc.org/github.com/libp2p/go-libp2p

Do you want to submit a pull request with that !secio section removed from the code?

@jorge-abarca
Copy link

While go-libp2p removed the NoEncryption method, the contributors added a variable that seems to be its replacement: NoSecurity.

You can see in their next commit that their echo example for a basic host changed NoEncryption() for NoSecurity.

I see the whole check was removed in #14 from the blockchain-tutorial repository, since the secio parameter and flag are still a part of the example, perhaps it would make sense to add the following lines of code on line 73:

if !secio {
	opts = append(opts, libp2p.NoSecurity)
}

These would be the replacement lines of go-libp2p's example. They seem to still be used at this moment.

I will submit a pull request with this change if that is more convenient for you.

@jorge-abarca
Copy link

I submitted PR #39, if you are interested to bring back the secio check functionality.

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

3 participants