@ethernity-cloud/sdk-js 1.6.1 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/README.md +44 -6
  2. package/cas/config.js +61 -3
  3. package/info.js +333 -324
  4. package/init.js +20 -4
  5. package/nodenithy/build/securelock/Dockerfile.tmpl +34 -32
  6. package/nodenithy/build/securelock/scripts/binary-fs-build.sh +7 -6
  7. package/nodenithy/build/securelock/src/securelock.js.tmpl +5 -2
  8. package/nodenithy/build.mjs +83 -71
  9. package/nodenithy/run/docker-compose-final.yml.tmpl +36 -31
  10. package/nodenithy/run/docker-compose.yml.tmpl +34 -45
  11. package/nodenithy/run/image_registry.js +396 -380
  12. package/nodenithy/run.js +42 -28
  13. package/package.json +5 -3
  14. package/publish.js +4 -2
  15. package/pynithy/build/securelock/Dockerfile.base.tpl +13 -0
  16. package/pynithy/build/securelock/Dockerfile.tpl +131 -0
  17. package/pynithy/build/securelock/scripts/binary-fs-build.sh +25 -34
  18. package/pynithy/build/securelock/scripts/pyfreeze.sh +32 -0
  19. package/pynithy/build/securelock/src/{pox.abi → abi/etnyImplementationV2.abi} +1489 -1489
  20. package/pynithy/build/securelock/src/abi/image_registry.abi +1 -0
  21. package/pynithy/build/securelock/src/ecld_state.py +906 -0
  22. package/pynithy/build/securelock/src/esr.abi +1 -0
  23. package/pynithy/build/securelock/src/esr_local.py +267 -0
  24. package/pynithy/build/securelock/src/esr_wallet.py +150 -0
  25. package/pynithy/build/securelock/src/etny_crypto.py +208 -167
  26. package/pynithy/build/securelock/src/etny_exec.py +385 -79
  27. package/pynithy/build/securelock/src/etny_exec_flask.py +535 -0
  28. package/pynithy/build/securelock/src/etny_exec_serv.py +353 -0
  29. package/pynithy/build/securelock/src/etny_session_exec.py +245 -0
  30. package/pynithy/build/securelock/src/get_sgx_report.so +0 -0
  31. package/pynithy/build/securelock/src/image_registry.abi +1 -1
  32. package/pynithy/build/securelock/src/key_generation.py +17 -17
  33. package/pynithy/build/securelock/src/local_api.py +189 -0
  34. package/pynithy/build/securelock/src/models.py +200 -176
  35. package/pynithy/build/securelock/src/securelock.py.tmpl +1037 -727
  36. package/pynithy/build/securelock/src/swift_stream_service.py +206 -186
  37. package/pynithy/build.mjs +142 -92
  38. package/pynithy/run/docker-compose-final.yml.tmpl +58 -51
  39. package/pynithy/run/docker-compose.yml.tmpl +62 -48
  40. package/pynithy/run/etny-securelock-test.yaml.tpl +4 -1
  41. package/pynithy/run/image_registry.js +396 -380
  42. package/pynithy/run.js +44 -28
  43. package/pynithy/src/serverless/Dockerfile.serverless +8 -0
  44. package/pynithy/src/serverless/requirements.txt +6 -0
  45. package/run.js +69 -28
  46. package/nodenithy/build/las/Dockerfile +0 -5
  47. package/pynithy/build/docker-compose.yml +0 -70
  48. package/pynithy/build/las/Dockerfile +0 -11
  49. package/pynithy/build/las/src/etny_entrypoint.sh +0 -6
  50. package/pynithy/build/las/src/las_entrypoint.sh +0 -26
  51. package/pynithy/build/scripts/binary-fs-build.sh +0 -28
  52. package/pynithy/build/securelock/Dockerfile.tmpl +0 -95
@@ -5,24 +5,29 @@
5
5
  # no local SGX is present, cert extraction falls back to the remote
6
6
  # publickey.ethernity.cloud service. The on-node runtime uses
7
7
  # docker-compose-final.yml, which targets real SGX hardware.
8
+ #
9
+ # Tagged lines are kept, untagged, only where they apply (cas/config.js
10
+ # renderCompose): __CAS_ONLY__ serves CAS attestation (mainnet, or a testnet
11
+ # with a SessionRegistry), and __SAFE_ONLY__ is the LAS, which every network
12
+ # but an -unsafe one runs.
8
13
  version: '3.2'
9
14
  services:
10
- las:
11
- container_name: las
12
- privileged: true
13
- image: localhost:5000/etny-las
14
- entrypoint: "/las_entrypoint.sh"
15
- # -a 0.0.0.0: without it the LAS binds dual-stack (:::18766) and cannot
16
- # allocate the socket on a host booted with ipv6.disable=1, so it
17
- # crash-loops and every task on that node times out with no attestation.
18
- # The enclaves reach it over IPv4 either way.
19
- command: "/usr/local/bin/las -a 0.0.0.0"
20
- restart: on-failure
21
- ports:
22
- - target: 18766
23
- published: 18766
24
- protocol: tcp
25
- mode: host
15
+ las: # __SAFE_ONLY__
16
+ container_name: las # __SAFE_ONLY__
17
+ privileged: true # __SAFE_ONLY__
18
+ image: localhost:5000/etny-las # __SAFE_ONLY__
19
+ entrypoint: "/las_entrypoint.sh" # __SAFE_ONLY__
20
+ # -a 0.0.0.0: without it the LAS binds dual-stack (:::18766) and cannot # __SAFE_ONLY__
21
+ # allocate the socket on a host booted with ipv6.disable=1, so it # __SAFE_ONLY__
22
+ # crash-loops and every task on that node times out with no attestation. # __SAFE_ONLY__
23
+ # The enclaves reach it over IPv4 either way. # __SAFE_ONLY__
24
+ command: "/usr/local/bin/las -a 0.0.0.0" # __SAFE_ONLY__
25
+ restart: on-failure # __SAFE_ONLY__
26
+ ports: # __SAFE_ONLY__
27
+ - target: 18766 # __SAFE_ONLY__
28
+ published: 18766 # __SAFE_ONLY__
29
+ protocol: tcp # __SAFE_ONLY__
30
+ mode: host # __SAFE_ONLY__
26
31
 
27
32
  etny-securelock:
28
33
  container_name: etny-securelock
@@ -31,9 +36,9 @@ services:
31
36
  entrypoint: ""
32
37
  command: [ "/usr/local/bin/node", "/etny-securelock/securelock.js" ]
33
38
  environment:
34
- - SCONE_CAS_ADDR=scone-cas.cf
35
- - SCONE_LAS_ADDR=las
36
- - SCONE_CONFIG_ID=__ENCLAVE_NAME_SECURELOCK__/application
39
+ - SCONE_CAS_ADDR=scone-cas.cf # __CAS_ONLY__
40
+ - SCONE_LAS_ADDR=las # __CAS_ONLY__
41
+ - SCONE_CONFIG_ID=__ENCLAVE_NAME_SECURELOCK__/application # __CAS_ONLY__
37
42
  - SCONE_HEAP=1024M
38
43
  # Must match the --stack the securelock binary was signed with (build.mjs),
39
44
  # otherwise SCONE recomputes MRENCLAVE at load and re-signs as debug.
@@ -42,8 +47,8 @@ services:
42
47
  - SCONE_ALLOW_DLOPEN=1
43
48
  - SCONE_EXTENSIONS_PATH=/lib/libbinary-fs.so
44
49
  restart: on-failure:5
45
- depends_on:
46
- - las
50
+ depends_on: # __SAFE_ONLY__
51
+ - las # __SAFE_ONLY__
47
52
 
48
53
  etny-trustedzone:
49
54
  container_name: etny-trustedzone
@@ -52,31 +57,15 @@ services:
52
57
  entrypoint: ""
53
58
  command: [ "/usr/local/bin/node", "/etny-trustedzone/trustedzone.js" ]
54
59
  environment:
55
- - SCONE_CAS_ADDR=scone-cas.cf
56
- - SCONE_LAS_ADDR=las
57
- - SCONE_CONFIG_ID=__ENCLAVE_NAME_TRUSTEDZONE__/application
58
- - SCONE_HEAP=256M
60
+ - SCONE_CAS_ADDR=scone-cas.cf # __CAS_ONLY__
61
+ - SCONE_LAS_ADDR=las # __CAS_ONLY__
62
+ - SCONE_CONFIG_ID=__ENCLAVE_NAME_TRUSTEDZONE__/application # __CAS_ONLY__
63
+ # The heap the trustedzone was measured and registered with: 1024M for
64
+ # every testnet trustedzone (etny-nodenithy v3/run/docker-compose.yml).
65
+ - SCONE_HEAP=__TRUSTEDZONE_HEAP__
59
66
  - SCONE_LOG=DEBUG
60
67
  - SCONE_ALLOW_DLOPEN=1
61
68
  - SCONE_EXTENSIONS_PATH=/lib/libbinary-fs.so
62
69
  restart: on-failure
63
- depends_on:
64
- - las
65
-
66
- etny-validator:
67
- container_name: etny-validator
68
- privileged: true
69
- image: localhost:5000/etny-validator
70
- entrypoint: ""
71
- command: [ "/usr/local/bin/node", "/etny-validator/validator.js" ]
72
- environment:
73
- - SCONE_CAS_ADDR=scone-cas.cf
74
- - SCONE_LAS_ADDR=las
75
- - SCONE_CONFIG_ID=ecld-nodenithy/application
76
- - SCONE_HEAP=256M
77
- - SCONE_LOG=DEBUG
78
- - SCONE_ALLOW_DLOPEN=1
79
- - SCONE_EXTENSIONS_PATH=/lib/libbinary-fs.so
80
- restart: on-failure:5
81
- depends_on:
82
- - las
70
+ depends_on: # __SAFE_ONLY__
71
+ - las # __SAFE_ONLY__