Bitcoin Forum
May 11, 2024, 08:46:23 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Initial peer discovery  (Read 218 times)
roro9500 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 1


View Profile
April 13, 2020, 01:06:48 PM
Last edit: April 13, 2020, 08:20:08 PM by gmaxwell
Merited by DaCryptoRaccoon (1)
 #1

Hello, I am new (and sorry in advance for my language I am French).



I would like to know how we connect to the blockchain, to the network, when there is no ip?

Indeed we all use bitcoin core (for bitcoin) to connect and retrieve information and update.

However the source code of bitcoin core (I have never read it) does not redirect us to an ip, but people still manage to find themselves, without ever saving the ip.

How can people know or find the information, when the source code of the software does not have ip, they do not know address (ip) which has the information?

Knowing that the ip is the basis of the connection ...
The forum strives to allow free discussion of any ideas. All policies are built around this principle. This doesn't mean you can post garbage, though: posts should actually contain ideas, and these ideas should be argued reasonably.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
April 13, 2020, 01:21:40 PM
Merited by ABCbits (1)
 #2

I think you're asking about how core makes it's initial connections and how it discovers peers?

Core comes with a list of addresses that it knows to be nodes functioning (these are normally core devs or long standing nodes) these nodes send back to your client a list of peers they're connected to (up to 1000 IPs) and you then send a message to some/each of those.. Presumably ip heuristics are used to better locate who to connect to (someone in Europe will be faster to connect to if you're in Europe than the US).

The peers.dat then stores a list of up to 1000 of your nodes fastest peers, once you have a full chain you'll also be included in those peers.dat on standard nodes of other people.
ranochigo
Legendary
*
Offline Offline

Activity: 2968
Merit: 4179



View Profile
April 13, 2020, 02:24:33 PM
Merited by ABCbits (1), fillippone (1), BrewMaster (1)
 #3

There's a list of DNS seeds[1] within the code itself. The DNS seeds are domains that ONLY give out a list of well connected seed nodes. The seed nodes are the ones which has a high reliability and a good connection. After a connection to the seed node, the client can then obtain more peers information by querying the seed nodes.

If all else fails, there is a hardcoded bunch of seed nodes within the client itself.

[1] https://github.com/bitcoin/bitcoin/blob/b83565625e32b22395e28c1965b2e42fc17f04d7/src/chainparams.cpp#L116

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
BrewMaster
Legendary
*
Offline Offline

Activity: 2114
Merit: 1292


There is trouble abrewing


View Profile
April 13, 2020, 03:58:03 PM
Merited by ABCbits (1)
 #4

you are asking about one of the biggest challenges that any peer to peer network faces, which is the "initial" peer discovery. as it was mentioned it is by hardcoded seeders. the problem is that any P2P client has to know at least one IP address of another peer on that network to start its connection. to do that we have these seeders. but as soon as that first connection is made the client is already a part of the network and can find nearly all other peers by communicating with some of them and asking them for a list of other peers (their IP addresses) and by storing them locally the client can connect to those other peers in the future.

There is a FOMO brewing...
roro9500 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 1


View Profile
April 14, 2020, 10:07:49 AM
 #5

if this is the case, it means that bitcoin core will no longer work for new clients (who have never started it), if the DNS is unavailable.

Is it a certain way of centralization? : /
The DNS can delete ? D:
ranochigo
Legendary
*
Offline Offline

Activity: 2968
Merit: 4179



View Profile
April 14, 2020, 10:24:30 AM
 #6

if this is the case, it means that bitcoin core will no longer work for new clients (who have never started it), if the DNS is unavailable.

Is it a certain way of centralization? : /
No. Back up nodes are also hard-coded into the source code. In the event that the DNS fails, the client would then try to connect to the reliable nodes that are listed within the code itself. If all else fails, the client has to manually add the IPs himself using the command-line option which is not difficult.

The client would try to establish more nodes to connect to by the getaddr message sent to it's peers and build a peers.dat which includes some nodes which it has succesfully contacted previously.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
roro9500 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 1


View Profile
April 14, 2020, 11:25:09 AM
 #7

OK i understand, very thank !
hushan
Member
**
Offline Offline

Activity: 61
Merit: 15


View Profile
May 03, 2020, 01:21:13 AM
 #8

like any p2p networks, a list of initial seed nodes are either preconfigured or harded coded so that the startup and bootstraping can work without knowing all the nodes out there.

BTC: 38ykUxZeSv5aqav1keCc4KUxXLPPGkfrm5 LTC: MPpWNvqDCVB1PHJt4A28j9oFfc6Y1KKDno ETH: 0x07C8c68d5253247038947EF9495b054160c8737c
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!