当我在其中一个组织上批准时使用了错误的 packageID,我遇到了这个错误
使用时approveformyorg
,请检查您使用各自的$PACKAGE_ID_ORG1
和$PACKAGE_ID_ORG2
:
在 org1 上:
peer lifecycle chaincode approveformyorg \
--channelID $CHANNEL_NAME \
--name $CHAINCODE_NAME --version $CC_VERSION \
--package-id $PACKAGE_ID_ORG1 \
--sequence $CC_SEQ -o orderer:7050 --tls --cafile $ORDERER_TLS_CA
在 org2 上:
peer lifecycle chaincode approveformyorg \
--channelID $CHANNEL_NAME \
--name $CHAINCODE_NAME --version $CC_VERSION \
--package-id $PACKAGE_ID_ORG2 \
--sequence $CC_SEQ -o orderer:7050 --tls --cafile
否则它会给我以下信息:
在 org1 上:
bash-5.0# peer lifecycle chaincode queryapproved -C bankscochannel -n fabcar
Approved chaincode definition for chaincode 'fabcar' on channel 'bankscochannel':
sequence: 1, version: 1.0, init-required: false, package-id: fabcar-v1:002d3fc291572c3e8bc52fea3b228cbd1877ab87669978759fc75f51f893a0dd, endorsement plugin: escc, validation plugin: vscc
bash-5.0# peer lifecycle chaincode querycommitted -C bankscochannel
Committed chaincode definitions on channel 'bankscochannel':
Name: fabcar, Version: 1.0, Sequence: 1, Endorsement Plugin: escc, Validation Plugin: vscc
bash-5.0# peer lifecycle chaincode queryinstalled
Installed chaincodes on peer:
Package ID: fabcar-v1:002d3fc291572c3e8bc52fea3b228cbd1877ab87669978759fc75f51f893a0dd, Label: fabcar-v1
0n组织2:
bash-5.0# peer lifecycle chaincode queryapproved -C bankscochannel -n fabcar
Approved chaincode definition for chaincode 'fabcar' on channel 'bankscochannel':
sequence: 1, version: 1.0, init-required: false, package-id: fabcar-v1:002d3fc291572c3e8bc52fea3b228cbd1877ab87669978759fc75f51f893a0dd, endorsement plugin: escc, validation plugin: vscc
bash-5.0# peer lifecycle chaincode querycommitted -C bankscochannel
Committed chaincode definitions on channel 'bankscochannel':
Name: fabcar, Version: 1.0, Sequence: 1, Endorsement Plugin: escc, Validation Plugin: vscc
bash-5.0# peer lifecycle chaincode queryinstalled
Installed chaincodes on peer:
Package ID: fabcar-v1:c4430b8d45ee5bca03233272da19aafab73d41c973861adfab8d349c70d950e3, Label: fabcar-v1
请注意,在控制台输出中,两者的结果都peer lifecycle chaincode queryapproved
返回相同的 package_id,这是不正确的