Summary
notifyOrgAboutNewChannel and notifyOrgAboutNewChannelTls in commands-generated.sh are hardcoding peer0.<org.domain> as the peer address instead of using the peer.prefix from the config. Everything else in the same file handles the prefix correctly, so this one just got missed.
You can see it clearly if you run:
- Set up a config with
"peer": { "instances": 2, "prefix": "node" }
- Run
fablo generate fablo-config.json
- Check:
grep "notifyOrgAboutNewChannel" fablo-target/fabric-docker/commands-generated.sh
All other operations will show node0.org1.example.com but notifyOrgAboutNewChannel is still pointing at peer0.org1.example.com.
Root Cause
Lines 219 and 226 in src/setup-docker/templates/fabric-docker/commands-generated.sh have the peer address hardcoded:
"peer0.<%= org.domain %>"
It should be org.headPeer.address which is already prefix-aware. org.headPeer is computed from the peer list in extendOrgsConfig.ts:258 (headPeer: peers[0]) and the exact same pattern is already being used correctly in chaincode-install-v2.sh (lines 33, 66, 89, 90) and chaincode-dev-v2.sh (lines 11, 26, 34).
Impact
Any network with a custom peer prefix will fail at anchor peer update. The CLI looks for peer0.org1.example.com which doesn't exist as a container, Docker DNS resolution fails, and the error gives no hint that the prefix config is being ignored. Took a while to track down.
Suggested Fix
Two lines need updating in src/setup-docker/templates/fabric-docker/commands-generated.sh:
- "peer0.<%= org.domain %>" <% -%>
+ "<%= org.headPeer.address %>" <% -%>
Line 219 is the non-TLS case, line 226 is the TLS variant.
Opened PR for this fix.
Summary
notifyOrgAboutNewChannelandnotifyOrgAboutNewChannelTlsincommands-generated.share hardcodingpeer0.<org.domain>as the peer address instead of using thepeer.prefixfrom the config. Everything else in the same file handles the prefix correctly, so this one just got missed.You can see it clearly if you run:
"peer": { "instances": 2, "prefix": "node" }fablo generate fablo-config.jsongrep "notifyOrgAboutNewChannel" fablo-target/fabric-docker/commands-generated.shAll other operations will show
node0.org1.example.combutnotifyOrgAboutNewChannelis still pointing atpeer0.org1.example.com.Root Cause
Lines 219 and 226 in
src/setup-docker/templates/fabric-docker/commands-generated.shhave the peer address hardcoded:It should be
org.headPeer.addresswhich is already prefix-aware.org.headPeeris computed from the peer list inextendOrgsConfig.ts:258(headPeer: peers[0]) and the exact same pattern is already being used correctly inchaincode-install-v2.sh(lines 33, 66, 89, 90) andchaincode-dev-v2.sh(lines 11, 26, 34).Impact
Any network with a custom peer prefix will fail at anchor peer update. The CLI looks for
peer0.org1.example.comwhich doesn't exist as a container, Docker DNS resolution fails, and the error gives no hint that the prefix config is being ignored. Took a while to track down.Suggested Fix
Two lines need updating in
src/setup-docker/templates/fabric-docker/commands-generated.sh:Line 219 is the non-TLS case, line 226 is the TLS variant.
Opened PR for this fix.