Updated on 2023-01-16 GMT+08:00

Using SDKs

Installing the SDK

For details about how to obtain the Golang and Java packages, see Overview.

  • Golang: Decompress the downloaded package to the $GOPATH directory.
  • Java: Add the JAR file in the downloaded package to the dependency of the project as follows:
    1. Run the following command to register the downloaded SDK JAR package to the local Maven repository:
      Mvn install:install-file -Dfile=fabric-sdk-java-2.2.6-jar-with-dependencies.jar -DgroupId=org.hyperledger.fabric-sdk-java -DartifactId=fabric-sdk-java -Dversion=2.2.6-BCS -Dpackaging=jar
    2. Add the SDK dependency in the project by using the following code:
      <dependency>
           <groupId>org.hyperledger.fabric-sdk-java</groupId>
           <artifactId>fabric-sdk-java</artifactId>
           <version>2.2.6-BCS</version>
       </dependency>

Developing a Client Program

Develop your own application code. To use OSSCA-published cryptographic algorithms, simply choose them as the security mechanism when creating the BCS instance, and use OSCCA-published cryptographic algorithm SDKs instead of Fabric SDKs. The usage is the same.

Running the Client Program

To run the client program, you need to set the configuration file path, channel name, chaincode name, and organization ID.

  • Configuration file path: the path for storing the downloaded configuration file
  • Channel name: the channel name specified for the BCS instance
  • Chaincode name: the name specified when the chaincode is installed for the BCS instance
  • Organization ID: 02f23ab00f6e1ffcde8a27bfd3ac2290edc18127 in the following example configuration file
    client:
    organization: 02f23ab00f6e1ffcde8a27bfd3ac2290edc18127