Hyperledger Fabric (d) the main configuration file first-network cases and the main script

The main configuration file:

1.crypto-config.yaml

Cryptogen file generation tool uses the "cryptographic material", i.e. the key and certificate Fabric various network entity (peer, order, ca) required. crypto-config.yaml define the network topology comprises, Cryptogen organization based thereon (including order) and the components belonging to these tissues (peer and ca) generates a certificate and a key. The configuration file variable "count" is used to specify the number of points the rest of the other, each file organization easier to understand.

cryptogen generate --config =. / crypto-config.yaml # After running the tool, these certificates will be placed in a file named "crypto-config" folder.

2.configtx.yaml

configtx.yaml contains a definition of Network (channel). The first specifies MSP file directory for each member of the organization's position (order of creation block requires root certificate store member organizations), anchors and other organizations. And then specify a league (the league can create multiple channels) which consists of the organization, as well as order services configuration (common type, block size, etc.). In addition, the document also provides a number of system access channel and general channel control strategy.

configtxgen tool to create a work based on configtx.yaml four profiles: genesis.block, channel.tx, Org1MSPanchors.tx, Org2MSPanchors.tx. genesis.block system channel (maintained by all nodes order) Creation of a block, the latter three were to create a channel, set ORG1, the anchor node ORG2 (anchor node as an organization to order visible node) of system transactions, Fabric submitted to the operating system configuration as the channel system transactions.

export FABRIC_CFG_PATH = $ PWD # configtxgen told where to find the file configtx.yaml

configtxgen -profile SampleMultiNodeEtcdRaft -channelID byfn-sys-channel -outputBlock ./channel-artifacts/genesis.block # generation system channel creation block genesis.block

export CHANNEL_NAME = mychannel # set path through the environment variable name

configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID $ CHANNEL_NAME # Create a channel configurations Affairs

Anchor nodes configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID $ CHANNEL_NAME -asOrg Org1MSP # Org1 create an update on the organization's affairs channel

The main script:

1.ccp-generate.sh

fabcar case, startFabric.sh script generates a certificate for the organization in the use cryptogen tool, call the script file generated CCP, the CCP documents have generated json and yaml formats. Usefulness CCP document is not yet clear, looks like a file SDK block chain network connection required, subsequent updates.

Org2 anchor nodes configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org2MSPanchors.tx -channelID $ CHANNEL_NAME -asOrg Org2MSP # Creating an update on the organization's affairs channel

The resulting four component configuration directory located in the channel-artifacts

Guess you like

Origin www.cnblogs.com/always-kaixuan/p/12403445.html