Kartik Chauhan
Kartik Chauhan

Reputation: 3068

Unable to see the user in peer docker container that got created in fabric-ca container

I'm running a Hyperledger fabric network which is the sample basic-network. My configuration is one peer, one ca and one orderer. In crypto-config.yml, I've one peer and only one user.

I generated the certificates for the network by running the command cryptogen generate --config=./crypto-config.yml.

When I looked for the user certificate in the fabric-ca docker container, I couldn't find it which to some extent makes sense because certificates got generated using the cryptogen tool. But now I've registered and enrolled a new user in fabric-ca container and I want him to invoke the chaincode. How can I do that? How can I pass the certificates from fabric-ca to peer container? And let's suppose even if I do that using docker cp command, will it be the correct way to pass the certificates?

What will I need to do if I want the new user to invoke the chaincode from cli container?

Upvotes: 1

Views: 46

Answers (1)

R Thatcher
R Thatcher

Reputation: 5570

With the basic-network, when the cli container is created an environment variable is set: CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/[email protected]/msp

You will need to reset this variable to direct to the folder for your new ID then you should be able to use the peer chaincode invoke command which will use the new credentials.

(I found a small problem when testing this - the invoke command is looking for an admincerts subfolder under msp so I just copied the signcerts folder to admincerts.)

Upvotes: 1

Related Questions