修改后如何升级链码? [英] How to upgrade a chaincode after modification?

查看:78
本文介绍了修改后如何升级链码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Hyperledger的新手,正在通过示例

I am new to hyperledger and is going through the example here . I am tried to play around the chaincode but is now stuck at the part where I am suppose to upgrade the chaincode

我尝试在docker对等节点中执行对等链码升级:

I have tried to execute the peer chaincode upgrade within the docker peer node:

peer chaincode upgrade -n tuna-app -p github.com/tuna-app

但最终会出现错误

 Error getting (testchainid) orderer endpoint: Error endorsing GetConfigBlock: rpc error: code = Unknown desc = chaincode error (status: 500, message: "GetConfigBlock" request failed authorization check for channel [testchainid]: [Failed to get policy manager for channel [testchainid]])

推荐答案

您需要指定要为其升级链码的频道名称,还需要指定args和新版本.此外,您必须指定订购服务端点,以便对等cli能够提交升级交易:

You need to specify the channel name for which you'd like to upgrade the chaincode, also need to specify args and new version. Moreover you have to specify the ordering service endpoints so peer cli will be able to submit the upgrade transaction:

peer chaincode upgrade -n tuna-app -v 2.0 \
               -c '{"Args":[""]}' \
               -p github.com/tuna-app -C mychannel \
               -o orderer:7051

您可以在此处找到更多.

这篇关于修改后如何升级链码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆