10
10
matrix :
11
11
go-version : [ 1.23.x ]
12
12
os : [ ubuntu-latest ]
13
+ fabric-version : [ { version: 2.5, peer: 2.5.10, orderer: 2.5.10, ca: 1.5.13 }, { version: 3.0, peer: 3.0.0, orderer: 3.0.0, ca: 1.5.13 } ]
13
14
runs-on : ${{ matrix.os }}
14
15
env :
15
16
IMAGE : hlf-operator
56
57
kubectl create namespace istio-system
57
58
58
59
istioctl operator init
59
-
60
-
60
+
61
+
61
62
kubectl apply -f - <<EOF
62
63
apiVersion: install.istio.io/v1alpha1
63
64
kind: IstioOperator
@@ -168,14 +169,14 @@ jobs:
168
169
- name : Create Peer org
169
170
run : |
170
171
export PEER_IMAGE=hyperledger/fabric-peer
171
- export PEER_VERSION=2.5.10
172
+ export PEER_VERSION=${{ matrix.fabric-version.peer }}
172
173
173
174
export CA_IMAGE=hyperledger/fabric-ca
174
- export CA_VERSION=1.5.13
175
+ export CA_VERSION=${{ matrix.fabric-version.ca }}
175
176
176
177
kubectl hlf ca create --image=$CA_IMAGE --version=$CA_VERSION --storage-class=standard --capacity=2Gi --name=org1-ca \
177
178
--enroll-id=enroll --hosts=org1-ca.localho.st --enroll-pw=enrollpw
178
- kubectl wait --timeout=240s --for=condition=Running fabriccas.hlf.kungfusoftware.es --all
179
+ kubectl wait --timeout=240s --for=condition=Running fabriccas.hlf.kungfusoftware.es --all
179
180
180
181
# register user for the peers
181
182
kubectl hlf ca register --name=org1-ca --user=peer --secret=peerpw --type=peer \
@@ -189,10 +190,10 @@ jobs:
189
190
- name : Create Orderer Org
190
191
run : |
191
192
export ORDERER_IMAGE=hyperledger/fabric-orderer
192
- export ORDERER_VERSION=2.5.10
193
+ export ORDERER_VERSION=${{ matrix.fabric-version.orderer }}
193
194
194
195
export CA_IMAGE=hyperledger/fabric-ca
195
- export CA_VERSION=1.5.13
196
+ export CA_VERSION=${{ matrix.fabric-version.ca }}
196
197
197
198
kubectl hlf ca create --image=$CA_IMAGE --version=$CA_VERSION --storage-class=standard --capacity=2Gi --name=ord-ca \
198
199
--enroll-id=enroll --enroll-pw=enrollpw --hosts=ord-ca.localho.st
@@ -212,7 +213,7 @@ jobs:
212
213
--type=admin --enroll-id enroll --enroll-secret=enrollpw --mspid=OrdererMSP
213
214
214
215
kubectl hlf ca enroll --name=ord-ca --user=admin --secret=adminpw --mspid OrdererMSP \
215
- --ca-name ca --output admin-ordservice.yaml
216
+ --ca-name ca --output admin-ordservice.yaml
216
217
## add user from admin-ordservice.yaml to ordservice.yaml
217
218
kubectl hlf utils adduser --userPath=admin-ordservice.yaml --config=ordservice.yaml --username=admin --mspid=OrdererMSP
218
219
@@ -221,14 +222,14 @@ jobs:
221
222
222
223
# enroll using the TLS CA
223
224
kubectl hlf ca enroll --name=ord-ca --namespace=default --user=admin --secret=adminpw --mspid OrdererMSP \
224
- --ca-name tlsca --output admin-tls-ordservice.yaml
225
+ --ca-name tlsca --output admin-tls-ordservice.yaml
225
226
kubectl hlf ca enroll --name=ord-ca --namespace=default --user=admin --secret=adminpw --mspid OrdererMSP \
226
- --ca-name ca --output admin-sign-ordservice.yaml
227
+ --ca-name ca --output admin-sign-ordservice.yaml
227
228
228
229
- name : Prepare connection string for Peer
229
230
run : |
230
231
kubectl hlf ca register --name=org1-ca --user=admin --secret=adminpw --type=admin \
231
- --enroll-id enroll --enroll-secret=enrollpw --mspid Org1MSP
232
+ --enroll-id enroll --enroll-secret=enrollpw --mspid Org1MSP
232
233
233
234
kubectl hlf ca enroll --name=org1-ca --user=admin --secret=adminpw --mspid Org1MSP \
234
235
--ca-name ca --output peer-org1.yaml
@@ -237,7 +238,8 @@ jobs:
237
238
238
239
## add user key and cert to org1.yaml from admin-ordservice.yaml
239
240
kubectl hlf utils adduser --userPath=peer-org1.yaml --config=org1.yaml --username=admin --mspid=Org1MSP
240
- - name : Create a channel
241
+ - name : Create a channel(${{ matrix.fabric-version.version }})
242
+ if : ${{ matrix.fabric-version.version == '2.5' }}
241
243
run : |
242
244
243
245
kubectl create secret generic wallet --namespace=default \
@@ -328,10 +330,11 @@ jobs:
328
330
329
331
EOF
330
332
331
- kubectl wait --timeout=240s --for=condition=RUNNING fabricmainchannels.hlf.kungfusoftware.es --all
333
+ kubectl wait --timeout=240s --for=condition=RUNNING fabricmainchannels.hlf.kungfusoftware.es --all
332
334
333
335
334
336
- name : Join peers to channel
337
+ if : ${{ matrix.fabric-version.version == '2.5' }}
335
338
run : |
336
339
kubectl get fabricorderernodes ord-node1 -o jsonpath='{.status.tlsCert}' > ./orderer-cert.pem
337
340
kubectl hlf channelcrd follower create \
@@ -347,6 +350,23 @@ jobs:
347
350
--secret-key="peer-org1.yaml"
348
351
349
352
kubectl wait --timeout=240s --for=condition=RUNNING fabricfollowerchannels.hlf.kungfusoftware.es --all
353
+ - name : create a channel(${{ matrix.fabric-version.version }})
354
+ if : ${{ matrix.fabric-version.version == '3.0' }}
355
+ run : |
356
+ kubectl hlf channel generate \
357
+ --output=testchannel.block --name=testchannel \
358
+ --organizations Org1MSP --ordererOrganizations OrdererMSP \
359
+ --consensus BFT
360
+ - name : Join orderers to channel(${{ matrix.fabric-version.version }})
361
+ if : ${{ matrix.fabric-version.version == '3.0' }}
362
+ run : |
363
+ kubectl hlf ordnode join --block=testchannel.block \
364
+ --name=ord-node1 --identity=admin-tls-ordservice.yaml
365
+ - name : Join peers to channel(${{ matrix.fabric-version.version }})
366
+ if : ${{ matrix.fabric-version.version == '3.0' }}
367
+ run : |
368
+ kubectl hlf channel join --name=testchannel \
369
+ --config=org1.yaml --user=admin -p=org1-peer0.default
350
370
- name : Get channel
351
371
run : |
352
372
sleep 3
@@ -404,7 +424,7 @@ jobs:
404
424
run : |
405
425
sleep 10
406
426
echo "waiting for deployment to be ready"
407
- kubectl wait --timeout=240s --for=condition=Available deployment asset --namespace=default
427
+ kubectl wait --timeout=240s --for=condition=Available deployment asset --namespace=default
408
428
kubectl hlf chaincode invoke --config=org1.yaml \
409
429
--user=admin --peer=org1-peer0.default \
410
430
--chaincode=asset --channel=demo \
@@ -429,7 +449,7 @@ jobs:
429
449
kubectl get fabricfollowerchannels.hlf.kungfusoftware.es -A -o=custom-columns='NAME:metadata.name,NAMESPACE:metadata.namespace,STATE:status.status,MESSAGE:status.message'
430
450
kubectl get configmap coredns -n kube-system -o yaml
431
451
echo "Logs for hlf-operator deployment:"
432
- kubectl logs -l app.kubernetes.io/name=hlf-operator -c manager --tail 2500
452
+ kubectl logs -l app.kubernetes.io/name=hlf-operator -c manager --tail 2500
433
453
kubectl get fabricmainchannels -o yaml
434
454
kubectl get fabricfollowerchannels -o yaml
435
455
0 commit comments