小编Chr*_*cke的帖子

Hyperledger Fabric改变fabcar的例子

我一直在研究fabcar的例子,并且在没有发生任何改变的情况下让它完美运行.我正在尝试更新fabcar.go代码以添加更多字段并简单地玩w /示例,但我的docker图像没有更新w /正确的代码.

要安装链代码,此命令在cli容器上运行:

docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" cli peer chaincode install -n fabcar -v 1.0 -p github.com/fabcar
Run Code Online (Sandbox Code Playgroud)

cli容器已设置此卷:

./../chaincode/:/opt/gopath/src/github.com/
Run Code Online (Sandbox Code Playgroud)

然而,在代码/去更新之后(我实际上已将它从Car更改为具有全新字段的Ticket对象并更新所有相关的链命令以反映),拆解,然后再次启动我仍然看到所有旧字段.

我在这里错过了什么?

这是在"调用"功能中更改为票证的代码片段

func (s *SmartContract) Invoke(APIstub shim.ChaincodeStubInterface) sc.Response {

    // Retrieve the requested Smart Contract function and arguments
    function, args := APIstub.GetFunctionAndParameters()
    // Route to the appropriate handler function to interact with the ledger appropriately
    if function == "queryTicket" {
        return s.queryTicket(APIstub, args)
    } else if function == "initLedger" {
        return s.initLedger(APIstub)
    } else if …
Run Code Online (Sandbox Code Playgroud)

docker hyperledger hyperledger-fabric

4
推荐指数
1
解决办法
1850
查看次数

标签 统计

docker ×1

hyperledger ×1

hyperledger-fabric ×1