The repository uses submodules so be sure to check them out by doing:
$ git submodule update --init --recursive
The easiest way to build SGX code is to use the provided scripts, which run a Docker
container with all the included tools. This has been tested on MacOS and Ubuntu with SGX_MODE=SIM
.
To start the SGX development container:
$ ./ekiden/scripts/sgx-enter.sh
Ekiden uses cargo-make
as the build system. The
development Docker container already comes with cargo-make
preinstalled.
First, build Ekiden to get the correct core contracts. This is currently needed because the core contracts are not yet finalized and it is important that correct hashes are used. You can do that by running:
$ cd ekiden
$ cargo make
$ cd ..
After the process completes, to build everything required for running Ekiden, simply run the following in the top-level directory:
$ cargo make
For subsequent rebuilds, you only need to perform this step while rebuilding Ekiden is not required.
This should install any required dependencies and build all packages. By default SGX code is
built in simulation mode. To change this, do export SGX_MODE=HW
(currently untested) before
running the cargo make
command.
The built contract will be stored under target/enclave/dummy.signed.so
.
The example client is located under examples/client
and it may be built using:
$ cd examples/client
$ cargo build
For running the built contract consult the Ekiden documentation.