hyperledger / fabric-gateway

Go, Node and Java client API for Hyperledger Fabric v2.4+
https://hyperledger.github.io/fabric-gateway/
Apache License 2.0
145 stars 87 forks source link

Add Support for .NET #716

Closed Varorbc closed 1 month ago

Varorbc commented 1 month ago

As a .NET Developer I want .NET client API for Hyperledger Fabric v2.4+

andrew-coleman commented 1 month ago

A .NET client is not on the roadmap for this project. The Peer Gateway has a well defined gRPC/protobuf interface enabling developers to create their own language bindings, so please feel free to create one for your needs. However, the maintainers of this repo would not be taking on its maintenance here.

Varorbc commented 1 month ago

But I found out that it involves signatures and encryption. Can you help me with that?

bestbeforetoday commented 1 month ago

To build a native C# client, you will likely need to:

  1. Build C# bindings for the Fabric protocol buffer messages. The definitions for the gRPC services provided by the Gateway are defined here.
  2. For building and sending endorse and evaluate requests, your references are:
  3. For sending submit requests using the message returned from endorse, your reference is:
  4. For subsequently checking commit status for a submitted transaction, your references are:
  5. For retrieving chaincode events, your references are:

An alternative — perhaps simpler — approach you might want to consider is to build a Fabric client in one of the currently supported languages (Go, Node, Java), and then expose this functionality to your .NET clients as a RESTful service.

Varorbc commented 1 month ago

@bestbeforetoday Thank you very much for your help

Varorbc commented 1 month ago

@bestbeforetoday Can I use C# to implementation Hyperledger Fabric Contract and Chaincode?

bestbeforetoday commented 1 month ago

See https://hyperledger-fabric.readthedocs.io/en/latest/sdk_chaincode.html

Varorbc commented 1 month ago

What I want to ask is, can I use C# to implement the contract API? Instead of using Java,nodejs or go.

bestbeforetoday commented 1 month ago

The chaincode uses gRPC to communicate with the Fabric peer. You could implement your own smart contract API in C#. As the documentation page I linked says, "Smart contract APIs are available for Go, Node.js, and Java". There is no existing C# smart contract API so you would have to implement it yourself.

As mentioned in the contributing document, please do not use issues to ask questions. Use one of the resources for question mentioned in that document.