1
0
mirror of https://github.com/bitcoinbook/bitcoinbook synced 2025-05-31 13:18:50 +00:00

CH10: update peer finding section

- Update example for Bitcoin Core 24
- Generalize language a bit
This commit is contained in:
David A. Harding 2023-05-11 09:48:16 -10:00
parent 9142816196
commit cf750ecf4d

View File

@ -310,7 +310,7 @@ list of IP addresses of stable Bitcoin listening nodes. Some of the DNS
seeds are custom implementations of BIND (Berkeley Internet Name Daemon) seeds are custom implementations of BIND (Berkeley Internet Name Daemon)
that return a random subset from a list of Bitcoin node addresses 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 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 client contains the names of several different DNS seeds. The diversity of
ownership and diversity of implementation of the different DNS seeds ownership and diversity of implementation of the different DNS seeds
offers a high level of reliability for the initial bootstrapping offers a high level of reliability for the initial bootstrapping
process. In the Bitcoin Core client, the option to use the DNS seeds is process. In the Bitcoin Core client, the option to use the DNS seeds is
@ -368,38 +368,54 @@ $ bitcoin-cli getpeerinfo
[source,json] [source,json]
---- ----
[ [
{ {
"addr" : "85.213.199.39:8333", "id": 0,
"services" : "00000001", "addr": "82.64.116.5:8333",
"lastsend" : 1405634126, "addrbind": "192.168.0.133:50564",
"lastrecv" : 1405634127, "addrlocal": "72.253.6.11:50564",
"bytessent" : 23487651, "network": "ipv4",
"bytesrecv" : 138679099, "services": "0000000000000409",
"conntime" : 1405021768, "servicesnames": [
"pingtime" : 0.00000000, "NETWORK",
"version" : 70002, "WITNESS",
"subver" : "/Satoshi:0.9.2.1/", "NETWORK_LIMITED"
"inbound" : false, ],
"startingheight" : 310131, "lastsend": 1683829947,
"banscore" : 0, "lastrecv": 1683829989,
"syncnode" : true "last_transaction": 0,
"last_block": 1683829989,
"bytessent": 3558504,
"bytesrecv": 6016081,
"conntime": 1683647841,
"timeoffset": 0,
"pingtime": 0.204744,
"minping": 0.20337,
"version": 70016,
"subver": "/Satoshi:24.0.1/",
"inbound": false,
"bip152_hb_to": true,
"bip152_hb_from": false,
"startingheight": 788954,
"presynced_headers": -1,
"synced_headers": 789281,
"synced_blocks": 789281,
"inflight": [
],
"relaytxes": false,
"minfeefilter": 0.00000000,
"addr_relay_enabled": false,
"addr_processed": 0,
"addr_rate_limited": 0,
"permissions": [
],
"bytessent_per_msg": {
...
}, },
{ "bytesrecv_per_msg": {
"addr" : "58.23.244.20:8333", ...
"services" : "00000001", },
"lastsend" : 1405634127, "connection_type": "block-relay-only"
"lastrecv" : 1405634124, },
"bytessent" : 4460918,
"bytesrecv" : 8903575,
"conntime" : 1405559628,
"pingtime" : 0.00000000,
"version" : 70001,
"subver" : "/Satoshi:0.8.6/",
"inbound" : false,
"startingheight" : 311074,
"banscore" : 0,
"syncnode" : false
}
] ]
---- ----
@ -411,7 +427,7 @@ maintaining the peer connections automatically.
If there is no traffic on a connection, nodes will periodically send a If there is no traffic on a connection, nodes will periodically send a
message to maintain the connection. If a node has not communicated on a message to maintain the connection. If a node has not communicated on a
connection for more than 90 minutes, it is assumed to be disconnected connection for too long, it is assumed to be disconnected
and a new peer will be sought. Thus, the network dynamically adjusts to and a new peer will be sought. Thus, the network dynamically adjusts to
transient nodes and network problems, and can organically grow and transient nodes and network problems, and can organically grow and
shrink as needed without any central control.((("", shrink as needed without any central control.((("",