回复: 曾节明  转Kai的话,你是不懂装懂,  2017-04-01 00:05:16 [Reads:83]



 有诚意来学的话,俺可以指点一二。

 作者: java   2017-04-01 00:17:59 [Reads:124]     返回共舞台首页 

你就算了,得有基础知识。专业术语叫“SEED NODES".

比如说,最有名的比特币系统,“固定的地方”是这么几个:(把这几个地方封杀了,比特币软件就歇菜了)。

DNS Addresses
Upon startup, if peer node discovery is needed, the client then issues DNS requests to learn about the addresses of other peer nodes. The client includes a list of host names for DNS services that are seeded. As-of May 17, 2012 the list (from chainparams.cpp[1]) includes:

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

A DNS reply can contain multiple IP addresses for a requested name.
Addresses discovered via DNS are initially given a zero timestamp, therefore they are not advertised in response to a "getaddr" request.


Hard Coded "Seed" Addresses
The client contains hard coded IP addresses that represent bitcoin nodes.
These addresses are only used as a last resort, if no other method has produced any addresses at all. When the loop in the connection handling thread ThreadOpenConnections2() sees an empty address map, it uses the "seed" IP addresses as backup.
There is code is move away from seed nodes when possible. The presumption is that this is to avoid overloading those nodes. Once the local node has enough addresses (presumably learned from the seed nodes), the connection thread will close seed node connections.
Seed Addresses are initially given a zero timestamp, therefore they are not advertised in response to a "getaddr" request.

 跟帖: 返回共舞台首页 

发表评论

笔名: 密码: 注册
主题:   导读:
内容:
图片链接: (必须含有http://)
网友链接: (必须含有http://)
音乐链接: (必须含有http://)
电影链接: (必须含有http://)