问题描述
我刚刚开始学习并遵循官方网站上的BYFN教程.
我真的不确定Hyperledger架构是否支持在某些对等节点中安装不同版本的链码
我正在尝试在peer0Org1和peer1Org1 上安装名为 mycc-1.0.1的链码,在peer0Org2和peer1Org2 上安装 mycc-1.0.0的链码. 然后,当我尝试在peer0Org2或peer1Org2(mycc-1.0.0)上通过命令( (假设您正在运行Fabric 1.4.x) 您将 您在频道上 (如果要在同一频道中运行2个不同的版本,则必须使用不同的名称.) 在具有默认策略的测试网络中,实例化通常在1个对等方上构建并启动链码容器,并且在其他对等方上调用事务时,会延迟创建/启动该对等方的链码容器 在您看来,v101似乎已在通道上实例化,并且Org 2的对等方尝试构建/启动v101,但由于您尚未安装代码而无法找到代码.如果您将v101安装到组织2的对等方,则他们应该构建新的容器,并且应该从调用中获取结果. I just start learning and follow the BYFN tutorial on the official website. I'm really not sure does the Hyperledger fabric support to install a different version of chaincode in some peers I'm trying to install my chaincode named mycc-1.0.1 on peer0Org1 and peer1Org1 and mycc-1.0.0 on peer0Org2 and peer1Org2 Then when I trying to query or invoke some data via command ( (Assuming you are running Fabric 1.4.x) You You (If you want to run 2 different versions in the same channel you would have to use different names.) In test networks with default policies in place, the instantiate typically builds and starts a chaincode container on 1 peer, and when a transaction is invoked on a different peer there is a delay whilst the chaincode container for that peer is built/started. In you case it looks like v101 has been instantiated on the channel, and the peers for Org 2 try to build/start v101 but they can't find the code because you have not installed it. If you install v101 to the peers for Org 2, then they should build the new containers and you should get results back from invoke. 这篇关于安装不同版本的Chaincode(Hyperledger fabic)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! peer chaincode invoke
/ peer chaincode query
)查询或调用某些数据时,我出现此错误
错误:查询期间背书失败.响应:状态:500消息:无法获取链码mycc/1.0.1的程序包,错误打开/var/hyperledger/production/chaincodes/mycc.1.0.1:无此类文件或目录"
安装
安装到同位体上-这是复制文件的快速任务.实例化
-且频道具有一个当前版本.实例化花费的时间更长,因为构建了链码映像并启动了容器.这意味着您不能在不同的对等节点上具有不同的版本.peer chaincode invoke
/ peer chaincode query
) on peer0Org2 or peer1Org2 (mycc-1.0.0) I got this errorError: endorsement failure during query. response: status:500 message:"cannot retrieve package for chaincode mycc/1.0.1, error open /var/hyperledger/production/chaincodes/mycc.1.0.1: no such file or directory"
install
on to a peer - a quick task that copies files.instantiate
on a channel - and a channel has one current version. The instantiate takes longer as a chaincode image is built and a container started. This means that you cannot have different versions on different peers.