链码安装的路径问题

    科技2025-04-08  13

    在安装链码的时候,提示path 不存在,可是实际 上存在 /opt/gopath/src/github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 那么这路径到底是什么呢? 我们在安装链码时,是进入cli容器之中,而/opt/gopath/src这个路径是挂载到容器中的路径,与本机上的目录还是有着明显的区别。 如何查看挂载路径呢? 查看docker-compose-cli.yaml 文件

    volumes: - /var/run/:/host/var/run/ - ./../chaincode/:/opt/gopath/src/github.com/chaincode - ./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

    我们可以看到本机中的chaincode文件夹是挂载在/opt/gopath/src/github.com/chaincode这个路径的

    Processed: 0.008, SQL: 8