Author

Topic: How do blockchain nodes find each other? (Read 435 times)

staff
Activity: 3458
Merit: 6793
Just writing some code
December 02, 2017, 01:20:35 PM
#7
Some of those DNS seeds provide a static list of IP addresses of stable bitcoin listening nodes.
None of the DNS seeders provide a static list of IP addresses. They all provide a random subset of IPs that are gathered by a crawler. It is against Bitcoin Core's DNS Seeder policy to have a seeder that returns static addresses.
jr. member
Activity: 42
Merit: 2
December 02, 2017, 10:17:48 AM
#6
It is well known that blockchain is decentralised and each node stores whole history of transactions (all blocks).

But when you start the node, how does it know how to connect to others to synchronise? Is there central registry of nodes (or IP addresses of nodes) that it checks?

For blockchain nodes to find each other it query the DNS using a number of "DNS seeds," which are DNS servers that provide a list of IP addresses of bitcoin nodes. Some of those DNS seeds provide a static list of IP addresses of stable bitcoin listening nodes. Some of the DNS seeds are custom implementations of BIND (Berkeley Internet Name Daemon) that return a random subset from a list of bitcoin node addresses collected by a crawler or a long-running bitcoin node. The Bitcoin Core client contains the names of five different DNS seeds. The diversity of ownership and diversity of implementation of the different DNS seeds offers a high level or reliability for the initial bootstrapping process. In the Bitcoin Core client, the option to use the DNS seeds is controlled by the option switch -dnsseed.





jr. member
Activity: 33
Merit: 1
November 30, 2017, 03:48:19 PM
#5
Thanks for explanation achow101. Does it mean that DNS seeders (primary and built in) are set of "hardcoded" servers which are basically critical point of bitcoin core and if those servers won't be available whole blockchain will stop functioning (as eventually nodes won't be able to discover each other)?
No. Nodes can still discover each other without the DNS seeders. The DNS seeders can be swapped out with some other initial discovery process too.

Furthermore, as I said, nodes maintain their own internal database that persists across restarts of nodes that it can connect to. So it will use those nodes instead of the DNS seeders on all starts after the first start. For new nodes, new nodes will fall back to the hundreds of hard coded seed nodes.

Lastly, nodes can be added manually too.

Ah, ok. Thanks for clarification!
staff
Activity: 3458
Merit: 6793
Just writing some code
November 30, 2017, 03:45:26 PM
#4
Thanks for explanation achow101. Does it mean that DNS seeders (primary and built in) are set of "hardcoded" servers which are basically critical point of bitcoin core and if those servers won't be available whole blockchain will stop functioning (as eventually nodes won't be able to discover each other)?
No. Nodes can still discover each other without the DNS seeders. The DNS seeders can be swapped out with some other initial discovery process too.

Furthermore, as I said, nodes maintain their own internal database that persists across restarts of nodes that it can connect to. So it will use those nodes instead of the DNS seeders on all starts after the first start. For new nodes, new nodes will fall back to the hundreds of hard coded seed nodes.

Lastly, nodes can be added manually too.
jr. member
Activity: 33
Merit: 1
November 30, 2017, 03:39:33 PM
#3
Bitcoin Core (the most common type of node) has 3 methods of discovering peers. First it consults an internal database of peers it knows about. For a new node, this will be empty. Then it will consult a set of servers called DNS seeders. The DNS seeders give out the IP addresses of nodes that a node can connect to. The node will connect to these nodes only temporarily to gather the IP addresses of other nodes it can also connect to. It will then connect to those nodes. Lastly, if the previous two were unavailable, the node will consult a built in list of seed nodes. It does the same thing with these seed nodes that it did with nodes returned by the DNS seeders.

Thanks for explanation achow101. Does it mean that DNS seeders (primary and built in) are set of "hardcoded" servers which are basically critical point of bitcoin core and if those servers won't be available whole blockchain will stop functioning (as eventually nodes won't be able to discover each other)?
staff
Activity: 3458
Merit: 6793
Just writing some code
November 30, 2017, 03:31:27 PM
#2
Bitcoin Core (the most common type of node) has 3 methods of discovering peers. First it consults an internal database of peers it knows about. For a new node, this will be empty. Then it will consult a set of servers called DNS seeders. The DNS seeders give out the IP addresses of nodes that a node can connect to. The node will connect to these nodes only temporarily to gather the IP addresses of other nodes it can also connect to. It will then connect to those nodes. Lastly, if the previous two were unavailable, the node will consult a built in list of seed nodes. It does the same thing with these seed nodes that it did with nodes returned by the DNS seeders.
jr. member
Activity: 33
Merit: 1
November 30, 2017, 03:20:30 PM
#1
It is well known that blockchain is decentralised and each node stores whole history of transactions (all blocks).

But when you start the node, how does it know how to connect to others to synchronise? Is there central registry of nodes (or IP addresses of nodes) that it checks?
Jump to: