Advanca is now Automata.
The development is moved to https://github.com/automata-network/automata. Come and join us there!
This repository contains the source code of Advanca Worker. See advanca/advanca for more information.
Before you start, make sure you clone the repository recursively.
git clone --recursive https://github.com/advanca/advanca-worker.git
To build and run the project, there are some requirements listed below. You may choose to install some of them according to your need.
Build | Run (Simulation) | Run (Hardware) | |
---|---|---|---|
Rust Toolchain | ➕ | ➖ | ➖ |
System Packages | ➕ | ➕ | ➕ |
Intel SGX Linux SDK | ➕ | ➕ | ➕ |
Intel SGX Linux Driver | ➕ | ➖ | ➕ |
Intel SGX Linux PSW | ➖ | ➖ | ➕ |
SGX Hardware | ➖ | ➖ | ➕ |
Notes
- ➕ Required
- ➖ Not required
Install Rust toolchain through rustup and complete the installation following the prompted instructions from command line.
curl https://sh.rustup.rs -sSf | sh
The repository contains a rust-toolchain
that specifies a different version from the default toolchain installation.
To install the required version, go to the directory and run:
cd advanca-worker/
# This installs WASM, but it also triggers an installation of the said version in `rust-toolchain`.
rustup target add wasm32-unknown-unknown
The project is developmend on Ubuntu 18.04. You may need to install the following packages:
sudo apt-get update
sudo apt-get install -y make build-essential cmake protobuf-compiler golang automake libtool libssl-dev
For other Linux distributions, there are no instructions available yet. However, you may install similar packages and get them working with the project.
The project relies on the following SGX dependencies on specific versions, which work best with Rust SGX SDK v1.1.2:
- Intel SGX Linux Driver v2.6.0 (out-of-tree version, not DCAP driver)
- Intel SGX Linux SDK and PSW v2.9.1
Follow the offical install instructions to build and install Intel SGX Linux Driver v2.6.0.
You can build SDK and PSW installers from the source code following its offical build instructions.
Alternatively, you can obtain the ready-to-use installers from Intel's website.
Once you have the installers, follow these guides for installation:
A community-maintained list of SGX-capable machines is available. It is only need when running the project in hardware mode.
Add this to your shell profile or run it everytime before you build.
# The script path may differ on your machine. It's located inside the SDK installtion destination
source /opt/intel/sgxsdk/environment
You may also use the following environment variables to set the build options.
Environment Variable | Default | Accepted Values | Description |
---|---|---|---|
SGX_DEBUG |
0 |
|
If the Debug mode is enabled (1 ) or not (0 ). It also affects cargo build targets in the subdirectories |
SGX_MODE |
HW |
|
If the built artifact is for hardware (HW ) or simulation (SW ) |
# set the environment variable SGX_MODE=SW
SGX_MODE=SW make
# or with DEBUG symbols
SGX_MODE=SW SGX_DEBUG=1 make
# implicilty ask for a hardware build
make
# or set the environment variable SGX_MODE=HW
SGX_MODE=HW make
# or with DEBUG symbols
SGX_MODE=HW SGX_DEBUG=1 make
The built artifacts can be found under ./bin
directory.
advanca-client
: The client which executes the demo introduced in github.com/advanca/advanca.advanca-worker
: The worker that loads theenclave.signed.so
. See more at github.com/advanca/advanca.enclave.signed.so
: The signed enclave dynamic library.
The Advanca Worker needs to work with Advanca Node
. See the umbrella project github.com/advanca/advanca for more information.
This repository is licensed under GPL 3.0
except the code in these directories:
protos/
: Licensed underApache-2.0
enclave/
: Licensed underApache-2.0