fabric-network

The fabric-network module provides a high-level API for interacting with smart contracts. The module implements a new programming model introduced in Hyperledger Fabric v1.4. fabric-network is a recommended API for client applications to be used for the following purposes:

  • Submitting transactions to a smart contract

  • Querying a smart contract for the latest application state

  • Listening to all types of events (i.e., chaincode, transaction, block events) that can be emitted in a Hyperledger Fabric blockchain network.

The entry point for interacting with a Hyperledger Fabric blockchain network is the Gateway class. This class provides a connection to a peer within the blockchain network and enables access to any channels the peer has joined. The channels are represented by Network objects that provide access to chaincodes in the channel. Chaincodes are accessed using the Contract interface implementations, which provide the means to invoke and query the chaincode deployed in the network.

Private data can be submitted to transactions as transient data to prevent it from being recorded on the ledger. You can find more information about private data in the Private Data Collections chapter.

We will discuss the fabric-network module and a new programming model in detail in the Main Application Components chapter. An example of a client application will be provided as well.

Last updated

Was this helpful?