1 year ago

#278551

test-img

Chetan Ambi

ERRO 007 Visit /opt/gopath/src/github.com/chaincode/fabcar failed: lstat /opt/gopath/src/github.com/chaincode/fabcar: no such file or directory

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/Admin@org1.example.com/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

hyperledger-fabric

hyperledger

hyperledger-chaincode

0 Answers

Your Answer

Accepted video resources