Support Fabric v2.4.4 and later
Closed this issue · 4 comments
When I configure Fabric version as v2.4.4 in the configure file, I get following error:
Critical error occured:
- Json schema validation failed!
Errors found:
Schema validation:
- instance.global.fabricVersion : is not one of enum values: 1.3.0,1.4.0,1.4.1,1.4.2,1.4.3,1.4.4,1.4.5,1.4.6,1.4.7,1.4.8,1.4.9,1.4.10,1.4.11,1.4.12,2.0.1,2.1.0,2.1.1,2.2.0,2.2.1,2.2.2,2.2.3,2.2.4,2.3.0,2.3.1,2.3.2,2.3.3,2.4.0,2.4.1,2.4.2,2.4.3
It would be great if fablo can supports Fabric v2.4.4 and later versions, as the Golang chaincode with generic features can be packaged.
Thanks for pointing this out! We are working on an upgrade. Right now you can bypass validation for this case by adding a post-generate hook to Fablo config to replace it after network files are generated.
Assuming you have 2.4.3
version selected and you want to use 2.4.7
, you can update your Fablo config as follows:
{
"global": {
"fabricVersion": "2.4.3",
...
},
...
"hooks": {
"postGenerate": "perl -i -pe 's/_VERSION=2.4.3/_VERSION=2.4.7/g' ./fablo-target/fabric-docker/.env"
}
}
Perl will replace Fabric version in relevant config file generated by Fablo. Also note that using perl
instead of sed
is a cross-platform solution, since sed
has slightly different options on OSX and Linux.
I have been using this method successfully to update up to 2.4.9 and also updating fabric-ca to 1.5.6. I tried to update to 2.5.0 but get an error. This is the postgenerateHook I am using:
"postGenerate": "perl -i -pe 's/MaxMessageCount: 10/MaxMessageCount: 1/g' \"./fablo-target/fabric-config/configtx.yaml\"; perl -i -pe 's/_VERSION=2.4.3/_VERSION=2.5.0/g' ./fablo-target/fabric-docker/.env; perl -i -pe 's/FABRIC_CA_VERSION=1.5.0/FABRIC_CA_VERSION=1.5.6/g' ./fablo-target/fabric-docker/.env"
The error message:
=========== \U1F60E Packaging chaincode 'chaincode1' \U1F60E ==============
2.5.0: Pulling from hyperledger/fabric-baseos
06d39c85623a: Pull complete
c8a44e77f433: Pull complete
a5cda75c31bc: Pull complete
2430da07214f: Pull complete
Digest: sha256:c6648cbaa846dcee3bce3004ff85074f9d525dbbf8ad18b0e809b38eb4335a4e
Status: Downloaded newer image for hyperledger/fabric-baseos:2.5.0
WARNING: image with reference hyperledger/fabric-baseos was found but does not match the specified platform: wanted linux/amd64, actual: linux/arm64/v8
docker.io/hyperledger/fabric-baseos:2.5.0
Packaging chaincode chaincode1...
CHAINCODE_VERSION: 0.0.1
CHAINCODE_LANG: golang
PEER_ADDRESS: peer0.org0.vfs.com:7041
CLI_NAME: cli.org0.vfs.com
Error: failed to normalize chaincode path: failed to determine module root: exec: "go": executable file not found in $PATH
Is there a workaround available to get 2.5.0 working?
Fabric added back the go binary in version 2.5.1 so now I am able to start up the network with fablo.