Skip to content

Commit

Permalink
fix: update makefile variable setting
Browse files Browse the repository at this point in the history
Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
  • Loading branch information
osamamagdy committed Nov 5, 2024
1 parent 6d8ac47 commit 5f5eaa9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
16 changes: 5 additions & 11 deletions samples/chaincode/cc-tools-demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,19 +157,19 @@ include $(TOP)/ecc_go/build.mk

CC_NAME ?= fpc-cc-tools-demo

EGO_CONFIG_FILE ?= $(FPC_PATH)/ecc_go/ccToolsDemoEnclave.json
EGO_CONFIG_FILE = $(FPC_PATH)/ecc_go/ccToolsDemoEnclave.json

```

Please make sure that in the file above the variable `TOP` points to the FPC root directory (i.e., `$FPC_PATH`) as it uses the `$FPC_PATH/ecc_go/build.mk` file.

**Note**: In our case, we need to change the build command in the `$FPC_PATH/ecc_go/build.mk` file at the `ecc` target instead of
**Note**: In our case, we need to change the build command in the `$FPC_PATH/ecc_go/build.mk` file at the `ecc` target instead of

```Makefile
ego-go build $(GOTAGS) -o $(ECC_BINARY) main.go
```

to be
to be

```Makefile
ego-go build $(GOTAGS) -o $(ECC_BINARY)
Expand All @@ -190,20 +190,14 @@ Note: this command runs inside the FPC dev environment and not your local host.
```

This is because there is a minor difference between the `ChaincodeStubInterface` used in the cc-tools `Mockstub` as it's missing the `PurgePrivateData` method.
To solve this, run
To solve this, run the following to download all used packages

```bash
cd $FPC_PATH/samples/chaincode/cc-tools-demo
go mod vendor
```

to download all used packages and go to the file of the error to add the missing method there.

```bash
nano $FPC_PATH/vendor/github.com/hyperledger-labs/cc-tools/mock/mockstub.go
```

add the following function:
Edit the file of the error `$FPC_PATH/samples/chaincode/cc-tools-demo/vendor/github.com/hyperledger-labs/cc-tools/mock/mockstub.go` and add the missing method there:

```go
// PurgePrivateData ...
Expand Down
3 changes: 2 additions & 1 deletion samples/chaincode/cc-tools-demo/testTutorial.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,15 @@ export CC_VER=$(cat "$FPC_PATH/samples/chaincode/cc-tools-demo/mrenclave")
cd $FPC_PATH/samples/deployment/test-network
./installFPC.sh
sleep 5
export EXTRA_COMPOSE_FILE="$FPC_PATH/samples/deployment/test-network/cc-tools-demo-compose.yaml"
make ercc-ecc-start
sleep 5

# # prepare connections profile
cd $FPC_PATH/samples/deployment/test-network
./update-connection.sh

# # update the connection profile for external clients outside the fpc dev environment
# update the connection profile for external clients outside the fpc dev environment
cd $FPC_PATH/samples/deployment/test-network
./update-external-connection.sh

Expand Down

0 comments on commit 5f5eaa9

Please sign in to comment.