enclave-source.js missing
Rufaida94 opened this issue · 3 comments
browserify --insert-global-vars __filename,__dirname --no-commondir -t [ babelify --presets [ es2015 ] ] enclave-source.js > enclave-bundle.js
With this command, which file in the node-secureworker repository should we use instead of enclave-source.js? Is it test-commands.js in node-secureworker/tests directory?
because I can't find a file named enclave-source.js in any directory.
I know eventually this file should be whatever code I want to run inside my enclave, but I wanted an example to make sure everything is running fine before moving forward?
Thanks
enclave-source.js
is your source file you are trying to bundle into the SGX enclave. This is an example name. Maybe documentation is unclear.
Also, that is only needed if you are using imports in your code. Then this is how you can use browserify to bundle everything together into one file.
But you can also just use one simple file. Tests are doing that, for example. Adding tests.js
and test-commands.js
into the enclave and then running it.
You can see example here as well.
Also, this project is not production ready. So feel free to make any PRs with improvements, both to documentation and code.
OK, so if I followed the example and generated the .so file using:
secureworker-create --output enclave.so tests.js test-commands.js
then to be able to start the enclave should I add the line:
const worker = new SecureWorker('enclave.so', 'enclave-bundle.js');
to run.js file in the tests directory?or where should I add it exactly?