无法在windows7上找到自定义链码路径Hyperledger Fabricv1.0本地网络

Gir*_*007 4 go blockchain hyperledger hyperledger-fabric

我正在尝试在我的本地Hyperledger Fabric v1.0环境中安装我的自定义链代码.

为此,我按照文档构建了您的第一个网络,我在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
Run Code Online (Sandbox Code Playgroud)

我改变了

peer chaincode install -n mycc -v 1.0 -p github.com/myuserId/fabrcicV1_chaincodes/mychaincode >&log.txt
Run Code Online (Sandbox Code Playgroud)

现在通过运行./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 ===========
Run Code Online (Sandbox Code Playgroud)

我在github那里有存储库,那么为什么它不显示不退出

我已经在$ GOPATH/src/github.com /路径下克隆了同样的Windows 7机器,并给出了本地路径,然后我也得到了同样的错误.我正在通过Windows 7的 docker快速启动终端运行所有命令.

请告诉我哪里做错了.

此外,在一些网络日志中,我找到了一个位置/opt/gopath/src/github.com/....以及它指向的位置.在我的Windows路径gopath是/c/users/public/fabricv1.

由于我对该工具不太熟悉,请对此进行评论.

在从我这边做了一些分析之后,似乎链代码是从一些预先安装的目录中读取sacc /,fabcar /,/ marble02,chaincode_example_02,hyperledger /在路径下, root@7785f8b27559:/opt/gopath/src/chaincodedev/chaincode#并且在编码时也预先加载了链码使用泊坞窗图像进行网络连接.在Windows文件夹中添加链代码似乎没有效果,它来自上述虚拟机路径.

那么我现在可以做些什么来继续我的工作呢?有没有办法将我的自定义链代码安装到本地网络.我尝试使用我的githhub路径和本地路径但没有用.请有人帮忙:(

Art*_*ger 7

看来你在$ GOPATH中没有你的链码,你需要运行:

go get github.com/myuserId/fabrcicV1_chaincodes/mychaincode
Run Code Online (Sandbox Code Playgroud)

在尝试在peer上安装链代码之前,在你使用构建第一个网络的情况下,你需要确保你的新链代码在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
Run Code Online (Sandbox Code Playgroud)

特别是,您可能需要在此替换您的链代码或确保在$GOPATHcli容器中安装其他文件夹:

- ./../chaincode/:/opt/gopath/src/github.com/hyperledger/fabric/examples/chaincode/go
Run Code Online (Sandbox Code Playgroud)