hyperledger / fabric-private-chaincode

FPC enables Confidential Chaincode Execution for Hyperledger Fabric using Intel SGX.
Apache License 2.0
159 stars 91 forks source link

Fabric image missing when running sample #751

Closed munapower closed 8 months ago

munapower commented 9 months ago

Describe the bug

When the sample "the-simple-testing-network" is tested with chaincode written in go on an Apple Mac M1 there is a Hyperledger Fabric image that the user could not have in their docker library and that is required to start a fabric network with the Fabric Smart Client To Reproduce

To reproduce first delete all the images in your docker environment then start as if you were setting up a new fpc environment:

> make -C $FPC_PATH/utils/docker pull pull-dev
> make -C $FPC_PATH/utils/docker run-dev

run the commands specific for go chaincode on M1

> GOOS=linux make -C $FPC_PATH/ercc build docker
> execute commands for the sample:
> export CC_NAME=echo-go
> export CC_PATH=$FPC_PATH/samples/chaincode/echo-go
> export FPC_CHAINCODE_IMAGE=fpc/echo-go
> export FAB_BINS=$FPC_PATH/fabric/_internal/bin
> GOOS=linux make -C $FPC_PATH/samples/chaincode/echo-go with_go docker
> cd samples/deployment/fabric-smart-client/the-simple-testing-network/
> make run

and there it crashes with the error:

2024-01-08 19:44:09.055 UTC [fsc.integration] Start -> INFO 01d Post execution for nodes... panic: Unexpected error: <errors.withStack | 0xc000222150>: check failed; Require the following container images: [hyperledger/fabric-ccenv:latest]: missing required image: hyperledger/fabric-ccenv:latest { error: <errors.withMessage | 0xc0005b2240>{ cause: <*errors.fundamental | 0xc0002220f0>{ msg: "missing required image: hyperledger/fabric-ccenv:latest", stack: [0xcdcff8, 0x11219ed, 0x112219d, 0xb44d24, 0x11be8d3, 0x11be8c1, 0x11be656, 0x5cafc2, 0x5cb83d, 0x875cac, 0x875c9c, 0x11bee88, 0x43c1e7, 0x46cba1], }, msg: "check failed; Require the following container images: [hyperledger/fabric-ccenv:latest]", }, stack: [0x1121af0, 0x112219d, 0xb44d24, 0x11be8d3, 0x11be8c1, 0x11be656, 0x5cafc2, 0x5cb83d, 0x875cac, 0x875c9c, 0x11bee88, 0x43c1e7, 0x46cba1], } occurred

goroutine 1 [running]: github.com/hyperledger-labs/fabric-smart-client/integration.failMe({0xc00030c000?, 0x0?}, {0xc000222150?, 0xc00030c000?, 0x0?}) /project/pkg/mod/github.com/hyperledger-labs/fabric-smart-client@v0.2.1-0.20230614155312-b510a247e75d/integration/integration.go:332 +0x2d github.com/onsi/gomega/internal.(Assertion).match(0xc000059500, {0x179c4c0, 0x22cb570}, 0x0, {0x0, 0x0, 0x0}) /project/pkg/mod/github.com/onsi/gomega@v1.27.6/internal/assertion.go:106 +0x1f0 github.com/onsi/gomega/internal.(Assertion).NotTo(0xc000059500, {0x179c4c0, 0x22cb570}, {0x0, 0x0, 0x0}) /project/pkg/mod/github.com/onsi/gomega@v1.27.6/internal/assertion.go:74 +0xb2 github.com/hyperledger-labs/fabric-smart-client/integration/nwo/fabric.(Platform).PostRun(0xc000221160, 0x0) /project/pkg/mod/github.com/hyperledger-labs/fabric-smart-client@v0.2.1-0.20230614155312-b510a247e75d/integration/nwo/fabric/platform.go:151 +0x73 github.com/hyperledger-labs/fabric-smart-client/integration/nwo.(NWO).Start(0xc0007da420) /project/pkg/mod/github.com/hyperledger-labs/fabric-smart-client@v0.2.1-0.20230614155312-b510a247e75d/integration/nwo/nwo.go:127 +0x7e4 github.com/hyperledger-labs/fabric-smart-client/integration.(Infrastructure).Start(...) /project/pkg/mod/github.com/hyperledger-labs/fabric-smart-client@v0.2.1-0.20230614155312-b510a247e75d/integration/integration.go:184 github.com/hyperledger-labs/fabric-smart-client/integration/nwo/cmd/network.Start(0x0?) /project/pkg/mod/github.com/hyperledger-labs/fabric-smart-client@v0.2.1-0.20230614155312-b510a247e75d/integration/nwo/cmd/network/cmd.go:192 +0x233 github.com/hyperledger-labs/fabric-smart-client/integration/nwo/cmd/network.StartCmd.func1(0xc0002b6c00?, {0xc0003ff400?, 0x2?, 0x2?}) /project/pkg/mod/github.com/hyperledger-labs/fabric-smart-client@v0.2.1-0.20230614155312-b510a247e75d/integration/nwo/cmd/network/cmd.go:150 +0x56 github.com/spf13/cobra.(Command).execute(0xc0002b6c00, {0xc0003ff3e0, 0x2, 0x2}) /project/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:940 +0x862 github.com/spf13/cobra.(Command).ExecuteC(0xc000005500) /project/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x3bd github.com/spf13/cobra.(Command).Execute(...) /project/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992 github.com/hyperledger-labs/fabric-smart-client/integration/nwo/cmd.(*Main).Execute(0xc0007c3440) /project/pkg/mod/github.com/hyperledger-labs/fabric-smart-client@v0.2.1-0.20230614155312-b510a247e75d/integration/nwo/cmd/main.go:56 +0x20c main.main() /project/src/github.com/hyperledger/fabric-private-chaincode/samples/deployment/fabric-smart-client/the-simple-testing-network/main.go:18 +0xe8 exit status 2 make: *** [Makefile:14: run] Error 1

Expected behavior

Fabric Sample Network should start without errors Log-filesScreenshots

Environment (please complete the following information):

Apple Mac M1 Additional context

munapower commented 9 months ago

@mbrandenburger To fix this issue I thought of adding to the make file in the simple test network the commands to pull the image and add a line in the readme for the user to execute. What do you think? I already created a branch and made the changes there