Step 2: Build an enclave image with the node.js binary
Step 2.1: Create a config file
Create a config.json file with the following content:
{
"caddy": {
"url": "",
"caddyfile": ""
},
"params": {
},
"service_commands": [
{
"name": "node_app",
"command": "/app/mount/app",
"build_commands": [
""
],
"ports": [4000],
"env": {}
}
]
}
The second app in /app/mount/app refers to the package created in Step 1.
Step 2.2: Build the enclave image
Build the enclave image using
sudo docker run -it --privileged -v `pwd`:/app/mount marlinorg/enclave-builder
The command will create enclave/enclave.eif which is the enclave image file and will print measurements which should look something like
{
"Measurements": {
"HashAlgorithm": "Sha384 { ... }",
"PCR0": "cfa7554f87ba13620037695d62a381a2d876b74c2e1b435584fe5c02c53393ac1c5cd5a8b6f92e866f9a65af751e0462",
"PCR1": "bcdf05fefccaa8e55bf2c8d6dee9e79bbff31e34bf28a99aa19e6b29c37ee80b214a414b7607236edf26fcb78654e63f",
"PCR2": "20caae8a6a69d9b1aecdf01a0b9c5f3eafd1f06cb51892bf47cef476935bfe77b5b75714b68a69146d650683a217c5b3"
}
}
tip
If you aren't able to access the created enclave/enclave.eif file, you may need to change its owner from root to user(you).