0
votes

I am trying to connect Hyperledger Composer to a running Fabric deployment, but am receiving certificate errors. Below is an extract of the docker composer file to initiate the CA

extends:
  file: base.yaml
  service: ca-base
container_name: ca.org1.example.com
hostname: ca.org1.example.com
environment:
  - FABRIC_CA_SERVER_CA_NAME=ca-org1
ports:
  - "7054:7054"
volumes:
  - ./e2e_cli/crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/c843d3f021118963ce5d340e95286e8869bb7bd051454cd4166aa2887a2ad451_sk -b admin:adminpw -d'

As you can see the CA was started with a certificate, i have tried importing this into composer using the command;

composer identity import -p org1 -u admin -c /home/a/BC/yeasy/hyperledger/1.0/e2e_cli/crypto-config/peerOrganizations/org1.example.com/ca/ca.org1.example.com-cert.pem -k /home/a/BC/yeasy/hyperledger/1.0/e2e_cli/crypto-config/peerOrganizations/org1.example.com/ca/c843d3f021118963ce5d340e95286e8869bb7bd051454cd4166aa2887a2ad451_sk

When i run the command composer runtime install -n ibor-network -p org1 -i admin -s adminpw (or any composer command) i receive an error similar to the following; Error: Error trying install chaincode. Error: Failed to deserialize creator identity, err The supplied identity is not valid, Verify() returned x509: certificate signed by unknown authority

Any ideas how to get this to work?

here is my connection profile { "type": "hlfv1", "name": "org1", "orderers": [ { "url": "grpc://localhost:7050", "hostnameOverride": "orderer.example.com" } ], "ca": { "url": "http://localhost:7054", "name": "ca-org1" }, "peers": [ { "requestURL": "grpc://localhost:7051", "eventURL": "grpc://localhost:7053", "hostnameOverride": "peer0.org1.example.com" }, { "requestURL": "grpc://localhost:8051", "eventURL": "grpc://localhost:8053", "hostnameOverride": "peer1.org1.example.com" } ], "keyValStore": "/home/a/.composer-credentials", "channel": "businesschannel", "mspID": "Org1MSP", "timeout": "300" }

1

1 Answers

1
votes

In order to install the composer runtime using the composer install runtime command you need to have imported crypto material which is defined as an admin for the peer you plan to install on. If you are using the cryptogen structure then each organisation defines an admin user which you should ensure that each of the peers in that organisation uses that admin user (the fabric examples should already do this). That user can be found in the users directory of the organisations for the peer, you need the file in msp/signcert for the public certificate and the msp/keystore for the private key for the composer identity import command. You can call that user anything you like, but that is the user you specify for the -i flag. Then you need to start your business network, for that you need to use a channel admin identity. I'm pretty sure all the fabric examples make the peer admins channel admins as well so you would use composer network start and specify that user for the -i option. It all depends on how you have set your network up, unfortunately in order to composer on more complex networks you need to have an understanding of how the networks and channels have been configured in order to utilise the composer commands to set composer up appropriately