ERRO 007 访问 /opt/gopath/src/github.com/chaincode/fabcar 失败:lstat /opt/gopath/src/github.com/chaincode/fabcar:没有这样的文件或目录

发布于 2025-01-13 06:36:32 字数 4327 浏览 3 评论 0原文

我正在学习 Udemy 上的课程,作者正在使用 go lang 进行链码。链代码位于名为“chaincode”的文件夹中。我正在尝试使用 fabcar javascript 代码,并且已将其放入“chaincode”文件夹中,但遇到以下错误。您能否提供一些意见来解决此问题?

bash-5.1# export CC_NAME=fabcar
bash-5.1# ./scripts/package_cc.sh
2022-03-11 06:50:10.898 UTC [bccsp] GetDefault -> DEBU 001 Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
2022-03-11 06:50:10.900 UTC [bccsp] GetDefault -> DEBU 002 Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
2022-03-11 06:50:10.913 UTC [bccsp] GetDefault -> DEBU 003 Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
2022-03-11 06:50:10.916 UTC [main] InitCmd -> DEBU 004 peer lifecycle chaincode package does not need to init crypto
2022-03-11 06:50:10.918 UTC [chaincode.platform.node] GetDeploymentPayload -> DEBU 005 Packaging node.js project from path /opt/gopath/src/github.com/chaincode/fabcar
2022-03-11 06:50:10.918 UTC [chaincode.platform.util] WriteFolderToTarPackage -> DEBU 006 writing folder to package rootDirectory=/opt/gopath/src/github.com/chaincode/fabcar
2022-03-11 06:50:10.919 UTC [chaincode.platform.util] func1 -> ERRO 007 Visit /opt/gopath/src/github.com/chaincode/fabcar failed: lstat /opt/gopath/src/github.com/chaincode/fabcar: no such file or directory
2022-03-11 06:50:10.919 UTC [chaincode.platform.util] WriteFolderToTarPackage -> INFO 008 Error walking rootDirectory: lstat /opt/gopath/src/github.com/chaincode/fabcar: no such file or directory
2022-03-11 06:50:10.920 UTC [chaincode.platform.node] GetDeploymentPayload -> ERRO 009 Error writing folder to tar package lstat /opt/gopath/src/github.com/chaincode/fabcar: no such file or directory
Error: error getting chaincode bytes: Error writing Chaincode package contents: lstat /opt/gopath/src/github.com/chaincode/fabcar: no such file or directory

用于 cli 的 Docker-compose。

services:
  cliOrg1:
    container_name: cli
    image: hyperledger/fabric-tools:2.3
    tty: true
    stdin_open: true
    deploy:
      placement:
        constraints:
          - node.labels.name == manager
    environment:
      - SYS_CHANNEL=system-channel
      - GOPATH=/opt/gopath
      - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
      - FABRIC_LOGGING_SPEC=DEBUG
      - ORDERER_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
      # - FABRIC_LOGGING_SPEC=INFO
      - CC_PATH=/opt/gopath/src/github.com/chaincode
      - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=test
      - CORE_PEER_ID=cli
      - CORE_PEER_ADDRESS=peer0.org1.example.com:7051
      - CORE_PEER_LOCALMSPID=Org1MSP
      - CORE_PEER_TLS_ENABLED=true
      - CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
      - CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
      - CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
      - CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
    command: /bin/bash
    volumes:
      - /var/run/:/host/var/run/
      - /home/ubuntu/hlf-docker-swarm/chaincode/:/opt/gopath/src/github.com/chaincode
      - /home/ubuntu/hlf-docker-swarm/test-network/organizations:/opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/
      - /home/ubuntu/hlf-docker-swarm/test-network/scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/
      - /home/ubuntu/hlf-docker-swarm/test-network/channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts
    
    networks:
      test:
        aliases:
          - cliOrg1.example.com

I am following a course on Udemy and the author is using go lang for chaincode. The chaincode is present in the folder named "chaincode". I am trying to use fabcar javascript code and I have placed inside "chaincode" folder but running into below error. Can you please give some inputs to fix this issue?

bash-5.1# export CC_NAME=fabcar
bash-5.1# ./scripts/package_cc.sh
2022-03-11 06:50:10.898 UTC [bccsp] GetDefault -> DEBU 001 Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
2022-03-11 06:50:10.900 UTC [bccsp] GetDefault -> DEBU 002 Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
2022-03-11 06:50:10.913 UTC [bccsp] GetDefault -> DEBU 003 Before using BCCSP, please call InitFactories(). Falling back to bootBCCSP.
2022-03-11 06:50:10.916 UTC [main] InitCmd -> DEBU 004 peer lifecycle chaincode package does not need to init crypto
2022-03-11 06:50:10.918 UTC [chaincode.platform.node] GetDeploymentPayload -> DEBU 005 Packaging node.js project from path /opt/gopath/src/github.com/chaincode/fabcar
2022-03-11 06:50:10.918 UTC [chaincode.platform.util] WriteFolderToTarPackage -> DEBU 006 writing folder to package rootDirectory=/opt/gopath/src/github.com/chaincode/fabcar
2022-03-11 06:50:10.919 UTC [chaincode.platform.util] func1 -> ERRO 007 Visit /opt/gopath/src/github.com/chaincode/fabcar failed: lstat /opt/gopath/src/github.com/chaincode/fabcar: no such file or directory
2022-03-11 06:50:10.919 UTC [chaincode.platform.util] WriteFolderToTarPackage -> INFO 008 Error walking rootDirectory: lstat /opt/gopath/src/github.com/chaincode/fabcar: no such file or directory
2022-03-11 06:50:10.920 UTC [chaincode.platform.node] GetDeploymentPayload -> ERRO 009 Error writing folder to tar package lstat /opt/gopath/src/github.com/chaincode/fabcar: no such file or directory
Error: error getting chaincode bytes: Error writing Chaincode package contents: lstat /opt/gopath/src/github.com/chaincode/fabcar: no such file or directory

Docker-compose for cli.

services:
  cliOrg1:
    container_name: cli
    image: hyperledger/fabric-tools:2.3
    tty: true
    stdin_open: true
    deploy:
      placement:
        constraints:
          - node.labels.name == manager
    environment:
      - SYS_CHANNEL=system-channel
      - GOPATH=/opt/gopath
      - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
      - FABRIC_LOGGING_SPEC=DEBUG
      - ORDERER_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
      # - FABRIC_LOGGING_SPEC=INFO
      - CC_PATH=/opt/gopath/src/github.com/chaincode
      - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=test
      - CORE_PEER_ID=cli
      - CORE_PEER_ADDRESS=peer0.org1.example.com:7051
      - CORE_PEER_LOCALMSPID=Org1MSP
      - CORE_PEER_TLS_ENABLED=true
      - CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
      - CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
      - CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
      - CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
    command: /bin/bash
    volumes:
      - /var/run/:/host/var/run/
      - /home/ubuntu/hlf-docker-swarm/chaincode/:/opt/gopath/src/github.com/chaincode
      - /home/ubuntu/hlf-docker-swarm/test-network/organizations:/opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/
      - /home/ubuntu/hlf-docker-swarm/test-network/scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/
      - /home/ubuntu/hlf-docker-swarm/test-network/channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts
    
    networks:
      test:
        aliases:
          - cliOrg1.example.com

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文