简体   繁体   English

为链码获取不同的 package ID - Hyperledger Fabric 2.2.0

[英]Getting different package ID for a chaincode - Hyperledger Fabric 2.2.0

I have an hyperledger fabric network (v2.2.0) running in a kubernetes cluster deployed using baf.我有一个超级账本结构网络(v2.2.0)在使用 baf 部署的 kubernetes 集群中运行。 Initially the network had 5 orgs (Org1, Org2, Org3, Org4 and Org5), later I tried to join an org (Org6) into the network using the baf script.最初网络有 5 个组织(Org1、Org2、Org3、Org4 和 Org5),后来我尝试使用 baf 脚本将一个 org(Org6)加入网络。 Since using baf script didn't add the org to the channel successfully, I have manually joined the org6 to the network using the configtxlator tool.由于使用 baf 脚本没有成功将 org 添加到频道,我使用 configtxlator 工具手动将 org6 加入网络。

Now during Chaincode installation, I am facing an issue.现在在 Chaincode 安装过程中,我遇到了一个问题。 Tested the fabcar chaincode (from the github repo - fabric-samples-2.0.0-beta), this chaincode installation resulted in same package id for all the 6 orgs in the network.测试了 fabcar 链码(来自 github repo - fabric-samples-2.0.0-beta),这个链码安装导致网络中所有 6 个组织的 package id 相同。 But when I tried to deploy my own chaincode, I am getting different package id for the newly added 6th org, and different package id for all the remaining 5 orgs.但是当我尝试部署自己的链代码时,我得到了新添加的第 6 个组织的不同 package id,以及所有剩余 5 个组织的不同 package id。 Can anyone explain the cause of this?任何人都可以解释这个的原因吗?

I need to quote a statement that I am using the chaincode that I was using in hyperledger fabric 1.4.2.我需要引用一个声明,我正在使用我在 hyperledger fabric 1.4.2 中使用的链代码。 Would the chaincode written for fabric v1.4.x work against fabric v.2.2.0?为fabric v1.4.x 编写的链码是否适用于fabric v.2.2.0? Also I am using peer lifecycle chaincode commands to deploy the chaincode.此外,我正在使用对等生命周期链代码命令来部署链代码。

It's not impossible to get different package IDs as they are the hash of the chaincode package.获得不同的 package ID 并非不可能,因为它们是链码 package 的 hash。 With the same code and the same peer version, you've get the same ID it's true.使用相同的代码和相同的对等版本,您将获得相同的 ID,这是真的。

If, as far as you know, the chaincode package is exactly the same and the peer is exactly the same version - that it's worth double-checking the code is correct.据您所知,如果链码 package 完全相同,并且对等点的版本完全相同 - 值得仔细检查代码是否正确。

However, different package ids are permitted.但是,允许使用不同的 package id。 It's used when you are talking to a peer to say "that chaincode I just installed with ID:xxx, please approve it, and then commit"当您与对等方交谈时使用它说“我刚刚使用 ID:xxx 安装的链码,请批准它,然后提交”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM