Skip to content

docs: fix missing --tlsRootCertFiles in CLI examples#5471

Open
mishalshanavas wants to merge 1 commit into
hyperledger:mainfrom
mishalshanavas:docs/fix-missing-tlsRootCertFiles
Open

docs: fix missing --tlsRootCertFiles in CLI examples#5471
mishalshanavas wants to merge 1 commit into
hyperledger:mainfrom
mishalshanavas:docs/fix-missing-tlsRootCertFiles

Conversation

@mishalshanavas
Copy link
Copy Markdown
Contributor

Title: docs: fix missing --tlsRootCertFiles in peer chaincode CLI examples

Type of change

  • Documentation update

Description

Two CLI examples in the wrapper documentation files were missing the --tlsRootCertFiles flag, which must be paired 1:1 with each --peerAddresses entry when TLS is enabled.

  • docs/wrappers/peer_chaincode_postscript.md: the peer chaincode invoke example had no TLS flags at all — added --tls --cafile for the orderer and --tlsRootCertFiles for each peer address.
  • docs/wrappers/peer_lifecycle_chaincode_postscript.md: the peer lifecycle chaincode commit example had --tls --cafile set (TLS on) but was missing --tlsRootCertFiles for both peer addresses.

Additional details

Tested on fabric-samples/test-network with a live TLS-enabled network.

@mishalshanavas mishalshanavas requested review from a team as code owners May 5, 2026 09:03
@mishalshanavas
Copy link
Copy Markdown
Contributor Author

Reproduction steps (using fabric-samples/test-network):

Before (old example — broken):

peer chaincode invoke -o localhost:7050 -C mychannel -n basic \
  --peerAddresses localhost:7051 \
  --peerAddresses localhost:9051 \
  -c '{"function":"InitLedger","Args":[]}'

# Error: error validating peer connection parameters: number of peer addresses (2)
# does not match the number of TLS root cert files (1)

After (fixed example):

peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com \
  --tls --cafile "${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" \
  -C mychannel -n basic \
  --peerAddresses localhost:7051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" \
  --peerAddresses localhost:9051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" \
  -c '{"function":"InitLedger","Args":[]}'

# Chaincode invoke successful. result: status:200

@mishalshanavas mishalshanavas force-pushed the docs/fix-missing-tlsRootCertFiles branch from b131bfd to bb4decc Compare May 5, 2026 09:09
The wrapper postscript examples for 'peer chaincode invoke'
and 'peer lifecycle chaincode commit' were missing the
--tlsRootCertFiles flag when --peerAddresses was used in a
TLS-enabled network. Without this flag, both commands would
fail to connect to peers when TLS is enabled.

Updated examples to pair --tlsRootCertFiles with each
--peerAddresses entry, consistent with the pattern used in
docs/source/endorsement-policies.rst and other tutorials.

Signed-off-by: mishalshanavas <mishalshanavas8@gmail.com>
@mishalshanavas mishalshanavas force-pushed the docs/fix-missing-tlsRootCertFiles branch from bb4decc to d2e79c4 Compare May 5, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant