admin管理员组

文章数量:1410706

I am new to Hyperledger Fabric and, hence, to Fabric integrations with apps. My intent was on creating an API using Node that would register and enroll new Users. I know and have been successful doing this using the CLI, however, for integrations the only code that I see doing that uses the already deprecated fabric-ca-client. I've checked both forums and the documentation for the recommended @hyperledger/fabric-gateway but can't seem to find a way to register and enroll new Users like it used to be possible before. Any help would be gladly appreciated.

Thank you in advance!

I am new to Hyperledger Fabric and, hence, to Fabric integrations with apps. My intent was on creating an API using Node that would register and enroll new Users. I know and have been successful doing this using the CLI, however, for integrations the only code that I see doing that uses the already deprecated fabric-ca-client. I've checked both forums and the documentation for the recommended @hyperledger/fabric-gateway but can't seem to find a way to register and enroll new Users like it used to be possible before. Any help would be gladly appreciated.

Thank you in advance!

Share Improve this question edited Mar 6 at 5:47 VLAZ 29.2k9 gold badges63 silver badges84 bronze badges asked Mar 5 at 15:32 PensoGlidePensoGlide 113 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Reproduced from my comment in this discussion...

The Fabric Gateway client API (similar to the fabric-network package that preceded it) focuses only on enabling client business applications to invoke (evaluate and submit) transactions, and receive chaincode and block events. It intentionally omits capability for administrative operations, such as chaincode deployment, channel creation, or identity registration / enrolment.

For administrative tasks, there are a few potential options:

  • Use the Fabric CLI commands.
  • If deploying to Kubernetes, a Kubernetes operator designed for managing Fabric might provide the capability you need. Two alternatives that I know of are Hyperledger Fabric Operator and fabric-operator.
  • Continue using the existing fabric-ca-client. While it is no longer actively developed, the Fabric CA is pretty stable in its capability so this client API should continue to work.
  • Use the REST API of the Fabric CA directly with your own client. I don't know of any specific documentation of the API, but the fabric-ca-client implementation just interacts with the Fabric CA using HTTP requests. You could inspect the implementation (or perhaps the unit tests to identify the correct HTTP request structure. The Swagger definition of the CA REST services and this StackOverflow post might also be helpful.

For chaincode deployment and channel management, there is a pretty complete Golang implementation in the fabric-admin-sdk repository. That repository also contains a Node admin implementation (based on code developed here) with code to interact with the CA. I am not sure how stable and/or functional the Node implementation is.

本文标签: nodejsHyperledger FabricRegister and Enroll new UsersStack Overflow