Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request to provide support for Oracle in fabric chaincode #4420

Open
ctsatheesh opened this issue Sep 1, 2023 · 4 comments
Open

Request to provide support for Oracle in fabric chaincode #4420

ctsatheesh opened this issue Sep 1, 2023 · 4 comments

Comments

@ctsatheesh
Copy link

Current Status

As part of developing business logic in fabric smart contracts, if we need information
outside of blockchain, request for seamless integration of Oracle service with chaincode
to process blockchain transactions. Protocol should be able to support pausing transaction
endorsement, fetch information from Oracle service (if not already available) and resume endorsement
and commit of transactions.

This feature would be handy for fabric smart contract developers to dynamically fetch
information outside of blockchain and integrate with smart contract.

Expected

Required methods in supported languages (Go, java, javascript/typescript) to integrate Oracle with chaincode.
Fetch information from external service and resume transaction processing.

Solution

  1. One possible approach to register data points along with details of external REST API endpoint details, input payload, expected data type of response.
    Once registered, fabric protocol can fetch information from external API service periodically with frequency mentioned
    by developer / organization admins. Chaincode can simply invoke get APIs to read information within fabric ledger.
    (or)
  2. Otherway is to on-demand fetch information from external service when processing transactions in chaincode using regular transaction flow of endorsement and commit.

Please let us know if you plan to work on this.

No.

@ctsatheesh
Copy link
Author

ctsatheesh commented Sep 1, 2023

Thinking again on possible solution, above 1st approach to get data from fabric ledger is any way possible today
by making client requests to update ledger with required data points. But in scenario where data is very basic and common across multiple channels in a fabric network, then we don't want to duplicate this data in all channels.

Instead, oracle service in fabric network can help to fetch required information and feed into chaincode.

@Ethereumx
Copy link

The problem is in case of chaincode fetch you 'll endup with n call in case of n endorser peer. so If API response is different or dynamic the endorsement would fail. This require some endorsement tweak! I would suggest we build a solution like CCAAS but for oracle and give it extra endorsement ability

@denyeart
Copy link
Contributor

Leveraging an Oracle service makes sense but I don't think it necessarily needs to be part of Fabric core. In fact, to maintain flexibility it probably should not be part of Fabric core. It could be implemented as a library that user chaincodes could leverage, potentially made available as a Hyperledger lab to start. If somebody is working on a solution that requires an Oracle service, such a contribution would be welcome and encouraged.

@ctsatheesh
Copy link
Author

Yes. If chaincode developer can include package/module for getting data outside of blockchain, that would solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants