@@ -234,6 +234,16 @@ function createOrderer() {
234
234
fabric-ca-client register --caname ca.orderer.example.com --id.name orderer --id.secret ordererpw --id.type orderer --tls.certfiles " ${PWD} /organizations/fabric-ca/ordererOrg/ca-cert.pem"
235
235
{ set +x; } 2> /dev/null
236
236
237
+ infoln " Registering orderer2"
238
+ set -x
239
+ fabric-ca-client register --caname ca.orderer.example.com --id.name orderer2 --id.secret ordererpw --id.type orderer --tls.certfiles " ${PWD} /organizations/fabric-ca/ordererOrg/ca-cert.pem"
240
+ { set +x; } 2> /dev/null
241
+
242
+ infoln " Registering orderer3"
243
+ set -x
244
+ fabric-ca-client register --caname ca.orderer.example.com --id.name orderer3 --id.secret ordererpw --id.type orderer --tls.certfiles " ${PWD} /organizations/fabric-ca/ordererOrg/ca-cert.pem"
245
+ { set +x; } 2> /dev/null
246
+
237
247
infoln " Registering the orderer admin"
238
248
set -x
239
249
fabric-ca-client register --caname ca.orderer.example.com --id.name ordererAdmin --id.secret ordererAdminpw --id.type admin --tls.certfiles " ${PWD} /organizations/fabric-ca/ordererOrg/ca-cert.pem"
@@ -244,22 +254,58 @@ function createOrderer() {
244
254
fabric-ca-client enroll -u https://orderer:
[email protected] :9054 --caname ca.orderer.example.com -M
" ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp" --csr.hosts orderer.example.com --csr.hosts 10.184.0.5 --tls.certfiles
" ${PWD} /organizations/fabric-ca/ordererOrg/ca-cert.pem"
245
255
{ set +x; } 2> /dev/null
246
256
257
+ infoln " Generating the orderer2 msp"
258
+ set -x
259
+ fabric-ca-client enroll -u https://orderer2:
[email protected] :9054 --caname ca.orderer.example.com -M
" ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer2.example.com/msp" --csr.hosts orderer2.example.com --csr.hosts 10.184.0.6 --tls.certfiles
" ${PWD} /organizations/fabric-ca/ordererOrg/ca-cert.pem"
260
+ { set +x; } 2> /dev/null
261
+
262
+ infoln " Generating the orderer3 msp"
263
+ set -x
264
+ fabric-ca-client enroll -u https://orderer3:
[email protected] :9054 --caname ca.orderer.example.com -M
" ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer3.example.com/msp" --csr.hosts orderer3.example.com --csr.hosts 10.184.0.7 --tls.certfiles
" ${PWD} /organizations/fabric-ca/ordererOrg/ca-cert.pem"
265
+ { set +x; } 2> /dev/null
266
+
247
267
cp " ${PWD} /organizations/ordererOrganizations/example.com/msp/config.yaml" " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/config.yaml"
268
+ cp " ${PWD} /organizations/ordererOrganizations/example.com/msp/config.yaml" " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer2.example.com/msp/config.yaml"
269
+ cp " ${PWD} /organizations/ordererOrganizations/example.com/msp/config.yaml" " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer3.example.com/msp/config.yaml"
248
270
249
271
infoln " Generating the orderer-tls certificates"
250
272
set -x
251
273
fabric-ca-client enroll -u https://orderer:
[email protected] :9054 --caname ca.orderer.example.com -M
" ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls" --enrollment.profile tls --csr.hosts orderer.example.com --csr.hosts 10.184.0.5 --tls.certfiles
" ${PWD} /organizations/fabric-ca/ordererOrg/ca-cert.pem"
252
274
{ set +x; } 2> /dev/null
253
275
276
+ infoln " Generating the orderer2-tls certificates"
277
+ set -x
278
+ fabric-ca-client enroll -u https://orderer2:
[email protected] :9054 --caname ca.orderer.example.com -M
" ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer2.example.com/tls" --enrollment.profile tls --csr.hosts orderer2.example.com --csr.hosts 10.184.0.6 --tls.certfiles
" ${PWD} /organizations/fabric-ca/ordererOrg/ca-cert.pem"
279
+ { set +x; } 2> /dev/null
280
+
281
+ infoln " Generating the orderer3-tls certificates"
282
+ set -x
283
+ fabric-ca-client enroll -u https://orderer3:
[email protected] :9054 --caname ca.orderer.example.com -M
" ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer3.example.com/tls" --enrollment.profile tls --csr.hosts orderer3.example.com --csr.hosts 10.184.0.7 --tls.certfiles
" ${PWD} /organizations/fabric-ca/ordererOrg/ca-cert.pem"
284
+ { set +x; } 2> /dev/null
285
+
254
286
# Copy the tls CA cert, server cert, server keystore to well known file names in the orderer's tls directory that are referenced by orderer startup config
255
287
cp " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/tlscacerts/" * " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt"
256
288
cp " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/signcerts/" * " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crt"
257
289
cp " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/keystore/" * " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.key"
258
290
291
+ cp " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer2.example.com/tls/tlscacerts/" * " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer2.example.com/tls/ca.crt"
292
+ cp " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer2.example.com/tls/signcerts/" * " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer2.example.com/tls/server.crt"
293
+ cp " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer2.example.com/tls/keystore/" * " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer2.example.com/tls/server.key"
294
+
295
+ cp " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer3.example.com/tls/tlscacerts/" * " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer3.example.com/tls/ca.crt"
296
+ cp " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer3.example.com/tls/signcerts/" * " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer3.example.com/tls/server.crt"
297
+ cp " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer3.example.com/tls/keystore/" * " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer3.example.com/tls/server.key"
298
+
259
299
# Copy orderer org's CA cert to orderer's /msp/tlscacerts directory (for use in the orderer MSP definition)
260
300
mkdir -p " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts"
261
301
cp " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer.example.com/tls/tlscacerts/" * " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.orderer.example.com-cert.pem"
262
302
303
+ mkdir -p " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer2.example.com/msp/tlscacerts"
304
+ cp " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer2.example.com/tls/tlscacerts/" * " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer2.example.com/msp/tlscacerts/tlsca.orderer2.example.com-cert.pem"
305
+
306
+ mkdir -p " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer3.example.com/msp/tlscacerts"
307
+ cp " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer3.example.com/tls/tlscacerts/" * " ${PWD} /organizations/ordererOrganizations/example.com/orderers/orderer3.example.com/msp/tlscacerts/tlsca.orderer3.example.com-cert.pem"
308
+
263
309
infoln " Generating the admin msp"
264
310
set -x
265
311
fabric-ca-client enroll -u https://ordererAdmin:
[email protected] :9054 --caname ca.orderer.example.com -M
" ${PWD} /organizations/ordererOrganizations/example.com/users/[email protected] /msp" --tls.certfiles
" ${PWD} /organizations/fabric-ca/ordererOrg/ca-cert.pem"
0 commit comments