Skip to content
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

Feature/integrate with cc tools #779

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

osamamagdy
Copy link
Contributor

@osamamagdy osamamagdy commented Oct 11, 2024

What this PR does / why we need it:
This PR adds a tutorial on how to integrate with cc-tools project, specially using the cc-tools-demo project

Which issue(s) this PR fixes:

Fixes the LFX mentorship project Hyperledger Fabric CC-Tools Support for Fabric Private Chaincode

Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
@osamamagdy osamamagdy marked this pull request as ready for review October 11, 2024 11:21
@osamamagdy osamamagdy requested a review from a team as a code owner October 11, 2024 11:21
Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
@osamamagdy osamamagdy force-pushed the feature/integrate-with-cc-tools branch from 39d2366 to a064eb0 Compare October 11, 2024 11:31
Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
Copy link
Contributor

@munapower munapower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to follow but wasn't able to compile the changes for main.go

samples/chaincode/cc-tools-demo/README.md Outdated Show resolved Hide resolved
samples/chaincode/cc-tools-demo/README.md Outdated Show resolved Hide resolved
samples/chaincode/cc-tools-demo/README.md Outdated Show resolved Hide resolved
samples/chaincode/cc-tools-demo/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@mbrandenburger mbrandenburger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @osamamagdy this is pretty cool! Let's shape it a bit more!

go.mod Outdated
Comment on lines 26 to 40
github.com/hyperledger/fabric v2.1.1+incompatible
github.com/hyperledger/fabric-chaincode-go v0.0.0-20230228194215-b84622ba6a7a
github.com/hyperledger/fabric-contract-api-go v1.2.1
github.com/hyperledger/fabric-protos-go v0.3.0
github.com/hyperledger/fabric-samples/asset-transfer-basic/chaincode-go v0.0.0-20230505123407-84f9ba1dc4ec
github.com/hyperledger/fabric-sdk-go v1.0.1-0.20240123083657-5d6ca326e01b
github.com/maxbrunsfeld/counterfeiter/v6 v6.6.1
github.com/onsi/ginkgo v1.16.5
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.8
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.7.0
github.com/stretchr/testify v1.8.4
github.com/stretchr/testify v1.9.0
golang.org/x/sync v0.5.0
golang.org/x/tools v0.14.0
google.golang.org/protobuf v1.33.0
google.golang.org/protobuf v1.34.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to just revert the changes on go.mod and go.sum

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done and checking...

commands.sh Show resolved Hide resolved
ecc_go/chaincode/enclave_go/shim.go Outdated Show resolved Hide resolved
ecc_go/chaincode/enclave_go/shim.go Outdated Show resolved Hide resolved
ecc_go/chaincode/enclave_go/shim.go Outdated Show resolved Hide resolved
Comment on lines +35 to +39
cd ~
git clone https://github.com/hyperledger-labs/cc-tools-demo.git
cp -a ~/cc-tools-demo/chaincode/. $FPC_PATH/samples/chaincode/cc-tools-demo/
cd $FPC_PATH/samples/chaincode/cc-tools-demo
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just clone directly?

git clone https://github.com/hyperledger-labs/cc-tools-demo.git $FPC_PATH/samples/chaincode/cc-tools-demo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need the whole cc-tools-demo repo, I only want the chaincode as the repo includes multiple other files

samples/chaincode/cc-tools-demo/README.md Outdated Show resolved Hide resolved
samples/chaincode/cc-tools-demo/README.md Outdated Show resolved Hide resolved

```

## Set the needed env vars in the docker-compose file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this step should come after we explained how to build the chaincode container

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it better to have it here as these env vars are mentioned in the code?

Comment on lines +178 to +180
Next step is to test the chaincode by invoking transactions, for which you need a basic Fabric network with a channel.
We will use the test network provided in [`$FPC_PATH/samples/deployment/test-network`](../../deployment/test-network).
To invoke the chaincode, we will use the `simple-cli` application in [`$FPC_PATH/samples/application/simple-cli-go`](../../pplication/simple-cli-go).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we use your cool shell script to test?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I don't see where you explain how to use samples/application/cc-demo here?!

Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
@osamamagdy osamamagdy force-pushed the feature/integrate-with-cc-tools branch from 92e4665 to 1ec09a9 Compare October 15, 2024 23:08
Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants