Skip to content

Conversation

@osamamagdy
Copy link
Contributor

What this PR does / why we need it:
This PR is a continuation to #779 on how to integrate with the cc-tools project, especially using the cc-tools-demo project

Here, we add the CCAPI, which is an API server that uses REST APIs to communicate with peers and invoke operations.

Which issue(s) this PR fixes:

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

@osamamagdy osamamagdy requested a review from a team as a code owner October 22, 2024 21:21
@osamamagdy osamamagdy force-pushed the feature/add-ccapi-for-samples branch from 748ac3f to d4d237d Compare October 22, 2024 21:22
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 force-pushed the feature/add-ccapi-for-samples branch from 8645511 to 41b2505 Compare January 17, 2025 12:26
Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
@osamamagdy osamamagdy force-pushed the feature/add-ccapi-for-samples branch from 41b2505 to 266287c Compare January 17, 2025 12:33
Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
@osamamagdy osamamagdy force-pushed the feature/add-ccapi-for-samples branch from 379f567 to d3dee26 Compare January 17, 2025 12:59
@munapower
Copy link
Contributor

munapower commented Jan 22, 2025

@osamamagdy checks are failing because you have to add core_peer_org_name to the test.sh script in the test-network directory around line 111
you also have to update the cc-tools-demo readme because it is missing the same definition that you did add to the test-network readme.
For some reason when I started the chaincode I got this error:

EGo (bundled) v1.5.3 (04243b39cc7bdc92732c2dacca8c509f8fb10550)
2025-01-22 20:32:09 panic: signal: illegal instruction
2025-01-22 20:32:09 
2025-01-22 20:32:09 goroutine 1 [running]:
2025-01-22 20:32:09 main.main()
2025-01-22 20:32:09     github.com/edgelesssys/ego/ego/cmd/bundle/main.go:58 +0x155
2025-01-22 20:32:05 [erthost] running in simulation mode
2025-01-22 20:32:05 [erthost] loading enclave ...

@mbrandenburger
Copy link
Contributor

@osamamagdy checks are failing because you have to add core_peer_org_name to the test.sh script in the test-network directory around line 111 you also have to update the cc-tools-demo readme because it is missing the same definition that you did add to the test-network readme. For some reason when I started the chaincode I got this error:

EGo (bundled) v1.5.3 (04243b39cc7bdc92732c2dacca8c509f8fb10550)
2025-01-22 20:32:09 panic: signal: illegal instruction
2025-01-22 20:32:09 
2025-01-22 20:32:09 goroutine 1 [running]:
2025-01-22 20:32:09 main.main()
2025-01-22 20:32:09     github.com/edgelesssys/ego/ego/cmd/bundle/main.go:58 +0x155
2025-01-22 20:32:05 [erthost] running in simulation mode
2025-01-22 20:32:05 [erthost] loading enclave ...

It seems that you run it with ego instead of pure go (for testing on M1).

@mbrandenburger
Copy link
Contributor

Looking at the Github actions ... it's still failing related to the missing CORE_PEER_ORG_NAME when running the simple-cli. See here https://github.com/hyperledger/fabric-private-chaincode/actions/runs/12829555830/job/35985706439?pr=780#step:7:10333

@munapower
Copy link
Contributor

@osamamagdy checks are failing because you have to add core_peer_org_name to the test.sh script in the test-network directory around line 111 you also have to update the cc-tools-demo readme because it is missing the same definition that you did add to the test-network readme. For some reason when I started the chaincode I got this error:

EGo (bundled) v1.5.3 (04243b39cc7bdc92732c2dacca8c509f8fb10550)
2025-01-22 20:32:09 panic: signal: illegal instruction
2025-01-22 20:32:09 
2025-01-22 20:32:09 goroutine 1 [running]:
2025-01-22 20:32:09 main.main()
2025-01-22 20:32:09     github.com/edgelesssys/ego/ego/cmd/bundle/main.go:58 +0x155
2025-01-22 20:32:05 [erthost] running in simulation mode
2025-01-22 20:32:05 [erthost] loading enclave ...

It seems that you run it with ego instead of pure go (for testing on M1).

yeah @mbrandenburger now that you mention it I remember!

Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
@osamamagdy osamamagdy force-pushed the feature/add-ccapi-for-samples branch from 3dffe3a to 2efeb72 Compare January 24, 2025 11:56
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 was able to make it run ....

@osamamagdy osamamagdy requested a review from munapower January 28, 2025 00:13
Signed-off-by: Osama Magdy <59124937+osamamagdy@users.noreply.github.com>
@osamamagdy osamamagdy requested a review from munapower January 31, 2025 11:37
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.

LGTM

@mbrandenburger mbrandenburger merged commit 805e428 into hyperledger:main Jan 31, 2025
4 checks passed
munapower pushed a commit to munapower/fabric-private-chaincode that referenced this pull request Mar 31, 2025
* feat: add ccapi

Signed-off-by: osamamagdy <osamamagdy174@gmail.com>

* fix: fix linting errors

Signed-off-by: osamamagdy <osamamagdy174@gmail.com>

* fix: add go mod for ccapi

Signed-off-by: osamamagdy <osamamagdy174@gmail.com>

* fix: edit go mod to use fpc from main commit

Signed-off-by: osamamagdy <osamamagdy174@gmail.com>

* fix: edit path

Signed-off-by: osamamagdy <osamamagdy174@gmail.com>

* fix: remove go mod vendor from dockerfile

Signed-off-by: osamamagdy <osamamagdy174@gmail.com>

* doc: cd into ccapi before running

Signed-off-by: osamamagdy <osamamagdy174@gmail.com>

* feat: remove hardcoded org name

Signed-off-by: osamamagdy <osamamagdy174@gmail.com>

* feat: edit ccapi to be just an extension

Signed-off-by: osamamagdy <osamamagdy174@gmail.com>

* fix: add the org name for scripts

Signed-off-by: osamamagdy <osamamagdy174@gmail.com>

* fix: export CORE_PEER_ORG_NAME

Signed-off-by: osamamagdy <osamamagdy174@gmail.com>

* docs: edit readme

Signed-off-by: osamamagdy <osamamagdy174@gmail.com>

* docs: add notes for ccapi

Signed-off-by: Osama Magdy <59124937+osamamagdy@users.noreply.github.com>

---------

Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
Signed-off-by: Osama Magdy <59124937+osamamagdy@users.noreply.github.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