-
Trying to do a POC of porting a C++ application to JS. Managed to port most of the application logic and test it out on virtual enclave based on JS generics & ACL on Azure.
Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
You can import some packages from npm, so long as they do not require nodejs APIs, which are not implemented in CCF. For an example of what can be used, see https://github.com/microsoft/azure-privacy-sandbox-kms/blob/main/package.json The polyfill.js is intended to be used outside of CCF, for unit tests. See https://microsoft.github.io/CCF/main/js/ccf-app/modules/global.html for what is available in CCF. ccfapp.crypto implements some of WebCrypto, but if functionality is missing, you can request it/propose it in a PR.
JS handlers also get a Tx, which is exposed through
There is effectively a global Tx for the duration of the handler in JS. This is true in C++ too. It is not the case that the handlers can create and commit additional Tx objects. Checks not being enforced sounds like a bug, can you provide more detail?
Yes, see options ending in "_details" under https://microsoft.github.io/CCF/main/governance/js_runtime.html#javascript-runtime-options
I am not sure what the local virtual mode governor is. One of the things that will impact commit time is the signature interval (see ledger_signatures.delay in https://microsoft.github.io/CCF/main/operations/configuration.html#configuration). Can you share more detail about what you are doing and experiencing? |
Beta Was this translation helpful? Give feedback.
-
Yes, that makes sense. Extending the polyfill when adding APIs is nice to help folks who want to unit test their transaction handlers, but not required.
That's a good place to start, yes.
Please see: https://microsoft.github.io/CCF/main/contribute/build_setup.html Release images are made with app_dev/app_run under https://github.com/microsoft/CCF/blob/main/docker/, but post GH release, you will need to patch up the ansible playbook a bit to pick up a local .deb file. You can make one of those with
That sounds fine, yes.
Yes, we are not aware of a JS interpreter with quicker startup (but we are interested in pointers!). |
Beta Was this translation helpful? Give feedback.
@bsenthilr I understand your concerns, but I think they are inherent in choosing to use a hosted service as opposed to hosting yourself. You trade off having to do maintenance for control over deployment cycles. With ACL you are in full control of the JS code, but the native code is updated by the ACL team. Reaching out to them for additional questions is definitely a good idea.
wrt the docker build, yes that looks like it should work.