From 1d70dfa96bf187de6e54511017556653ea17ade3 Mon Sep 17 00:00:00 2001 From: "Andreas M. Antonopoulos" Date: Sun, 20 Jul 2014 12:41:13 -0500 Subject: [PATCH] address propagation and discovery --- ch06.asciidoc | 6 ++++++ images/AddressPropagation.png | Bin 0 -> 9252 bytes 2 files changed, 6 insertions(+) create mode 100644 images/AddressPropagation.png diff --git a/ch06.asciidoc b/ch06.asciidoc index 47d8e526..ebd1b0ec 100644 --- a/ch06.asciidoc +++ b/ch06.asciidoc @@ -75,6 +75,12 @@ How does a new node find peers? While there are no special nodes in bitcoin, the Once one or more connections is established, the new node will send an +addr+ message containing its own IP address, to its neighbors. The neighbors will in turn forward the +addr+ message to their neighbors, ensuring that the newly connected node becomes well known and better connected. Additionally, the newly connected node can send +getaddr+ to the neighbors asking them to return a list of IP addresses of other peers. That way, a node can find peers to connect to and advertise its existence on the network for other nodes to find it. On a node running the Bitcoin Core client, you can list the peer connections with the command +getpeerinfo+: + +[[address_propagation]] +.Address Propagation and Discovery +image::images/AddressPropagation.png["AddressPropagation"] + + ---- $ bitcoin-cli getpeerinfo [ diff --git a/images/AddressPropagation.png b/images/AddressPropagation.png new file mode 100644 index 0000000000000000000000000000000000000000..05848dda08bc854c861df393f92567467060de18 GIT binary patch literal 9252 zcmb_>c|6o>`#+^bg))(BsZ&Gt6lE=?B9TVOzLjL(hB1~NC(05!WMnPEDa)9|n8uK; z!K67+&6u$iA;!#P9Sr98`Hb^C&pFTc_j>)F*YEf9$Bpa0Ki75L_kCUO`&yE(T3y^N zdO%b_Kw!7|rSsPW1h&8h1O#zAwgZ%{TM*j>1P(LI&!4r8qA`a|ZrhHGK!3uXU-Izq z*yE52ky25+=HTEUq^72JufDdn_L9dQDx{6v)@CY&sNEqhCDkUHp(Z8u%Aqkek^i&v zRpY@_Gbyzg2hKNAU>u%R&^wu#HCEW2X7$_3e01wspNS8}gE+)w7#YVI%m#G$|M=tH zWQPn;rws^_)UT5YP0GpGm=4B-?cy+TcH^yg<@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