Downloading and Installing CreDB

Note: The current version of CreDB is still considered a tech prototype and shall not be used in production environments.

Downloading Docker images

We provide docker images that contain a pre-compiled version of CreDB. Currently there is no hardware support for SGX in Docker images so this setup only allows to run CreDB in simulation mode.

To clone the image and run credb execute the following.

sudo docker pull cskama/credb-simulation
sudo docker tag cskama/credb-simulation credb

# This will set all the necessary environment variables to run the server
sudo docker run -e sgx_mode=simulation credb ../docker/run-server.sh

# Run a python shell on another instance
# (use docker inspect to find the IP of the server node)
sudo docker run -it -e sgx_mode=simulation credb ../docker/credb-shell.sh

Building from Source

If you want to modify the CreDB sourcecode or run the enclave in hardware support, you need to build the project from source.

Build Environment

CreDB can be built from source on any Linux system that provides a compiler supporting C++17 and a kernel supporting epoll(). However, for the following we assume a Debian-based systems, in particular Ubuntu 18.04. We rely on multiple packages that need to be installed in order to successfully build CreDB and its prerequisites.

Optionally:

On Ubuntu the following command should install all these dependencies.

sudo apt install build-essentials clang-tidy-6.0 clang-6.0 google-test libgoogle-glog-dev doxygen libboost-python-dev libpython3-dev libboost-program-options-dev meson

Prerequisites

  1. Install the SGX SDK following the instructions here.

  2. CreDB relies on multiple side projects to be built successfully

    1. bitstream serialization
    2. Yet Another Event Loop
    3. libdocument
    4. Cow Language

Compiling CreDB

After all dependencies and prerequisites have been installed you can checkout the latest CreDB sourcecode.

git clone https://github.com/kaimast/credb.git

Then you can compile the project using the Meson build system

meson build
cd build
ninja

Note that there are several options to configure CreDB. The most important is sgx mode. For example, if you don’t have access to SGX hardware, you can build it in simulation mode like so.

meson configure -Dsgx_mode=simulation