2016-11-09 7 views
1

に自分のGitHubからhyperledgerのchaincodeを実行することはできません。 https://github.com/ibm-blockchain/learn-chaincode/finished github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02は、私は、次の公式のパスからchaincodeを実行することができますUbuntuのターミナル

# peer chaincode deploy -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -c '{"Function":"init", "Args": ["a","100", "b", "200"]}' 

しかし、私自身のgithubのパスからchainncodeを実行することはできません。 https://github.com/jeffyxia/hyperledger/trade

# peer chaincode deploy -p https://github.com/jeffyxia/hyperledger/trade -c '{"Function":"init", "Args": ["a","100", "b", "200"]}' 

エラー情報がある:

エラー:エラー建物chaincode:RPCエラー:PBFTのalgrithmを使用して、言語環境に行くことなく、 Ubuntuの16.04:

chaincode package bytes: Error getting code 'go get' failed with error: "exit status 2" 
# github.com/jeffyxia/hyperledger/hello_world 
/go/_usercode_/519629987/src/github.com/jeffyxia/hyperledger/hello_world/chaincode_example01.go:31: cannot use new(SimpleChaincode) (type *SimpleChaincode) as type shim.Chaincode in argument to shim.Start: 
    *SimpleChaincode does not implement shim.Chaincode (wrong type for Init method) 
     have Init(*shim.ChaincodeStub, string, []string) ([]byte, error) 
     want Init(shim.ChaincodeStubInterface, string, []string) ([]byte, error) 

補足情報取得コード= 2 DESC =エラー。

この問題を解決する方法、thx。

答えて

1

まず、公式リポジトリの最新バージョンのファブリックを使用することができます。 第二に、エラーがあなたの行くファイルの至る所stub shim.ChaincodeStubInterfacestub *shim.ChaincodeStubを交換する必要が

*SimpleChaincode does not implement shim.Chaincode (wrong type for Init method) 
     have Init(*shim.ChaincodeStub, string, []string) ([]byte, error) 
     want Init(shim.ChaincodeStubInterface, string, []string) ([]byte, error) 

、自明です。これもお読みください。https://github.com/IBM-Blockchain/ibm-blockchain-issues/issues/29

関連する問題