Problem:
I have created a Hyperledger fabric network with six organizations 2 peers for each. After running the network I install fabcar chaincode on one peer of each organization and then I instantaited the chaincode using this command.
peer chaincode instantiate -o orderer.example.com:7050 --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -n fabcar -l node -v 1.0 -c '{"Args":["init"]}' -C myc -P "AND ('Org2MSP.peer','Org1MSP.peer',Org3MSP.peer','Org4MSP.peer','Org5MSP.peer','Org6MSP.peer')"
Up to this command, everything was successfully happened without giving me an error. After I tried to invoke a function using this command.
peer chaincode invoke -o orderer.example.com:7050 --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C myc -n fabcar -c '{"Args":["initLedger"]}
This command leaves this error on the particular peer logs.
2019-05-12 13:38:01.162 UTC [gossip.privdata] StoreBlock -> INFO 191 [myc] Received block [8] from buffer 2019-05-12 13:38:01.213 UTC [vscc] Validate -> ERRO 192 VSCC error: stateBasedValidator.Validate failed, err validation of endorsement policy for chaincode fabcar in tx 8:0 failed: signature set did not satisfy policy 2019-05-12 13:38:01.213 UTC [committer.txvalidator] validateTx -> ERRO 193 VSCCValidateTx for transaction txId = a17c0deb20af5a4e0a232fa432ea13e74fca101b63cb697384bbaced80905773 returned error: validation of endorsement policy for chaincode fabcar in tx 8:0 failed: signature set did not satisfy policy 2019-05-12 13:38:01.258 UTC [committer.txvalidator] Validate -> INFO 194 [myc] Validated block [8] in 96ms 2019-05-12 13:38:01.259 UTC [valimpl] preprocessProtoBlock -> WARN 195 Channel [trafficfine]: Block [8] Transaction index [0] TxId [a17c0deb20af5a4e0a232fa432ea13e74fca101b63cb697384bbaced80905773] marked as invalid by committer. Reason code [ENDORSEMENT_POLICY_FAILURE]
This was the logs on the chincode.
[email protected] start /usr/local/src node fabcar.js "--peer.address" "peer0.org2.example.com:9052"
2019-05-12T13:35:08.951Z info [lib/chaincode.js]
info: Registering with peer peer0.org2.example.com:9052 as chaincode "fabcar:1.0" {"timestamp":"2019-05-12T13:35:08.951Z"} 2019-05-12T13:35:09.232Z info [lib/handler.js]
info: Successfully registered with peer node. State transferred to "established" {"timestamp":"2019-05-12T13:35:09.232Z"} 2019-05-12T13:35:09.234Z info [lib/handler.js]
info: Successfully established communication with peer node. State transferred to "ready" {"timestamp":"2019-05-12T13:35:09.234Z"} =========== Instantiated fabcar chaincode =========== 2019-05-12T13:35:09.240Z info [lib/handler.js]
info: [myc-8ecdb2a5] Calling chaincode Init() succeeded. Sending COMPLETED message back to peer {"timestamp":"2019-05-12T13:35:09.240Z"} { fcn: 'initLedger', params: [] } ============= START : Initialize Ledger =========== successful { status: 200, message: '', payload: } Added <--> { make: 'Toyota', model: 'Prius', color: 'blue', owner: 'Tomoko',
docType: 'car' } successful { status: 200, message: '', payload: } Added <--> { make: 'Ford', model: 'Mustang', color: 'red', owner: 'Brad', docType: 'car' } successful { status: 200, message: '', payload: } Added <--> { make: 'Hyundai',
model: 'Tucson', color: 'green', owner: 'Jin Soo', docType: 'car' } successful { status: 200, message: '', payload: } Added <--> { make: 'Volkswagen', model: 'Passat', color: 'yellow', owner: 'Max', docType: 'car' } successful { status: 200, message: '', payload: } Added <--> { make: 'Tesla',
model: 'S', color: 'black', owner: 'Adriana', docType: 'car' } successful { status: 200, message: '', payload: } Added <--> { make: 'Peugeot', model: '205', color: 'purple', owner: 'Michel', docType: 'car' } successful { status: 200, message: '', payload: } Added <--> { make: 'Chery', model: 'S22L',
color: 'white', owner: 'Aarav', docType: 'car' } successful { status: 200, message: '', payload: } Added <--> { make: 'Fiat', model: 'Punto', color: 'violet', owner: 'Pari',
docType: 'car' } successful { status: 200, message: '', payload: } Added <--> { make: 'Tata', model: 'Nano', color: 'indigo', owner: 'Valeria', docType: 'car' } successful { status: 200, message: '', payload: } Added <--> { make: 'Holden',
model: 'Barina', color: 'brown', owner: 'Shotaro', docType: 'car' } ============= END : Initialize Ledger =========== 2019-05-12T13:37:58.998Z info [lib/handler.js]
info: [myc-a17c0deb] Calling chaincode Invoke() succeeded. Sending COMPLETED message back to peer {"timestamp":"2019-05-12T13:37:58.998Z"}
I tried a lot to figure out what is wrong with my network. But I was unable to find out. can someone help me to solve this problem? Thank you.