This is a tracing network with one channel composed of 3 Orgs, 1 anchor peer per organization, 1 MSP per org, and 1 CA for org3. And I'm not using TLS (because I couldn't find a dependable sample with TLS ON)
I'm trying to use Fabric-sdk-node to build a web front end for it, and I'm using fabcar sample. and when I use invoke.js (almost the same as the example), I find this.
root@oyu-virtual-machine:~/hyperledger-fabric/test/webapp# node get2.js
Wallet path: /root/hyperledger-fabric/test/webapp/wallet
2021-05-05T10:34:16.275Z - warn: [Query]: evaluate: Query ID "[object Object]" of peer "peer0.sell.trace.com" failed: message=cannot retrieve package for chaincode sellcc/1.0, error open /var/hyperledger/production/chaincodes/sellcc.1.0: no such file or directory, stack=Error: cannot retrieve package for chaincode sellcc/1.0, error open /var/hyperledger/production/chaincodes/sellcc.1.0: no such file or directory
at /root/hyperledger-fabric/test/webapp/node_modules/fabric-client/lib/Peer.js:144:36
at Object.onReceiveStatus (/root/hyperledger-fabric/test/webapp/node_modules/grpc/src/client_interceptors.js:1212:9)
at InterceptingListener._callNext (/root/hyperledger-fabric/test/webapp/node_modules/grpc/src/client_interceptors.js:568:42)
at InterceptingListener.onReceiveStatus (/root/hyperledger-fabric/test/webapp/node_modules/grpc/src/client_interceptors.js:618:8)
at callback (/root/hyperledger-fabric/test/webapp/node_modules/grpc/src/client_interceptors.js:847:24), status=500, , url=grpc://localhost:7051, name=peer0.sell.trace.com, grpc.max_receive_message_length=-1, grpc.max_send_message_length=-1, grpc.keepalive_time_ms=120000, grpc.http2.min_time_between_pings_ms=120000, grpc.keepalive_timeout_ms=20000, grpc.http2.max_pings_without_data=0, grpc.keepalive_permit_without_calls=1, name=peer0.sell.trace.com, request-timeout=3000000, isProposalResponse=true
Failed to evaluate transaction: Error: cannot retrieve package for chaincode sellcc/1.0, error open /var/hyperledger/production/chaincodes/sellcc.1.0: no such file or directory
In my opinion, the most important message is
error open /var/hyperledger/production/chaincodes/sellcc.1.0: no such file or directory
It once occurred when I forgot install other orgs' chaincodes on the SellOrg(InvokeChaincode API require), but I definitetly install it this time. I dont know what's going on.
I'm a very newbie in both fabric and nodejs, so any kind of help would be great. Thanks in advance.
Now I know where the problem is, all of my peers have the same addr of localhost:7051, and it link to another org's peer. The peer's name in the error message is completely wrong, it just show the name in my connection.json !