hyperledger-labs / convector

Smart Contract Systems the easy way. Open source development framework.
Other
146 stars 45 forks source link

Pagination Functionality #85

Open Dhrumil2910 opened 5 years ago

Dhrumil2910 commented 5 years ago

The problem

Hyperledger Fabric recently added the pagination feature. So, is it possible to add this feature to convector as pagination is very necessary for production level deployment.

Environment

Details

Current Behavior

Explain what the current behavior is

Expected Behavior

Explain what you were expecting to happend instead

Code To Reproduce Issue [ Good To Have ]

Please remember that with sample code it's easier to reproduce the bug and it's much faster to fix it.

Use convector-cli if possible as the base to reproduce the issue

diestrin commented 5 years ago

Convector doesn't have an explicit API for doing this. But given the nature of Convector, you can do this inside a controller function by doing this.tx.stub.getStub().getQueryResultWithPagination(...). This is a call to the Fabric Shim API https://fabric-shim.github.io/release-1.4/fabric-shim.ChaincodeStub.html#getQueryResultWithPagination__anchor

We might add some shortcuts inside the models in the future, we're always happy to get community PRs for things like this :)