hyperledger / hyperledger/fabric-private-chaincode

Generalize demo-related mock & fabric-gateway backends as well as return/error handling.

Open
#199 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
174
Forks
98
Avg merge
2d 21h
Merged PRs (30d)
1

Description

The code in demo/client/backend is currently auction-specific but has the potential of being much more widely usable to either efficiently test chaincode (mock) or running UI apps (fabric-gateway). Note this is not even necessarily FPC specific but would apply also to other fabric chaincode!

Most of the code is already generic, the exception being the
- /api/clockauction/getDefaultAuction action
- a few other auction-specific parts in mock
It probably also would be worth moving the calls to __init & __setup as well as the unpacking of the payload objects, which are specific to FPC to chaincode/fpc_chaincode.go (or handle these calls for non-fpc in chaincode/go_chaincode.go such that actual go chaincode doesn't have to know about it?)

A related issue is also whether the return value processing (see PR #196) could be generalized and abstracted into the FPC shim. Ultimately, the underlying problem here, though, is that fabric itself doesn't offer a good way to return program-actionable (e.g., numeric error codes) but only human actionable (i.e., a string) error messages. So doing it only in FPC would make the FPC programming model deviate from fabric and cleaner would be to extend/change fabric itself (by e.g., adding an enum or alike to the shim response).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.