Samples for Hyperledger Fabric
Find a file
James Taylor 5d92abc52d Clarify retry logic
Improve the separation between Fabric logic and the job queue implementation details

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:24 +00:00
.github/workflows wrong Dockerfile path - try again 2021-12-14 14:31:23 +00:00
asset-transfer-basic/rest-api-typescript Clarify retry logic 2021-12-14 14:31:24 +00:00
.gitignore Refactor transaction logic 2021-12-14 14:14:56 +00:00
LICENSE Initial commit 2021-12-14 14:14:39 +00:00
README.md Update readmes 2021-12-14 14:31:23 +00:00

Fabric REST sample

Prototype sample REST server to demonstrate good Fabric Node SDK practices for parts of FAB-18511

The intention is to deliver the sample to the asset-transfer-basic/rest-api-typescript directory of the fabric-samples repository

See the sample readme for usage intructions

Overview

The primary aim of this sample is to show how to write a long running client application using the Fabric Node SDK, i.e. without reconnecting for each transaction

It should also show:

  • basic transaction retries
  • long running event handling
  • requests from multiple users

Next steps

Handling transaction errors

Should transactions be retried unless they fail with specific errors, e.g. duplicate transaction (the current implementation)?

or

Should transactions be retried when they fail with specific errors?

Also, transactions are currently only retried if they are successfully endorsed- does that seem reasonable?

If the transaction failed because of MVCC_READ_CONFLICT, is a chance that it could pass when retrying? (Is MVCC_READ_CONFLICT an endorsement error?)

Handling other errors

Need to make sure it's clear what went wrong and fail properly it necessary, for example when starting without a redis instance

Finish off unit tests

Coverage is looking much better now but there are a few more todos

More comments

Need to document what's going on and why, especially in the fabric.ts file!

Feedback

  • More people trying out the sample (and ideally trying to break it a bit!)
  • Code review to merge sample into fabric-samples

Known problems

See issues