divya sekaran
divya sekaran

Reputation: 55

How to view or retrieve data from hyperledger fabric

I have modified fabcar example to store my own data which have keys like this 5e57b8dbb9b30e3575f45d75,5e57b8dbb9b30e3575f45d76.

I used getStateByRange to get data, but it retrieves only certain data between the range. Is there any way to retrieve all the data or based on the timestamp of data

Also how can to view the GUI of couchDB which is running in the fabcar example.

Upvotes: 1

Views: 980

Answers (1)

Isha Padalia
Isha Padalia

Reputation: 1222

Yes, You can view a CouchDB GUI on http://127.0.0.1:5984/_utils URL, If you run your fabric locally if you have any server then check docker ps command output and get your couchDB port number.

And in fabric you want query for all data then use getQueryResult method it will give you all data.

for example:

let queryString = {
      "selector": {}
 }

let resultsIterator = await ctx.stub.getQueryResult(JSON.stringify(queryString));

Hope it will help you :)

Upvotes: 3

Related Questions