fix: auto-fill chaincode sequence with default value of 1 - #784
Conversation
ba81764 to
7571476
Compare
…t Dockerfile The agent Dockerfile hardcoded linux-amd64 for the Fabric binary download, causing cryptogen to crash with SIGTRAP on ARM64 hosts (e.g., Apple Silicon). - Use dpkg --print-architecture for reliable arch detection - Fail build on unsupported architectures instead of silently defaulting to amd64 - Add curl --fail flag to catch HTTP errors early Signed-off-by: haibo <haibo942us@gmail.com> Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Some info of the postman collection is unnecessary for the newman test, so they shouldn't be pushed on Git. Signed-off-by: dodo920306 <dodo920306@gmail.com> Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com> Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com> Signed-off-by: khanak0509 <kkhanak512@gmail.com>
The pipeline names can be more specific about their actual purposes. Signed-off-by: dodo920306 <dodo920306@gmail.com> Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Rename workflow files according to their new action name. Signed-off-by: dodo920306 <dodo920306@gmail.com> Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com> Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com> Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com> Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com> Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com> Signed-off-by: khanak0509 <kkhanak512@gmail.com>
In order to use the latest docker (29+), Hyperledger Fabric used in this project is bumped to 2.5.15 Signed-off-by: dodo920306 <dodo920306@gmail.com> Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com> Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com> Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com> Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com> Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Since the postman delay API only allows clients to delay for at most 10 seconds, the expected 60 seconds delay is unavailable. Thus, the maximum retry time is increased from 5 to 30 to still keep waiting for 5 minutes for the chaincode to be installed and approved. Signed-off-by: dodo920306 <dodo920306@gmail.com> Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com> Signed-off-by: khanak0509 <kkhanak512@gmail.com>
Signed-off-by: dodo920306 <dodo920306@gmail.com> Signed-off-by: khanak0509 <kkhanak512@gmail.com>
58f9d43 to
9adc1fe
Compare
|
Defaulting the sequence to 1 is reasonable for a brand-new chaincode, but this is not ready to merge yet: Removing the sequence field from the dashboard prevents users from specifying 2, 3, etc. for chaincode upgrades. Fabric requires the sequence to be incremented for every definition update. Please either keep the field editable with a default value of 1, or derive the next sequence from the committed chaincode definition. default=1 was added to the Django model without a corresponding migration. Please add an AlterField migration, or remove the model default if the serializer default is sufficient. Please add tests covering omitted sequence → 1, an explicitly supplied sequence being preserved, invalid values being rejected, and the upgrade scenario. |
|
@yeasy Thanks for the review, I have addressed the requested change. |
Signed-off-by: khanak0509 <kkhanak512@gmail.com>
7d43bb7 to
bcc889b
Compare
Fixes #769
When creating a chaincode, the sequence is always 1 for a brand new chaincode. There's no reason to ask users to manually type it every time - it just adds unnecessary friction and room for mistakes.
This PR removes the sequence input from the upload form in the dashboard and defaults it to 1
automatically across the backend.
changes -
•src/dashboard/src/pages/ChainCode/forms/UploadForm.js - removed the sequence
InputNumber field from the chaincode creation form
• src/api-engine/chaincode/models.py -added default=1 to the sequence field on the
Chaincode model
• src/api-engine/chaincode/serializers.py - marked sequence as not required and
defaulted to 1 in ChaincodeCreateBody
• src/agents/hyperledger-fabric/chaincode/serializers.py - same change in
ChaincodeCreationSerializer