-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(connector-fabric): deployContractGoSourceV1 uses Fabric v2.5.6 #3058
refactor(connector-fabric): deployContractGoSourceV1 uses Fabric v2.5.6 #3058
Conversation
...rc/main/typescript/deploy-contract-go-source/deploy-contract-go-source-impl-fabric-v2-5-6.ts
Dismissed
Show resolved
Hide resolved
The supply chain app's build and execution scripts should finally be working after this and also be much more stable than before due to the flakiness of the Fabric V1 test ledger not being an issue anymore. 1.The new contract is compiled with go v1.20 and therefore has to have the contract method names capitalized insted of camelCase, otherwise the methods are not possible to be exported and the contract deployment fails even if everything else is correct. 2. The supply chain app now uses the newest edition of the Fabric v2 AIO test ledger container image which uses Fabric v2.5.6 (current LTS at the time of this writing). 3. The shipment contract's source code has been migrated to Fabric v2 meaning that instead of a stub object we get a context object for each method's first parameter and then the stub can be acquired from that context object. 4. The method arguments no longer need to be passed around as an array of strings and instead the contract method's input arguments are first-class go method parameters. 5. Re-enabled a test case that was being skipped until now due to flakiness: ...`src/test/typescript/integration/supply-chain-backend-api-calls.test.ts` Depends on hyperledger-cacti#3058 Depends on hyperledger-cacti#3054 Fixes hyperledger-cacti#2945 Fixes hyperledger-cacti#2969 Fixes hyperledger-cacti#1899 Fixes hyperledger-cacti#1521 Fixes hyperledger-cacti#1518 Signed-off-by: Peter Somogyvari <[email protected]>
The supply chain app's build and execution scripts should finally be working after this and also be much more stable than before due to the flakiness of the Fabric V1 test ledger not being an issue anymore. 1.The new contract is compiled with go v1.20 and therefore has to have the contract method names capitalized insted of camelCase, otherwise the methods are not possible to be exported and the contract deployment fails even if everything else is correct. 2. The supply chain app now uses the newest edition of the Fabric v2 AIO test ledger container image which uses Fabric v2.5.6 (current LTS at the time of this writing). 3. The shipment contract's source code has been migrated to Fabric v2 meaning that instead of a stub object we get a context object for each method's first parameter and then the stub can be acquired from that context object. 4. The method arguments no longer need to be passed around as an array of strings and instead the contract method's input arguments are first-class go method parameters. 5. Re-enabled a test case that was being skipped until now due to flakiness: ...`src/test/typescript/integration/supply-chain-backend-api-calls.test.ts` Depends on hyperledger-cacti#3058 Depends on hyperledger-cacti#3054 Fixes hyperledger-cacti#2945 Fixes hyperledger-cacti#2969 Fixes hyperledger-cacti#1899 Fixes hyperledger-cacti#1521 Fixes hyperledger-cacti#1518 Signed-off-by: Peter Somogyvari <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, squash the commits before the merge (I've disabled an auto-merge)
@outSH Oops, sorry and thank you very much for being on the lookout! I should be more careful with the auto-merge feature for pull requests that have parents! |
The deployContractGoSourceV1() method now assumes that the underlying test ledger is Fabric 2.5 (current LTS). This will allow us to upgrade the contracts that are being used by the Supply chain app to Fabric 2.x from Fabric 1.x which will then implicitly fix a large number of other issues at the same time. This change is part of laying the foundation for that follow-up work. Primary changes: ----------------- 1. Added a new, standalone utility function to deploy go source contracts with the name of `deployContractGoSourceImplFabricV256()`. 2. The code of this function was derived from the original Fabric v1 compatible deployContractGoSourceV1 method of the Fabric connector. 3. 2 organizations are supported for deployment via the endpoint. 4. The endpoint is only used by the supply chain app example at the moment and there is no test coverage of it due to dependencies that will be resolved in a follow-up pull request that is coming soon. Secondary changes: 1. Also extracted the SSH execution function from the fabric connector into a standalone function that can be used without having to have a Fabric connector instance created first. 2. Also extracted/abstracted some logic into a utility function for similar reasons that is used to replace logging configuration environment variables in shell commands that we use to perform contract deployment onto the Fabric test ledgers. Depends on hyperledger-cacti#3054 Signed-off-by: Peter Somogyvari <[email protected]>
bdfc683
to
ffbcf31
Compare
This PR/issue depends on:
|
The supply chain app's build and execution scripts should finally be working after this and also be much more stable than before due to the flakiness of the Fabric V1 test ledger not being an issue anymore. 1.The new contract is compiled with go v1.20 and therefore has to have the contract method names capitalized insted of camelCase, otherwise the methods are not possible to be exported and the contract deployment fails even if everything else is correct. 2. The supply chain app now uses the newest edition of the Fabric v2 AIO test ledger container image which uses Fabric v2.5.6 (current LTS at the time of this writing). 3. The shipment contract's source code has been migrated to Fabric v2 meaning that instead of a stub object we get a context object for each method's first parameter and then the stub can be acquired from that context object. 4. The method arguments no longer need to be passed around as an array of strings and instead the contract method's input arguments are first-class go method parameters. 5. Re-enabled a test case that was being skipped until now due to flakiness: ...`src/test/typescript/integration/supply-chain-backend-api-calls.test.ts` Depends on hyperledger-cacti#3058 Depends on hyperledger-cacti#3054 Fixes hyperledger-cacti#2945 Fixes hyperledger-cacti#2969 Fixes hyperledger-cacti#1899 Fixes hyperledger-cacti#1521 Fixes hyperledger-cacti#1518 Signed-off-by: Peter Somogyvari <[email protected]>
The supply chain app's build and execution scripts should finally be working after this and also be much more stable than before due to the flakiness of the Fabric V1 test ledger not being an issue anymore. The container image is now published as: `ghcr.io/hyperledger/cactus-example-supply-chain-app:2024-03-08--pr-3059-1` 1.The new contract is compiled with go v1.20 and therefore has to have the contract method names capitalized insted of camelCase, otherwise the methods are not possible to be exported and the contract deployment fails even if everything else is correct. 2. The supply chain app now uses the newest edition of the Fabric v2 AIO test ledger container image which uses Fabric v2.5.6 (current LTS at the time of this writing). 3. The shipment contract's source code has been migrated to Fabric v2 meaning that instead of a stub object we get a context object for each method's first parameter and then the stub can be acquired from that context object. 4. The method arguments no longer need to be passed around as an array of strings and instead the contract method's input arguments are first-class go method parameters. 5. Re-enabled a test case that was being skipped until now due to flakiness: ...`src/test/typescript/integration/supply-chain-backend-api-calls.test.ts` The supply chain app container image was built with this command: ```sh DOCKER_BUILDKIT=1 docker build \ --build-arg="NPM_PKG_VERSION=2.0.0-2945-supply-chain-app-build-failed.241+b2c306ea0" \ -f ./examples/cactus-example-supply-chain-backend/Dockerfile \ . \ -t scaeb ``` The NPM_PKG_VERSION build arg is important because the image defaults to "latest" which at the moment is packages that do not contain the fixes made by this commit, so re-building the image without that extra arg will not work until we issue the next official non-canary release. Depends on hyperledger-cacti#3058 Depends on hyperledger-cacti#3054 Fixes hyperledger-cacti#2945 Fixes hyperledger-cacti#2969 Fixes hyperledger-cacti#1899 Fixes hyperledger-cacti#1521 Fixes hyperledger-cacti#1518 Signed-off-by: Peter Somogyvari <[email protected]>
The supply chain app's build and execution scripts should finally be working after this and also be much more stable than before due to the flakiness of the Fabric V1 test ledger not being an issue anymore. The container image is now published as: `ghcr.io/hyperledger/cactus-example-supply-chain-app:2024-03-08--pr-3059-1` 1.The new contract is compiled with go v1.20 and therefore has to have the contract method names capitalized insted of camelCase, otherwise the methods are not possible to be exported and the contract deployment fails even if everything else is correct. 2. The supply chain app now uses the newest edition of the Fabric v2 AIO test ledger container image which uses Fabric v2.5.6 (current LTS at the time of this writing). 3. The shipment contract's source code has been migrated to Fabric v2 meaning that instead of a stub object we get a context object for each method's first parameter and then the stub can be acquired from that context object. 4. The method arguments no longer need to be passed around as an array of strings and instead the contract method's input arguments are first-class go method parameters. 5. Re-enabled a test case that was being skipped until now due to flakiness: ...`src/test/typescript/integration/supply-chain-backend-api-calls.test.ts` The supply chain app container image was built with this command: ```sh DOCKER_BUILDKIT=1 docker build \ --build-arg="NPM_PKG_VERSION=2.0.0-2945-supply-chain-app-build-failed.241+b2c306ea0" \ -f ./examples/cactus-example-supply-chain-backend/Dockerfile \ . \ -t scaeb ``` The NPM_PKG_VERSION build arg is important because the image defaults to "latest" which at the moment is packages that do not contain the fixes made by this commit, so re-building the image without that extra arg will not work until we issue the next official non-canary release. Depends on #3058 Depends on #3054 Fixes #2945 Fixes #2969 Fixes #1899 Fixes #1521 Fixes #1518 Signed-off-by: Peter Somogyvari <[email protected]>
The supply chain app's build and execution scripts should finally be working after this and also be much more stable than before due to the flakiness of the Fabric V1 test ledger not being an issue anymore. The container image is now published as: `ghcr.io/hyperledger/cactus-example-supply-chain-app:2024-03-08--pr-3059-1` 1.The new contract is compiled with go v1.20 and therefore has to have the contract method names capitalized insted of camelCase, otherwise the methods are not possible to be exported and the contract deployment fails even if everything else is correct. 2. The supply chain app now uses the newest edition of the Fabric v2 AIO test ledger container image which uses Fabric v2.5.6 (current LTS at the time of this writing). 3. The shipment contract's source code has been migrated to Fabric v2 meaning that instead of a stub object we get a context object for each method's first parameter and then the stub can be acquired from that context object. 4. The method arguments no longer need to be passed around as an array of strings and instead the contract method's input arguments are first-class go method parameters. 5. Re-enabled a test case that was being skipped until now due to flakiness: ...`src/test/typescript/integration/supply-chain-backend-api-calls.test.ts` The supply chain app container image was built with this command: ```sh DOCKER_BUILDKIT=1 docker build \ --build-arg="NPM_PKG_VERSION=2.0.0-2945-supply-chain-app-build-failed.241+b2c306ea0" \ -f ./examples/cactus-example-supply-chain-backend/Dockerfile \ . \ -t scaeb ``` The NPM_PKG_VERSION build arg is important because the image defaults to "latest" which at the moment is packages that do not contain the fixes made by this commit, so re-building the image without that extra arg will not work until we issue the next official non-canary release. Depends on hyperledger-cacti#3058 Depends on hyperledger-cacti#3054 Fixes hyperledger-cacti#2945 Fixes hyperledger-cacti#2969 Fixes hyperledger-cacti#1899 Fixes hyperledger-cacti#1521 Fixes hyperledger-cacti#1518 Signed-off-by: Peter Somogyvari <[email protected]>
The deployContractGoSourceV1() method now assumes that the underlying
test ledger is Fabric 2.5 (current LTS).
This will allow us to upgrade the contracts that are being used by the
Supply chain app to Fabric 2.x from Fabric 1.x which will then implicitly
fix a large number of other issues at the same time.
This change is part of laying the foundation for that follow-up work.
Primary changes:
with the name of
deployContractGoSourceImplFabricV256()
.compatible deployContractGoSourceV1 method of the Fabric connector.
and there is no test coverage of it due to dependencies that will be
resolved in a follow-up pull request that is coming soon.
Secondary changes:
into a standalone function that can be used without having to have a
Fabric connector instance created first.
similar reasons that is used to replace logging configuration environment
variables in shell commands that we use to perform contract deployment
onto the Fabric test ledgers.
Depends on #3054
Signed-off-by: Peter Somogyvari [email protected]
Pull Request Requirements
upstream/main
branch and squashed into single commit to help maintainers review it more efficient and to avoid spaghetti git commit graphs that obfuscate which commit did exactly what change, when and, why.-s
flag when usinggit commit
command. You may refer to this link for more information.Character Limit
A Must Read for Beginners
For rebasing and squashing, here's a must read guide for beginners.