简体   繁体   English

Hyperledger Fabric中有序生成模块的重要性是什么?

[英]What is the importance of orderer genesis block in Hyperledger Fabric?

In the build your first network documentation. 构建您的第一个网络文档。
TwoOrgsOrdererGenesis: generates the genesis block for a Solo ordering service.
TwoOrgsChannel: generates the genesis block for our channel, mychannel.

The mychannel.tx is the genesis block in the channel and any peer who want to join the channel require this. mychannel.tx是通道中的创世块,任何想要加入该通道的对等方都需要此。

In the complete tutorial once the orderer genesis block is created it never used. 在完整的教程中,一旦创建了顺序生成块,就永远不会使用它。 And also Is there any other blockchain also present other than the channel ledger? 还有,除了通道分类帐以外,是否还存在其他区块链?

Does this orderer genesis block require for system channel? 此订购者创始块是否需要系统通道?

In the build your first network documentation. 在构建您的第一个网络文档。

Let me start from pointing to official documentation here 让我从这里指向官方文档开始

TwoOrgsOrdererGenesis: generates the genesis block for a Solo ordering service. TwoOrgsOrdererGenesis:为Solo订购服务生成创世块。 TwoOrgsChannel: generates the genesis block for our channel, mychannel. TwoOrgsChannel:为我们的频道mychannel生成创世块。

Here is the source of the confusion, in fact TwoOrgsChannel profile generates configuration transaction which is submitted to the system channel and it includes configuration required for formation of the new channel. 这是造成混淆的根源,实际上, TwoOrgsChannel配置文件会生成配置事务,该事务已提交给系统通道,并且其中包括形成新通道所需的配置。 Such as channel policies and members of the channel consortium which by the way have to be a subset of the consortium defined within genesis block of the system channel. 诸如渠道策略和渠道联盟的成员,顺便说一句,它们必须是在系统渠道的创世块内定义的联盟的子集。

The mychannel.tx is the genesis block in the channel and any peer who want to join the channel require this. mychannel.tx是通道中的创世块,任何想要加入该通道的对等方都需要此。

This is config transaction to be submitted to the ordering service such that it will create a new channel and return genesis block for new channel so peers could use it to join it. 这是配置事务,将提交给订购服务,这样它将创建一个新通道并为新通道返回创世块,以便对等方可以使用它来加入它。

In the complete tutorial once the orderer genesis block is created it never used. 在完整的教程中,一旦创建了顺序生成块,就永远不会使用它。 And also Is there any other blockchain also present other than the channel ledger? 还有,除了通道分类帐以外,是否还存在其他区块链?

It's always used to bootstrap your ordering service nodes for example after shutdowns or restarts. 它总是用于引导您的订购服务节点,例如在关闭或重新启动之后。

Does this orderer genesis block require for system channel? 此订购者创始块是否需要系统通道?

In fact, system channel bootstrapped using this genesis block. 实际上,使用该创世块引导了系统通道。 Now to complete on @Narendranath Reddy answer, genesis block contains consortium information which he called a network definition, basically it contains all certificates of organizations root CAs. 现在要完成@Narendranath Reddy的回答,创世块包含联盟信息,他称之为网络定义,基本上它包含组织根CA的所有证书。 Therefore allowing to initialize channels MSPs and use those root CAs certificates to validate ACLs, endorsements and clients signatures. 因此,允许初始化通道MSP并使用那些根CA证书来验证ACL,认可和客户端签名。

Good Questions thanks @Shubham Chadokar 好的问题,谢谢@Shubham Chadokar

Channel.tx is needed which contain channel policy information 需要Channel.tx,其中包含通道策略信息

while joining we will need the latest block which contains network configuration which is needed in order to join peers to channel. 加入时,我们将需要包含网络配置的最新块,以便将对等方加入通道。

SEE below detailed information 请参阅下面的详细信息

Statement1 : 声明1

The mychannel.tx is the genesis block in the channel and any peer who want to join the channel require this. mychannel.tx是通道中的创世块,任何想要加入该通道的对等方都需要此。

Answer 回答

Note : mychannel.tx is not the genesis block 注意mychannel.tx is not the genesis block

I would like to highlight the difference between genesis.block mychannel.tx 我想强调genesis.block mychannel.tx之间的区别

  • genesis.block is a configuration of an HLF network (contains network definition) genesis.block是HLF网络的配置(包含网络定义)

  • mychannel.tx >>> initial binary configuration definition (contains sign-able channel definition) mychannel.tx >>>初始二进制配置定义(包含可签名的通道定义)

ordering system channel : orderers maintain the long list of all organizations that are allowed to create channels. 订购系统渠道 :订购者维护允许创建渠道的所有组织的详细清单。 This list of organizations is known as the “consortium”, and the list itself is kept in the configuration of the “orderer system channel”. 该组织列表称为“联盟”,该列表本身保留在“订购者系统渠道”的配置中。

Now the interesting part what is present inside mychannel.tx 现在,有趣的部分是mychannel.tx内部的内容

  • mychannel.tx is a binary file mychannel.tx是一个二进制文件
  • One can decode this file using protolator Commands: 可以使用protolator命令对该文件进行解码:

Step1 : GOTO fabricsamples/bin ./configtxlator start 步骤1 :GOTO fabricsamples / bin ./configtxlator开始

Step2 : GOTO mychannel.tx file location then issue below command 步骤2 :转到mychannel.tx文件位置,然后发出以下命令

curl -X POST --data-binary @mychannel.tx http://127.0.0.1:7059/protolator/decode/common.Envelope > mychannel.json curl -X POST --data-binary @ mychannel.tx http://127.0.0.1:7059/protolator/decode/common.Envelope > mychannel.json

The results of decoding the file mychannel.tx which is a common.Envelope produced by the configtxgen tool contains a common.ConfigUpdate object. 文件mychannel.tx其是由configtxgen工具产生的common.Envelope包含common.ConfigUpdate对象进行解码的结果。 This object has the name " config_update " within the "payload.data" JSON object. 此对象具有“payload.data” JSON对象中的名称“config_update”。

This is the object that is needed as the source of the template to be used for creating new channels. 这是用作创建新通道的模板源所需要的对象。 The common.ConfigUpdate is the object that will be signed by all organizations and submitted to the orderer to create a new channel. common.ConfigUpdate是将由所有组织签名并提交给订购者以创建新通道的对象。

mychannel.tx contains read/write set of mychannel mychannel.tx包含mychannel的读/写集

Result: 结果:

{ "channel_id": "mychannel", "read_set": { "groups": { "Application": { "groups": { "Org1MSP": {} } } }, "values": { "Consortium": { "value": { "name": "SampleConsortium" } } } }, "write_set": { "groups": { "Application": { "groups": { "Org1MSP": {} }, "mod_policy": "Admins", "policies": { "Admins": { "policy": { "type": 3, "value": { "rule": "MAJORITY", "sub_policy": "Admins" } } }, "Readers": { "policy": { "type": 3, "value": { "sub_policy": "Readers" } } }, "Writers": { "policy": { "type": 3, "value": { "sub_policy": "Writers" } } } }, "version": "1" } }, "values": { "Consortium": { "value": { "name": "SampleConsortium" } } } } } {“ channel_id”:“ mychannel”,“ read_set”:{“ groups”:{“ Application”:{“ groups”:{“ Org1MSP”:{}}}}},“ values”:{“ Consortium”:{“ value“:{” name“:” SampleConsortium“}}}},” write_set“:{” groups“:{” Application“:{” groups“:{” Org1MSP“:{}},” mod_policy“:”管理员“,” policies“:{” Admins“:{” policy“:{” type“:3,” value“:{” rule“:” MAJORITY“,” sub_policy“:” Admins“}}},”读者“ :{“ policy”:{“ type”:3,“ value”:{“ sub_policy”:“ Readers”}}},“ Writers”:{“ policy”:{“ type”:3,“ value”:{ “ sub_policy”:“ Writers”}}}},“ version”:“ 1”}},“ values”:{“ Consortium”:{“ value”:{“ name”:“ SampleConsortium”}}}}}


I have done the same for the genesis.block check this http://ideone.com/L1hcRX which contain genesis.block as json format which contain all network information. 我对genesis.block执行了相同的操作,请检查此http://ideone.com/L1hcRX ,其中包含genesis.block为包含所有网络信息的json格式。


Statement 2 : the complete tutorial once the orderer genesis block is created it never used. 声明2 :完整的教程一经创建,就不再使用。 And also Is there any other blockchain also present other than the channel ledger? 还有,除了通道分类帐以外,是否还存在其他区块链?

Answer 回答

I hope now you have got sufficient information. 希望您现在掌握了足够的信息。 genesis block main purpose is network configuration, once network is up and running we will not use again except you onboard new organization which contain orderer you can use old genesis.block later it will fetch latest configuration from other orderers. 创世纪阻止的主要目的是网络配置,一旦网络启动并运行,我们将不再使用,除非您加入了包含订购者的新组织,您可以使用旧的创世纪。稍后阻止它将从其他订购者获取最新的配置。


Does this orderer genesis block require for system channel? 此订购者创始块是否需要系统通道?


YES

Orderer genesis block is the genesis block for the system channel as it is the basic configuration block for the network. 订购者创始块是系统通道的创始块,因为它是网络的基本配置块。 It a special channel managed by the orderer admins which includes a list of the organizations permitted to create channels. 它是由订购者管理员管理的特殊渠道,其中包括允许创建渠道的组织的列表。

The genesis block of the orderer system channel is special: it must be created and included in the configuration of the node before the node can be started . 订购者系统通道的创世块很特殊:必须先创建它并将其包含在节点的配置中,然后才能启动节点

Most importantly, the ordering system channel contains the crypto material that defines an organizations in a consortium: the root certificates and the admin certificates. 最重要的是,订购系统通道包含用于定义联盟中的组织的加密材料:根证书和管理证书。 They allow organizations to join new channels without supplying new crypto material each time. 他们允许组织加入新渠道而无需每次都提供新的加密材料。

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

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