hyperledger/fabric-sdk-node

Name: fabric-sdk-node

Owner: Hyperledger

Description: Read-only mirror of https://gerrit.hyperledger.org/r/#/admin/projects/fabric-sdk-node

Created: 2016-09-12 16:48:26.0

Updated: 2018-05-23 17:21:57.0

Pushed: 2018-05-24 11:53:18.0

Homepage: https://hyperledger.org/

Size: 3730

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Hyperledger Fabric Client SDK for Node.js

|Node 6 Build Status|Node 8 Build Status| |—|—| |Build Status|Build Status|

The Hyperledger Fabric Client SDK makes it easy to use APIs to interact with a Hyperledger Fabric blockchain.

As an application developer, to learn about how to install and use the Node.js SDK, please visit the SDK documentation.

This project publishes two separate npm packages:

The following section targets a current or future contributor to this project itself.

Build and Test

To build and test, the following pre-requisites must be installed first:

Clone the project and launch the following commands to install the dependencies and perform various tasks.

In the project root folder:

The following tests require setting up a local blockchain network as the target. Because v1.0 is still in active development, you still need to build the necessary Docker images needed to run the network. Follow the steps below to set it up.

You can build the docker images in your native host (Mac, Ubuntu, Windows, etc.):

Special Tests for Hardware Security Module support (experimental) via PKCS#11 interface

The SDK has experimental support for PKCS#11 interface in order to allow applications to make use of HSM devices for key management. Unit tests for this feature are skipped by default. To run these testss:

The unit test assumes slot '0' and user PIN 98765432. If your configuration is different, use these environment variables to pass in the values:

Contributor Check-list

The following check-list is for code contributors to make sure their changesets are compliant to the coding standards and avoid time wasted in rejected changesets:

Check the coding styles, run the following command and make sure no ESLint violations are present:

Run the full unit test bucket and make sure 100% are passing. Because v1.0 is still in active development, all tests may not pass. You can run each individually to isolate the failure(s):

The gulp test command above also generates code coverage reports. Your new code should be accompanied with unit tests and provide 80% line coverage or higher.

Hyperledger Fabric Client objects and reference documentation

For a high-level design specificiation for Fabric SDKs of all languages, visit this google doc (Work-In-Progress).

fabric-client and fabric-ca-client are written in CommonJS modules and take advantage of ECMAScript 2015 class syntax.

Pluggability

HFC defines the following abstract classes for application developers to supply extensions or alternative implementations. For each abstract class, a built-in implementation is included with the ability to load alternative implementations via designated environment variables:

  1. To replace FileKeyValueStore with a different implementation, such as one that saves data to a database, specify “KEY_VALUE_STORE” and provide the full require() path to an alternative implementation of the api.KeyValueStore abstract class.

  2. The cryptography suite used by the default implementation uses ECDSA for asymmetric keys cryptography, AES for encryption and SHA2/3 for secure hashes. A different suite can be plugged in with “CRYPTO_SUITE” environment variable specifying full require() path to the alternative implementation of the api.CrytoSuite abstract class.

  3. If the user application uses an alternative membership service than the one provided by the component fabric-ca, the client code will likely need to use an alternative client to fabric-ca-client to interact with that membership service.

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. s


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.