Skip to content

Commit dbc4256

Browse files
committed
fix: Resolve port conflict
Signed-off-by: Osama Rabea <159753803+OsamaRab3@users.noreply.github.com>
1 parent 75a2f05 commit dbc4256

7 files changed

+45
-39
lines changed

e2e/__snapshots__/fablo-config-hlf2-1org-1chaincode.json.test.ts.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ exports[`samples/fablo-config-hlf2-1org-1chaincode.json should create proper e2e
212212
"url": "grpcs://localhost:7041"
213213
},
214214
"peer1.org1.example.com": {
215-
"url": "grpcs://localhost:7042"
215+
"url": "grpcs://localhost:7043"
216216
}
217217
},
218218
"certificateAuthorities": {
@@ -246,7 +246,7 @@ peers:
246246
peer0.org1.example.com:
247247
url: grpcs://localhost:7041
248248
peer1.org1.example.com:
249-
url: grpcs://localhost:7042
249+
url: grpcs://localhost:7043
250250
certificateAuthorities:
251251
ca.orderer.example.com:
252252
url: http://localhost:7020
@@ -281,7 +281,7 @@ exports[`samples/fablo-config-hlf2-1org-1chaincode.json should create proper e2e
281281
"url": "grpcs://localhost:7041"
282282
},
283283
"peer1.org1.example.com": {
284-
"url": "grpcs://localhost:7042"
284+
"url": "grpcs://localhost:7043"
285285
}
286286
},
287287
"certificateAuthorities": {
@@ -315,7 +315,7 @@ peers:
315315
peer0.org1.example.com:
316316
url: grpcs://localhost:7041
317317
peer1.org1.example.com:
318-
url: grpcs://localhost:7042
318+
url: grpcs://localhost:7043
319319
certificateAuthorities:
320320
ca.org1.example.com:
321321
url: http://localhost:7040
@@ -2025,8 +2025,8 @@ services:
20252025
command: peer node start
20262026
ports:
20272027
- 8042:9440
2028-
- 7042:7042
2029-
- 7043:7043
2028+
- 7043:7042
2029+
- 7044:7043
20302030
volumes:
20312031
- /var/run/docker.sock:/host/var/run/docker.sock
20322032
- ../fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp:/etc/hyperledger/fabric/peer/msp

e2e/__snapshots__/fablo-config-hlf2-2orgs-2chaincodes-private-data.yaml.test.ts.snap

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ exports[`samples/fablo-config-hlf2-2orgs-2chaincodes-private-data.yaml should cr
267267
"url": "grpcs://localhost:7041"
268268
},
269269
"peer1.org1.example.com": {
270-
"url": "grpcs://localhost:7042"
270+
"url": "grpcs://localhost:7043"
271271
},
272272
"peer0.org2.example.com": {
273273
"url": "grpcs://localhost:7061"
@@ -305,7 +305,7 @@ peers:
305305
peer0.org1.example.com:
306306
url: grpcs://localhost:7041
307307
peer1.org1.example.com:
308-
url: grpcs://localhost:7042
308+
url: grpcs://localhost:7043
309309
peer0.org2.example.com:
310310
url: grpcs://localhost:7061
311311
certificateAuthorities:
@@ -343,7 +343,7 @@ exports[`samples/fablo-config-hlf2-2orgs-2chaincodes-private-data.yaml should cr
343343
"url": "grpcs://localhost:7041"
344344
},
345345
"peer1.org1.example.com": {
346-
"url": "grpcs://localhost:7042"
346+
"url": "grpcs://localhost:7043"
347347
},
348348
"peer0.org2.example.com": {
349349
"url": "grpcs://localhost:7061"
@@ -381,7 +381,7 @@ peers:
381381
peer0.org1.example.com:
382382
url: grpcs://localhost:7041
383383
peer1.org1.example.com:
384-
url: grpcs://localhost:7042
384+
url: grpcs://localhost:7043
385385
peer0.org2.example.com:
386386
url: grpcs://localhost:7061
387387
certificateAuthorities:
@@ -419,7 +419,7 @@ exports[`samples/fablo-config-hlf2-2orgs-2chaincodes-private-data.yaml should cr
419419
"url": "grpcs://localhost:7041"
420420
},
421421
"peer1.org1.example.com": {
422-
"url": "grpcs://localhost:7042"
422+
"url": "grpcs://localhost:7043"
423423
},
424424
"peer0.org2.example.com": {
425425
"url": "grpcs://localhost:7061"
@@ -457,7 +457,7 @@ peers:
457457
peer0.org1.example.com:
458458
url: grpcs://localhost:7041
459459
peer1.org1.example.com:
460-
url: grpcs://localhost:7042
460+
url: grpcs://localhost:7043
461461
peer0.org2.example.com:
462462
url: grpcs://localhost:7061
463463
certificateAuthorities:
@@ -2858,8 +2858,8 @@ services:
28582858
command: peer node start
28592859
ports:
28602860
- 8042:9440
2861-
- 7042:7042
2862-
- 7043:7043
2861+
- 7043:7042
2862+
- 7044:7043
28632863
volumes:
28642864
- /var/run/docker.sock:/host/var/run/docker.sock
28652865
- ../fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp:/etc/hyperledger/fabric/peer/msp

e2e/__snapshots__/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.json.test.ts.snap

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ exports[`samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.json should cr
374374
}
375375
},
376376
"peer1.org1.example.com": {
377-
"url": "grpcs://localhost:7042",
377+
"url": "grpcs://localhost:7043",
378378
"tlsCACerts": {
379379
"path": "<absolute path>/samples/fablo-target/fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"
380380
},
@@ -462,7 +462,7 @@ peers:
462462
grpcOptions:
463463
ssl-target-name-override: peer0.org1.example.com
464464
peer1.org1.example.com:
465-
url: grpcs://localhost:7042
465+
url: grpcs://localhost:7043
466466
tlsCACerts:
467467
path: >-
468468
<absolute path>/samples/fablo-target/fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt
@@ -543,7 +543,7 @@ exports[`samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.json should cr
543543
}
544544
},
545545
"peer1.org1.example.com": {
546-
"url": "grpcs://localhost:7042",
546+
"url": "grpcs://localhost:7043",
547547
"tlsCACerts": {
548548
"path": "<absolute path>/samples/fablo-target/fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"
549549
},
@@ -631,7 +631,7 @@ peers:
631631
grpcOptions:
632632
ssl-target-name-override: peer0.org1.example.com
633633
peer1.org1.example.com:
634-
url: grpcs://localhost:7042
634+
url: grpcs://localhost:7043
635635
tlsCACerts:
636636
path: >-
637637
<absolute path>/samples/fablo-target/fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt
@@ -712,7 +712,7 @@ exports[`samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.json should cr
712712
}
713713
},
714714
"peer1.org1.example.com": {
715-
"url": "grpcs://localhost:7042",
715+
"url": "grpcs://localhost:7043",
716716
"tlsCACerts": {
717717
"path": "<absolute path>/samples/fablo-target/fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"
718718
},
@@ -800,7 +800,7 @@ peers:
800800
grpcOptions:
801801
ssl-target-name-override: peer0.org1.example.com
802802
peer1.org1.example.com:
803-
url: grpcs://localhost:7042
803+
url: grpcs://localhost:7043
804804
tlsCACerts:
805805
path: >-
806806
<absolute path>/samples/fablo-target/fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt
@@ -881,7 +881,7 @@ exports[`samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.json should cr
881881
}
882882
},
883883
"peer1.org1.example.com": {
884-
"url": "grpcs://localhost:7042",
884+
"url": "grpcs://localhost:7043",
885885
"tlsCACerts": {
886886
"path": "<absolute path>/samples/fablo-target/fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"
887887
},
@@ -969,7 +969,7 @@ peers:
969969
grpcOptions:
970970
ssl-target-name-override: peer0.org1.example.com
971971
peer1.org1.example.com:
972-
url: grpcs://localhost:7042
972+
url: grpcs://localhost:7043
973973
tlsCACerts:
974974
path: >-
975975
<absolute path>/samples/fablo-target/fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt
@@ -1159,7 +1159,7 @@ exports[`samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.json should cr
11591159
}
11601160
},
11611161
"peer1.org1.example.com": {
1162-
"url": "grpcs://peer1.org1.example.com:7042",
1162+
"url": "grpcs://peer1.org1.example.com:7043",
11631163
"tlsCACerts": {
11641164
"path": "/tmp/crypto/peerOrganizations/org1.example.com/msp/tlscacerts/tlsca.org1.example.com-cert.pem"
11651165
}
@@ -4361,8 +4361,8 @@ services:
43614361
command: peer node start
43624362
ports:
43634363
- 8042:9440
4364-
- 7042:7042
4365-
- 7043:7043
4364+
- 7043:7042
4365+
- 7044:7043
43664366
volumes:
43674367
- /var/run/docker.sock:/host/var/run/docker.sock
43684368
- ../fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp:/etc/hyperledger/fabric/peer/msp

e2e/__snapshots__/fablo-config-hlf3-1orgs-1chaincode.json.test.ts.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ exports[`samples/fablo-config-hlf3-1orgs-1chaincode.json should create proper e2
235235
}
236236
},
237237
"peer1.org1.example.com": {
238-
"url": "grpcs://localhost:7042",
238+
"url": "grpcs://localhost:7043",
239239
"tlsCACerts": {
240240
"path": "<absolute path>/samples/fablo-target/fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"
241241
},
@@ -283,7 +283,7 @@ peers:
283283
grpcOptions:
284284
ssl-target-name-override: peer0.org1.example.com
285285
peer1.org1.example.com:
286-
url: grpcs://localhost:7042
286+
url: grpcs://localhost:7043
287287
tlsCACerts:
288288
path: >-
289289
<absolute path>/samples/fablo-target/fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt
@@ -332,7 +332,7 @@ exports[`samples/fablo-config-hlf3-1orgs-1chaincode.json should create proper e2
332332
}
333333
},
334334
"peer1.org1.example.com": {
335-
"url": "grpcs://localhost:7042",
335+
"url": "grpcs://localhost:7043",
336336
"tlsCACerts": {
337337
"path": "<absolute path>/samples/fablo-target/fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"
338338
},
@@ -380,7 +380,7 @@ peers:
380380
grpcOptions:
381381
ssl-target-name-override: peer0.org1.example.com
382382
peer1.org1.example.com:
383-
url: grpcs://localhost:7042
383+
url: grpcs://localhost:7043
384384
tlsCACerts:
385385
path: >-
386386
<absolute path>/samples/fablo-target/fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt
@@ -2268,8 +2268,8 @@ services:
22682268
command: peer node start
22692269
ports:
22702270
- 8042:9440
2271-
- 7042:7042
2272-
- 7043:7043
2271+
- 7043:7042
2272+
- 7044:7043
22732273
volumes:
22742274
- /var/run/docker.sock:/host/var/run/docker.sock
22752275
- ../fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp:/etc/hyperledger/fabric/peer/msp

e2e/__snapshots__/fablo-config-hlf3-bft-1orgs-1chaincode.json.test.ts.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ exports[`samples/fablo-config-hlf3-bft-1orgs-1chaincode.json should create prope
260260
}
261261
},
262262
"peer1.org1.example.com": {
263-
"url": "grpcs://localhost:7042",
263+
"url": "grpcs://localhost:7043",
264264
"tlsCACerts": {
265265
"path": "<absolute path>/samples/fablo-target/fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"
266266
},
@@ -308,7 +308,7 @@ peers:
308308
grpcOptions:
309309
ssl-target-name-override: peer0.org1.example.com
310310
peer1.org1.example.com:
311-
url: grpcs://localhost:7042
311+
url: grpcs://localhost:7043
312312
tlsCACerts:
313313
path: >-
314314
<absolute path>/samples/fablo-target/fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt
@@ -357,7 +357,7 @@ exports[`samples/fablo-config-hlf3-bft-1orgs-1chaincode.json should create prope
357357
}
358358
},
359359
"peer1.org1.example.com": {
360-
"url": "grpcs://localhost:7042",
360+
"url": "grpcs://localhost:7043",
361361
"tlsCACerts": {
362362
"path": "<absolute path>/samples/fablo-target/fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"
363363
},
@@ -405,7 +405,7 @@ peers:
405405
grpcOptions:
406406
ssl-target-name-override: peer0.org1.example.com
407407
peer1.org1.example.com:
408-
url: grpcs://localhost:7042
408+
url: grpcs://localhost:7043
409409
tlsCACerts:
410410
path: >-
411411
<absolute path>/samples/fablo-target/fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt
@@ -2292,8 +2292,8 @@ services:
22922292
command: peer node start
22932293
ports:
22942294
- 8042:9440
2295-
- 7042:7042
2296-
- 7043:7043
2295+
- 7043:7042
2296+
- 7044:7043
22972297
volumes:
22982298
- /var/run/docker.sock:/host/var/run/docker.sock
22992299
- ../fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp:/etc/hyperledger/fabric/peer/msp

src/setup-docker/templates/fabric-docker/docker-compose.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,13 @@ services:
293293
command: peer node start <%= global.peerDevMode ? '--peer-chaincodedev=true' : '' %>
294294
ports:
295295
- <%= peer.port + 1000 %>:9440
296+
<%_ if (peer.port === 7042) { _%>
297+
- 7043:<%= peer.port %>
298+
- <%= peer.port + 2 %>:<%= peer.port + 1 %>
299+
<%_ } else { _%>
296300
- <%= peer.port %>:<%= peer.port %>
297301
- <%= peer.port + 1 %>:<%= peer.port + 1 %>
302+
<%_ } _%>
298303
<%_ if(peer.db.type==="CouchDb") { _%>
299304
depends_on:
300305
couchdb.<%= peer.name %>.<%= org.domain %>:

src/types/ConnectionProfile.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,10 @@ function createPeers(
117117
if ((orgName === o.name && isExplorer) || !isExplorer) {
118118
o.anchorPeers.forEach((p: PeerConfig) => {
119119
const tlsCACertsExplorerPath = `${rootPath}/peerOrganizations/${o.domain}/msp/tlscacerts/tlsca.${o.domain}-cert.pem`;
120+
const peerPort = p.port === 7042 ? 7043 : p.port;
120121
if (isTls) {
121122
peers[p.address] = {
122-
url: isExplorer ? `grpcs://${p.address}:${p.port}` : `grpcs://localhost:${p.port}`,
123+
url: isExplorer ? `grpcs://${p.address}:${peerPort}` : `grpcs://localhost:${peerPort}`,
123124
tlsCACerts: {
124125
path: isExplorer
125126
? tlsCACertsExplorerPath
@@ -133,7 +134,7 @@ function createPeers(
133134
}
134135
} else {
135136
peers[p.address] = {
136-
url: isExplorer ? `grpcs://${p.address}:${p.port}` : `grpcs://localhost:${p.port}`,
137+
url: isExplorer ? `grpcs://${p.address}:${peerPort}` : `grpcs://localhost:${peerPort}`,
137138
};
138139
if (isExplorer) {
139140
peers[p.address]["tlsCACerts"] = {

0 commit comments

Comments
 (0)