Seed discovery for bitcoin core client

2

I just installed bitcoin core client (from github) and started the client. It took around 24 hours to install the full block chain. Where did the blockchain come from? How did did my bitcoin core client find its first peer on the network?

OldStick00001

Posted 2017-12-11T14:05:03.100

Reputation: 31

Answers

1

Bitcoin Core chooses peers in the P2P network in a few ways:

  1. it tries to connect to peers it already knows about, or
  2. it connects to peers it learns about by querying volunteer-run DNS services, or
  3. it connects to one of a number of hardcoded seeds

Once connected to the P2P network, peers rumor possible other nodes they know about, and the node builds a picture of the network using these responses. On a fresh installation there's no known peers, so the discovery begins at the seed nodes.

Anonymous

Posted 2017-12-11T14:05:03.100

Reputation: 10 054

When you say "it tries to connect to peers it already knows about" - how does it "already" know about them? Is that the same as point #3?Max Vernon 2017-12-11T16:41:10.810

1It knows about them from earlier runs. Known peers are stored on disk in peers.dat.Pieter Wuille 2017-12-11T17:56:57.377