What Is Hyperledger Fabric Query


What Is Hyperledger Fabric Query?

✍: FYIcenter.com


A Hyperledger Fabric Query is a GET operation provided by a chaincode on a channel on a Hyperledger Fabric network to return the current state of a given asset.

In order to perform a query operation, you need to prepare the following:

  • Asset ID - Identifies the Asset for which you want to get the current state.
  • Chaincode ID - Identifies the chaincode who manages the given asset.
  • Channel ID - Identifies the channel on which the given chaincode is running.
  • Peer Address - Identifies the peer who is a member node of the given channel.

The process flow a query operation has 3 major steps:

  • Sending Query Request - The client needs to send the query request to the peer based on the peer address. The request must contain all required information listed above.
  • Querying Data from World State - The peer runs given chaincode and queries the given asset from the world state. for the current state.
  • Returning Query Response - The peer receives the current state of the asset and returns it back the client.

Hyperledger Fabric Query Process Flow

As you can see, a query operation only involves one peer. Other peers and the orderer are not involved.


Interfaces to Communicate with Ledger Peer

Hyperledger Fabric Process Flow

Hyperledger Fabric Process Flow

⇑⇑ Hyperledger Tutorials

2020-01-29, 1041🔥, 0💬