Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hyperledger fabric cryptgen tool not creating the admincerts

I am using the cryptogen tool from the hyper-ledgerfabric firstsample, Its does not create the admin certificate inside the crypto-config/peerorganisation/org1.example.com/msp/admicerts.

./cryptogen generate --output="crypto-config"

my crypto-config file

          OrdererOrgs:
            - Name: Orderer
            OrdererOrgs:
            - Name: Orderer
              Domain: example.com
              Specs:
            - Hostname: orderer
              PeerOrgs:
            - Name: Org1
            Domain: org1.example.com
           EnableNodeOUs: true
           Template:
           Count: 1
           Users:
           Count: 1
          - Name: Org2
          Domain: org2.example.com
          EnableNodeOUs: true
           Template:
            Count: 1
            Users:
           Count: 1
         - Name: Org3
           Domain: org3.example.com
           EnableNodeOUs: true
           Template:
          Count: 1
          Users:
          Count: 1
like image 854
naga Avatar asked Sep 26 '19 08:09

naga


1 Answers

There is a new feature in 1.4.3 which allows you to specify an OU for admin rather than explicitly putting certificates in the admincerts folder.

In your crypto-config, you set EnableNodeOUs: true and this automatically enables OUs for all supported roles.

You'll see something like

NodeOUs:
  Enable: true
  ClientOUIdentifier:
    Certificate: cacerts/ca.sampleorg-cert.pem
    OrganizationalUnitIdentifier: client
  PeerOUIdentifier:
    Certificate: cacerts/ca.sampleorg-cert.pem
    OrganizationalUnitIdentifier: peer
  AdminOUIdentifier:
    Certificate: cacerts/ca.sampleorg-cert.pem
    OrganizationalUnitIdentifier: admin
  OrdererOUIdentifier:
    Certificate: cacerts/ca.sampleorg-cert.pem
    OrganizationalUnitIdentifier: orderer

in the msp/config.yaml file ( in your case in crypto-config/peerorganisation/org1.example.com/msp/crypto.yaml).

Note the AdminOUIdentifier field. This means that any cert issued by the CA for your org which contains an OU=admin is now considered an admin. The certificate generated for the admin user under your org MSP is also generated with OU=admin (e.g. Subject: C=US, ST=California, L=San Francisco, OU=admin, CN=Admin@sampleorg ).

like image 196
Gari Singh Avatar answered Oct 22 '22 15:10

Gari Singh