Hyperledger Fabric principle (3) and channel organizations

1 configuration, the channel

Channel is Fabric is very important concept ( similar to the micro-channel group? ), It is essentially a sort node designated points and management of private atomic broadcast channel , purpose is to channel the information be isolated so that the outer channel entity can not access the inside passage of information, in order to achieve trading of privacy .

At present the channel into a system channel (System Channel) and application channel (Application Channel). Sort node via system channels to manage the channel application , the user's transaction information through the application channel transmission. For general users , the channel is a channel applications . Application of the relationship between system channels and channel as shown below:

In the article https://www.cnblogs.com/xdyixia/p/11765820.html  generating step founding block, the block and there is initiated the founding block Channel two-part system.

Passage by the sequencing service node is responsible for the management , while the node is also responsible for ordering channel transaction . In the channel generally contains a number of members of the (organization) , if two network entities of identity certificate can be traced to the same root CA , it believes that these two entities belong to the same organization . Further, channel each organization will have one or more of the " anchors ", which is responsible with other organizations cross exchange of shared data books .

(This concept a bit more, attention to the relationship of each noun)

Create a channel when the definition of the members , and only by members of the MSP verification entity, to be able to join the channel and access channel data. A verification example is as follows:

 

Org1 is the channel mychannel of members of the one, and MSP identification Org1 bound to Org1MSP , which represents the CA called CA1 ; if the entity MSP meet the following criteria considered entities have access to the data mychannel:

MSP entity identifier (ID) is Org1MSP ; entity identity certificate of chain of trust source for the CA1 . Entity as long as the channel in any member of the MSP check , the entity considers the right to limit access to channels of data .

************************************************************************

MSP: members of the service providers Member service provider

MSP is just an interface, Fabric-CA is an interface that implementation of MSP

MSP provided the abstract: the specific identity of the format, the user certificate authentication, user credentials revoked signature generation and verification, all cryptographic mechanisms and protocols are abstracted out.

Fabric-CA used to generate the certificate and key to real initialize MSP. Fabric-CA is the default for identity management MSP implementation of the interface.

https://blog.csdn.net/maixia24/article/details/79761367

https://www.jianshu.com/p/dd19fc125356?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

************************************************************************

2, the configuration of the channel

Channel configuration information are packed into a block and store it in the channel of shared books in. In addition to the block configuration information does not contain other transaction information, called channel allocation block (Configuration Block). Channel can be used to configure the block to update the configuration , so the books new in each add a configuration block , by definition channel on the latest configuration of the block to modify the configuration . Books channel must be first blocks arranged blocks, also referred to as initial block ( Genesis Block) .

3, using the generated channel configuration tool configtxgen

configtxgen Fabric provides tools for generating pass channel required profile . configtxgen a tool yaml file as input , commonly referred configtx.yaml , the document will be defined to create a channel of the configuration information , the file typically includes the following components:

1) Profiles: contains the channel configuration templates, to specify which template parameter -profile configtxgen tool.

2) Organizations: defines the organization (members of) the corresponding MSP and with them.

3) Orderer: defining the system configuration of the channel, such as sorting node address , the consensus algorithm .

4) Application: Application of channel configuration is defined is referenced profile.

 

In the following configuration file configtx.yml for example, explain how to create the initial block passage through configtxgen. configtx.yml list is as follows:

 

 

 

The above profile defines the system channel and apply passage of two different types of channels.

The system and the channel must be defined Orderer Consortiums two parts, the application must define the channel and Application Consortium two portions.

 

Yaml definition of a good file, you need to configtxgen tools and msp directory are copied to the directory where the file yaml, configtxgen reads the current default directory configtx.yaml as input:

1) Create the initial block sorting node:

configtxgen -profile Genesis -outputBlock genesis.block

The command specifies the configuration file generated yaml Profile.Genesis by profile parameter block to write the files -outputBlock genesis.block parameter.

 

2) Create the initial application block passage mychannel Transaction Documents channel.tx:

configtxgen -profile Channel -outputCreateChannelTx channel.tx -channelID mychannel

The command generates a transaction file written channel.tx by -outputCreateChannelTx parameter to specify the name of the channel created by mychannel -channelID.

3) Create a feature set to block the transaction documents Org1MSPanchors.tx to update the anchor node mychannel in PeerOrg1 of:

configtxgen -profile Channel -outputAnchorPeersUpdate Org1MSPanchors.tx -channelID mychannel -asOrg PeerOrg1MSP

The command specifies the use PeerOrg1MSP -asOrg identity by creating a configuration block , and by -outputAnchorPeersUpdate parameter configuration block write into the file Org1MSPanchors.tx in.

 

Similarly, to create a trading block configuration file Org2MSPanchors.tx to update mychannel in PeerOrg2 anchor nodes:

configtxgen -profile Channel -outputAnchorPeersUpdate Org2MSPanchors.tx -channelID mychannel -asOrg PeerOrg2MSP

4, channel-related commands

Channel management by the command line, the command associated with the channel is as follows:

 

peer channel create: create a channel for the main parameters -c, -f, -o respectively, for the specified channel ID, configtx path and orderer address.

peer channel fetch: fetch block specific channels, and the channel ID specified by the orderer address -c and -f parameters.

peer channel join: join channel specified by the initial block -b parameter.

peer channel list: those channels listed peer.

peer channel update: configtx signature and sends to upgrade the channel configuration needs to be specified by a channel ID -c, -f, -o parameters, respectively, and the address path of the sorting node configtx.

5, the dynamic channel configuration modification

After the channel is created, the channel- configuration to blocks present in the form of books channel in. If you need to modify the configuration of the channel, by generating a new block arranged to update. Step modified channel configuration is as follows:

1) Get the latest configuration of the block by sdk or CLI.

2) edit the configuration block.

3) update amount computing configurations.

4) Add the amount of configuration updates to the configuration block.

5) sdk or CLI signature and send configuration blocks.

If the new configuration block is verified, the channel configuration only the last configuration blocks.

 

https://www.8btc.com/article/283739

"The core technology and application block chain"

"Block chain to develop key technologies and combat Hyperledger Fabric Case Study"

 

Guess you like

Origin www.cnblogs.com/xdyixia/p/11726882.html