Muhammed Hafil
Muhammed Hafil

Reputation: 87

How do i access fabric ca server REST API

I am able to interact with CA via fabric ca client of node SDK, But I can't access REST server, Can anybody provide me a getting started guide with CA API? This is my docker compose file

ca:
image: hyperledger/fabric-ca
environment:
  - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
  - FABRIC_CA_SERVER_CA_NAME=ca
  - FABRIC_CA_SERVER_TLS_ENABLED=true
  - FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.peers.test.com-cert.pem
  - FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/CA_PRIVATE_KEY
  - FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.peers.test.com-cert.pem
  - FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/CA_PRIVATE_KEY
ports:
  - "7054:7054"
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.peers.test.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/CA_PRIVATE_KEY -b admin:adminpw -d'
volumes:
  - ./crypto-config/peerOrganizations/peers.test.com/ca/:/etc/hyperledger/fabric-ca-server-config
container_name: ca
networks:
  - test

Upvotes: 2

Views: 1863

Answers (3)

gdenuf
gdenuf

Reputation: 890

You can trigger normal REST call by browser or postman or curl etc.. based on swagger doc here

Port is 7054 and make sure you ignore the certificate error if you are using localhost as host name - like this:

https://localhost:7054/api/v1/cainfo

Upvotes: 0

Paul Russell
Paul Russell

Reputation: 544

There is no documentation for direct access to the REST API (except for the swagger docs mentioned by Saad - which only documents the individual API calls, not how to use them). The API can be accessed either via the Node SDK, or the fabric-ca-server CLI.

Please see my answer to this question for more details.

Upvotes: 0

Saad Karim
Saad Karim

Reputation: 239

Have you looked at the swagger doc on the Fabric CA Github Repo (https://github.com/hyperledger/fabric-ca/blob/release-1.3/swagger/swagger-fabric-ca.json)? This defines all the APIs that are available on the CA.

Upvotes: 2

Related Questions