[英]Chaincode installation on peer in HyperLedger Fabric
我试图在本地测试我的链代码,为此我有一个脚本可以运行,但是在安装链代码(下面的代码)时会得到链代码路径不存在的错误?
peer chaincode install -n mycc -v 1.0 -p ./bitbucket.org/Foldername/testBlockchain/folder_name_for_chaincode
在我看到的所有示例中都使用了以下命令
peer chaincode -n mycc -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02
我的问题恰恰是我如何纠正指向链码的路径?
您需要在GOPATH中提供您的链代码,然后您应该能够安装它。 只需将您的bitbucket文件夹添加到GOPATH中或将链码移动到$GOPATH/src
。
更新
以下命令
peer chaincode install -n mycc -v 1.0 -p ./bitbucket.org/Foldername/testBlockchain/folder_name_for_chaincode
需要更换
peer chaincode install -n mycc -v 1.0 -p bitbucket.org/Foldername/testBlockchain/folder_name_for_chaincode
Step a)
get the channel name using the following
peer channel list
step b)
get the chaincode version using this
peer chaincode list --installed
step c)
install the chaincode using this
CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode install -n mycc -p github.com/lc/go -v v3
-n=name,
-v=version,
-p=path
感谢您的回答。 我的链码已经在$ GOPATH。 目录结构如下。 目录结构如下
$GOPATH ->src
--->bitbucket.org
------>FolderName
--------->chaincodefolder
------------->chaincodenamefolder
----------------chaincode.go
---------->Middleware
---------->localfabricfolder
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.