1

Is it possible to invoke external data from the chaincode?

For example, in my business process, the client only releases payment if the work performed is equal to or greater than a certain quantity (i.e. the external data detected). The external data recorded is private data that is recorded in the network.

giup
  • 13
  • 3

1 Answers1

0

The chaincode cant make calls to fetch external data, because that external call could potentially be non-deterministic. However "oracle" pattern is useful here.

  • Have a trusted organization(called the oracle) post updates on a smart contract that is deployed to a seperate channel.

  • Only the oracle is allowed to post updates to this smart contract. This would be the external data that you are trying to query.

  • Your chaincode then accesses this data via a inter-channel chaincode query

Source - Oracle pattern for fabric

Clyde D'Cruz
  • 1,915
  • 1
  • 14
  • 36