Skip to content

Latest commit

 

History

History
113 lines (73 loc) · 2.29 KB

File metadata and controls

113 lines (73 loc) · 2.29 KB

Building SGX wallet from source

Clone this repository and its submodules

git clone --recurse-submodules https://github.com/skalenetwork/sgxwallet.git

Install required debian packages

cd scripts; sudo ./install_packages.sh; cd ..

Build and install Intel SGX SDK

We are currently using SGX SDK version 2.13.

Below is a sequence of commands that builds SDK and installs it into /opt/intel directory.

# update to use your sgxwallet folder path
SGX_FOLDER="your-sgxwallet-folder" 

git clone -b sgx_2.25 --depth 1 https://github.com/intel/linux-sgx
cd linux-sgx
make preparation
sudo make sdk_install_pkg_no_mitigation
cd /opt/intel
sudo sh -c "echo yes | $SGX_FOLDER/linux-sgx/linux/installer/bin/sgx_linux_x64_sdk_*.bin"
cd $SGX_FOLDER/linux-sgx
sudo make psw_install_pkg
cd /opt/intel
sudo cp $SGX_FOLDER/linux-sgx/linux/installer/bin/sgx_linux_x64_psw*.bin .
sudo ./sgx_linux_x64_psw*.bin --no-start-aesm

Build dependencies

Dependencies only need to be built once.

cd scripts; ./build_deps.py; cd ..

Set SGX environment variables

source /opt/intel/sgxsdk/environment

Configure and build sgxwallet

Go to the project's top directory, then run

./autoconf.bash
./configure
make

Note: to run in simulation mode, add --enable-sgx-simulation flag when you run configure.

./autoconf.bash
./configure --enable-sgx-simulation
make

Format code

To format code run

cd scripts
python3 format.py

Build base Docker container

The base container includes software common to hardware mode and simulation mode.

sudo docker build -t sgxwallet_base .

Build Docker container in simulation mode

sudo docker build -t sgxwalletsim -f ./DockerfileSimulation .

Build Docker container in hardware mode

sudo docker build -t sgxwallet -f ./Dockerfile .

Adding new source files

Note that configure, Makefile and Makefile.in files are created by automake tools on the fly.
Please do not add these files to the source tree!

To add new source and include files to app and enclave, edit the corresponding Makefile.am file and then re-run configure.

If you change .edl file, you need to re-run configure too.