I set up a network on several servers. On one of the servers, the compiled chaincode is consistently different from the chaincode on other servers, resulting in the message:
Error: Error endorsing query: rpc error: code = Unknown desc = Error executing chaincode: Could not get deployment transaction from LSCC for mycc:1.0 - Get ChaincodeDeploymentSpec for mycc/torchplatformchannel from LSCC error: chaincode fingerprint mismatch data mismatch - <nil>
I don't know how chaincode is compiled exactly, but when I run a number of peers on my own laptop, with the same configuration, the hash always matches. I use the normal command to install the chaincode on the peer from the cli (fabric-tools) container (peer chaincode install -n mycc -v 1.0 -p chaincode_example02
). The host machines are similar:
root@fabric:~# uname -a
Linux fabric 4.4.0-81-generic #104-Ubuntu SMP Wed Jun 14 08:17:06 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Other server:
Linux fabric2 4.4.0-75-generic #96-Ubuntu SMP Thu Apr 20 09:56:33 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Docker versions are the same:
root@fabric:~# docker version
Client:
Version: 17.06.0-ce
API version: 1.30
Go version: go1.8.3
Git commit: 02c1d87
Built: Fri Jun 23 21:23:31 2017
OS/Arch: linux/amd64
Server:
Version: 17.06.0-ce
API version: 1.30 (minimum version 1.12)
Go version: go1.8.3
Git commit: 02c1d87
Built: Fri Jun 23 21:19:04 2017
OS/Arch: linux/amd64
Experimental: false
Images are the same:
root@fabric:~# docker images
hyperledger/fabric-tools x86_64-1.0.0-beta ae6b0f53cb70 3 weeks ago 1.32GB
hyperledger/fabric-peer x86_64-1.0.0-beta e01c2b645f11 3 weeks ago 182MB
hyperledger/fabric-ca x86_64-1.0.0-beta e549e8c53c2e 3 weeks ago 238MB
But the chaincode actually IS different:
root@286f0cd4bc82:/var/hyperledger/production/chaincodes# md5sum mycc.1.0
a96076f0cadf7c0e5c8da50ee5195078 mycc.1.0
root@286f0cd4bc82:/var/hyperledger/production/chaincodes# ls -la mycc.1.0
-rw-r--r-- 1 root root 2441 Jul 4 12:55 mycc.1.0
And on the other side:
root@6089fc35a6d9:/var/hyperledger/production/chaincodes# md5sum mycc.1.0
918307de80ef18de378c63e4138ccdf5 mycc.1.0
root@6089fc35a6d9:/var/hyperledger/production/chaincodes# ls -la mycc.1.0
-rw-r--r-- 1 root root 2448 Jul 4 12:53 mycc.1.0
What could be the reason for a chaincode not having the same hash on a different peer?