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

Error while fetching asset modification history through REST #1058

Open
abhignan27 opened this issue Jun 21, 2023 · 0 comments
Open

Error while fetching asset modification history through REST #1058

abhignan27 opened this issue Jun 21, 2023 · 0 comments

Comments

@abhignan27
Copy link

abhignan27 commented Jun 21, 2023

Hello team,
I am using hyperledger fabric 2.4.9 test-network to build an application, the chaincode is written in Go using contract api.
I have exposed the chaincode functions as REST API using express js and I have used the scripts AppUtil.js and CAUtil.js
available under test-application/javascript directory in fabric-samples.
When I invoke the chaincode methods using the peer command in my CLI all my methods work fine as expected.
When I start the express server for peerOrganization - org1(known as orgA in my case) and test the methods from Postman client
from the desktop everything works fine.
However, When I start the express server for peerOrganization - org2(knows as orgB in my case) and test the methods from Postman client from the desktop, the REST API for invoking the getHistoryForTransaction(which takes in transaction ID as a parameter in the url) throws an error which implies that there is no data in HistoryDB in the network, despite the asset being created and present in the ledger, all other API's for querying the asset work as expected. The issue is faced only when invoking the getHistoryForTransaction which calls GetHistoryForKey() for getting the asset modification history.
Once, I am not able to fetch the history, the API stops working for orgA also and even from the peer CLI I get an error.

I am attaching the screenshot of my getTransactionHistory function and the rest api as well as the error.

I have tried checking the peer logs and debugging the functions but I am not able to resolve this issue. Please help
GetTransactionHistory-function-chaincode-go
expressJs-api-gettransactionhistory
error-expressjs-console-cli
error-peer-cli

Summary: The historyDB is getting timed out as it works as expected initially and then it fails sending a response even though asset exisits in the ledger

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

No branches or pull requests

1 participant