This repository was archived by the owner on Apr 25, 2025. It is now read-only.
feat: expose ChannelProvider from the gateway#244
Open
mblottiere wants to merge 1 commit intohyperledger:mainfrom
Open
feat: expose ChannelProvider from the gateway#244mblottiere wants to merge 1 commit intohyperledger:mainfrom
mblottiere wants to merge 1 commit intohyperledger:mainfrom
Conversation
This can be a useful escape hatch when one needs a ledger client and already has a Gateway available. Signed-off-by: Matthieu Blottière <matthieu.blottiere@owkin.com>
4462385 to
d36373a
Compare
Codecov Report
@@ Coverage Diff @@
## main #244 +/- ##
=======================================
Coverage 76.23% 76.23%
=======================================
Files 193 193
Lines 14103 14103
=======================================
Hits 10752 10752
Misses 2384 2384
Partials 967 967
Help us with your feedback. Take ten seconds to tell us how you rate us. |
Member
|
You can get a block by transaction ID by evaluating the GetBlockByTxID transaction function on the qscc system chaincode. It takes two parameters: channel name and transaction ID. The implementation is here: This assumes that invocation of system chaincode works OK for fabric-sdk-go, which I haven't tried. It does work with fabric-gateway. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We have a use case where given a Getway we need to query the ledger for some information (retrieving block from txID).
Being able to obtain the ChannelProvider is convenient since we can then create ledger.Client as needed.
I wonder however if it is desirable to expose such a low level component. Maybe something like
gateway.GetLedger(...)would be more appropriate? Let me know what you think.