GithubHelp home page GithubHelp logo

isabella232 / ccf-app-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from microsoft/ccf-app-template

0.0 0.0 0.0 17 KB

Template repository for C++ applications for CCF

Home Page: https://github.com/microsoft/ccf

License: MIT License

C++ 83.37% CMake 16.63%

ccf-app-template's Introduction

CCF C++ App Template

Template repository for CCF C++ applications.

Install Dependencies

Install CCF and its dependencies:

$ wget https://github.com/microsoft/CCF/releases/download/ccf-2.0.0/ccf_2.0.0_amd64.deb
$ sudo dpkg -i ccf_2.0.0_amd64.deb # Install CCF under /opt/ccf
$ cat /opt/ccf/share/VERSION_LONG
ccf-2.0.0
$ /opt/ccf/getting_started/setup_vm/run.sh # Install dependencies

Alternatively, you can checkout this repository in a VSCode development container.

Build

In the local checkout of this repository:

$ cd ccf_app_template
$ mkdir build
$ cd build
$ CC="/opt/oe_lvi/clang-10" CXX="/opt/oe_lvi/clang++-10" cmake -GNinja ..
$ ninja
$ ls
libccf_app.enclave.so.signed # SGX-enabled application
libccf_app.virtual.so # Virtual application (i.e. insecure!)

Test

$ /opt/ccf/bin/sandbox.sh -p ./libccf_app.virtual.so
Setting up Python environment...
Python environment successfully setup
[12:00:00.000] Virtual mode enabled
[12:00:00.000] Starting 1 CCF node...
[12:00:00.000] Started CCF network with the following nodes:
[12:00:00.000]   Node [0] = https://127.0.0.1:8000
[12:00:00.000] You can now issue business transactions to the ./libccf_app.virtual.so application
[12:00:00.000] Keys and certificates have been copied to the common folder: .../ccf_app_template/build/workspace/sandbox_common
[12:00:00.000] See https://microsoft.github.io/CCF/main/use_apps/issue_commands.html for more information
[12:00:00.000] Press Ctrl+C to shutdown the network

Or, for an SGX-enabled application: $ /opt/ccf/bin/sandbox.sh -p ./libccf_app.enclave.so.signed -e release

In another terminal:

$ cd ccf_app_template/build
$ curl -X POST https://127.0.0.1:8000/app/log?id=1 --cacert ./workspace/sandbox_common/service_cert.pem -H "Content-Type: application/json" --data '{"msg": "hello world"}'
$ curl https://127.0.0.1:8000/app/log?id=1 --cacert ./workspace/sandbox_common/service_cert.pem
"hello world"

Code Tour

To get a guided tour of the sample application, checkout this repository in VSCode and use the CodeTour extension.

ccf-app-template's People

Contributors

jumaffre avatar letmaik avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.