HyperledgerFabric官网翻译入门教程--之HyperledgerFabric入门

更新时间:2023-05-07 18:39:40 阅读: 评论:0

HyperledgerFabric官⽹翻译⼊门教程--之HyperledgerFabric⼊
Hyperledger Fabric ⼊门
Introduction/介绍
In general terms, a blockchain is an immutable transaction ledger, maintained within a distributed network of peer nodes. The nodes each maintain a copy of the ledger by applying transactions that have been validated by a connsus protocol, grouped into blocks that include a hash that bind each block to the preceding block.
⼀般⽽⾔,区块链是不可变的交易总账,由peer节点组成的分布式⽹络维护。分布式⽹络中的每个节点都保存交易账簿的⼀份拷贝,账簿中的这些交易都已经通过了⼀致性协议的确认,被组织归类进各个区块,每个区块都包含⼀个hash,通过该hash和前⼀个区块进⾏绑定。
The first and most widely recognized application of blockchain is the Bitcoin cryptocurrency, though others have followed in its footsteps. Ethereum, an alternative cryptocurrency, took a different approach, integrating many of the same as Bitcoin but adding smart contracts to create a platform for d
istributed applications. Bitcoin and Ethereum fall into a class of blockchain that we would classify as public permissionless blockchain technology. Basically, the are public networks, open to anyone, where participants interact anonymously.
第⼀个也是最受⼈们⼴泛认可的区块链应⽤是⽐特币加密货币,尽管其它类似区块链应⽤紧随其后的出现。以太币,另⼀个替代性的加密货币,采⽤了不同的⽅法,整合了与⽐特币相同的⼀些特性,同时增加了智能合约,为分布式应⽤创建⼀个平台。我们将⽐特币和以太坊归类为公共的⽆需许可的区块链技术。基本上,这些都是公共的⽹络,对所有⼈开放,匿名参与互动。
As the popularity of Bitcoin, Ethereum and a few other derivative technologies grew, interest in applying the underlying technology of the blockchain, distributed ledger and distributed application platform to more innovative enterpri u cas also grew. However, many enterpri u cas require performance characteristics that the permissionless blockchain technologies are unable (prently) to deliver. In addition, in many u cas, the identity of the participants is a hard requirement, such as in the ca of financial transactions where Know-Your-Customer (KYC) and Anti-Money Laundering (AML) regulations must be followed.
随着⽐特币,以太坊和其他⼀些衍⽣技术的普及,对将区块链,分布式账簿和分布式应⽤平台的基础
技术应⽤于更具创新性的企业⽤例的兴趣也在增长。然⽽,公共的⽆需许可的区块链技术⽬前还不能满⾜许多企业的⽤例的需求特性。另外,在许多⽤例中,参与者⾝份的识别是⼀个硬性要求,例如⾦融交易的案例中,熟悉你的客户 (KYC) and 反洗钱(AML) 的规则必须遵循。
For enterpri u, we need to consider the following requirements:
为了企业的应⽤,我们需要考虑下⾯的需求:
Participants must be identified/identifiable
参与者必须是可识别和辨认的
Networks need to be permissioned
⽹络需要获得许可
High transaction throughput performance
具有⾼交易吞吐性能
Low latency of transaction confirmation
低延迟的交易确认
Privacy and confidentiality of transactions and data pertaining to business transactions
交易和数据的隐私以及保密性,适⽤于商业交易
While many early blockchain platforms are currently being adapted for enterpri u, Hyperledger Fabric has been designed for enterpri u from the outt. The following ctions describe how Hyperledger Fabric (Fabric) differentiates itlf from other blockchain platforms and describes some of the motivation for its architectural decisions.
尽管许多早期区块链平台⽬前正在适应于企业应⽤,Hyperledger Fabric从⼀开始就是为了企业的应⽤⽽设计的。下⾯的章节将描述Hyperledger Fabric和其它区块链平台的不同,以及采⽤这种架构的动机。
Hyperledger Fabric
Hyperledger Fabric is an open source enterpri-grade permissioned distributed ledger technology (DLT) platform, designed for u in enterpri contexts, that delivers some key differentiating capabilities over other popular distributed ledger or blockchain platforms.
Hyperledger Fabric 是⼀个开源的企业级带许可的分布式的账本技术(DLT)平台,为了能在企业环境中使⽤⽽设计,在其它流⾏的分布式总账或区块链平台之上提供⼀些关键的差异化能⼒。
One key point of differentiation is that Hyperledger was established under the Linux Foundation, which itlf has a long and very successful history of nurturing open source projects under open governance that grow strong sustaining communities and thriving ecosystems. Hyperledger is governed by a diver technical steering committee, and the Hyperledger Fabric project by a diver t of maintainers from multiple organizations. It has a development community that has grown to over 35 organizations and nearly 200 developers since its earliest commits.
差异化的⼀个关键点是Hyperledger是在Linux基⾦会下建⽴的,该基⾦会本⾝在开放式治理下培育开源项⽬的历史悠久且⾮常成功,这些项⽬可以发展强⼤的持续社区和蓬勃发展的⽣态系统。 Hyperledger由多元化技术指导委员会和Hyperledger Fabric项⽬管理,该项⽬由来⾃多个组织的各种维护⼈员组成。 它拥有⼀个开发社区,⾃最早提交以来已经发展到超过35个组织和近200个开发⼈员。
Fabric has a highly modular and configurable architecture, enabling innovation, versatility and optimization for a broad range of industry u cas including banking, finance, insurance, healthcare, human resources, supply chain and even digital music delivery.
Fabric具有⾼度模块化和可配置的架构,可为各种⾏业⽤例提供创新、多功能性和优化,包括银⾏,⾦融,保险,医疗保健,⼈⼒资源,供应链甚⾄数字⾳乐交付。
Fabric is the first distributed ledger platform to support smart contracts authored in general-purpo programming languages such as Java, Go and Node.js, rather than constrained domain-specific languages (DSL). This means that most enterpris already have the skill t needed to develop smart contracts, and no additional training to learn a new language or DSL is needed.
Fabric是第⼀个在通⽤编程语⾔中,如Java,Go和Node.js,⽀持智能合约授权的分布式账本平台,⽽不是限制在特定领域内的语⾔(DSL)。这意味着⼤多数企业已经具有开发智能合约所需的技能,并不需要额外的培训来学习⼀门新语⾔或必需的DSL。
The Fabric platform is also permissioned, meaning that, unlike with a public permissionless network, the participants are known to each other, rather than anonymous and therefore fully untrusted. This means that while the participants may not fully trust one another (they may, for example, be competitors in the same industry), a network can be operated under a governance model that is built off of what trust does exist between participants, such as a legal agreement or framework
for handling disputes.
Fabric平台也是有许可授权的,这意味着,不同于与公共⽆需许可的⽹络,参与者彼此了解,⽽不是匿名参与,且因此完全不可信。这意味着虽然参与者可能彼此不完全信任(例如,他们可能是同⼀⾏业的竞争对⼿),但⽹络可以在管理模式下运⾏,该模式构建了参与者之间存在的信任,如处理纠纷的法律协议或框架。
One of the most important of the platform’s differentiators is its support for pluggable connsus protocols that enable the platform to be more effectively customized to fit particular u cas and trust models. For instance, when deployed within a single enterpri, or operated by a trusted authority, fully byzantine fault tolerant connsus might be considered unnecessary and an excessive drag on performance and throughput. In situations such as that, a crash fault-tolerant (CFT) connsus protocol might be more than adequate whereas, in a multi-party, decentralized u ca, a more traditional byzantine fault tolerant (BFT) connsus protocol might be required.
该平台最重要的区别之⼀是它⽀持可插拔的共识协议,使平台能更有效地进⾏定制,进⽽适应特殊的⽤例和信任模型。例如,当部署在单个企业内,或由⼀个可信的权威机构运营时,完全拜占庭容错的共识可能被认为是不必要的,并且对性能和吞吐量造成过度拖累。在诸如此类的情况下,崩溃容错(CFT)共识协议或许是绰绰有余,然⽽,在多重,去中⼼化的⽤例中,⼀个更传统的拜占庭容错(BFT)共识协议或许是需要的。
Fabric can leverage connsus protocols that do not require a native cryptocurrency to incent costly mining or to fuel
smart contract execution. Avoidance of a cryptocurrency reduces some significant risk/attack vectors, and abnce of cryptographic mining operations means that the platform can be deployed with roughly the same operational cost as any other distributed system.
Fabric可以利⽤不需要本机加密货币的共识协议来激活昂贵的采矿或推动智能合约执⾏。加密货币的缺失减⼩了⼀些重⼤风险/攻击向量,没有加密货币的采矿作业意味着可以使⽤和其他分布式系统相同的运营成本(粗略上计算)部署平台。
The combination of the differentiating design features makes Fabric one of the better performing platforms available today both in terms of transaction processing and transaction confirmation latency, and it enables privacy and confidentiality of transactions and the smart contracts (what Fabric calls “chaincode”) that implement them.
这些差异化的设计特性的组合使Fabric在交易处理和交易确认延迟性两⽅⾯上,都具有较好的性能。它使得交易的隐私和机密性,以及智能合约实现它们成为可能。
Let’s explore the differentiating features in more detail.
让我们更详细地探索这些差异特性。
Modularity/模块性
Hyperledger Fabric has been specifically architected to have a modular architecture. Whether it is pluggable connsus, pluggable identity management protocols such as LDAP or OpenID Connect, key management protocols or cryptographic libraries, the platform has been designed at its core to be configured to meet the diversity of enterpri u ca requirements.
Hyperledger Fabric经过专门设计,具有模块化架构。 ⽆论是可插拔的共识,可插拔的⾝份管理协议(如LDAP或OpenID Connect),密钥管理协议还是加密库,该平台的核⼼都经过精⼼设计,以满⾜企业⽤例需求的多样性。
At a high level, Fabric is comprid of the following modular components:
在⾼层视图上,Fabric由下列模块化的组件构成:
A pluggable ordering rvice establishes connsus on the order of transactions and then broadcasts blocks to peers.      可插拔的ordering服务就交易秩序达成共识,然后将区块⼴播给peers。
A pluggable membership rvice provider is responsible for associating entities in the network with cryptographic
identities.
可插拔的成员资格服务提供商负责将⽹络中的实体与加密⾝份相关联
An optional peer-to-peer gossip rvice disminates the blocks output by ordering rvice to other peers.
⼀个可选的peer-to-peer的⼋卦服务通过ordering 服务向其它peers传播块的输出。
Smart contracts (“chaincode”) run within a container environment (e.g. Docker) for isolation. They can be written in standard programming languages but do not have direct access to the ledger state.
智能合约(“chaincode”)在容器环境(例如Docker)中运⾏以进⾏隔离。它们可以⽤标准编程语⾔编写,但不能直接访问  总账状态。
The ledger can be configured to support a variety of DBMSs.
总账可以配置为⽀持各种DBMS.
A pluggable endorment and validation policy enforcement that can be independently configured per application.
  可插拔的背书(endorment)和验证策略的实施,可以针对每个应⽤程序独⽴配置。
There is fair agreement in the industry that there is no “one blockchain to rule them all”. Hyperledger Fabric can be configured in multiple ways to satisfy the diver solution requirements for multiple industry u cas.
业内⼈⼠普遍认为,没有“⼀种区块链可以满⾜所有⾏业的应⽤需求”。 Hyperledger Fabric可以以多种⽅式进⾏配置,以满⾜多种⾏业⽤例的多样化解决⽅案要求。
Permissioned vs Permissionless Blockchains/有许可授权的的区块链 VS ⽆需许可授权的区块链
In a permissionless blockchain, virtually anyone can participate, and every participant is anonymous. In such a context, there can be no trust other than that the state of the blockchain, prior to a certain depth, is immutable. In order to mitigate this abnce of trust, permissionless blockchains typically employ a “mined” native cryptocurrency or transaction fees to provide economic incentive to offt the extraordinary costs of participating in a form of byzantine fault tolerant connsus bad on “proof of work” (PoW).
在⼀个⽆需许可的区块链中,⼏乎任何⼈都可以参与,每个参与者都是匿名的。在这样的背景下,除了在某个深度之前区块链的状态是不可变的之外,不存在任何可信的东西。为了减轻这种信任缺失,⽆需许可的区块链通常使⽤“挖掘”本地加密货币或交易费⽤来提供经济激励,以抵消参与基于“⼯作证明”的拜占庭式容错共识形式的⾮凡成本(PoW)。
Permissioned blockchains, on the other hand, operate a blockchain amongst a t of known, identified and often vetted participants operating under a governance model that yields a certain degree of trust. A permissioned blockchain provides a way to cure the interactions among a group of entities that have a common goal but which may not fully trust each other. By relying on the identities of the participants, a permissioned blockchain can u more traditional crash fault tolerant (CFT) or byzantine fault tolerant (BFT) connsus protocols that do not require costly mining.
另⼀⽅⾯,带许可的区块链在⼀组已知的,经过鉴定并经常审核的参与者之间进⾏区块链操作,该参与者在产⽣⼀定程度的信任的管理模型下运⾏。 经过许可的区块链提供了⼀种⽅法来保护具有共同⽬标但不完全相互信任的⼀组实体之间的交互。 通过依赖参与者的⾝份,带许可的区块链可以使⽤更传统的碰撞容错(CFT)或拜占庭容错(BFT)共识协议,这些协议不需要昂贵的挖掘。
Additionally, in such a permissioned context, the risk of a participant intentionally introducing malicio
us code through a smart contract is diminished. First, the participants are known to one another and all actions, whether submitting application transactions, modifying the configuration of the network or deploying a smart contract are recorded on the blockchain following an endorment policy that was established for the network and relevant transaction type. Rather than being completely anonymous, the guilty party can be easily identified and the incident handled in accordance with the terms of the governance model.
此外,在这种许可的情况下,参与者通过智能合约故意引⼊恶意代码的风险会降低。 ⾸先,与会者彼此了解,⽆论是提交应⽤交易,修改⽹络配置还是部署智能合约,所有⾏为都将记录在为⽹络和相关交易类型建⽴的背书(endorment)策略之后的区块链中。 根据治理模式的条款,可以很容易地识别犯罪党并处理事件,⽽不是完全匿名。
Smart Contracts/智能合约
A smart contract, or what Fabric calls “chaincode”, functions as a trusted distributed application that gains its
curity/trust from the blockchain and the underlying connsus among the peers. It is the business logic of a blockchain application.
智能合约或Fabric称之为“chaincode”(链码),相当于⼀个可信的分布式应⽤程序,从区块链中获得其安全性/信任以及peers之间的基本共识。 这是区块链应⽤的业务逻辑。
There are three key points that apply to smart contracts, especially when applied to a platform:
有三个关键点适⽤于智能合约,尤其是在应⽤于平台时:
many smart contracts run concurrently in the network,
许多智能合约在⽹络中同时运⾏,
they may be deployed dynamically (in many cas by anyone), and
他们可以动态部署(在很多情况下由任何⼈),并且
application code should be treated as untrusted, potentially even malicious.
应⽤程序代码应该被视为不可信的,甚⾄可能是恶意的。
Most existing smart-contract capable blockchain platforms follow an order-execute architecture in which the connsus protocol:
⼤多数现有的⽀持智能合约的区块链平台遵循排序执⾏(order-execute )架构,其中共识协议:
validates and orders transactions then propagates them to all peer nodes,
验证和排序交易然后将它们传播到所有peer节点,
each peer then executes the transactions quentially.
每个peer然后顺序执⾏这些交易。
The order-execute architecture can be found in virtually all existing blockchain systems, ranging from public/permissionless platforms such as Ethereum (with PoW-bad connsus) to permissioned platforms such as Tendermint, Chain, and Quorum.
排序执⾏(order-execute)架构可以在⼏乎所有现有的区块链系统中找到,从公共/⽆权限的平台(如以太坊(基于PoW的共识))到许可的平台(如Tendermint,Chain和Quorum)。
Smart contracts executing in a blockchain that operates with the order-execute architecture must be deterministic; otherwi, connsus might never be reached. To address the non-determinism issue, many platforms require that the smart contracts be written in a non-standard, or domain-specific lang
uage (such as Solidity) so that non-deterministic operations can be eliminated. This hinders wide-spread adoption becau it requires developers writing smart contracts to learn a new language and may lead to programming errors.
在区块链中执⾏的与排序执⾏(order-execute)架构⼀起运⾏的智能合约必须是确定性的; 否则,可能永远不会达成共识。 为解决⾮确定性问题,许多平台都要求智能合约以⾮标准或特定领域语⾔(如Solidity)编写,以便消除⾮确定性操作。 这阻碍了智能合约的⼴泛应⽤,因为它要求开发⼈员必须学习⼀种新的语⾔来编写智能合约,且这可能导致编程错误。
Further, since all transactions are executed quentially by all nodes, performance and scale is limited. The fact that the smart contract code executes on every node in the system demands that complex measures be taken to protect the overall system from potentially malicious contracts in order to ensure resiliency of the overall system.
此外,由于所有节点都顺序执⾏所有交易,因此性能和规模受到限制。 智能合约代码在系统中的每个节点上执⾏的事实要求采取复杂的措施来保护整个系统免受潜在的恶意合同侵害,以确保整个系统的弹性。
A New Approach/新途径
Fabric introduces a new architecture for transactions that we call execute-order-validate. It address the resiliency, flexibility, scalability, performance and confidentiality challenges faced by the order-execute model by parating the transaction flow into three steps:
Fabric为我们称之为execute-order-validate的交易引⼊了⼀种新架构。 它通过将交易流程分为三个步骤来解决排序执⾏(order-execute)模型⾯临的弹性,灵活性,可扩展性,性能和机密性挑战:
execute a transaction and check its correctness, thereby endorsing it,
order transactions via a (pluggable) connsus protocol, and
validate transactions against an application-specific endorment policy before committing them to the ledger.
执⾏交易并检查其正确性,从⽽认可它,
通过(可插⼊)共识协议排序交易,以及
在将它们提交到账本之前,根据应⽤特定的背书(endorment)策略验证交易

本文发布于:2023-05-07 18:39:40,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/866662.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:交易   区块   合约   智能   平台   共识
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图