(Work in Progress) Crypto.com Chain Transaction Enclaves
For more details, see the Crypto.com Chain README
SGX_MODE
:SW
for Software Simulation modeHW
for Hardware mode
NETWORK_HEX_ID
: Network HEX Id of TendermintAPP_PORT
: Listening Port inside the Docker instance (Default: 25933)
$ docker build -t chain-tx-validation \
-f ./tx-validation/Dockerfile . \
--build-arg SGX_MODE=<SW|HW> \
--build-arg NETWORK_ID=<NETWORK_HEX_ID>
# Example
$ docker build -t chain-tx-validation \
-f ./tx-validation/Dockerfile . \
--build-arg SGX_MODE=SW \
--build-arg NETWORK_ID=AB
- Software Simulation Mode
# docker run --rm -p <HOST_PORT>:<DOCKER_APP_PORT> -rm chain-tx
$ docker run --rm \
-p 25933:25933 \
--env RUST_BACKTRACE=1 \
--env RUST_LOG=info \
chain-tx-validation
- Hardware Mode
# docker run --rm --device /dev/isgx -p <HOST_PORT>:<DOCKER_APP_PORT> chain-tx
$ docker run --rm \
--device /dev/isgx \
-p 25933:25933 \
--env RUST_BACKTRACE=1 \
--env RUST_LOG=info \
chain-tx-validation
Encalve contains its own state stored inside Docker instance, if you are restarting the Docker, you may experience sanity check error because by default the docker storage is cleared on teardown.
To solve the problem, consider binding your host storage to the /enclave-storage
of the instance by:
$ docker run --rm \
-p 25933:25933 \
--env RUST_BACKTRACE=1 \
--env RUST_LOG=info \
-v /User/crypto-com/enclave-storage:/enclave-storage \
chain-tx-validation
Replace /User/crypto-com/enclave-storage
with your desired host path. Note that host storage path must be an absolute path.
If you want to get your hands dirty, you can
$ docker run --rm \
chain-tx-validation \
/bin/bash
$ make -f UpdateRustSGXSDK.mk
Commit the updated Rust SGX SDK in your forked branch and create a Pull Request to this repository.