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

BE 334 fetch data by block number, block range and transaction id - Backend #338

Conversation

Anusha-Padmanabhan
Copy link
Contributor

Signed-off-by: Anusha anu.vp.nair@gmail.com

What this PR does / why we need it:

This functionality enables the explorer to retrieve data using block id, block range (for example, blocks 1 to 10), and transaction data by giving the transaction id .Using these inputs, matching data are pulled in accordance with the user's search selection. First it will check whether the data is available in the PostgreSQL, if it is there it will fetch from there, otherwise it will fetch from blockchain.

With this new feature, data is fetched from the blockchain if it is not available in PostgreSQL using the block number, block number range, or transaction id.

Which issue(s) this PR fixes:

Fixes #334

Special notes for your reviewer:

Does this PR introduce a user-facing change?

 NONE

Additional documentation, usage docs, etc.:

http://<host>:<port>/api/fetchDataByBlockNo/:channel_genesis_hash/:blockNo
http://<host>:<port>/api/fetchDataByBlockRange/:channel_genesis_hash/:startBlockNo/:endBlockNo
http://<host>:<port>/api/fetchDataByTxnId/:channel_genesis_hash/:txnId
_Note_ : As part of testing, please pass bearer token for authorization

app/rest/platformroutes.ts Show resolved Hide resolved
app/rest/platformroutes.ts Outdated Show resolved Hide resolved
app/platform/fabric/Proxy.ts Outdated Show resolved Hide resolved
app/platform/fabric/Proxy.ts Outdated Show resolved Hide resolved
app/platform/fabric/Proxy.ts Outdated Show resolved Hide resolved
app/persistence/fabric/CRUDService.ts Outdated Show resolved Hide resolved
@adityajoshi12 adityajoshi12 requested a review from a team January 27, 2023 11:20
@Anusha-Padmanabhan Anusha-Padmanabhan force-pushed the BE-334-Fetch-data-by-block-number,-block-range-and-transaction-id branch from eb8a717 to 4c6a0ba Compare January 31, 2023 10:38
@Anusha-Padmanabhan Anusha-Padmanabhan changed the title BE 334 fetch data by block number, block range and transaction - Backend BE 334 fetch data by block number, block range and transaction id - Backend Feb 2, 2023
Signed-off-by: Anusha <anu.vp.nair@gmail.com>

Modified function names

Signed-off-by: Anusha <anu.vp.nair@gmail.com>

code formatted as per review comments

Signed-off-by: Anusha <anu.vp.nair@gmail.com>
@arsulegai arsulegai force-pushed the BE-334-Fetch-data-by-block-number,-block-range-and-transaction-id branch from 4c6a0ba to 14d1338 Compare February 3, 2023 11:07
@ArchanaArige ArchanaArige merged commit f84f298 into hyperledger-labs:main Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fetch data by block number, block range and transaction id
3 participants