cansado2930
cansado2930

Reputation: 339

How create a profile connection for hyperledger composer manually

I’m trying to deploy a developed network with the composer on first network sample. I have set the connection profile but it’s not enough because I have to set composer-credentials. I have tried to use the credential of developing environment (I have added the role of channel admin and peerAdmin) but it is firing the following error when I try to deploy the network:

Error: Error trying login and get user Context. Error: Private key missing from the key store. Can not establish the signing identity for user PeerAdmin

I have search information and there are two users on peers node one [email protected] and [email protected] where there are 3 files: ca.crt, server.crt and server.key. I have read that steps for creating a new ID card but it is using playground environment with the website but I need to do manually for the composer. So, what steps should I follow to create/update a connection profile for first network sample? Thank you

My file

{
    "name":"PeerAdmin",
    "mspid":"Org1MSP",
    "roles":["PeerAdmin", "ChannelAdmin"],
    "affiliation":"",
    "enrollmentSecret":"",
    "enrollment":{
        "signingIdentity":"114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457",
        "identity":{
            "certificate":"-----BEGIN CERTIFICATE-----\n
            MIICGjCCAcCgAwIBAgIRANuOnVN+yd/BGyoX7ioEklQwCgYIKoZIzj0EAwIwczEL\n
            MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG\n
            cmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh\n
            Lm9yZzEuZXhhbXBsZS5jb20wHhcNMTcwNjI2MTI0OTI2WhcNMjcwNjI0MTI0OTI2\n
            WjBbMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN\n
            U2FuIEZyYW5jaXNjbzEfMB0GA1UEAwwWQWRtaW5Ab3JnMS5leGFtcGxlLmNvbTBZ\n
            MBMGByqGSM49AgEGCCqGSM49AwEHA0IABGu8KxBQ1GkxSTMVoLv7NXiYKWj5t6Dh\n
            WRTJBHnLkWV7lRUfYaKAKFadSii5M7Z7ZpwD8NS7IsMdPR6Z4EyGgwKjTTBLMA4G\n
            A1UdDwEB/wQEAwIHgDAMBgNVHRMBAf8EAjAAMCsGA1UdIwQkMCKAIBmrZau7BIB9\n
            rRLkwKmqpmSecIaOOr0CF6Mi2J5H4aauMAoGCCqGSM49BAMCA0gAMEUCIQC4sKQ6\n
            CEgqbTYe48az95W9/hnZ+7DI5eSnWUwV9vCd/gIgS5K6omNJydoFoEpaEIwM97uS\n
            XVMHPa0iyC497vdNURA=\n
            -----END CERTIFICATE-----\n"
        }
    }
}

Upvotes: 1

Views: 1412

Answers (3)

chan zanway
chan zanway

Reputation: 51

Here's a workaround:

  1. create a BlockChain Starter Plan from IBM Cloud
  2. define the peers & channels as you wish from the UI
  3. click download the connection profile
  4. the file downloaded contains all the information about the Fabric, including the public/private keys and enrollmentSecret.

Upvotes: 0

cansado2930
cansado2930

Reputation: 339

To create a profile, it is done with composer cli tool. You have to execute the following command:

composer identity import -p hlfv1 -u Admin -c ../Downloads/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected] -k ../Downloads/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/072d0b5a2dfc61beb8120736a9aa836f5046148dcba178ba52d57a4e26def8b6_sk

Upvotes: 1

Paul O'Mahony
Paul O'Mahony

Reputation: 6740

I see you're using the sample Developer environment. Why not just go into the fabric-tools directory (you downloaded) and run ./createComposerProfile.sh . It will import the required crypto material into the composer credentials directory for the dev setup, and that represents a channel admin and admin for the peer of the development fabric server.

Upvotes: 0

Related Questions