- clone the repository
https://github.com/hyperledger/fabric-ca
in the directory where you have your golang installed and inside
the directory into the following subdirectory /src/github.com/hyperledger
- cd into the cloned fabric-ca directory
- run the command
make fabric-ca-server
and make fabric-ca-client
inside fabric-ca, to generate the client and server executable which would be located inside the bin folder of the current directory.
- export the following path variable
export PATH=$PATH:~/go/src/github.com/hyperledger/fabric-ca/bin
- Run the following command to check if fabric-ca-server is working
fabric-ca-server
from any directory
- For the purpose of local setup you may want to create the directory where you can store server and client side artifacts.
- In our case we create the directory
~/Documents/hyperledger2/fabric-CA_work_env
- Inside the directiry create a subdirectory server.
- export the values of the following variables as well
export FABRIC_CA_HOME=~/Documents/hyperledger2/fabric-CA_work_env
export FABRIC_CA_SERVER_HOME=$FABRIC_CA_HOME/server
- Inside the server directory we run the following command to auto-initialize all the config files and auto-create the keys
fabric-ca-server init -b “admin:adminpw”
where admin = username and adminpw = password
- Lastly we have to start our server
fabric-ca-server start -b “admin:adminpw”
- export the following path variable
export PATH=$PATH:~/go/src/github.com/hyperledger/fabric-ca/bin
- Run the following command to check if fabric-ca-server is working
fabric-ca-client
from any directory
- cd into the directory
~/Documents/hyperledger2/fabric-CA_work_env/client
- export the values of the following variables as well
export FABRIC_CA_HOME=~/Documents/hyperledger2/fabric-CA_work_env
export FABRIC_CA_CLIENT_HOME=$FABRIC_CA_HOME/client
- Now at first we have to enroll the admin, so as to be able to enroll other client, we do that by
fabric-ca-client enroll -u “http://admin:adminpw@localhost:7054”
- Now register a new client
fabric-ca-client register -u “http://localhost:7054” — id.name “mlgblockchain” — id.secret “mlg” — id.type “client” — id.affiliation “org1.department1”
- Now enroll the client
fabric-ca-client enroll -u “http://mlgblockchain:mlg@localhost:7054”