I am able to invoke my chaincode from docker cli successfully (fabric-shim).
i ran enrollAdmin.js and registerUser.js sucessfully,
but when i try to run invoke.js or query.js, i get Error: 2 UNKNOWN: access denied: channel [mychannel] creator org [Org1MSP]
.
Though there are limited information shows above, the peer log give the essential hint about the problem:
WARN 044 channel [mychannel]: MSP error: the supplied identity is not valid: x509: certificate signed by unknown authority (possibly because of "x509: ECDSA verification failure" while trying to verify candidate authority certificate "ca.org1.example.com"
Here is the suggestions that may help your to solve this problem:
- Change your peer's logging level to
DEBUG
on docker-compose file, you will be more easily to find the solution followed by the debug information. - Make sure your CA container is running and its logs not throws out error, like some certifications verify error, which commonly causes by wrong configuration.
- Now that the logs shows up some information about x509 ECDSA, which related to the signature and and the peers endorsement keycert. Also, this keycerts may storage on
/tmp/hfc-key-store
or any other place that you defined on you code. Try to clean up this temporary file and restart network again. - Noticed that your are using the fabric-sample repo, I think this problem may not caused by some code issues since you just modified a few parameters. So I recommend you to follow this tutorial to get the right step.
Ramananda Panda
I came across similar issue.
I found out then channel name in network config and the channel I created was different. So I changed the channel name in the network config and it got fixed.
来源:https://stackoverflow.com/questions/52462989/hyperledger-fabric-invoke-js-error-2-unknown-access-denied-channel-mychanne