Merge pull request #68 from ozwaldorf/docs/usage

docs: add test enclave usage example
This commit is contained in:
Harald Hoyer 2024-11-15 00:14:42 +07:00 committed by GitHub
commit 4ec107365f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,6 @@
# nixsgx # 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. Hopefully most of the packages will be upstreamed to nixpkgs at some point.
@ -8,5 +8,29 @@ All package builds should be reproducible and therefore can be used to build rep
## Usage ## Usage
See: https://github.com/matter-labs/teepot ### Test enclave
and https://github.com/matter-labs/era-fee-withdrawer/tree/gramine-sgx
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