-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Demo FSC integration using the IRB demo (#635)
* adding more irb demo files Signed-off-by: Marcus Brandenburger <bur@zurich.ibm.com> * Complete IBR flow Signed-off-by: Marcus Brandenburger <bur@zurich.ibm.com> * Integrate into FPC build flow Signed-off-by: Marcus Brandenburger <bur@zurich.ibm.com>
- Loading branch information
1 parent
d07bc32
commit 0aea62d
Showing
68 changed files
with
8,052 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright 2019 Intel Corporation | ||
# Copyright IBM Corp. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
TOP = ../.. | ||
include $(TOP)/build.mk | ||
|
||
DEMOS = irb | ||
|
||
build clean: | ||
$(foreach DIR, $(DEMOS), $(MAKE) -C $(DIR) $@ || exit;) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cmd/** | ||
users/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright IBM Corp. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
TOP = ../../.. | ||
include $(TOP)/build.mk | ||
|
||
COMPONENTS = chaincode experimenter | ||
|
||
all: build test | ||
|
||
build: | ||
$(foreach DIR, $(COMPONENTS), $(MAKE) -C $(DIR) $@ || exit;) | ||
|
||
test: | ||
$(GO) test -v ./... | ||
|
||
clean: | ||
$(GO) clean | ||
rm -rf cmd users | ||
$(foreach DIR, $(COMPONENTS), $(MAKE) -C $(DIR) $@ || exit;) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# IRB approval sample | ||
|
||
Get redis | ||
```bash | ||
docker pull redis:latest | ||
``` | ||
|
||
```bash | ||
make build test | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
_protos/** | ||
_build/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Copyright 2019 Intel Corporation | ||
# Copyright IBM Corp. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
cmake_minimum_required(VERSION 3.5.1) | ||
project(FPC_DEMO_EAS) | ||
|
||
set(SOURCE_FILES | ||
entry.cpp | ||
dispatcher.cpp | ||
chaincode.cpp | ||
errors.cpp | ||
messages.cpp | ||
_protos/irb.pb.c | ||
storage.cpp | ||
id.cpp | ||
experiment.cpp | ||
study.cpp | ||
signedapproval.cpp | ||
evaluationpack.cpp | ||
) | ||
|
||
# NANOPB for protos | ||
include($ENV{FPC_PATH}/cmake/NanoPB.cmake) | ||
include_directories( | ||
${CMAKE_CURRENT_SOURCE_DIR} | ||
${NANOPB_PATH} | ||
) | ||
|
||
# FPC Common chaincode | ||
include($ENV{FPC_PATH}/ecc_enclave/enclave/CMakeLists-common-app-enclave.txt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Copyright 2019 Intel Corporation | ||
# Copyright IBM Corp. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
TOP = ../../../.. | ||
include $(TOP)/build.mk | ||
|
||
BUILD_DIR := _build | ||
DOCKER_IMAGE_NAME := fpc/irb-experiment | ||
|
||
all: docker | ||
|
||
$(BUILD_DIR): | ||
@if [ ! -d $(BUILD_DIR) ]; then \ | ||
mkdir -p $(BUILD_DIR) && \ | ||
cd $(BUILD_DIR) && \ | ||
cmake ./..; \ | ||
fi | ||
|
||
build: protos $(BUILD_DIR) | ||
$(MAKE) --directory=$(BUILD_DIR) | ||
|
||
clean: protos-clean | ||
rm -rf $(BUILD_DIR) | ||
|
||
docker: build | ||
if [ "${SGX_MODE}" = "HW" ]; then \ | ||
export HW_EXTENSION="-hw" ; \ | ||
fi && \ | ||
make -C ${FPC_PATH}/ecc DOCKER_IMAGE=${DOCKER_IMAGE_NAME}$${HW_EXTENSION} DOCKER_ENCLAVE_SO_PATH=${FPC_PATH}/samples/demos/irb/chaincode/${BUILD_DIR}/lib all docker | ||
|
||
PROTO_BUILD_DIR := _protos | ||
PROTO_PATH := ../protos | ||
PROTO_FILES := irb.proto | ||
|
||
.PHONY: protos | ||
protos: $(PROTO_BUILD_DIR) | ||
$(PROTOC_CMD) \ | ||
--plugin=protoc-gen-nanopb=$(NANOPB_PATH)/generator/protoc-gen-nanopb-py2 \ | ||
--proto_path=$(PROTO_PATH) "--nanopb_out=-f ${PROTO_PATH}/irb.options:$(PROTO_BUILD_DIR)" $(PROTO_FILES) | ||
|
||
$(PROTO_BUILD_DIR): | ||
mkdir -p $@ | ||
|
||
.PHONY: protos-clean | ||
protos-clean: | ||
rm -rf $(PROTO_BUILD_DIR) |
Oops, something went wrong.