fablo
fablo copied to clipboard
The same peer certificates for one org?
#!/bin/sh
peer="peer1.org1.com"
channel="my-channel2"
chaincode="chaincode1"
command='{"Args":["KVContract:get", "name"]}'
docker exec "cli.org1.com" peer chaincode invoke \
--peerAddresses "$peer:7051" \
--tlsRootCertFiles "/var/hyperledger/cli/crypto/peers/peer1.org1.com/tls/ca.crt" \
-C "$channel" \
-n "$chaincode" \
-c "$command" \
--waitForEvent \
--tls \
--cafile "/var/hyperledger/cli/crypto/daTls/msp/tlscacerts/tlsca.root.com-cert.pem" \
2>&1
in the line with --tlsRootCertFiles we can change peer1 with peer0 and everything will work since the content of files /var/hyperledger/cli/crypto/peers/peer1.org1.com/tls/ca.crt and /var/hyperledger/cli/crypto/peers/peer0.org1.com/tls/ca.crt is the same
https://kctheservant.medium.com/tls-in-hyperledger-fabric-b38fccb8614c