5

This question already has an answer here:

I've seen a few questions about this already and they talk in generalities. I'm talking about specifics. If I start the bitcoin client from scratch, where in the source code does it actually add nodes.

http://bitcoin.sipa.be/seeds.txt seems to be a list of known clients, which is fine, but where in source does it connect. If I wanted to create my own private network, how would I accomplish this?

If there's just one client on the network, is that client still doing all of the work that bitcoin does? Mining, etc.

marked as duplicate by Nick ODell May 13 '15 at 21:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

8

The peer discovery process, in order of priority:

  1. the client attempts to connect to peers in it's local peers.dat database
  2. the client attempts to gain peers from one of four DNS-based seed nodes, hosted by Bitcoin developers
  3. the client gives up

The peers.dat database is filled with information using addr messages, which connected peers use to exchange their knowledge of other existing nodes in the network.

If you want to make your own local nodes, you need to set discovery to 0, which will disable advertising of the peers as available for incoming connections. You can then forge connections using local DNS or simply ip addresses of other local nodes with the connect option. At least one of these will need to be connecting out to the wider network for you to be able to stay up to date, and to mine on using p2pool. More than one connection out is vital to the stability of your private nodes.

Not the answer you're looking for? Browse other questions tagged or ask your own question.