Skip to content

Commit 3777a48

Browse files
committed
Merge branch 'main' into CI-tests
2 parents 2b78db6 + e2903e5 commit 3777a48

40 files changed

+7734
-14054
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

.github/workflows/test-on-push.yml

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -172,35 +172,11 @@ jobs:
172172
173173
test-05-v3:
174174
needs: test-main
175-
runs-on: macos-13
175+
runs-on: ubuntu-latest
176176
steps:
177177
- name: Check out repository code
178178
uses: actions/checkout@v2
179-
180-
- name: Fix Python conflicts between macOS runner and Homebrew
181-
run: |
182-
# see https://github.com/actions/setup-python/issues/577
183-
brew list -1 | grep python | while read formula; do brew unlink $formula; brew link --overwrite $formula; done
184-
185-
- name: Install homebrew dependencies
186-
run: |
187-
set -x
188-
sudo chmod ugo+w /usr/local/bin
189-
brew install docker docker-compose lima qemu
190-
191-
- name: Install and start Colima
192-
run: |
193-
brew install colima
194-
colima version
195-
colima start --cpu 3 --memory 6 --disk 100 --vm-type=qemu --mount-type=sshfs --dns=1.1.1.1
196-
colima restart
197-
198-
- name: Install dependencies
199-
run: |
200-
brew install shellcheck yamllint
201-
npm install -g npm@latest
202-
npm install
203-
179+
204180
- name: Build Fablo
205181
run: |
206182
shellcheck --version && \
@@ -219,7 +195,7 @@ jobs:
219195
e2e-network/docker/test-05-v3.sh.logs/*
220196
e2e-network/docker/test-05-v3.sh.tmpdir/fablo-target/**/*
221197
222-
test-05-v3-BFT:
198+
test-06-v3-BFT:
223199
needs: test-main
224200
runs-on: ubuntu-latest
225201
steps:

.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 ||| | [01_v2](/e2e-network/docker/test-01-v2-simple.sh), [02_v2](/e2e-network/docker/test-02-v2-raft-2orgs.sh), [05_v3](/e2e-network/docker/test-05-v3.sh), [06_v3](/e2e-network/docker/test-06-v3-bft.sh) | |
2323
| Go ||| | | |
2424
| Java ||| | [02_v2](/e2e-network/docker/test-02-v2-raft-2orgs.sh) | |
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 ||| | [03_v2](/e2e-network/docker/test-03-v2-private-data.sh), [02_v2](/e2e-network/docker/test-02-v2-raft-2orgs.sh) | |
2727
| Multi-org Endorsements ||| | [03_v2](/e2e-network/docker/test-03-v2-private-data.sh) | |
2828
| Private Data Collections ||| | [03_v2](/e2e-network/docker/test-03-v2-private-data.sh) | |

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-network/docker/test-05-v3.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ expectInvoke "peer1.org1.example.com" "my-channel1" "chaincode1" \
109109
expectCommand "cat \"$TEST_TMP/newest.block\"" "KVContract:get"
110110

111111
(cd "$TEST_TMP" && "$FABLO_HOME/fablo.sh" channel fetch 3 my-channel1 org1 peer1 "another.block")
112-
expectCommand "cat \"$TEST_TMP/another.block\"" "KVContract:put"
112+
expectCommand "cat \"$TEST_TMP/another.block\"" "put"
113113

114114
(cd "$TEST_TMP" && "$FABLO_HOME/fablo.sh" channel fetch config my-channel1 org1 peer1 "channel-config.json")
115115
expectCommand "cat \"$TEST_TMP/channel-config.json\"" "\"mod_policy\": \"Admins\","
116116

117-
expectCommand "(cd \"$TEST_TMP\" && \"$FABLO_HOME/fablo.sh\" channel getinfo my-channel1 org1 peer1)" "\"height\":5"
117+
expectCommand "(cd \"$TEST_TMP\" && \"$FABLO_HOME/fablo.sh\" channel getinfo my-channel1 org1 peer1)" "\"height\":6"
118118

119119
echo "🎉 Test passed! 🎉"

0 commit comments

Comments
 (0)