Unverified Commit e626362b authored by kladko's avatar kladko

Fix test

parent 371994d5
...@@ -29,22 +29,31 @@ The sgxwallet server is still in active development and therefore should be rega ...@@ -29,22 +29,31 @@ The sgxwallet server is still in active development and therefore should be rega
The easiest way to try the sgxwallet server is to run a docker container in insecure simulation mode that emulates an SGX processor. Once you are familiar with the server, you can enable sgx on your machine and run it in secure production mode. The easiest way to try the sgxwallet server is to run a docker container in insecure simulation mode that emulates an SGX processor. Once you are familiar with the server, you can enable sgx on your machine and run it in secure production mode.
First install docker-compose if you dont have it [as described here](https://linuxize.com/post/how-to-install-and-use-docker-compose-on-ubuntu-18-04/). First install docker-compose if you dont have it
Then run sgxwallet using docker compose ```bash
sudo apt-get install docker.io docker-compose
```
Then run sgxwallet using docker-compose
```bash ```bash
$ cd run_sgx; sudo docker-compose up $ cd run_sgx_sim; sudo docker-compose up
``` ```
Note: sgxwallet requires docker-compose for correct operation. You must always use Note: sgxwallet requires docker-compose for correct operation. You must always use
docker-compose and avoid using raw docker tools. docker-compose and avoid using raw docker tools.
Note: simulation mode is only try try sgxwallet.
In production, you need to run sgxwallet on a server that supports SGX.
Never run a production sgxserver in simulation mode.
## Admin guide ## Admin guide
If you are a SKALE validator and want to run sgxwallet for testnet or mainnet usage, If you are a SKALE validator and want to run sgxwallet for testnet or mainnet usage, you need
please refer to Admin guide. a SGX-capable server.
Please refer to Admin guide for details on how to setup sgxwallet in a secure hardware mode.
[docs/admin_guide.md](docs/admin_guide.md). [docs/admin_guide.md](docs/admin_guide.md).
## Developer guide ## Developer guide
......
# Admin guide # Admin guide
## Running SGX in secure mode. ## Running SGX in secure mode
- [Verify that your hardware and software can run SGX](prerequisites.md) - [Verify that your hardware and software can run SGX](prerequisites.md)
- [Enable SGX](enabling-sgx.md) - [Enable SGX](enabling-sgx.md)
......
# Building SGX wallet from source # Building SGX wallet from source
### Install Intel SGX SDK
The Intel SGX SDK is required for both Intel SGX hardware platform and Intel SGX simulator mode.
The following instructions download the Intel SGX SDK 2.5 and installs it in
`/opt/intel/sgxsdk/` :
```bash
sudo mkdir -p /opt/intel
cd /opt/intel
sudo wget https://download.01.org/intel-sgx/linux-2.5/rhel7.4-server/sgx_linux_x64_psw_2.5.100.49891.bin
echo "yes" | sudo bash ./sgx_linux_x64_sdk_2.5.100.49891.bin
```
This installs the Intel SGX SDK in the recommended location,
`/opt/intel/sgxsdk` .
The Intel SGX OpenSSL library expects the SDK to be here by default.
After installing, source the Intel SGX SDK activation script to set
`$SGX_SDK`, `$PATH`, `$PKG_CONFIG_PATH`, and `$LD_LIBRARY_PATH`.
Append this line to your login shell script (`~/.bashrc` or similar):
```bash
source /opt/intel/sgxsdk/environment
echo "source /opt/intel/sgxsdk/environment" >>~/.bashrc
```
To learn more about Intel SGX read the
[Intel SGX SDK documentation](https://software.intel.com/en-us/sgx-sdk/documentation)
or visit the [Intel SGX homepage](https://software.intel.com/en-us/sgx).
Downloads are listed at
[Intel SGX Downloads for Linux](https://01.org/intel-software-guard-extensions/downloads).
<!-- SPDX-License-Identifier: (AGPL-3.0-only OR CC-BY-4.0) --> <!-- SPDX-License-Identifier: (AGPL-3.0-only OR CC-BY-4.0) -->
This document describes how to build sgxwallet on Ubuntu 18.04. This document describes how to build sgxwallet on Ubuntu 18.04.
...@@ -15,18 +51,10 @@ sudo apt-get install build-essential make cmake gcc g++ yasm python libprotobuf ...@@ -15,18 +51,10 @@ sudo apt-get install build-essential make cmake gcc g++ yasm python libprotobuf
``` ```
## Install SGX SDK
```bash
cd scripts; sudo ./sgx_linux_x64_sdk_2.5.100.49891.bin; cd ..
```
## Install required debian packages ## Install required debian packages
```bash ```bash
cd scripts; sudo ./install_packages.sh; cd .. cd scripts; sudo ./install_packages.sh; cd ..
``` ```
## Build dependencies ## Build dependencies
...@@ -35,7 +63,6 @@ Dependencies only need to be built once. ...@@ -35,7 +63,6 @@ Dependencies only need to be built once.
```bash ```bash
cd scripts; ./build.py; cd .. cd scripts; ./build.py; cd ..
``` ```
## Configure and build sgxwallet ## Configure and build sgxwallet
...@@ -60,7 +87,10 @@ Note: to run in simulation mode, add --enable-sgx-simulation flag when you run c ...@@ -60,7 +87,10 @@ Note: to run in simulation mode, add --enable-sgx-simulation flag when you run c
``` ```
## Build Docker container ## Build base Docker container
The base container includes software common to hardware mode and simulation mode.
```bash ```bash
sudo docker build -t sgxwallet_base . sudo docker build -t sgxwallet_base .
...@@ -74,6 +104,13 @@ sudo docker build -t sgxwalletsim -f ./DockerfileSimulation . ...@@ -74,6 +104,13 @@ sudo docker build -t sgxwalletsim -f ./DockerfileSimulation .
``` ```
## Build Docker container in hardware mode
```bash
sudo docker build -t sgxwallet -f ./Dockerfile .
```
## Adding new source files ## Adding new source files
Note that `configure, Makefile` and `Makefile.in` files are created by `automake` tools on the fly. Note that `configure, Makefile` and `Makefile.in` files are created by `automake` tools on the fly.
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
sgxwallet depends on several freely available sgxwallet depends on several freely available
software components. These must be installed and configured before software components. These must be installed and configured before
compiling sgxwallet. running sgxwallet.
This document describes how to get and compile these required components. This docment describes how to install and configure these required components.
# Table of Contents # Table of Contents
...@@ -18,22 +18,18 @@ This document describes how to get and compile these required components. ...@@ -18,22 +18,18 @@ This document describes how to get and compile these required components.
sgxwallet should be ran on Ubuntu 18.04. Sgxwallet has been tested on Ubuntu 18.04. sgxwallet should be ran on Ubuntu 18.04. Sgxwallet has been tested on Ubuntu 18.04.
Sgxwallet may run on other Linux distributions, but the installation process is likely to be more complicated, and the use of other distributions is not supported by their respective communities at this time. Sgxwallet may run on other Linux distributions,
but the installation process is likely to be more complicated,
and the use of other distributions is not supported by their respective communities at this time.
## Docker
Docker may be used instead of building sgxwallet directly (standalone mode) and is recommended. If you build using Docker, you need to install Docker Engine and Docker Compose if it is not already installed.
### To install Docker CE Engine: ### To install Docker CE Engine:
```bash Docker CE engine is pre-installed on Ubuntu 18.04. You can re-install it as
sudo apt-get install -y apt-transport-https ca-certificates described below
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce
```bash
sudo apt-get install -y docker-io
``` ```
To verify a correct installation, run `sudo docker run hello-world` To verify a correct installation, run `sudo docker run hello-world`
...@@ -41,11 +37,7 @@ To verify a correct installation, run `sudo docker run hello-world` ...@@ -41,11 +37,7 @@ To verify a correct installation, run `sudo docker run hello-world`
### To install Docker Compose: ### To install Docker Compose:
```bash ```bash
sudo curl -L \ sudo apt-get install -y docker-compose
https://github.com/docker/compose/releases/download/1.24.1/docker-compose-`uname -s`-`uname -m` \
-o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
``` ```
To verify a correct installation, run `docker-compose version` To verify a correct installation, run `docker-compose version`
...@@ -54,41 +46,10 @@ For details on Docker installation, see <https://docs.docker.com/engine/installa ...@@ -54,41 +46,10 @@ For details on Docker installation, see <https://docs.docker.com/engine/installa
## Intel® Software Guard Extensions (Intel SGX) ## Intel® Software Guard Extensions (Intel SGX)
Sgxwallet is intended to be run on Intel SGX-enabled platforms. However, it can also be run in "simulator mode" on platforms that do not have hardware support for Intel SGX. Support for other hardware-based Trusted Execution Environments (TEEs) can be added by submitting a Pull Request. Sgxwallet is intended to be run on Intel SGX-enabled platforms.
However, it can also be run in "simulator mode" on platforms that do not have hardware support for Intel SGX.
### Intel SGX SDK Support for other hardware-based Trusted Execution Environments (TEEs) can be added by submitting a Pull Request.
The Intel SGX SDK is required for both Intel SGX hardware platform and Intel SGX simulator mode.
The following instructions download the Intel SGX SDK 2.5 and installs it in
`/opt/intel/sgxsdk/` :
```bash
sudo mkdir -p /opt/intel
cd /opt/intel
sudo wget https://download.01.org/intel-sgx/linux-2.5/rhel7.4-server/sgx_linux_x64_psw_2.5.100.49891.bin
echo "yes" | sudo bash ./sgx_linux_x64_sdk_2.5.100.49891.bin
```
This installs the Intel SGX SDK in the recommended location,
`/opt/intel/sgxsdk` .
The Intel SGX OpenSSL library expects the SDK to be here by default.
After installing, source the Intel SGX SDK activation script to set
`$SGX_SDK`, `$PATH`, `$PKG_CONFIG_PATH`, and `$LD_LIBRARY_PATH`.
Append this line to your login shell script (`~/.bashrc` or similar):
```bash
source /opt/intel/sgxsdk/environment
echo "source /opt/intel/sgxsdk/environment" >>~/.bashrc
```
To learn more about Intel SGX read the
[Intel SGX SDK documentation](https://software.intel.com/en-us/sgx-sdk/documentation)
or visit the [Intel SGX homepage](https://software.intel.com/en-us/sgx).
Downloads are listed at
[Intel SGX Downloads for Linux](https://01.org/intel-software-guard-extensions/downloads).
### Intel SGX in Hardware Mode ### Intel SGX in Hardware Mode
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment