Smitha
Smitha

Reputation: 11

Hyperledger fabric ca V1 . fabric-ca-client error

At command line i am executing :

fabric-ca-client register --id.name <> --id.type peer --id.affiliation peerorgs.1A --id.attrs <>

I am getting the error below:

"Failed getting affiliation" .

But, the affiliation entry is present in the fabric-ca-server.db. Can some one help me understand why I'm getting this error?

Thanks, Smitha

Upvotes: 0

Views: 600

Answers (1)

Gari Singh
Gari Singh

Reputation: 12053

Assuming you are using Docker and Docker Compose, then you should be able to do the following:

1) Use a docker-compose.yaml with the following contents (this is a slightly modified version of the one in the repo):

#
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
fabric-ca-server:
   image: hyperledger/fabric-ca
   container_name: fabric-ca-server
   ports:
     - "7054:7054"
   environment:
     - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
     - FABRIC_CA_SERVER_DEBUG=true
   volumes:
     - "./fabric-ca-server:/etc/hyperledger/fabric-ca-server"
   command: sh -c 'fabric-ca-server start -b admin:adminpw'

2) The above mounts a volume where you can place your customized fabric-ca-server-config.yaml file. Simply create a directory named fabric-ca-server in the same directory as the docker-compose.yaml and then copy your fabric-ca-server-config.yaml there.

3) Run docker-compose up and check the logs. You should see that your affiliations have been created

Upvotes: 3

Related Questions