Skip to content

Commit 6a4039a

Browse files
Add lifecycle support to FPC client SDK (#522)
* Add lifecycle support to FPC client sdk - Implement LifecycleInitEnclave on top of resmgmt package - Implement NewCCPackage - Add SGX attestation paramer API - Integrate LifecycleInitEnclave and NewCCPackage in integration test - Rename client_sdk/go/test to client_sdk/go/sample - Refactor client sdk structure to be aligned with fabric client go sdk - Update godoc and references Signed-off-by: bur <bur@zurich.ibm.com>
1 parent cca8578 commit 6a4039a

File tree

24 files changed

+1227
-287
lines changed

24 files changed

+1227
-287
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Additional google documents provide details on FPC 1.0:
123123

124124
### Source organization
125125

126-
- [`client_sdk`](client_sdk/): The FPC Go Client SDK
126+
- [`client_sdk`](client_sdk/go/): The FPC Go Client SDK
127127
- [`cmake`](cmake/): CMake build rules shared across the project
128128
- [`common`](common/): Shared C/C++ code
129129
- [`config`](config/): SGX configuration
@@ -569,7 +569,7 @@ before designing, implementing and deploying an FPC-based solution.
569569

570570
### FPC Client-side SDK
571571

572-
See **[Godocs](https://pkg.go.dev/github.com/hyperledger-labs/fabric-private-chaincode/client_sdk/go/fpc)**
572+
See **[Godocs](https://pkg.go.dev/github.com/hyperledger-labs/fabric-private-chaincode/client_sdk/go/)**
573573
for Go Client SDK.
574574
For the command-line invocations, use the **`fabric/bin/peer.sh`** wrapper script.
575575
Both make FPC related client-side encryption and decryption transparent to the user, i.e., client-side programming is mostly standard Fabric and agnostic to FPC.

client_sdk/go/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
TOP = ../..
66
include $(TOP)/build.mk
77

8-
SUB_DIRS = fpc test
8+
SUB_DIRS = pkg sample
99

1010
all build test clean clobber:
1111
$(foreach DIR, $(SUB_DIRS), $(MAKE) -C $(DIR) $@ || exit ;)

client_sdk/go/README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
# FPC Go SDK
2-
3-
The FPC API is built on top of the new gateway API of the Fabric Go SDK.
4-
For more documentation, see [godoc](https://pkg.go.dev/github.com/hyperledger-labs/fabric-private-chaincode/client_sdk/go/fpc)
5-
and a [test program](./test/main.go) to illustrate it use.
6-
<!-- TODO: replace above reference to test program with hello world example once done ...-->
1+
# FPC Client SDK for Go
72

3+
The FPC Client SDK for Go builds on top of the [Fabric Client SDK Go](https://godoc.org/github.com/hyperledger/fabric-sdk-go).
4+
For more documentation, see [godoc](https://pkg.go.dev/github.com/hyperledger-labs/fabric-private-chaincode/client_sdk/go/)
5+
and a [sample program](./sample/main.go) to illustrate it use.
6+
<!-- TODO: replace above reference to sample program with hello world example once done ...-->
87

98
## Testing
10-
See [`test/main.go`](./test/main.go) for a simple test program and
9+
See [`sample/main.go`](./sample/main.go) for a simple test program and
1110
[integration/test-network/README.md](../../integration/test-network/README.md)
1211
for instructions to run it.

client_sdk/go/doc.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
Copyright IBM Corp. All Rights Reserved.
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
// Package fpcclientsdk enables Go developers to build solutions that interact with FPC chaincode for Hyperledger Fabric.
8+
// The FPC Client SDK builds on top of the Fabric Client SDK Go (https://godoc.org/github.com/hyperledger/fabric-sdk-go)
9+
// and provides FPC specific functionality such as enclave initialization and secure interaction with a FPC chaincode.
10+
// The main goal is to ease the interaction with a FPC chaincode and provide similar experience as offered by normal
11+
// chaincode interaction.
12+
//
13+
// Packages for end developer usage
14+
//
15+
// pkg/client/resmgmt: Provides resource management capabilities such as installing FPC chaincode.
16+
// Reference: https://godoc.org/github.com/hyperledger-labs/fabric-private-chaincode/client_sdk/go/pkg/client/resmgmt
17+
//
18+
// pkg/gateway: Enables Go developers to build client applications using the Hyperledger
19+
// Fabric programming model.
20+
// Reference: https://godoc.org/github.com/hyperledger-labs/fabric-private-chaincode/client_sdk/go/pkg/gateway
21+
//
22+
// Usage samples
23+
//
24+
// samples/main.go: Illustrates the use of the FPC Client SDK. The application can be used with the our test-network.
25+
// Reference: https://github.com/hyperledger-labs/fabric-private-chaincode/tree/master/integration/test-network
26+
//
27+
package fpcclientsdk

client_sdk/go/fpc/logging.go

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

client_sdk/go/fpc/management.go

Lines changed: 0 additions & 135 deletions
This file was deleted.
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,5 @@
66
TOP = ../../..
77
include $(TOP)/build.mk
88

9-
build:
10-
$(GO) build
11-
129
test:
13-
$(GO) test $(GOTAGS) -v ./...
14-
15-
clean:
16-
$(GO) clean
10+
${GO} test $(GOTAGS) -race -covermode=atomic ./...

0 commit comments

Comments
 (0)