我在几台服务器上建立了一个网络。在其中一个服务器上,编译的链代码始终与其他服务器上的链代码不同,从而产生以下消息:
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>
我不知道链代码是如何编译的,但是当我在自己的笔记本电脑上运行多个对等体时,使用相同的配置,哈希总是匹配。我使用normal命令从cli(fabric-tools)容器(peer chaincode install -n mycc -v 1.0 -p chaincode_example02
)在对等端上安装链代码。主机类似:
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
其他服务器:
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版本是相同的:
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
图像是一样的:
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
但链码实际上是不同的:
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
另一方面:
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
链码在不同的对等体上没有相同哈希的原因是什么?