1

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.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

3

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 :)

Isha Padalia
  • 877
  • 7
  • 24
  • One comment. If you want **all** data (and your number of records exceeds `totalQueryLimit`), you must use `getQueryResultWithPagination` to get the data paginated. Otherwise, `getQueryResult` is not able to return more than `totalQueryLimit` results (100000 by default, as defined in `core.yaml` or redefined via environment variable). – kekomal Apr 22 '20 at 07:28
  • Even when your records are less than `totalQueryLimit`, you probably don't want to return thousands of records in a single response, so let's paginate. – kekomal Apr 22 '20 at 07:34
  • cab9e4f94488 hyperledger/fabric-couchdb "tini -- /docker-ent…" 6 minutes ago Up 5 minutes 4369/tcp, 9100/tcp, 0.0.0.0:7984->5984/tcp couchdb2 1e7364876fe6 hyperledger/fabric-couchdb => This is the response receiving from docker ps. But i can't able to view the couchdb. – divya sekaran Apr 23 '20 at 11:59
  • Nope it is not working. Getting site can't be reached error. – divya sekaran Apr 24 '20 at 04:14