AnswerAIL / fabric-sdk-server

Fabric-SDK-Java 封装版项目 fabric-sdk-server
https://github.com/AnswerAIL/fabric-sdk-server
18 stars 5 forks source link

can't load package: package github.com/hyperledger/fabric/core/chaincode/lib/cid: cannot find package "github.com/hyperledger/fabric/core/chaincode/lib/cid" in any of: /opt/go/src/github.com/hyperledger/fabric/core/chaincode/lib/cid (from $GOROOT) /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/lib/cid (from $GOPATH) #2

Open AnswerAIL opened 5 years ago

AnswerAIL commented 5 years ago
    # 步骤1: 启动一个ccenv容器
    docker run -it <hyperledger/fabric-ccenv ImageID> bash
    e.g. docker run -it 953124d80237 bash   # 启动的容器ID: 73b10cc2e704

    # 步骤2: 进入fabric目录
    cd /opt/go/src/github.com/hyperledger/fabric

    # 73b10cc2e704 为步骤1hyperledger/fabric-ccenv镜像启动的容器ID
    # 步骤3: 将cid代码拷贝到容器内部
    docker cp . 73b10cc2e704:/opt/gopath/src/github.com/hyperledger/fabric

    # 步骤4: 重新生成镜像, 提交容器为镜像
    docker commit 73b10cc2e704 answer/fabric-ccenv:1.3.0

    # 步骤5: 给peer节点的编排文件指定 fabric-ccenv 镜像及版本
    environment
        - CORE_CHAINCODE_BUILDER=answer/fabric-ccenv:1.3.0

    # 说明: fabric-ccenv 镜像中包含了智能合约所需要的一些GO语言库, 一下命令可进入容器内部进行验证
    docker run -it <hyperledger/fabric-ccenv ImageID> bash
    ls /opt/gopath/src/github.com/hyperledger/fabric