0

When the bitcoin core daemon starts first time it does not have the block database. It must be connecting to other nodes over network. But (I am assuming) it needs to know the at least one live node/peer address (may be more to be robust against down nodes) to connect to the network. Where in code that configuration is accessed? Basically looking for the home calling block of code.

I could try to go through the source https://github.com/bitcoin/bitcoin but I am sure someone will see this question who can point me to the source file to make it easier.

1
  • @PieterWuille Thanks for the link. It doers not show the source line I was looking for but searching the codebase from the information contained in that question's answers helped me find the source location: github.com/bitcoin/bitcoin/blob/… . I'll keep the question and put the source location as answer, in case anyone else may look for it in future. May 6 at 22:04
0

The following source line shows how a set of seed domains are used to bootstrap the network:

https://github.com/bitcoin/bitcoin/blob/06d573f053c63eb6521c62d210c5924418ae2b83/src/chainparams.cpp#L121

These are called seed nodes. Once the bitcoin core is connected to one live node successfully, it can receive more peer information from that node and continue to expand the network. It can then save that information on disk and if the system is restarted, it can reload from disk. If that fails it can go back to seed domains again.

The above list is accessed here:

https://github.com/bitcoin/bitcoin/blob/320e518b9062ea5510abd7876d22dc5bd3352535/src/net.cpp#L1591

And then it is looped through here:

https://github.com/bitcoin/bitcoin/blob/320e518b9062ea5510abd7876d22dc5bd3352535/src/net.cpp#L1620

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