Closed alrevuelta closed 8 months ago
What version of libp2p are you using? I don't find the source of this error anywhere in libp2p code.
With the latest libp2p version the test (which is pretty much the same as your code) does work: https://github.com/libp2p/go-libp2p-http/pull/93
I've looked at your code and I don't see an issue, unless you are trying to talk to the wrong peer ID somehow.
My bad thanks, just figured out that the defer listener.Close()
before the go func() {}()
was closing the listener prematurely in my function. Fixing that solves the issue.
Should this example work as it is? It's almost a copy-paste from the docs but I'm getting the following error:
To Reproduce
In two terminals run the following. It should work as it is.
And:
Code here: