0
votes

I saw in byfn that just two peers are used for the code invocation but we have four peers in the network. Why are just two used?

./byfn.md:+ peer chaincode invoke -o orderer.example.com:7050 --tls true --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 mychannel -n mycc --peerAddresses peer0.org1.example.com:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --peerAddresses peer0.org2.example.com:9051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt -c '{"Args":["invoke","a","b","10"]}' ./byfn.md:2019-11-24 08:01:03.051 UTC [chaincodeCmd] chaincodeInvokeOrQuery -> INFO 001 Chaincode invoke successful. result: status:200 ./byfn.md:===================== Invoke transaction successful on peer0.org1 peer0.org2 on channel 'mychannel' =====================

1

1 Answers

1
votes

Because peer0 and peer1 for org1 are actually the same. They share a gossip protocol and they share the same ledger in the form of a local copy. Querying and invoking peer0 will get the same output as querying and invoking peer1.

This for org1, but same for org2. You can for sure invoke all peers and see that you will get the same results.