I set up hyperledger fabric network in amazon managed blockchain using this document. I have used this as rest server. I have configured peer name as peer1 here. It was worked properly. Later I added one more member using this document. Now member 1 and member 2 should endorse the transaction.
docker exec cli peer chaincode instantiate -o $ORDERER \
-C ourchannel -n myjointcc -v v0 \
-c '{"Args":["init","a","100","b","200"]}' \
--cafile /opt/home/managedblockchain-tls-chain.pem --tls \
-P "AND ('Member1ID.member','Member2ID.member')"
Now I edited this config file as "peers":["peer1", "peer2"]
. But I am getting the following error,
[2020-09-02 05:54:20.915] [ERROR] invoke-chaincode - Error: Peer with name "peer2" not assigned to this channel
at Channel._getTargets (/var/www/html/network/node_modules/fabric-client/lib/Channel.js:3515:13)
at Channel.sendTransactionProposal (/var/www/html/network/node_modules/fabric-client/lib/Channel.js:2791:26)
at Object.invokeChaincode (/var/www/html/network/app/invoke-transaction.js:41:31)
at <anonymous>
[2020-09-02 05:54:20.915] [ERROR] invoke-chaincode - Failed to invoke chaincode. cause:Error: Peer with name "peer2" not assigned to this channel
What should I used instead of peer2? Help me to fix this issue.
you may have missed the step of joinning the peer to the channel:
Both org1 and org2 need to run the following command on their respective Hyperledger Fabric clients to join their peer nodes to the channel