Generate peers and orderer certificates

As stated earlier, nodes are allowed to access business networks using an MSP, which is typically a Certificate Authority (CA).

In this section, we will generate, for all the components that we need to run in the network, the required X.509 certificates using the cryptogen tool, which uses the crypto-config.yaml file as its configuration input. Here is an example which defines the orderer and peer organizations:

OrdererOrgs:
# ---------------------------------------------------------------------------
# Orderer
# ---------------------------------------------------------------------------
- Name: Orderer
Domain: fsc.com
Specs:
- Hostname: orderer
# ---------------------------------------------------------------------------
# "PeerOrgs" - Definition of organizations managing peer nodes
# ---------------------------------------------------------------------------
PeerOrgs:
# ---------------------------------------------------------------------------
# Org1
# ---------------------------------------------------------------------------
- Name: Org1
Domain: org1.fsc.com
Template:
Count: 2
Users:
Count: 2
# ---------------------------------------------------------------------------
# Org2
# ---------------------------------------------------------------------------
- Name: Org2
Domain: org2.fsc.com
Template:
Count: 2
Users:
Count: 2
# ---------------------------------------------------------------------------
# Org3
# ---------------------------------------------------------------------------
- Name: Org3
Domain: org3.fsc.com
Template:
Count: 2
Users:
Count: 2

We have now defined three organizations for peers and single orderer organization. You can use the sample file provided by Hyperledger sample projects at https://github.com/hyperledger/fabric-samples. Afterward, we run the following command to generate the certificates for the peers and the orderer:

cryptogen generate --config=./crypto-config.yaml

As a result, you should see the following output in the console:

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

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