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

Add transient map arg to chaincode invoke&query #195

Merged
merged 2 commits into from
Nov 7, 2023

Conversation

fthrslntgy
Copy link
Contributor

@fthrslntgy fthrslntgy commented Oct 5, 2023

What this PR does / why we need it:

In fabric peer chaincode (https://github.com/hyperledger/fabric/blob/main/internal/peer/chaincode), users can set transient map with argument --transient.
In code -> https://github.com/hyperledger/fabric/blob/58b6dc3651e99db7e3eaa61285cac4c5b3cdef4d/internal/peer/chaincode/common.go#L579

There is no equivalent parameter in kubectl hlf chaincode. This pr solves that.

Which issue(s) this PR fixes:

There is not any issue related with this problem.

Does this PR introduce a user-facing change?

Yes, users can set transient map in chaincode query&invoke comamnds.

Usage:

It can be used with -t parameter in kubectl hlf chaincode invoke/query commands.
Example for creating bid in https://github.com/hyperledger/fabric-samples/blob/main/auction-simple chaincode:

kubectl hlf chaincode invoke --config=resources/network.yaml \
    --user=admin --peer=org1-peer0.default \
    --chaincode=auction-simple --channel=demo \
    --fcn=Bid -a "auction_id_test"
    -t= "{\"bid\":{\"objectType\": \"bid\", \"price\": 250, \"org\": \"Org1MSP\", \"bidder\": \"admin\"}}

@fthrslntgy
Copy link
Contributor Author

fthrslntgy commented Oct 12, 2023

@sownak @dviejokfs Transient map is necessary for some common chaincodes like https://github.com/hyperledger/fabric-samples/tree/main/auction-simple/chaincode-go. I need this pr for develop auction rest API application with golang. Could you please speed up review pr process?

@adityajoshi12
Copy link
Contributor

Thanks for the PR @fthrslntgy, can you also add an example of how to pass the transient field with this PR.

@fthrslntgy
Copy link
Contributor Author

Thanks for the PR @fthrslntgy, can you also add an example of how to pass the transient field with this PR.

Sure, where should i add examples? I couldn't find example or test codes in kubectl-hlf path of repository.

@adityajoshi12
Copy link
Contributor

adityajoshi12 commented Oct 23, 2023

Thanks for the PR @fthrslntgy, can you also add an example of how to pass the transient field with this PR.

Sure, where should i add examples? I couldn't find example or test codes in kubectl-hlf path of repository.

You can add in the PR description.

@fthrslntgy
Copy link
Contributor Author

Thanks for the PR @fthrslntgy, can you also add an example of how to pass the transient field with this PR.

Sure, where should i add examples? I couldn't find example or test codes in kubectl-hlf path of repository.

You can add in the PR description.

Its done

@adityajoshi12
Copy link
Contributor

@fthrslntgy can you check the failing testcase?

@fthrslntgy
Copy link
Contributor Author

fthrslntgy commented Nov 4, 2023

@fthrslntgy can you check the failing testcase?

i think i fixed it with commit a855d4a

@adityajoshi12 adityajoshi12 merged commit c8e1a47 into hyperledger-bevel:main Nov 7, 2023
3 checks passed
@adityajoshi12 adityajoshi12 self-requested a review November 7, 2023 06:46
@adityajoshi12 adityajoshi12 added the enhancement New feature or request label Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants