Creating the crypto-config file

Refer to the crypto-config.yaml file in the repository. The crypto-config.yaml file defines the components and participants of our network and passes them to the cryptogen utility to generate the network artifacts, including the identity certificates and private keys for each network participant.

Open the crypto-config.yaml file. Inside the file, the following two organization-type tags are defined:

  • OrdererOrgs
  • PeerOrgs

OrdererOrgs defines organizations that maintain and manage the orderer nodes for our blockchain network. The orderer is a node in the Hyperledger Fabric ecosystem that orders transactions and generates the blocks for our channel. The crypto-config.yaml file defines the attributes of such an organization, under the OrdererOrgs tag.

In our network, we'll bring the orderer.example.com node online, to order our transactions. The Orderer organization will have ownership of this node.

PeerOrgs defines organizations that own and manage peer nodes on the blockchain network. In our case, these are the bankA and bankB organizations. The peer node can read and write transactions to the blockchain ledger and execute chaincodes (smart contracts). The crypto-config.yaml file defines the attributes of such an organization, under the PeerOrgs tag.

In our network, we'll be setting up two peer organizations, banka.example.com and bankb.example.com. Each organization will have two peers, indicated by the tag Count. The nomenclature followed for the nodes will be peer0.banka.example.com, peer1.banka.example.com, peer0.bankb.example.com, and peer1.bankb.example.com. Lastly, we set the Users tag, to indicate that there will be one user (apart from the admin user) who will access the blockchain through these nodes.

As you can see, the crypto-config file defines a base network structure. Now, let's move on to the configtx file that will be used to generate the channel artifacts, including the genesis block (first block in the blockchain).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.219.166