The Hyperledger Fabric SDK for Node.js provides a powerful API to interact with a Hyperledger Fabric blockchain. The SDK is designed to be used in the Node.js JavaScript runtime.

Overview

Hyperledger Fabric is the operating system of an enterprise-strength permissioned blockchain network. For a high-level overview of the fabric, visit http://hyperledger-fabric.readthedocs.io/en/latest/.

Applications can be developed to interact with the blockchain network on behalf of the users. APIs are available to:

  • create channels
  • ask peer nodes to join the channel
  • install chaincodes in peers
  • instantiate chaincodes in a channel
  • invoke transactions by calling the chaincode
  • query the ledger for transactions or blocks

How Different Components of the Fabric Work Together

The Transaction Flow document provides an excellent description of the application/SDK, peers, and orderers working together to process transactions and producing blocks.

Security on the Fabric is enforced with digital signatures. All requests made to the fabric must be signed by users with appropriate enrollment certificates. For a user's enrollment certificate to be considered valid on the Fabric, it must be signed by a trusted Certificate Authority (CA). Fabric supports any standard CAs. In addition, Fabric provides a CA server. See this overview.

Features of the SDK for Node.js

The Hyperledger Fabric SDK for Node.js is designed in an Object-Oriented programming style. Its modular construction enables application developers to plug in alternative implementations of key functions such as crypto suites, the state persistence store, and logging utility.

The SDK's list of features include:

API Reference

The SDK is made up of 4 top-level modules that can be accessed through the navigation menu Modules:

  • fabric-network: Provides high level APIs for client applications to submit transactions and evaluate queries for a smart contract (chaincode).
  • api: Pluggable APIs for application developers to supply alternative implementations of key interfaces used by the SDK. For each interface there are built-in default implementations.
  • fabric-client: Provides APIs to interact with the core components of a Hypreledger Fabric-based blockchain network, namely the peers, orderers and event streams.
  • fabric-ca-client: Provides APIs to interact with the optional component, fabric-ca, that contains services for membership management. Creative Commons License
    This work is licensed under a Creative Commons Attribution 4.0 International License.

Compatibility

The following tables show versions of Fabric, Node and other dependencies that are explicitly tested and that are supported for use with version 1.4 of the Fabric SDK for Node.

Tested Supported
Fabric 1.4 1.4.x, 2.2.x
Node 10, 12, 14, 16 10 LTS, 12 LTS, 14 LTS, 16 LTS
Platform Ubuntu 20.04