Warning: Trying to access array offset on value of type bool in /www/wwwroot/blockchain/wp-content/themes/Grace8.2/functions_suxingme.php on line 1208

Warning: Trying to access array offset on value of type bool in /www/wwwroot/blockchain/wp-content/themes/Grace8.2/functions_suxingme.php on line 1209

Warning: Trying to access array offset on value of type bool in /www/wwwroot/blockchain/wp-content/themes/Grace8.2/functions_suxingme.php on line 1210

Warning: Trying to access array offset on value of type bool in /www/wwwroot/blockchain/wp-content/themes/Grace8.2/functions_suxingme.php on line 1303

FileCoin

1篇文章
在这篇文章中,我想聊一聊最近比较热门的 IPFS(InterPlanetary File System),一个点对点的分布式文件系统;从 HTTP 协议出现到今天已经过去了半个多世纪,很少有一些设计能够增强整个 HTTP 网络或者为它带来新的功能。 使用 HTTP 协议传递相对小的文件其实是非常廉价和方便的,但是随着计算资源和存储空间的指数增长,我们面临了需要随时获取大量数据的问题,而 IPFS 就是为了解决这一问题出现的。 架构设计 作为一个分布式的文件系统,IPFS 提供了一个支持部署和写入的平台,同时能够支持大文件的分发和版本管理;为了达到上述的目的,IPFS 协议被分成如下的几个子协议: 上述的七个子协议分别负责 IPFS 中的不同功能,我们将在接下来的章节中分别介绍各个协议分别做了哪些工作以及 IPFS 是如何实现的。 身份 在 IPFS 网络中,所有的节点都通过唯一的 NodeId 进行标识,与 Bitcoin 的地址有一些相似, 它其实是一个公钥的哈希,然而为了增加攻击者的成本,IPFS 使用 S/Kademlia 中提到的算法增加创建新身份的成本: difficulty = <integer parameter> n = Node{} do { n.PubKey, n.PrivKey = PKI.genKeyPair() n.NodeId = hash(n.PubKey) p = count_preceding_zero_bits(hash(n.NodeId)) } while (p < difficulty) 每一个节点在 IPFS 代码中都由 Node 结构体来表示,其中只包含 NodeId 以及一个公私钥对: type NodeId Multihash type Multihash []byte type PublicKey []byte type PrivateKey []byte type Node struct { NodeId NodeId PubKey PublicKey PriKey PrivateKey } 总之,身份系统的主要作用就是表示 IPFS 网络中的每一个节点,代表每一个使用 IPFS 的『用户』。 网络 作为一个分布式的存储系统,节点之间的通信和信息传递都需要通过网络进行,同时能够使用多种传输层协议并保证可靠性、连通性、信息的完整性以及真实性。 IPFS 可以使用任意的网络进行通信,它并没有假设自己一定运行在 IP 协议上,而是通过 multiaddr…

关注我们的公众号

微信公众号