Skip to content

Commit

Permalink
feat(fabric-connector): contract deployment endpoint hyperledger-cact…
Browse files Browse the repository at this point in the history
…i#616

Primary change
=============

Finally adds real support for chain code deployment with
custom made contracts not just the ones that the fabric
samples container comes pre-built with.

Additional notes, changes
========================

1. Makes assumptions about the ledger being containerized the
same way the fabric-samples repo does it, e.g. there must
be a container called "cli" which is set up to execute the peer
binary and to be able to perform go builds with a version of
go that has go modules support (1.11+ IIRC)
2. Does not yet support Fabric 2.x (at least it was not tested)
3. Magic strings in the connector that still need to be eliminted.
4. Go mod file upload is not supported, for now one must use the
pinned dependencies array to lock dependencies to specific versions.
5. The deployment endpoint supports deploying to multiple orgs
with a single request but this only makes sense for example code
since in a production environment it is not expected that different
organizations will share the same server/container to run their
infrastructure.
6. Output structure is not yet finalized. Priority was for now to
at least allow failure detection. Diagnostics is a bit harder to
achieve but should come in a follow-up improvement nevertheless.
7. Forced to use ugly timeout to make sure test is passing.
8. Pending refactor of the chaincode compiler which will no
longer build on the file-system locally (after the refactor
is done). For now the test is being skipped.

End to end test demonstrating how it all works can be seen at:
packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/deploy-contract-go-bin-endpoint-v1/deploy-contract/deploy-cc-from-golang-source.test.ts

Fixes hyperledger-cacti#616

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz committed Mar 8, 2021
1 parent 483d4d9 commit 4495f06
Show file tree
Hide file tree
Showing 16 changed files with 916 additions and 311 deletions.
162 changes: 17 additions & 145 deletions packages/cactus-plugin-ledger-connector-fabric/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions packages/cactus-plugin-ledger-connector-fabric/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@
"ignore": [
"src/**/generated/*"
],
"extensions": ["ts", "json"],
"extensions": [
"ts",
"json"
],
"quiet": true,
"verbose": false,
"runOnChangeOnly": true
Expand Down Expand Up @@ -83,6 +86,7 @@
"@hyperledger/cactus-common": "0.3.0",
"@hyperledger/cactus-core": "0.3.0",
"@hyperledger/cactus-core-api": "0.3.0",
"axios": "0.21.1",
"bl": "1.2.3",
"express": "4.17.1",
"express-openapi-validator": "3.16.11",
Expand All @@ -92,11 +96,10 @@
"http-status-codes": "2.1.4",
"joi": "14.3.1",
"multer": "1.4.2",
"ngo": "2.6.2",
"node-ssh": "11.0.0",
"openapi-types": "7.0.1",
"prom-client": "13.0.0",
"temp": "0.9.1",
"temp": "0.9.4",
"typescript-optional": "2.0.1",
"uuid": "8.3.0",
"web3": "1.2.7",
Expand All @@ -110,8 +113,6 @@
"@types/multer": "1.4.4",
"@types/ssh2": "0.5.44",
"@types/temp": "0.8.34",
"@types/uuid": "8.3.0",
"axios": "0.21.1",
"form-data": "3.0.0"
"@types/uuid": "8.3.0"
}
}
Loading

0 comments on commit 4495f06

Please sign in to comment.