比特币客户端如何确定要连接的第一个IP地址? [英] How does the bitcoin client determine the first IP address to connect?

查看:680
本文介绍了比特币客户端如何确定要连接的第一个IP地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,比特币是一种p2p协议,并且 p2p协议必须具有专用中央服务器.但是据说比特币是去中心化的.

In my knowledge, bitcoin is a p2p protocol and a p2p protocol must have a dedicated central server. But it is said that bitcoin is decentralized.

推荐答案

在2009年,我们依靠IRC引导网络,因此每个节点都将连接到Freenode(后来的LFnet)并加入一个频道.他们的昵称是他们编码的公共IP地址.

Back in 2009 we relied on IRC to bootstrap the network, so every node would connect to Freenode (later LFnet) and would join a channel. Their nicknames were their encoded public IP address.

如今,Bitcoin Core客户端和许多其他实现依赖于DNS种子. DNS种子是特殊的DNS服务器,其配置为从网络返回许多随机选择的节点. DNS种子的运营商还运行搜寻器来枚举种子将返回的可公开访问的节点.

Nowadays the Bitcoin Core client, and many other implementations, rely on DNS seeds. DNS seeds are special DNS servers that are configured to return a number of randomly selected nodes from the network. The operators of the DNS seeds also run crawlers to enumerate the publicly reachable nodes that are to be returned by the seeds.

Bitcoin Core客户端当前包含的种子是:

The seeds that are currently included in the Bitcoin Core client are:

  • bitcoin.sipa.be
  • dnsseed.bluematt.me
  • dnsseed.bitcoin.dashjr.org
  • seed.bitcoinstats.com
  • bitseed.xf2.org
  • bitcoin.jonasschnelli.ch

如果您向这些服务器中的任何一个发送请求,它们将返回一些已知在端口8333上运行比特币的随机IP:

If you send a request to any of these servers they will return a number of random IPs that are known to run Bitcoin on port 8333:

dig seed.bitcoinstats.com +short
71.19.155.244
173.254.232.51
45.79.97.30
198.252.112.64
35.128.8.141
108.17.18.165
98.208.76.134
8.29.28.12
52.62.2.124
96.234.214.85
47.89.24.56
212.164.215.159
52.62.42.229
68.52.96.191
115.66.205.171
24.250.16.39
201.43.160.155
5.3.253.18
100.40.179.172
50.135.169.181
186.149.249.18
101.201.44.207
96.35.97.46
124.188.118.196
82.8.4.79

除了DNS种子外,Core客户端还具有静态列表IPs 首先尝试,它将在本地数据库中缓存以前联系过的所有对等点,以便在无需查询DNS种子的情况下重新连接.

Besides the DNS seeds, the Core client also has a static list of IPs to try first and it will cache any previously contacted peers in a local database in order to reconnect without having to query the DNS seeds.

(免责声明:我是DNS种子之一的运营商)

(Disclaimer: I am the operator of one of the DNS seeds)

这篇关于比特币客户端如何确定要连接的第一个IP地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆