Skip to content

Commit

Permalink
Merge pull request #68 from ozwaldorf/docs/usage
Browse files Browse the repository at this point in the history
docs: add test enclave usage example
  • Loading branch information
haraldh authored Nov 14, 2024
2 parents 88c0700 + 5a500fe commit 4ec1073
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,36 @@
# nixsgx

This repository contains a Nix flake with up2date packages for the Intel SGX SDK and gramine.
This repository contains a Nix flake with up-to-date packages for the Intel SGX SDK and gramine.

Hopefully most of the packages will be upstreamed to nixpkgs at some point.

All package builds should be reproducible and therefore can be used to build reproducible enclave images.

## Usage

See: https://github.com/matter-labs/teepot
and https://github.com/matter-labs/era-fee-withdrawer/tree/gramine-sgx
### Test enclave

A testing enclave container is provided and can be ran like so:

```sh
# Build the dcap (or azure) container variant
nix build .#nixsgx-test-sgx-dcap

# Load image into docker
docker load < result

# Run the enclave, binding the sgx devices
docker run -i --init --rm \
--device /dev/sgx_enclave \
--device /dev/sgx_provision \
nixsgx-test-sgx-dcap:latest
```

> Note: An external aesmd instance can be provided by mounting the socket to the container: `-v /var/run/aesmd/aesm.socket:/var/run/aesmd/aesm.socket`
### Reference projects

The following projects provide reproducible enclaves using nixsgx:

- https://github.com/matter-labs/teepot
- https://github.com/matter-labs/era-fee-withdrawer/tree/gramine-sgx

0 comments on commit 4ec1073

Please sign in to comment.