Skip to content

Commit 15354cb

Browse files
authored
Merge branch 'main' into fix-hyperledger-labs#340
2 parents f2a93ac + 271fa1a commit 15354cb

34 files changed

+2316
-222
lines changed

.github/workflows/publish-docker-on-main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ jobs:
3939
--platform linux/amd64,linux/arm64 \
4040
--tag "ghcr.io/fablo-io/fablo-kv-node-chaincode-sample:$FABLO_VERSION" \
4141
--push \
42-
samples/chaincodes/chaincode-kv-node
42+
samples/chaincodes/chaincode-kv-node

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ node_modules
77
.idea
88
.vscode
99
samples/invalid-fablo-config.json
10-
.DS_Store
10+
.DS_Store

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
[#569](https://github.com/hyperledger-labs/fablo/pull/569)
1010
* Export network topology with Mermaid
1111
[#565](https://github.com/hyperledger-labs/fablo/pull/565)
12+
* Support installing Chaincode from Docker image using CCaaS
13+
[#550](https://github.com/hyperledger-labs/fablo/pull/550)
14+
[#582](https://github.com/hyperledger-labs/fablo/pull/582)
1215

1316
## 2.2.0
1417

COVERAGE_TRACKER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This document provides an overview of Fablo features. The table below tracks fea
2222
| Node ||| | | |
2323
| Go ||| | | |
2424
| Java ||| | | |
25-
| Chaincode-as-a-Service (CCaaS) | || | | |
25+
| Chaincode-as-a-Service (CCaaS) | || | [04_v2](/e2e-network/docker/test-04-v2-snapshot.sh) | |
2626
| Endorsement Policies ||| | | |
2727
| Multi-org Endorsements ||| | | |
2828
| Private Data Collections ||| | | |

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ Example:
201201
3. Execute `./fablo prune` to destroy the current network. If the network was present, Fablo would not be able to restore the new one from backup.
202202
4. Execute `./fablo restore /tmp/my-snapshot` to restore the network.
203203
5. Execute `./fablo start` to start the restored network.
204+
6. When running external chaincodes(CCAAS), Execute `./fablo chaincodes install` to start the CCAAS container
204205
205206
Typically, a snapshot of the network with little data will take less than 1 MB, so it is easy to share.
206207

docs/schema.json

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,20 @@
416416
"name",
417417
"version",
418418
"lang",
419-
"channel",
420-
"directory"
419+
"channel"
420+
],
421+
"allOf": [
422+
{
423+
"if": {
424+
"properties": { "lang": { "const": "ccaas"}}
425+
},
426+
"then": {
427+
"required": [ "image"]
428+
},
429+
"else": {
430+
"required": [ "directory" ]
431+
}
432+
}
421433
],
422434
"properties": {
423435
"name": {
@@ -439,7 +451,8 @@
439451
"enum": [
440452
"golang",
441453
"java",
442-
"node"
454+
"node",
455+
"ccaas"
443456
]
444457
},
445458
"channel": {
@@ -478,6 +491,11 @@
478491
"title": "Chaincode directory",
479492
"type": "string"
480493
},
494+
"image": {
495+
"$id": "#/properties/chaincodes/items/properties/image",
496+
"title": "Chaincode image URI",
497+
"type": "string"
498+
},
481499
"privateData": {
482500
"$id": "#/properties/chaincodes/items/properties/privateData",
483501
"title": "Private data collections",

e2e-network/docker/test-01-v2-simple.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ expectInvoke "peer0.org1.example.com" "my-channel1" "chaincode1" \
9191
'{"Args":["KVContract:put", "name", "James Bond"]}' \
9292
'{\"success\":\"OK\"}'
9393

94-
9594
# Test export-network-topology to Mermaid
9695
cp -f "$FABLO_HOME/samples/fablo-config-hlf2-1org-1chaincode.json" "$TEST_TMP/simple-config.json"
9796
(cd "$TEST_TMP" && "$FABLO_HOME/fablo.sh" export-network-topology simple-config.json simple-network-topology.mmd)

e2e-network/docker/test-04-v2-snapshot.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ hook_command="perl -i -pe 's/FABRIC_VERSION=2\.3\.3/FABRIC_VERSION=2\.4\.2/g' ./
111111
"$FABLO_HOME/fablo.sh" prune &&
112112
"$FABLO_HOME/fablo.sh" restore "$snapshot_name" "$hook_command" &&
113113
"$FABLO_HOME/fablo.sh" start
114+
"$FABLO_HOME/fablo.sh" chaincodes install
114115
)
115116

116117
waitForContainer "explorer.example.com" "Successfully created channel event hub for \[my-channel1\]" "200"
@@ -129,3 +130,5 @@ expectInvokeRest "$fablo_rest_org1 $user_token" "my-channel1" "chaincode1" \
129130
expectInvokeRest "$fablo_rest_org1 $user_token" "my-channel1" "chaincode1" \
130131
"KVContract:getPrivateMessage" '["_implicit_org_Org1MSP"]' \
131132
'{"success":"RHIgVmljdG9yIEZyaWVz"}'
133+
134+
echo "✅ Test passed!"

e2e/__snapshots__/extendConfig.test.ts.snap

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ exports[`extend config samples/fablo-config-hlf2-1org-1chaincode.json 1`] = `
244244
},
245245
"directory": "./chaincodes/chaincode-kv-node",
246246
"endorsement": undefined,
247+
"image": undefined,
247248
"initRequired": false,
248249
"instantiatingOrg": {
249250
"anchorPeers": [
@@ -334,6 +335,7 @@ exports[`extend config samples/fablo-config-hlf2-1org-1chaincode.json 1`] = `
334335
},
335336
"lang": "node",
336337
"name": "chaincode1",
338+
"peerChaincodeInstances": [],
337339
"privateData": [],
338340
"privateDataConfigFile": undefined,
339341
"version": "0.0.1",
@@ -1070,6 +1072,7 @@ exports[`extend config samples/fablo-config-hlf2-1org-1chaincode-k8s.json 1`] =
10701072
},
10711073
"directory": "./chaincodes/chaincode-kv-node",
10721074
"endorsement": undefined,
1075+
"image": undefined,
10731076
"initRequired": false,
10741077
"instantiatingOrg": {
10751078
"anchorPeers": [
@@ -1160,6 +1163,7 @@ exports[`extend config samples/fablo-config-hlf2-1org-1chaincode-k8s.json 1`] =
11601163
},
11611164
"lang": "node",
11621165
"name": "chaincode1",
1166+
"peerChaincodeInstances": [],
11631167
"privateData": [],
11641168
"privateDataConfigFile": undefined,
11651169
"version": "0.0.1",
@@ -1886,6 +1890,7 @@ exports[`extend config samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.j
18861890
},
18871891
"directory": "./chaincodes/chaincode-kv-node",
18881892
"endorsement": undefined,
1893+
"image": undefined,
18891894
"initRequired": false,
18901895
"instantiatingOrg": {
18911896
"anchorPeers": [
@@ -1971,6 +1976,7 @@ exports[`extend config samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.j
19711976
},
19721977
"lang": "node",
19731978
"name": "chaincode1",
1979+
"peerChaincodeInstances": [],
19741980
"privateData": [],
19751981
"privateDataConfigFile": undefined,
19761982
"version": "0.0.1",
@@ -2681,8 +2687,9 @@ exports[`extend config samples/fablo-config-hlf2-1org-1chaincode-raft-explorer.j
26812687
],
26822688
"profileName": "MyChannel1",
26832689
},
2684-
"directory": "./chaincodes/chaincode-kv-node",
2690+
"directory": undefined,
26852691
"endorsement": undefined,
2692+
"image": "ghcr.io/fablo-io/fablo-sample-kv-node-chaincode:2.2.0",
26862693
"initRequired": false,
26872694
"instantiatingOrg": {
26882695
"anchorPeers": [
@@ -2766,8 +2773,16 @@ exports[`extend config samples/fablo-config-hlf2-1org-1chaincode-raft-explorer.j
27662773
},
27672774
},
27682775
},
2769-
"lang": "node",
2776+
"lang": "ccaas",
27702777
"name": "chaincode1",
2778+
"peerChaincodeInstances": [
2779+
{
2780+
"containerName": "ccaas-peer0.org1.example.com-chaincode1",
2781+
"orgDomain": "org1.example.com",
2782+
"peerAddress": "peer0.org1.example.com",
2783+
"port": 17041,
2784+
},
2785+
],
27712786
"privateData": [],
27722787
"privateDataConfigFile": undefined,
27732788
"version": "0.0.1",
@@ -3557,6 +3572,7 @@ exports[`extend config samples/fablo-config-hlf2-2orgs-2chaincodes-private-data.
35573572
},
35583573
"directory": "./chaincodes/chaincode-kv-node",
35593574
"endorsement": "OR('Org1MSP.member', 'Org2MSP.member')",
3575+
"image": undefined,
35603576
"initRequired": false,
35613577
"instantiatingOrg": {
35623578
"anchorPeers": [
@@ -3647,6 +3663,7 @@ exports[`extend config samples/fablo-config-hlf2-2orgs-2chaincodes-private-data.
36473663
},
36483664
"lang": "node",
36493665
"name": "or-policy-chaincode",
3666+
"peerChaincodeInstances": [],
36503667
"privateData": [
36513668
{
36523669
"blockToLive": 0,
@@ -3965,6 +3982,7 @@ exports[`extend config samples/fablo-config-hlf2-2orgs-2chaincodes-private-data.
39653982
},
39663983
"directory": "./chaincodes/chaincode-kv-go",
39673984
"endorsement": "AND('Org1MSP.member', 'Org2MSP.member')",
3985+
"image": undefined,
39683986
"initRequired": false,
39693987
"instantiatingOrg": {
39703988
"anchorPeers": [
@@ -4055,6 +4073,7 @@ exports[`extend config samples/fablo-config-hlf2-2orgs-2chaincodes-private-data.
40554073
},
40564074
"lang": "golang",
40574075
"name": "and-policy-chaincode",
4076+
"peerChaincodeInstances": [],
40584077
"privateData": [
40594078
{
40604079
"blockToLive": 0,
@@ -5034,6 +5053,7 @@ exports[`extend config samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml 1`]
50345053
},
50355054
"directory": "./chaincodes/chaincode-kv-node",
50365055
"endorsement": "OR ('Org1MSP.member', 'Org2MSP.member')",
5056+
"image": undefined,
50375057
"initRequired": false,
50385058
"instantiatingOrg": {
50395059
"anchorPeers": [
@@ -5129,6 +5149,7 @@ exports[`extend config samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml 1`]
51295149
},
51305150
"lang": "node",
51315151
"name": "chaincode1",
5152+
"peerChaincodeInstances": [],
51325153
"privateData": [],
51335154
"privateDataConfigFile": undefined,
51345155
"version": "0.0.1",
@@ -5481,6 +5502,7 @@ exports[`extend config samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml 1`]
54815502
},
54825503
"directory": "./chaincodes/chaincode-java-simple",
54835504
"endorsement": "OR ('Org1MSP.member', 'Org2MSP.member')",
5505+
"image": undefined,
54845506
"initRequired": false,
54855507
"instantiatingOrg": {
54865508
"anchorPeers": [
@@ -5576,6 +5598,7 @@ exports[`extend config samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml 1`]
55765598
},
55775599
"lang": "java",
55785600
"name": "chaincode2",
5601+
"peerChaincodeInstances": [],
55795602
"privateData": [],
55805603
"privateDataConfigFile": undefined,
55815604
"version": "0.0.1",
@@ -7601,6 +7624,7 @@ exports[`extend config samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.
76017624
},
76027625
"directory": "./chaincodes/chaincode-kv-node",
76037626
"endorsement": undefined,
7627+
"image": undefined,
76047628
"initRequired": false,
76057629
"instantiatingOrg": {
76067630
"anchorPeers": [
@@ -7739,6 +7763,7 @@ exports[`extend config samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.
77397763
},
77407764
"lang": "node",
77417765
"name": "chaincode1",
7766+
"peerChaincodeInstances": [],
77427767
"privateData": [],
77437768
"privateDataConfigFile": undefined,
77447769
"version": "0.0.1",
@@ -10226,6 +10251,7 @@ exports[`extend config samples/fablo-config-hlf3-1orgs-1chaincode.json 1`] = `
1022610251
},
1022710252
"directory": "./chaincodes/chaincode-kv-node",
1022810253
"endorsement": "AND ('Org1MSP.member')",
10254+
"image": undefined,
1022910255
"init": "{"Args":[]}",
1023010256
"instantiatingOrg": {
1023110257
"anchorPeers": [
@@ -10316,6 +10342,7 @@ exports[`extend config samples/fablo-config-hlf3-1orgs-1chaincode.json 1`] = `
1031610342
},
1031710343
"lang": "node",
1031810344
"name": "chaincode1",
10345+
"peerChaincodeInstances": [],
1031910346
"privateData": [],
1032010347
"privateDataConfigFile": undefined,
1032110348
"version": "0.0.1",
@@ -11184,6 +11211,7 @@ exports[`extend config samples/fablo-config-hlf3-bft-1orgs-1chaincode.json 1`] =
1118411211
},
1118511212
"directory": "./chaincodes/chaincode-kv-node",
1118611213
"endorsement": "AND ('Org1MSP.member')",
11214+
"image": undefined,
1118711215
"init": "{"Args":[]}",
1118811216
"instantiatingOrg": {
1118911217
"anchorPeers": [
@@ -11274,6 +11302,7 @@ exports[`extend config samples/fablo-config-hlf3-bft-1orgs-1chaincode.json 1`] =
1127411302
},
1127511303
"lang": "node",
1127611304
"name": "chaincode1",
11305+
"peerChaincodeInstances": [],
1127711306
"privateData": [],
1127811307
"privateDataConfigFile": undefined,
1127911308
"version": "0.0.1",
@@ -12097,8 +12126,9 @@ exports[`extend config samples/invalid-fablo-config.json 1`] = `
1209712126
],
1209812127
"profileName": "MyChannel1",
1209912128
},
12100-
"directory": "./chaincodes/chaincode-kv-node",
12129+
"directory": undefined,
1210112130
"endorsement": undefined,
12131+
"image": "ghcr.io/fablo-io/fablo-sample-kv-node-chaincode:2.2.0",
1210212132
"initRequired": false,
1210312133
"instantiatingOrg": {
1210412134
"anchorPeers": [
@@ -12182,8 +12212,16 @@ exports[`extend config samples/invalid-fablo-config.json 1`] = `
1218212212
},
1218312213
},
1218412214
},
12185-
"lang": "node",
12215+
"lang": "ccaas",
1218612216
"name": "chaincode1",
12217+
"peerChaincodeInstances": [
12218+
{
12219+
"containerName": "ccaas-peer0.org1.example.com-chaincode1",
12220+
"orgDomain": "org1.example.com",
12221+
"peerAddress": "peer0.org1.example.com",
12222+
"port": 17041,
12223+
},
12224+
],
1218712225
"privateData": [],
1218812226
"privateDataConfigFile": undefined,
1218912227
"version": "0.0.1",
@@ -12862,6 +12900,7 @@ exports[`extend config samples/java-dev-mode-sample.json 1`] = `
1286212900
},
1286312901
"directory": "./chaincodes/java-chaincode",
1286412902
"endorsement": undefined,
12903+
"image": undefined,
1286512904
"initRequired": false,
1286612905
"instantiatingOrg": {
1286712906
"anchorPeers": [
@@ -12928,6 +12967,7 @@ exports[`extend config samples/java-dev-mode-sample.json 1`] = `
1292812967
},
1292912968
"lang": "java",
1293012969
"name": "chaincode1",
12970+
"peerChaincodeInstances": [],
1293112971
"privateData": [],
1293212972
"privateDataConfigFile": undefined,
1293312973
"version": "0.0.1",

0 commit comments

Comments
 (0)