Varun Agarwal
Varun Agarwal

Reputation: 1587

Cannot find specific SDK function for Fabric CA

I want to create a dashboard for identity management using Hyperledger Fabric. I know how to use fabric-client and fabric-network to call the FabricCAServices object and register and enroll new users. However I am unable to access other functions for retrieving list of certificates issued.

The fabric-ca-client npm repo does not expose functions that can be called via the CLI as shown here - https://hyperledger-fabric-ca.readthedocs.io/en/release-1.4/clientcli.html The fabric-ca-client certificate xxx set of commands is what I am looking for.

This link shows how to get CertificateService which seems to have some of the code for certificate queries but there is no further documentation on how to use it. For reference these files seem to have the functions that I need.

Upvotes: 0

Views: 148

Answers (1)

Gari Singh
Gari Singh

Reputation: 12053

You actually want to use the IdentityService.

let opts = {...}; //fill in connect options
let idService = new FabricCAClient(opts).newIdentityService();
let admin = new User(...); //admin user
await user.setEnrollment(...); //fill in parameters
resp = idService.getAll(admin); //list all identities accessible by admin

Upvotes: 2

Related Questions