Skip to content

Commit a16a291

Browse files
committed
docs: add tutorial for ccapi
1 parent 57a9ff3 commit a16a291

File tree

6 files changed

+27
-1245
lines changed

6 files changed

+27
-1245
lines changed
18.3 KB
Loading
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# CCAPI - A web server developed to interface with CC-tools chaincode
2+
3+
## Motivation
4+
5+
As continuation to the [cc-tools-demo]() tutorial on how to integrate the cc-tools project with FPC chaincodes, we start by utilizing another powerful solution offered by cc-tools is the CCAPI. It's a complete web server that simplifies the communication with the peers and Fabric components to replace the need to deal with CLI applications.
6+
7+
## Architecture
8+
9+
The following diagram explains the process where we modified the API server developed for a demo on cc-tools ([CCAPI](https://github.com/hyperledger-labs/cc-tools-demo/tree/main/ccapi)) and modified it to communicate with FPC code.
10+
11+
The transaction client invocation process, as illustrated in the diagram, consists of several key steps that require careful integration between FPC and cc-tools.
12+
13+
1. Step 1-2: The API server is listening for requests on a specified port over an HTTP channel and sends it to the handler.
14+
2. Step 3: The handler starts by determining the appropriate transaction invocation based on the requested endpoint and calling the corresponding chaincode API.
15+
3. Step 4: The chaincode API is responsible for parsing and ensuring the payload is correctly parsed into a format that is FPC-friendly. This parsing step is crucial, as it prepares the data to meet FPC’s privacy and security requirements before it reaches the peer.
16+
4. Step 5: FPCUtils is the step where the actual transaction invocation happens and it follows the steps explained in the previous diagram as it builds on top of the FPC Client SDK.
17+
18+
![CCAPIFlow](./CCAPIFlow.png)
19+
20+
21+
## User Experience
22+
23+
CCAPI is using docker and docker-compose for spinning up all the required components needed to work.
24+
25+
Have a look at the [fpc-docker-compose.yaml](./fpc-docker-compose.yaml) to see how we use different env vars. Most of these environment variables are required by any client application to work and communicate with FPC. If you followed the [cc-tools-demo](../../chaincode/cc-tools-demo/README.md) tutorial, the values should be the same.
26+
27+
Start by running `docker-compose -f fpc-docker-compose.yaml up`

samples/application/ccapi/docker-compose-1org.yaml

Lines changed: 0 additions & 33 deletions
This file was deleted.

samples/application/ccapi/docker-compose.yaml

Lines changed: 0 additions & 85 deletions
This file was deleted.

samples/application/ccapi/go.mod

Lines changed: 0 additions & 97 deletions
This file was deleted.

0 commit comments

Comments
 (0)