Search code examples
blockchainethereumbitcoin

How Bitcoin/Ethereum or other cryptocurrency node knows about IP of peers at start


Recently, I have worked on my own blockchain based cryptocurrency and I have an architecture question. How new node in network knows to which peer to connect?

I had an idea that IPs can be specified in config file were user specifies nodes he/she wants. But I want to automate this process. How can I do this?


Solution

  • There is a hardcoded list / a file of IP addresses called bootstrap nodes.

    A fresh peer-to-peer client will try to connect to these first.

    If the client does not manage to connect it will never find the network.