简体   繁体   English

Blockchain和HyperLedger Fabric的区别

[英]Blockchain and HyperLedger Fabric difference

While I am trying to understand the blockchain technology, I came across HyperLedger Fabric. 当我试图理解区块链技术时,我遇到了HyperLedger Fabric。 As per the documentation, it is an implementation of blockchain technology. 根据文档,它是区块链技术的实现。

What does that mean? 那是什么意思? Is block chain just a concept and HyperLedger Fabric, an implementation of that concept? 块链只是一个概念和HyperLedger Fabric,这个概念的实现?

UPDATED: Where does the hyperledger fabric store the transactions? 更新:超级分层结构在哪里存储交易? I understand that its a p2p architecture and every peer has a copy of the transactions, but usually these transactions is a growing set. 我知道它是一个p2p体系结构,每个对等体都有一个事务副本,但通常这些事务是一个不断增长的集合。 Does every peer has a copy of growing transactions? 每个同行都有成长交易的副本吗? I am not clear on this yet. 我还不清楚这一点。 Does the community recommend any database? 社区是否推荐任何数据库?

The Blockchain is an "idea" for how the data can be saved in distributed network. 区块链是如何在分布式网络中保存数据的“想法”。 in Wiki it is defined as: 在Wiki中,它被定义为:

Block chain — is a distributed database that maintains a continuously-growing list of records called blocks. 块链 - 是一个分布式数据库,它维护着一个不断增长的记录列表,称为块。 Each block contains a timestamp and a link to a previous block. 每个块包含一个时间戳和前一个块的链接。 The data in a block cannot be altered retrospectively. 块中的数据不能追溯地改变。

There are many projects which utilize blockchain in its core: 有许多项目在其核心中使用区块链:

  • Bitcoin 比特币
  • Ethereum 复仇
  • Hyperledger Hyperledger
  • etc. 等等

Hyperledger - is not an implementation, it is Specification for how trusted network should work. Hyperledger - 不是一个实现,它是可信网络应该如何工作的规范

Hyperledger specification has several implementations from different vendors: Hyperledger规范有几个来自不同供应商的实现:

  • Fabric - from IBM Fabric - 来自IBM
  • Sawtooth Lake - from Intel Sawtooth Lake - 来自英特尔
  • Corda - from R3 consortium Corda - 来自R3财团
  • Iroha - from Soramitsu Iroha - 来自Soramitsu

PS Each company tries to implement it's own vision of Hyperledger and currently these implementations are not compatible with each other. PS每家公司都试图实现它自己的Hyperledger愿景,目前这些实现彼此不兼容。

Yes, simply put, Hyperledger Fabric is to blockchain what MySql is to database. 是的,简单地说,Hyperledger Fabric是块链接MySql对数据库的作用。

1.2 Why the fabric? 1.2为什么面料?

Early blockchain technology serves a set of purposes but is often not well-suited for the needs of specific industries. 早期的区块链技术有一系列用途,但往往不适合特定行业的需求。 To meet the demands of modern markets, the fabric is based on an industry-focused design that addresses the multiple and varied requirements of specific industry use cases, extending the learning of the pioneers in this field while also addressing issues such as scalability. 为了满足现代市场的需求,该结构基于以行业为中心的设计,可满足特定行业用例的多种多样需求,扩展该领域先驱者的学习,同时解决可扩展性等问题。 The fabric provides a new approach to enable permissioned networks, privacy, and confidentially on multiple blockchain networks. 该结构提供了一种新方法,可以在多个区块链网络上实现许可网络,隐私和机密。

- https://github.com/hyperledger/fabric/blob/master/docs/protocol-spec.md#12-why-the-fabric - https://github.com/hyperledger/fabric/blob/master/docs/protocol-spec.md#12-why-the-fabric

What does that mean? 那是什么意思? Is block chain just a concept and HyperLeder, an implementation of that concept? 块链只是一个概念和HyperLeder,这个概念的实现?

I would say it really depends on your definition of a blockchain (originally spelled "block chain" like you have above). 我会说这实际上取决于你对区块链的定义(原来拼写为“区块链”,如上所述)。

The original definition can be found here in the comments of the Bitcoin cpp code base. 原始定义可以在比特币cpp代码库的注释中找到。

https://github.com/bitcoin/bitcoin/blob/4405b78d6059e536c36974088a8ed4d9f0f29898/main.h#L807-L812 https://github.com/bitcoin/bitcoin/blob/4405b78d6059e536c36974088a8ed4d9f0f29898/main.h#L807-L812

and here. 和这里。

https://github.com/bitcoin/bitcoin/blob/4405b78d6059e536c36974088a8ed4d9f0f29898/main.h#L1014-L1019 https://github.com/bitcoin/bitcoin/blob/4405b78d6059e536c36974088a8ed4d9f0f29898/main.h#L1014-L1019

I believe one defining characteristic of a blockchain is immutability. 我认为区块链的一个特征是不可变性。 If a blockchain's history can be changed with collusion it's not a blockchain imho. 如果区块链的历史可以通过勾结来改变,那么它不是区块链imho。 I'm under the impression that any private/permissioned blockchain cannot make such guarantees, because if something needs or is wanting to be changed you can easily collude to make the change like a normal database (not to be confused with append only changes). 我的印象是任何私有/许可的区块链都不能做出这样的保证,因为如果某些东西需要或者想要改变,你可以很容易地勾结以使改变像普通的数据库一样(不要仅仅附加改变而混淆)。 Bitcoin makes this very difficult because of PoW (proof of work), if you wanted to change the past you would need miners to rewrite all the blocks afterwards which is very costly. 由于PoW(工作证明)比特币使得这非常困难,如果你想改变过去,你需要矿工重写所有的块,这是非常昂贵的。

At a minimum I would at least prefix it like... fabric enables implementation of "private/permissioned" blockchain. 至少我至少会为它添加前缀... fabric可以实现“私有/许可”区块链。 It's really up to the community and groups like fabric to define what "private/permissioned blockchain" means. 这完全取决于社区和像Fabric这样的团体来定义“私有/许可区块链”的含义。

Where does the hyperledger fabric store the transactions? 超级分层结构在哪里存储交易? I understand that its a p2p architecture and every peer has a copy of the transactions, but usually these transactions is a growing set. 我知道它是一个p2p体系结构,每个对等体都有一个事务副本,但通常这些事务是一个不断增长的集合。 Does every peer has a copy of growing transactions? 每个同行都有成长交易的副本吗? I am not clear on this yet. 我还不清楚这一点。 Does the community recommend any database? 社区是否推荐任何数据库?

They are doing a lot of development on fabric and I believe even changing up the tech stack they are using with minor releases, So it is hard for me to know what they are up to at the moment. 他们在面料上进行了大量的开发,我相信甚至更换他们正在使用的技术堆栈,因此很难让我知道他们目前正在做什么。 Their latest guide here: 他们的最新指南:

http://hyperledger-fabric.readthedocs.io/en/latest/glossary.html http://hyperledger-fabric.readthedocs.io/en/latest/glossary.html

or look at their codebase here: 或者在这里查看他们的代码库:

https://github.com/hyperledger/fabric https://github.com/hyperledger/fabric

Looks like they moved to rocket chat, their devs are helpful with technical questions. 看起来他们转向火箭聊天,他们的开发人员对技术问题很有帮助。 https://chat.hyperledger.org/home https://chat.hyperledger.org/home

One interesting thing is, I've talked with their devs in the past about these same questions and the answer I came away with, is they are using couchdb to hold state and apache kafka as the core "blockchain piece". 有一件有趣的事情是,我过去曾与他们的开发人员谈过这些相同的问题和我得出的答案,他们是使用couchdb来保持状态和apache kafka作为核心“区块链片”。 If you look at their latest guide and replace "channel" with "topic" I could kind of see how they are still using apache kafka, but I don't see it referenced anywhere. 如果您查看他们的最新指南并将“频道”替换为“主题”,我可以看到他们仍在使用apache kafka,但我没有看到它在任何地方引用。

While I am trying to understand the blockchain technology, I came across HyperLedger Fabric. 当我试图理解区块链技术时,我遇到了HyperLedger Fabric。 As per the documentation, it is an implementation of blockchain technology. 根据文档,它是区块链技术的实现。

Blockchain is an idea. 区块链是一个想法。 From Wiki A blockchain, originally block chain, is a continuously growing list of records, called blocks, which are linked and secured using cryptography. 来自Wiki区块链(最初是区块链)是一个不断增长的记录列表,称为块,使用加密技术进行链接和保护。 Each block typically contains a cryptographic hash of the previous block, a timestamp and transaction data. 每个块通常包含前一个块的加密散列,时间戳和事务数据。 区块链图像

Hyperledger is a Linux Foundation organization. Hyperledger是一个Linux Foundation组织。 There are various sponsors of this organization, for example IBM, American Express, and Baidu. 该组织有各种赞助商,例如IBM,American Express和Baidu。 I think there's almost 100 sponsors now. 我认为现在有近100个赞助商。

Hyperledger has a few implementations of the blockchain technology. Hyperledger有一些区块链技术的实现。 These are 这些是

Hyperledger Fabric. Hyperledger面料。
Hyperledger Iroha, Hyperledger Iroha,
Hyperledger Sawtooth. Hyperledger Sawtooth。

There are also other ones... 还有其他......
Ethereum. 复仇军。 Hashgraph (?) - even though they claim not to be a blockchain :D Hashgraph(?) - 即使他们声称不是区块链:D
Corda. 琴弦。

Since the above are implementations, how they accomplish consensus, features, and architecture will be different. 由于以上是实现,它们如何实现共识,功能和架构将是不同的。

There are a couple of things that differentiate Fabric. 有几件事区别于Fabric。

It runs something called a private or permissioned blockchain network - which means all peers are trusted. 它运行称为私有或许可的区块链网络 - 这意味着所有对等方都是可信的。 Because of this there's no such thing as proof of work that you see in Bitcoin for example. 因此,比如你在比特币中看到的工作证明就没有了。 It's also fast because there's no extra computations that need to take place. 它也很快,因为不需要进行额外的计算。 Blocks are created after an certain amount of time or transactions and most peers can have a copy of the ledger. 在一定量的时间或事务之后创建块,并且大多数对等体可以具有分类帐的副本。

在此输入图像描述

Fabric also uses Leveldb as world state database, but this can be changed to CouchDB for more complex queries. Fabric还使用Leveldb作为世界状态数据库,但是可以将其更改为CouchDB以进行更复杂的查询。

Hyperdger Fabric Introduction: http://hyperledger-fabric.readthedocs.io/en/release/blockchain.html Hyperdger Fabric简介: http ://hyperledger-fabric.readthedocs.io/en/release/blockchain.html

Yes, Blockchain is a technology of distributed network. 是的,Blockchain是一种分布式网络技术。 And Hyperledger fabric is one of the platforms for implementing this technology. Hyperledger结构是实现该技术的平台之一。

We can implement two types of blockchain using different platforms 我们可以使用不同的平台实现两种类型的区块链

1. Public blockchain : Anyone on the internet can easily join this 1. 公共区块链 :互联网上的任何人都可以轻松加入

ex- bitcoin or Etherium 前比特币或以太币

2. Private blockchain - this is the network of some peers like Intranet. 2. 私有区块链 - 这是Intranet等一些对等网络。

ex- some organisation come and create a network. 前一个组织来创建一个网络。 So only those peers can see the content of this blockchain. 所以只有那些同行才能看到这个区块链的内容。 And every peer of this blockchain network has a separate but same copy of ledger which can't be changed. 此区块链网络的每个对等方都有一个单独但相同的分类帐副本,无法更改。

And there are some platforms to develop such private blockchain, like Hyperledger fabric, hyperledger sawtooth, hyperledger indy, corda. 还有一些平台可以开发出这样的私有区块链,比如Hyperledger面料,hyperledger锯齿,hyperledger indy,corda。

And hyperledger store all transactions copy at each peer. 并且hyperledger将所有事务存储复制到每个对等端。 and these are stored in label db or couch db. 这些存储在标签db或couch db中。

Mainly these Blockchain frameworks are evolving: ( Please Note : Some Changes being made with respect to time like governance, additional consensus integrated etc ) 主要是这些区块链框架正在发展:(请注意:有关时间的一些变化,如治理,其他共识集成等)

  • Hyperledger Fabric Hyperledger面料

  • Corda 科尔达

  • Ehtereum Ehtereum

    Take a look Differences between them 看看他们之间的差异

在此输入图像描述

Blockchain and HyperLedger Fabric difference Blockchain和HyperLedger Fabric的区别

Blockchain is a Technology to store data ~A almost absolute permanent Database, a write once database, which cannot rewrite/edit later Blockchain是一种存储数据的技术〜几乎绝对永久的数据库,一次写入数据库,以后不能重写/编辑

HyperLedger Fabric in the other way, using Blockchain as its data storage or Database + another logic that is depend on the each framework/platform policies. 另一方面,HyperLedger Fabric使用Blockchain作为其数据存储或Database +另一种依赖于每个框架/平台策略的逻辑。 Or We can call it smart contract. 或者我们可以称之为智能合约。

Where does the hyperledger fabric store the transactions? 超级分层结构在哪里存储交易? It store in its blackchain nodes. 它存储在黑链节点中。

Does every peer has a copy of growing transactions? 每个同行都有成长交易的副本吗? Almost every peer have a copy of all transaction histories, by design blockchain need at least 50% of the nodes to approve the transactions therefore another 50% will have a copy of the new transaction after a while. 几乎每个同行都拥有所有交易历史的副本,按设计区块链需要至少50%的节点来批准交易,因此另一个50%将在一段时间后拥有新交易的副本。

I am not clear on this yet. 我还不清楚这一点。 Does the community recommend any database? 社区是否推荐任何数据库? I am not quite sure about this question. 我对这个问题不太确定。

Yes, Blockchain is just a technology and it get further classified into its types ie (public, private and permissioned Blockchain). 是的,区块链只是一种技术,它进一步分为其类型,即(公共,私人和许可的区块链)。

Public Blockchain: 公共区块链:

  1. Bitcoin 比特币
  2. Litecoin 莱特币

Private and Permissioned Blockchain: 私人和许可的区块链:

  1. Hyperledger Fabric Hyperledger面料

The above are just the implementation of the an idea or concept ie (Blockchain). 以上只是一个想法或概念的实现,即(区块链)。

Where does the hyperledger fabric store the transactions? 超级分层结构在哪里存储交易?

It stores the transactions in the peer nodes. 它将事务存储在对等节点中。 We can check these transactions by setting up the couchdb as well for the better understanding of of each transaction. 我们可以通过设置couchdb来检查这些事务,以便更好地理解每个事务。

What is Blockchain? 什么是区块链?
Blockchain is a concept. 区块链是一个概念。 At core it is just a database. 核心只是一个数据库。 It is Decentralised, Distributed, Immutable Database. 它是分散的,分布式的,不可变的数据库。

What is Hyperledger Fabric? 什么是Hyperledger Fabric?
Hyperledger is an umbrella project hosted by the Linux Foundation. Hyperledger是由Linux Foundation托管的伞形项目。 Hyperledger Fabric is one of this project. Hyperledger Fabric是这个项目之一。
Hyperledger Fabric is an implementation of Blockchain Concept. Hyperledger Fabric是Blockchain Concept的一个实现。
It is private / permission network. 它是私人/许可网络。
It is a Distributed Ledger Technology. 它是一种分布式分类帐技术。
Now it's confusing? 现在它令人困惑? It is designed in a way that if implemented correctly it will be decentralised else it is a distributed ledger. 它的设计方式是,如果正确实施,它将是分散的,否则它是分布式分类帐。

Where does it store the transaction? 它在哪里存储交易?
All the peers on the network and the channels everyone has there own separate ledger and the transactions get stored in it. 网络上的所有同伴和每个人拥有的频道都有独立的分类账,交易存储在其中。

Does every peer has a copy of growing transactions? 每个同行都有成长交易的副本吗? Yes, in this way peer can verify if transaction is compromised or not. 是的,通过这种方式,对等方可以验证交易是否受到损害。

Does the community recommend any database? 社区是否推荐任何数据库?
A ledger contains two things in it: 1. Blockchain , 2. World State 分类帐包含两个内容:1。区块链,2。世界状态
Blockchain contains all the transactions in it as transaction log in a file 区块链包含其中的所有事务作为文件中的事务日志
World State store states of the chaincode in database. World State存储数据库中的chaincode状态。 For all the operation on chaincode it use world state to do modification in blockchain and save the latest state in it. 对于链代码的所有操作,它使用世界状态在区块链中进行修改并在其中保存最新状态。
There are 2 DBs recommended by community: 社区推荐2个DB:
1. LEVEL DB : For Development 1. LEVEL DB:For Development
2. Couch DB : For Production 2.沙发DB:用于生产

In documentation it is mentioned as pluggable so maybe we can use other DBs but with some work around. 在文档中,它被称为可插拔,所以也许我们可以使用其他数据库,但有一些解决方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM