Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: clarity510 on February 04, 2016, 11:12:50 PM



Title: Bitcoin's p2p networking files
Post by: clarity510 on February 04, 2016, 11:12:50 PM
Hey,

I'm working on an p2p application, and I don't really know how to do it well, so I was thinking I could use bitcoin's p2p code as a learning tool.

Where in the source is all of the p2p stuff? I found bitcoin/src/net.cpp, and that looks like it has a lot of it, but is there more files?

Thanks!
Ryan


Title: Re: Bitcoin's p2p networking files
Post by: achow101 on February 04, 2016, 11:18:55 PM
Yes. protocol.cpp and protocol.h has stuff there with the p2p messages and main.cpp and main.h has stuff related to receiving and handling network messages.

You should also look at the documentation about the p2p network on bitcoin.org: https://bitcoin.org/en/developer-reference#p2p-network


Title: Re: Bitcoin's p2p networking files
Post by: clarity510 on February 05, 2016, 03:56:24 PM
Thanks for the response. This is really helpful.

--Ryan