What causes a stream reset?

Hi, guys!

I know that is already a topic on this subject, but there are no answers there.

I’m currently working on a project which runs a blockchain simulated on a p2p network created with libp2p. I’ve followed this tutorial from Medium:

The problem is that quite often, I get a stream reset on one of the terminals, for a reason that I currently figure.

Any ideas on this issue would be a great help for me. Thanks in advance!

If you didn’t call Reset on the stream, the underlying connection was closed somewhere. Could you run go list -m all? I want to make sure you don’t have a known-buggy version of something.

Thanks for the response!

Yeah, sure. When I ran “go list -m all” it said “go list -m: not using modules”, but I’ll attach a link for download of the file which contains the output from “go list all”, because it is quite large (1623 lines) to just copy it here. Hope it helps.

Hm. Could you please use modules? Using libp2p without using go modules isn’t supported and isn’t likely to work in many cases (it’ll just use the latest git version of all of your dependencies).

Run go mod init in your root directory.

I ran the command and after all the modules were installed I got the following build failure build github.com/libp2p/go-libp2p/examples/p2p: cannot find module for path crypto/ed25519. I found that this problem is caused by a lower than 1.13 version of Go (i got 1.11). So I have to see how I can solve this and after I’ll be able to say if the stream reset problem was solved.

Anyway, thank you very much for your help! I’ll get back with a response as soon as I can!

Yeah, you’ll need to use go 1.13. It sounds like you were likely using some outdated dependencies. There may be other issues, but updating is a good start.