使用hyperledger结构教程初始化具有资产的分类帐时出错



我正在学习教程。到目前为止,我可以使用以下命令在mychannel中启动链码:

./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go

设置完路径后,我运行以下程序来初始化分类帐

peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile ${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n basic --peerAddresses localhost:7051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --peerAddresses localhost:9051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt -c '{"function":"InitLedger","Args":[]}'

然后我得到以下错误:Error: endorsement failure during invoke. response: status:500 message:"make sure the chaincode basic has been successfully defined on channel mychannel and try again: chaincode basic not found"

我只是在学习这个教程https://hyperledger-fabric.readthedocs.io/en/release-2.3/test_network.html

请告知。

fabric 2.3被fabric 2.4取代,因此,如果教程中存在任何问题,则不会解决这些问题。我建议使用织物2.4并遵循此处的指南https://hyperledger-fabric.readthedocs.io/en/latest/test_network.html如果你想安装go链代码,请确保你首先安装了go 1.18(目前需要的go for fabric 2.4版本(。

您描述的错误表明go Chain代码没有安装,这可能是因为您试图使用fabric 2.3

如果您正在使用docker,请确保关闭网络以确保所有卷和网络都被修剪,并且当您下载fabric 2.4的docker映像时,请确保它们被标记为最新的(以确保您可以解开所有fabric docker映像的最新标记(

最新更新