无法在 windows7 上找到自定义链代码路径 Hyperledger Fabricv1.0 本地网络 运行
Unable to find custom chaincode path Hyperledger Fabricv1.0 local network running on windows7
我正在尝试在本地 Hyperledger Fabric v1.0 环境中安装自定义链码。
为此,我遵循了文档 build your first network and I am using first network sample with in the github 项目。不,它已经启动 运行 ./byfn.sh -m up
并执行所有用于通道创建、链代码安装和实例化的脚本,并且全部由 运行 script.sh 文件执行。
现在我更改了以下内容以试用我的自定义链码
peer chaincode install -n mycc -v 1.0 -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02>&log.txt
这个我改成了
peer chaincode install -n mycc -v 1.0 -p github.com/myuserId/fabrcicV1_chaincodes/mychaincode >&log.txt
现在 运行 ./byfn.sh -m up
得到异常
2017-08-22 11:01:17.048 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2017-08-22 11:01:17.048 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2017-08-22 11:01:17.048 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
Error: Error getting chaincode code chaincode: path to chaincode does not exist: github.com/myuserId/fabrcicV1_chaincodes/mychaincode
Usage:
peer chaincode install [flags]
Flags:
-c, --ctor string Constructor message for the chaincode in JSON format (default "{}")
-l, --lang string Language the chaincode is written in (default "golang")
-n, --name string Name of the chaincode
-p, --path string Path to chaincode
-v, --version string Version of the chaincode specified in install/instantiate/upgrade commands
Global Flags:
--cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoi
--logging-level string Default logging level and overrides, see core.yaml for full syntax
-o, --orderer string Ordering service endpoint
--test.coverprofile string Done (default "coverage.cov")
--tls Use TLS when communicating with the orderer endpoint
!!!!!!!!!!!!!!! Chaincode installation on remote peer PEER0 has Failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========
我在 github 中有存储库,那为什么它不显示 不退出 ?
我已经克隆 与路径 $GOPATH/src/github.com/ 下的 Windows 7 机器相同并给定本地路径,然后我也得到同样的错误。我是 运行 通过 docker 快速启动终端的所有命令 windows 7.
请指出我哪里做错了。
我还在一些网络日志中找到了一个位置 /opt/gopath/src/github.com/....
以及它指向的位置。在我的 windows 路径中,gopath 是 /c/users/public/fabricv1
。
由于我对这个工具不是很熟悉,还请大家评论一下。
After doing some analysis from my side, it seems like the chain code
is reading from some pre-mounted directories sacc/, fabcar/, /marble02
, chaincode_example_02, hyperledger/ under the path
root@7785f8b27559:/opt/gopath/src/chaincodedev/chaincode#
and
chaincode also pre-loaded at the time of making the network up
using docker image. There it seems no effect by adding chaincode in
windows folder and it is from the above said virtual machine path.
So what can I do now to continue my work? is there any way to install
my custom chaincode to the local network. I tried with my githhub path
and local path but no use. please somebody help :(
你的链码似乎没有在 $GOPATH 中,你需要 运行:
go get github.com/myuserId/fabrcicV1_chaincodes/mychaincode
在尝试在对等节点上安装链码之前,在您使用构建您的第一个网络的情况下,您需要确保您的新链码在fabric-samples/chaincode
中文件夹。还要注意,您需要将带有链代码的文件夹安装到 docker cli 容器中,请参阅当前 docker-compose-cli.yaml
文件的示例:
volumes:
- /var/run/:/host/var/run/
- ./../chaincode/:/opt/gopath/src/github.com/hyperledger/fabric/examples/chaincode/go
- ./crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
- ./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/
- ./channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts
特别是,您可能需要在此处替换为您的链代码,或者确保在 cli 容器的 $GOPATH
中安装一个额外的文件夹:
- ./../chaincode/:/opt/gopath/src/github.com/hyperledger/fabric/examples/chaincode/go
我正在尝试在本地 Hyperledger Fabric v1.0 环境中安装自定义链码。
为此,我遵循了文档 build your first network and I am using first network sample with in the github 项目。不,它已经启动 运行 ./byfn.sh -m up
并执行所有用于通道创建、链代码安装和实例化的脚本,并且全部由 运行 script.sh 文件执行。
现在我更改了以下内容以试用我的自定义链码
peer chaincode install -n mycc -v 1.0 -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02>&log.txt
这个我改成了
peer chaincode install -n mycc -v 1.0 -p github.com/myuserId/fabrcicV1_chaincodes/mychaincode >&log.txt
现在 运行 ./byfn.sh -m up
得到异常
2017-08-22 11:01:17.048 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2017-08-22 11:01:17.048 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2017-08-22 11:01:17.048 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
Error: Error getting chaincode code chaincode: path to chaincode does not exist: github.com/myuserId/fabrcicV1_chaincodes/mychaincode
Usage:
peer chaincode install [flags]
Flags:
-c, --ctor string Constructor message for the chaincode in JSON format (default "{}")
-l, --lang string Language the chaincode is written in (default "golang")
-n, --name string Name of the chaincode
-p, --path string Path to chaincode
-v, --version string Version of the chaincode specified in install/instantiate/upgrade commands
Global Flags:
--cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoi
--logging-level string Default logging level and overrides, see core.yaml for full syntax
-o, --orderer string Ordering service endpoint
--test.coverprofile string Done (default "coverage.cov")
--tls Use TLS when communicating with the orderer endpoint
!!!!!!!!!!!!!!! Chaincode installation on remote peer PEER0 has Failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========
我在 github 中有存储库,那为什么它不显示 不退出 ?
我已经克隆 与路径 $GOPATH/src/github.com/ 下的 Windows 7 机器相同并给定本地路径,然后我也得到同样的错误。我是 运行 通过 docker 快速启动终端的所有命令 windows 7.
请指出我哪里做错了。
我还在一些网络日志中找到了一个位置 /opt/gopath/src/github.com/....
以及它指向的位置。在我的 windows 路径中,gopath 是 /c/users/public/fabricv1
。
由于我对这个工具不是很熟悉,还请大家评论一下。
After doing some analysis from my side, it seems like the chain code is reading from some pre-mounted directories sacc/, fabcar/, /marble02 , chaincode_example_02, hyperledger/ under the path
root@7785f8b27559:/opt/gopath/src/chaincodedev/chaincode#
and chaincode also pre-loaded at the time of making the network up using docker image. There it seems no effect by adding chaincode in windows folder and it is from the above said virtual machine path.So what can I do now to continue my work? is there any way to install my custom chaincode to the local network. I tried with my githhub path and local path but no use. please somebody help :(
你的链码似乎没有在 $GOPATH 中,你需要 运行:
go get github.com/myuserId/fabrcicV1_chaincodes/mychaincode
在尝试在对等节点上安装链码之前,在您使用构建您的第一个网络的情况下,您需要确保您的新链码在fabric-samples/chaincode
中文件夹。还要注意,您需要将带有链代码的文件夹安装到 docker cli 容器中,请参阅当前 docker-compose-cli.yaml
文件的示例:
volumes:
- /var/run/:/host/var/run/
- ./../chaincode/:/opt/gopath/src/github.com/hyperledger/fabric/examples/chaincode/go
- ./crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
- ./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/
- ./channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts
特别是,您可能需要在此处替换为您的链代码,或者确保在 cli 容器的 $GOPATH
中安装一个额外的文件夹:
- ./../chaincode/:/opt/gopath/src/github.com/hyperledger/fabric/examples/chaincode/go