Re: Fetch all blocks using node sdk #fabric-sdk-node


Madhwendar Thakur
 

Dear team,

Please find sometime to review my concern.

Is it possible to fetch all blocks using node sdk ? If yes then how? Or if there is any other way too please let me know.

ThanksĀ & Regards
Madhwendar
Sr. Group Lead @OATI

On Tue, 12 Jul 2022, 8:02 pm madhwendar via lists.hyperledger.org, <madhwendar=gmail.com@...> wrote:
Hello team,

I am having an use-case where i have to show blocks as per date applied by the user. I am using hyper-ledger fabric v2.x with NodeJs sdk.

Currently i am using for loop to fetch each block using QSCC chaincode function GetBlockByNumber, then fetching the date from channel header timestamp and comparing the timestamp with the one sent in the request by user.

This is weird solution to fetch all the required blocks from ledger as per requested time stamp but I did not find any other solution to fetch all the blocks from the ledger.

Could you please suggest a way where i can fetch all the blocks from ledger or any other way which can fetch all blocks quickly?

Your help is much appreciated.

Thanks and Regards,
Madhwendar Thakur.

Join fabric@lists.hyperledger.org to automatically receive all group messages.