Skip to content

Commit

Permalink
Merge "[FAB-3306] cryptogen - copy admin certs to node MSPs"
Browse files Browse the repository at this point in the history
  • Loading branch information
kchristidis authored and Gerrit Code Review committed Apr 21, 2017
2 parents be28757 + 7187ca0 commit b00aca4
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions common/tools/cryptogen/main.go
Expand Up @@ -348,6 +348,17 @@ func generatePeerOrg(baseDir string, orgSpec OrgSpec) {
orgName, err)
os.Exit(1)
}

// copy the admin cert to each of the org's peer's MSP admincerts
for _, peerName := range peerNames {
err = copyAdminCert(usersDir, filepath.Join(peersDir, peerName,
"admincerts"), adminUserName)
if err != nil {
fmt.Printf("Error copying admin cert for org %s peer %s:\n%v\n",
orgName, peerName, err)
os.Exit(1)
}
}
}

func copyAdminCert(usersDir, adminCertsDir, adminUserName string) error {
Expand Down Expand Up @@ -431,6 +442,17 @@ func generateOrdererOrg(baseDir string, orgSpec OrgSpec) {
os.Exit(1)
}

// copy the admin cert to each of the org's orderers's MSP admincerts
for _, ordererName := range ordererNames {
err = copyAdminCert(usersDir, filepath.Join(orderersDir, ordererName,
"admincerts"), adminUserName)
if err != nil {
fmt.Printf("Error copying admin cert for org %s orderer %s:\n%v\n",
orgName, ordererName, err)
os.Exit(1)
}
}

}

func copyFile(src, dst string) error {
Expand Down

0 comments on commit b00aca4

Please sign in to comment.