@ethernity-cloud/sdk-js 1.1.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 (184) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +185 -0
  3. package/build.js +22 -0
  4. package/init.js +301 -0
  5. package/nodenithy/build/las/Dockerfile +5 -0
  6. package/nodenithy/build/securelock/Dockerfile.tmpl +65 -0
  7. package/nodenithy/build/securelock/scripts/binary-fs-build.sh +28 -0
  8. package/nodenithy/build/securelock/src/.env +3 -0
  9. package/nodenithy/build/securelock/src/etny_crypto.js +201 -0
  10. package/nodenithy/build/securelock/src/etny_exec.js +65 -0
  11. package/nodenithy/build/securelock/src/image_registry_abi.js +808 -0
  12. package/nodenithy/build/securelock/src/models.js +261 -0
  13. package/nodenithy/build/securelock/src/package.json +40 -0
  14. package/nodenithy/build/securelock/src/pox_abi.js +1491 -0
  15. package/nodenithy/build/securelock/src/securelock.js.tmpl +421 -0
  16. package/nodenithy/build/securelock/src/swift_stream_service.js +147 -0
  17. package/nodenithy/build/securelock/src/task_status.js +15 -0
  18. package/nodenithy/build/securelock/src/wallet.js +29 -0
  19. package/nodenithy/build/squash/Dockerfile +7 -0
  20. package/nodenithy/build/trustedzone/Dockerfile.tmpl +57 -0
  21. package/nodenithy/build/trustedzone/scripts/binary-fs-build.sh +22 -0
  22. package/nodenithy/build/trustedzone/src/.env +3 -0
  23. package/nodenithy/build/trustedzone/src/etny_crypto.js +202 -0
  24. package/nodenithy/build/trustedzone/src/etny_exec.js +54 -0
  25. package/nodenithy/build/trustedzone/src/image_registry_abi.js +808 -0
  26. package/nodenithy/build/trustedzone/src/models.js +261 -0
  27. package/nodenithy/build/trustedzone/src/package.json +40 -0
  28. package/nodenithy/build/trustedzone/src/pox_abi.js +1491 -0
  29. package/nodenithy/build/trustedzone/src/swift_stream_service.js +147 -0
  30. package/nodenithy/build/trustedzone/src/task_status.js +15 -0
  31. package/nodenithy/build/trustedzone/src/test.js +44 -0
  32. package/nodenithy/build/trustedzone/src/trustedzone.js.tmpl +508 -0
  33. package/nodenithy/build/trustedzone/src/wallet.js +28 -0
  34. package/nodenithy/build/validator/Dockerfile +58 -0
  35. package/nodenithy/build/validator/package-lock.json +6 -0
  36. package/nodenithy/build/validator/scripts/binary-fs-build.sh +19 -0
  37. package/nodenithy/build/validator/src/.env +3 -0
  38. package/nodenithy/build/validator/src/cert.pem +5 -0
  39. package/nodenithy/build/validator/src/etny_crypto.js +204 -0
  40. package/nodenithy/build/validator/src/etny_exec.js +52 -0
  41. package/nodenithy/build/validator/src/image_registry_abi.js +808 -0
  42. package/nodenithy/build/validator/src/key.pem +6 -0
  43. package/nodenithy/build/validator/src/models.js +261 -0
  44. package/nodenithy/build/validator/src/package-lock.json +2498 -0
  45. package/nodenithy/build/validator/src/package.json +40 -0
  46. package/nodenithy/build/validator/src/pox_abi.js +1491 -0
  47. package/nodenithy/build/validator/src/swift_stream_service.js +147 -0
  48. package/nodenithy/build/validator/src/task_status.js +15 -0
  49. package/nodenithy/build/validator/src/test.js +44 -0
  50. package/nodenithy/build/validator/src/trustedzone.js +613 -0
  51. package/nodenithy/build/validator/src/validator_abi.js +834 -0
  52. package/nodenithy/build/validator/src/wallet.js +28 -0
  53. package/nodenithy/build.js +184 -0
  54. package/nodenithy/build.mjs +179 -0
  55. package/nodenithy/build.sh +161 -0
  56. package/nodenithy/ipfs.js +135 -0
  57. package/nodenithy/ipfs.mjs +551 -0
  58. package/nodenithy/public/favicon.ico +0 -0
  59. package/nodenithy/public/index.html +43 -0
  60. package/nodenithy/public/logo192.png +0 -0
  61. package/nodenithy/public/logo512.png +0 -0
  62. package/nodenithy/public/manifest.json +25 -0
  63. package/nodenithy/public/robots.txt +3 -0
  64. package/nodenithy/run/__pycache__/swift_stream_service.cpython-312.pyc +0 -0
  65. package/nodenithy/run/app/input.txt +4 -0
  66. package/nodenithy/run/app/payload.js +4 -0
  67. package/nodenithy/run/docker-compose-final.yml.tmpl +65 -0
  68. package/nodenithy/run/docker-compose-swift-stream.yml +17 -0
  69. package/nodenithy/run/docker-compose.yml.tmpl +76 -0
  70. package/nodenithy/run/etny-securelock-test.yaml.tpl +46 -0
  71. package/nodenithy/run/etny-trustedzone-test.yaml.tpl +45 -0
  72. package/nodenithy/run/git.sh +22 -0
  73. package/nodenithy/run/image_registry.abi +1 -0
  74. package/nodenithy/run/image_registry.js +372 -0
  75. package/nodenithy/run/image_registry.py +327 -0
  76. package/nodenithy/run/image_registry_runner.py +71 -0
  77. package/nodenithy/run/ipfs.sh +58 -0
  78. package/nodenithy/run/ipfs_pre.sh +75 -0
  79. package/nodenithy/run/public_key_service.js +90 -0
  80. package/nodenithy/run/public_key_service.py +107 -0
  81. package/nodenithy/run/swift_stream_service.py +212 -0
  82. package/nodenithy/run/swiftstream.py +37 -0
  83. package/nodenithy/run/swiftstream1.py +27 -0
  84. package/nodenithy/run.js +538 -0
  85. package/nodenithy/run.sh +277 -0
  86. package/nodenithy/scripts/build-ipfs-upload.sh +23 -0
  87. package/nodenithy/scripts/build.sh +40 -0
  88. package/nodenithy/scripts/ipfs-daemon.sh +7 -0
  89. package/nodenithy/scripts/run.sh +50 -0
  90. package/nodenithy/src/App.css +57 -0
  91. package/nodenithy/src/ec_helloworld_example.js +64 -0
  92. package/nodenithy/src/index.css +13 -0
  93. package/nodenithy/src/index.js +17 -0
  94. package/nodenithy/src/preStart.js +45 -0
  95. package/nodenithy/src/preStart.mjs +57 -0
  96. package/nodenithy/src/reportWebVitals.js +13 -0
  97. package/nodenithy/src/serverless/backend.js +5 -0
  98. package/package.json +48 -0
  99. package/postinstall.js +34 -0
  100. package/publish.js +126 -0
  101. package/pynithy/build/docker-compose.yml +68 -0
  102. package/pynithy/build/las/Dockerfile +11 -0
  103. package/pynithy/build/las/src/etny_entrypoint.sh +6 -0
  104. package/pynithy/build/las/src/las_entrypoint.sh +26 -0
  105. package/pynithy/build/scripts/binary-fs-build.sh +28 -0
  106. package/pynithy/build/securelock/Dockerfile.tmpl +78 -0
  107. package/pynithy/build/securelock/scripts/binary-fs-build.sh +41 -0
  108. package/pynithy/build/securelock/src/app/.env +5 -0
  109. package/pynithy/build/securelock/src/app/cert1-ca1-clean.crt +10 -0
  110. package/pynithy/build/securelock/src/app/cert1-ca1-clean.key +6 -0
  111. package/pynithy/build/securelock/src/app/enclave_pub_cert.pem +10 -0
  112. package/pynithy/build/securelock/src/app/input.txt +1 -0
  113. package/pynithy/build/securelock/src/app/payload.py +25 -0
  114. package/pynithy/build/securelock/src/app/public-cert-clean.pem +10 -0
  115. package/pynithy/build/securelock/src/app/result.txt +1 -0
  116. package/pynithy/build/securelock/src/app/transaction.txt +1 -0
  117. package/pynithy/build/securelock/src/etny_crypto.py +167 -0
  118. package/pynithy/build/securelock/src/etny_exec.py +79 -0
  119. package/pynithy/build/securelock/src/image_registry.abi +1 -0
  120. package/pynithy/build/securelock/src/key_generation.py +17 -0
  121. package/pynithy/build/securelock/src/models.py +176 -0
  122. package/pynithy/build/securelock/src/pox.abi +1489 -0
  123. package/pynithy/build/securelock/src/securelock.py.tmpl +411 -0
  124. package/pynithy/build/securelock/src/swift_stream_service.py +186 -0
  125. package/pynithy/build/trustedzone/Dockerfile.tmpl +56 -0
  126. package/pynithy/build/trustedzone/scripts/binary-fs-build.sh +32 -0
  127. package/pynithy/build/trustedzone/src/app/.env +5 -0
  128. package/pynithy/build/trustedzone/src/app/cert1-ca1-clean.crt +10 -0
  129. package/pynithy/build/trustedzone/src/app/cert1-ca1-clean.key +6 -0
  130. package/pynithy/build/trustedzone/src/app/enclave_pub_cert.pem +10 -0
  131. package/pynithy/build/trustedzone/src/app/input.txt +1 -0
  132. package/pynithy/build/trustedzone/src/app/payload.py +25 -0
  133. package/pynithy/build/trustedzone/src/app/public-cert-clean.pem +10 -0
  134. package/pynithy/build/trustedzone/src/app/result.txt +1 -0
  135. package/pynithy/build/trustedzone/src/app/securelock.crt +10 -0
  136. package/pynithy/build/trustedzone/src/app/transaction.txt +1 -0
  137. package/pynithy/build/trustedzone/src/app/trustedzone.crt +10 -0
  138. package/pynithy/build/trustedzone/src/etny_crypto.py +188 -0
  139. package/pynithy/build/trustedzone/src/etny_exec.py +56 -0
  140. package/pynithy/build/trustedzone/src/formatter.py +42 -0
  141. package/pynithy/build/trustedzone/src/image_registry.abi +1 -0
  142. package/pynithy/build/trustedzone/src/key_generation.py +17 -0
  143. package/pynithy/build/trustedzone/src/models.py +176 -0
  144. package/pynithy/build/trustedzone/src/pox.abi +1489 -0
  145. package/pynithy/build/trustedzone/src/swift_stream_service.py +186 -0
  146. package/pynithy/build/trustedzone/src/trustedzone.py.tmpl +460 -0
  147. package/pynithy/build.mjs +179 -0
  148. package/pynithy/docker-compose.yml +0 -0
  149. package/pynithy/ipfs.mjs +244 -0
  150. package/pynithy/public/favicon.ico +0 -0
  151. package/pynithy/public/index.html +43 -0
  152. package/pynithy/public/logo192.png +0 -0
  153. package/pynithy/public/logo512.png +0 -0
  154. package/pynithy/public/manifest.json +25 -0
  155. package/pynithy/public/robots.txt +3 -0
  156. package/pynithy/run/certs/cert.pem +31 -0
  157. package/pynithy/run/certs/challenge.crt +10 -0
  158. package/pynithy/run/certs/key.pem +52 -0
  159. package/pynithy/run/docker-compose-final.yml +59 -0
  160. package/pynithy/run/docker-compose-final.yml.tmpl +59 -0
  161. package/pynithy/run/docker-compose-swift-stream.yml +27 -0
  162. package/pynithy/run/docker-compose-swift-stream.yml.tmpl +27 -0
  163. package/pynithy/run/docker-compose.yml +55 -0
  164. package/pynithy/run/docker-compose.yml.tmpl +55 -0
  165. package/pynithy/run/etny-pynity-test.yaml.tpl +46 -0
  166. package/pynithy/run/etny-securelock-test.yaml.tpl +46 -0
  167. package/pynithy/run/etny-trustedzone-test.yaml.tpl +46 -0
  168. package/pynithy/run/git.sh +22 -0
  169. package/pynithy/run/image_registry.abi +1 -0
  170. package/pynithy/run/image_registry.js +372 -0
  171. package/pynithy/run/image_registry.py +139 -0
  172. package/pynithy/run/image_registry_runner.py +45 -0
  173. package/pynithy/run/ipfs.sh +89 -0
  174. package/pynithy/run/public_key_service.js +90 -0
  175. package/pynithy/run/swiftstream.py +28 -0
  176. package/pynithy/run.js +538 -0
  177. package/pynithy/src/App.css +57 -0
  178. package/pynithy/src/ec_helloworld_example.js +64 -0
  179. package/pynithy/src/index.css +13 -0
  180. package/pynithy/src/index.js +17 -0
  181. package/pynithy/src/preStart.mjs +57 -0
  182. package/pynithy/src/reportWebVitals.js +13 -0
  183. package/pynithy/src/serverless/__init__.py +0 -0
  184. package/pynithy/src/serverless/backend.py +2 -0
@@ -0,0 +1,179 @@
1
+ import shell from 'shelljs';
2
+ import fs from 'fs';
3
+ import path from 'path';
4
+ import dotenv from 'dotenv';
5
+ dotenv.config();
6
+
7
+ const VERSION = process.env.VERSION;
8
+ console.log(`Building ${VERSION}`);
9
+
10
+ const writeEnv = (key, value) => {
11
+ const envFile = `${currentDir}/.env`;
12
+ let envContent = '';
13
+
14
+ if (fs.existsSync(envFile)) {
15
+ envContent = fs.readFileSync(envFile, 'utf8');
16
+ const regex = new RegExp(`^${key}=.*`, 'm');
17
+ if (regex.test(envContent)) {
18
+ envContent = envContent.replace(regex, `${key}=${value}`);
19
+ } else {
20
+ envContent += `\n${key}=${value}`;
21
+ }
22
+ } else {
23
+ envContent = `${key}=${value}`;
24
+ }
25
+
26
+ fs.writeFileSync(envFile, envContent, 'utf8');
27
+ };
28
+ // runner name: [smart contract address, image registry address, rpc url, chainid]
29
+ export const ECRunner = {
30
+ 'etny-pynithy-testnet': ['0x02882F03097fE8cD31afbdFbB5D72a498B41112c', '0x15D73a742529C3fb11f3FA32EF7f0CC3870ACA31', 'https://core.bloxberg.org', 8995],
31
+ 'etny-nodenithy-testnet': ['0x02882F03097fE8cD31afbdFbB5D72a498B41112c', '0x15D73a742529C3fb11f3FA32EF7f0CC3870ACA31', 'https://core.bloxberg.org', 8995],
32
+ 'etny-pynithy': ['0x549A6E06BB2084100148D50F51CF77a3436C3Ae7', '0x15D73a742529C3fb11f3FA32EF7f0CC3870ACA31', 'https://core.bloxberg.org', 8995],
33
+ 'etny-nodenithy': ['0x549A6E06BB2084100148D50F51CF77a3436C3Ae7', '0x15D73a742529C3fb11f3FA32EF7f0CC3870ACA31', 'https://core.bloxberg.org', 8995],
34
+ 'ecld-nodenithy-testnet': ['0x4274b1188ABCfa0d864aFdeD86bF9545B020dCDf', '0xF7F4eEb3d9a64387F4AcEb6d521b948E6E2fB049', 'https://rpc-mumbai.matic.today', 80001],
35
+ 'ecld-pynithy': ['0x439945BE73fD86fcC172179021991E96Beff3Cc4', '0x689f3806874d3c8A973f419a4eB24e6fBA7E830F', 'https://polygon-rpc.com', 137],
36
+ 'ecld-nodenithy': ['0x439945BE73fD86fcC172179021991E96Beff3Cc4', '0x689f3806874d3c8A973f419a4eB24e6fBA7E830F', 'https://polygon-rpc.com', 137]
37
+ };
38
+
39
+ const runCommand = (command, canPass = false) => {
40
+ if (shell.exec(command).code !== 0 && !canPass) {
41
+ console.error(`Error executing command: ${command}`);
42
+ process.exit(1);
43
+ }
44
+ };
45
+
46
+ // Downloading dependencies
47
+ shell.rm('-rf', './registry');
48
+ const currentDir = process.cwd();
49
+ // console.log(`current_dir: ${currentDir}`);
50
+ const buildDir = path.join(currentDir, 'node_modules/@ethernity-cloud/sdk-js/pynithy/build');
51
+ // console.log(`build_dir: ${buildDir}`);
52
+
53
+ const dockerPS = shell.exec('docker ps --filter name=registry -q', { silent: true }).stdout.trim();
54
+ if (dockerPS) {
55
+ runCommand(`docker stop ${dockerPS.split('\n').join(' ')}`);
56
+ }
57
+ const dockeri = shell.exec('docker ps --filter name=las -q', { silent: true }).stdout.trim();
58
+ if (dockeri) {
59
+ runCommand(`docker stop ${dockeri.split('\n').join(' ')}`);
60
+ }
61
+ const dockerRm = shell.exec('docker ps --filter name=registry -q', { silent: true }).stdout.trim();
62
+ if (dockerRm) {
63
+ runCommand(`docker rm ${dockerRm.split('\n').join(' ')} -f`);
64
+ }
65
+ const dockerImg = shell.exec('docker images --filter reference="*etny*" -q', { silent: true }).stdout.trim();
66
+ if (dockerImg) {
67
+ runCommand(`docker rmi ${dockerImg.split('\n').join(' ')} -f`);
68
+ }
69
+ const dockerImgReg = shell.exec('docker images --filter reference="*registry*" -q', { silent: true }).stdout.trim();
70
+ if (dockerImgReg) {
71
+ runCommand(`docker rmi ${dockerImgReg.split('\n').join(' ')} -f`);
72
+ }
73
+ runCommand(`docker rm registry -f`);
74
+
75
+
76
+
77
+ const srcDir = './src/serverless';
78
+ const destDir = path.join(buildDir, 'securelock/src/serverless');
79
+ console.log(`Creating destination directory: ${destDir}`);
80
+ fs.mkdirSync(destDir, { recursive: true });
81
+
82
+ console.log(`Copying files from ${srcDir} to ${destDir}`);
83
+ fs.readdirSync(srcDir).forEach(file => {
84
+ fs.copyFileSync(path.join(srcDir, file), path.join(destDir, file));
85
+ });
86
+
87
+ process.chdir(buildDir);
88
+
89
+ let templateName = process.env.TRUSTED_ZONE_IMAGE || 'etny-pynithy-testnet';
90
+
91
+ const isMainnet = !templateName.includes('testnet');
92
+
93
+ const ENCLAVE_NAME_TRUSTEDZONE = templateName;
94
+
95
+ runCommand('docker pull registry:2');
96
+ runCommand('docker run -d --restart=always -p 5000:5000 --name registry registry:2');
97
+ // runCommand(`docker login ${process.env.DOCKER_REPO_URL} -u ${process.env.DOCKER_LOGIN} -p ${process.env.DOCKER_PASSWORD}`);
98
+
99
+ // const CI_COMMIT_BRANCH = process.env.PROJECT_NAME;
100
+ // aleXPRoj-securelock-v3-testnet-0.1.0...
101
+ const ENCLAVE_NAME_SECURELOCK = `${process.env.PROJECT_NAME}-SECURELOCK-V3-${process.env.BLOCKCHAIN_NETWORK.split('_')[1].toLowerCase()}-${VERSION}`.replace(/\//g, '_').replace(/-/g, '_');
102
+ console.log(`ENCLAVE_NAME_SECURELOCK: ${ENCLAVE_NAME_SECURELOCK}`);
103
+ writeEnv('ENCLAVE_NAME_SECURELOCK', ENCLAVE_NAME_SECURELOCK);
104
+
105
+ console.log('Building etny-securelock');
106
+ process.chdir('securelock');
107
+ // runCommand(`cat Dockerfile.tmpl | sed s/"__ENCLAVE_NAME_SECURELOCK__"/"${ENCLAVE_NAME_SECURELOCK}"/g > Dockerfile`);
108
+ const dockerfileSecureTemplate = fs.readFileSync('Dockerfile.tmpl', 'utf8');
109
+ const dockerfileSecureContent = dockerfileSecureTemplate.replace(/__ENCLAVE_NAME_SECURELOCK__/g, ENCLAVE_NAME_SECURELOCK).replace(/__BUCKET_NAME__/g, templateName + "-v3").replace(/__SMART_CONTRACT_ADDRESS__/g, ECRunner[templateName][0]).replace(/__IMAGE_REGISTRY_ADDRESS__/g, ECRunner[templateName][1]).replace(/__RPC_URL__/g, ECRunner[templateName][2]).replace(/__CHAIN_ID__/g, ECRunner[templateName][3]).replace(/__TRUSTED_ZONE_IMAGE__/g, templateName);
110
+
111
+ fs.writeFileSync('Dockerfile', dockerfileSecureContent);
112
+
113
+ let imagesTag = process.env.BLOCKCHAIN_NETWORK.toLowerCase();
114
+
115
+ if (isMainnet) {
116
+ fs.writeFileSync('Dockerfile', dockerfileSecureContent.replace('# RUN scone-signer sign', 'RUN scone-signer sign'));
117
+ imagesTag = process.env.BLOCKCHAIN_NETWORK.split("_")[0].toLowerCase()
118
+ }
119
+
120
+
121
+
122
+
123
+ runCommand(`docker build --build-arg ENCLAVE_NAME_SECURELOCK=${ENCLAVE_NAME_SECURELOCK} -t etny-securelock:latest .`);
124
+ runCommand('docker tag etny-securelock localhost:5000/etny-securelock');
125
+ runCommand('docker push localhost:5000/etny-securelock');
126
+ // runCommand('docker save etny-securelock:latest -o etny-securelock.tar');
127
+ process.chdir('..');
128
+ // const ENCLAVE_NAME_TRUSTEDZONE = `ENCLAVE_NAME_TRUSTEDZONE_${VERSION}_${CI_COMMIT_BRANCH}`.toUpperCase().replace(/\//g, '_').replace(/-/g, '_');
129
+
130
+
131
+ console.log(`ENCLAVE_NAME_TRUSTEDZONE: ${ENCLAVE_NAME_TRUSTEDZONE}`);
132
+ writeEnv('ENCLAVE_NAME_TRUSTEDZONE', ENCLAVE_NAME_TRUSTEDZONE);
133
+
134
+ console.log('Building etny-trustedzone');
135
+ process.chdir('trustedzone');
136
+
137
+ // // runCommand(`cat Dockerfile.tmpl | sed s/"__ENCLAVE_NAME_TRUSTEDZONE__"/"${ENCLAVE_NAME_TRUSTEDZONE}"/g > Dockerfile`);
138
+ // const dockerfileTrustedTemplate = fs.readFileSync('Dockerfile.tmpl', 'utf8');
139
+ // const dockerfileTrustedContent = dockerfileTrustedTemplate.replace(/__ENCLAVE_NAME_SECURELOCK__/g, ENCLAVE_NAME_SECURELOCK);
140
+ // fs.writeFileSync('Dockerfile', dockerfileTrustedContent);
141
+
142
+ // runCommand(`docker build --build-arg ENCLAVE_NAME_TRUSTEDZONE=${ENCLAVE_NAME_TRUSTEDZONE} -t etny-trustedzone:latest .`);
143
+ // runCommand('docker tag etny-trustedzone localhost:5000/etny-trustedzone');
144
+ // runCommand('docker push localhost:5000/etny-trustedzone');
145
+ // runCommand('docker save etny-trustedzone:latest -o etny-trustedzone.tar');
146
+ // const zip = new AdmZip('etny-trustedzone.tar.zip');
147
+ // zip.extractAllTo('.', true);
148
+
149
+ runCommand(`docker pull registry.ethernity.cloud:443/debuggingdelight/ethernity-cloud-sdk-registry/ethernity/etny-trustedzone:py_${imagesTag}`);
150
+ runCommand(`docker tag registry.ethernity.cloud:443/debuggingdelight/ethernity-cloud-sdk-registry/ethernity/etny-trustedzone:py_${imagesTag} localhost:5000/etny-trustedzone`);
151
+ runCommand('docker push localhost:5000/etny-trustedzone');
152
+
153
+ // if (isMainnet) {
154
+ // console.log('Building validator');
155
+ // process.chdir('../validator');
156
+ // // runCommand('docker build -t etny-validator:latest .');
157
+ // // runCommand('docker tag etny-validator localhost:5000/etny-validator');
158
+ // // runCommand('docker push localhost:5000/etny-validator');
159
+ // runCommand(`docker pull registry.ethernity.cloud:443/debuggingdelight/ethernity-cloud-sdk-registry/ethernity/etny-validator:py_${imagesTag}`);
160
+ // runCommand(`docker tag registry.ethernity.cloud:443/debuggingdelight/ethernity-cloud-sdk-registry/ethernity/etny-validator:py_${imagesTag} localhost:5000/etny-validator`);
161
+ // runCommand('docker push localhost:5000/etny-validator');
162
+ // }
163
+
164
+
165
+ console.log('Building etny-las');
166
+ process.chdir('../las');
167
+ // runCommand('docker build -t etny-las .');
168
+ // runCommand('docker tag etny-las localhost:5000/etny-las');
169
+ // runCommand('docker push localhost:5000/etny-las');
170
+ runCommand(`docker pull registry.ethernity.cloud:443/debuggingdelight/ethernity-cloud-sdk-registry/ethernity/etny-las:py_${imagesTag}`);
171
+ runCommand(`docker tag registry.ethernity.cloud:443/debuggingdelight/ethernity-cloud-sdk-registry/ethernity/etny-las:py_${imagesTag} localhost:5000/etny-las`);
172
+ runCommand('docker push localhost:5000/etny-las');
173
+
174
+
175
+ process.chdir(currentDir);
176
+ runCommand('docker cp registry:/var/lib/registry registry');
177
+
178
+ console.log('Cleaning up');
179
+ fs.rmSync(destDir, { recursive: true, force: true });
File without changes
@@ -0,0 +1,244 @@
1
+ // ipfsClient.js
2
+ import { create, globSource } from 'kubo-rpc-client';
3
+ import { promisify } from 'util';
4
+ import fs from 'fs';
5
+ import { Command } from 'commander';
6
+ import { promises as fss } from 'fs';
7
+ import path from 'path';
8
+ import { MultiBar, Presets } from 'cli-progress';
9
+
10
+ const program = new Command();
11
+ const writeFile = promisify(fs.writeFile);
12
+ const delay = (ms) => new Promise((res) => setTimeout(res, ms));
13
+ const getRetryDelay = (retryCount, baseDelay = 1) => baseDelay * 2 ** retryCount;
14
+
15
+ let ipfs = null;
16
+
17
+ const initialize = (host, protocol, port, token) => {
18
+ if (host.search('http') !== -1) {
19
+ ipfs = create(host); //{ timeout: '4m' }
20
+ } else if (token === '') {
21
+ ipfs = create({
22
+ host,
23
+ protocol,
24
+ port,
25
+ // timeout: '4m'
26
+ });
27
+ } else {
28
+ ipfs = create({
29
+ host,
30
+ protocol,
31
+ port,
32
+ headers: { authorization: token },
33
+ // timeout: '4m'
34
+ });
35
+ }
36
+ };
37
+
38
+ const uploadFileToIPFS = async (filePath) => {
39
+ try {
40
+ const fileContent = await fss.readFile(filePath);
41
+ const response = await ipfs.add({ path: filePath, content: fileContent });
42
+ await fss.writeFile(`./IPFS_DOCKER_COMPOSE_HASH.ipfs`, response.cid.toString());
43
+ return response.cid.toString();
44
+ } catch (e) {
45
+ console.error();
46
+ return "Failed to upload file to IPFS, please try again.";
47
+ }
48
+ };
49
+
50
+
51
+ const uploadFolderToIPFS = async (folderPath) => {
52
+ try {
53
+ const addedFiles = [];
54
+ const ipfsOptions = {
55
+ wrapWithDirectory: true,
56
+ pin: true,
57
+ hidden: true,
58
+ timeout: '5m'
59
+ };
60
+
61
+ console.log(`Uploading folder to IPFS: ${folderPath}`);
62
+
63
+ const multiBar = new MultiBar({
64
+ clearOnComplete: false,
65
+ hideCursor: true,
66
+ format: 'Progress [{bar}] {percentage}% | {value}/{total} MB'
67
+ }, Presets.shades_classic);
68
+
69
+ const files = [];
70
+ const readDirectory = (dir) => {
71
+ fs.readdirSync(dir).forEach((file) => {
72
+ const fullPath = path.join(dir, file);
73
+ if (fs.statSync(fullPath).isDirectory()) {
74
+ readDirectory(fullPath);
75
+ } else {
76
+ files.push({
77
+ path: path.relative(folderPath, fullPath),
78
+ size: fs.statSync(fullPath).size
79
+ });
80
+ }
81
+ });
82
+ };
83
+
84
+ readDirectory(folderPath);
85
+ const totalSize = files.reduce((acc, file) => acc + file.size, 0);
86
+
87
+ const progressBar = multiBar.create(totalSize / 1024 / 1024, 0);
88
+
89
+ for await (const file of ipfs.addAll(files.map(file => ({
90
+ path: file.path.replace(/\\/g, '/'),
91
+ content: fs.createReadStream(path.join(folderPath, file.path))
92
+ })), { ...ipfsOptions })) {
93
+ addedFiles.push({
94
+ cid: file.cid.toString(),
95
+ path: file.path,
96
+ size: file.size,
97
+ });
98
+ progressBar.increment(file.size / 1024 / 1024);
99
+ }
100
+ progressBar.update(totalSize / 1024 / 1024);
101
+ multiBar.stop();
102
+ const _hash = addedFiles.find(file => file.path === '').cid;
103
+ // Return the CID of the root directory
104
+ await fss.writeFile(`./IPFS_HASH.ipfs`, _hash);
105
+ return _hash;
106
+ } catch (e) {
107
+ return "Upload failed.";
108
+ }
109
+ };
110
+
111
+ const getFromIPFS = async (hhash, filePath, maxRetries = process.env.REACT_APP_IPFS_RETRIES || 5) => {
112
+ let res = '';
113
+ let retryCount = 0;
114
+ // console.log('Downloading file from IPFS...');
115
+ // console.log(`Hash: ${hhash}`);
116
+ // console.log(`Max Retries: ${maxRetries}`);
117
+
118
+ while (retryCount < maxRetries) {
119
+ try {
120
+ for await (const file of ipfs.cat(hhash)) {
121
+ res += new TextDecoder().decode(file.buffer);
122
+ }
123
+ await writeFile(filePath, res);
124
+ return;
125
+ } catch (error) {
126
+ console.error(`Error: ${error.message}`);
127
+ retryCount += 1;
128
+
129
+ if (retryCount < maxRetries) {
130
+ console.log(`Retrying... (${retryCount}/${maxRetries})`);
131
+ await delay(getRetryDelay(retryCount));
132
+ continue;
133
+ } else {
134
+ throw new Error("ECError.IPFS_DOWNLOAD_ERROR");
135
+ }
136
+ }
137
+ }
138
+ };
139
+
140
+
141
+ const downloadFolderFromIPFS = async (cid, outputPath) => {
142
+ try {
143
+ console.log(`Downloading folder from IPFS: ${cid}`);
144
+
145
+ const multiBar = new MultiBar({
146
+ clearOnComplete: false,
147
+ hideCursor: true,
148
+ format: 'Progress [{bar}] {percentage}% | {value}/{total} MB'
149
+ }, Presets.shades_classic);
150
+
151
+ const files = [];
152
+ for await (const file of ipfs.get(cid)) {
153
+ console.log(`file: ${JSON.stringify(file, null, 2)}`);
154
+ if (!file.content) continue;
155
+
156
+ const filePath = path.join(outputPath, file.path);
157
+ const dir = path.dirname(filePath);
158
+
159
+ if (!fs.existsSync(dir)) {
160
+ fs.mkdirSync(dir, { recursive: true });
161
+ }
162
+
163
+ const writeStream = fs.createWriteStream(filePath);
164
+ const progressBar = multiBar.create(file.size / 1024 / 1024, 0);
165
+
166
+ for await (const chunk of file.content) {
167
+ writeStream.write(chunk);
168
+ progressBar.increment(chunk.length / 1024 / 1024);
169
+ }
170
+
171
+ writeStream.end();
172
+ progressBar.update(file.size / 1024 / 1024);
173
+ files.push(filePath);
174
+ }
175
+
176
+ multiBar.stop();
177
+ console.log(`Downloaded ${files.length} files to ${outputPath}`);
178
+ } catch (e) {
179
+ console.error(e);
180
+ return "err";
181
+ }
182
+ };
183
+
184
+ program
185
+ .option('--host <host>', 'IPFS host')
186
+ .option('--hhash <hhash>', 'IPFS hash')
187
+ .option('--filePath <path>', 'Path to the file')
188
+ .option('--folderPath <path>', 'Path to the folder')
189
+ .option('--action <action>', 'Action to perform (upload, download)')
190
+ .option('--output <path>', 'Output path for download');
191
+
192
+ program.parse(process.argv);
193
+
194
+ const options = program.opts();
195
+
196
+ const main = async () => {
197
+ const host = options.host || 'localhost';
198
+ initialize(host);
199
+
200
+ if (options.action === 'upload') {
201
+ if (options.filePath) {
202
+ const hhash = await uploadFileToIPFS(options.filePath);
203
+ console.log(`${hhash}`);
204
+ } else if (options.folderPath) {
205
+ let retryCount = 0;
206
+ let hhash = null;
207
+ try {
208
+ hhash = await uploadFolderToIPFS(options.folderPath);
209
+ console.log(`${hhash}`);
210
+ } catch (e) {
211
+ // console.log(e);
212
+ }
213
+ while ((!hhash || hhash === 'Upload failed.') && retryCount < 3) {
214
+ console.log(`Retrying... (${retryCount}/3)`);
215
+ hhash = await uploadFolderToIPFS(options.folderPath);
216
+ console.log(`${hhash}`);
217
+ retryCount += 1;
218
+ }
219
+
220
+ if (!hhash || hhash === 'Upload failed.') {
221
+ console.log(`Failed to upload folder to IPFS, please try again.`);
222
+ }
223
+ process.exit(0);
224
+ } else {
225
+ console.error('Please provide a filePath or folderPath for upload.');
226
+ }
227
+ } else if (options.action === 'download') {
228
+ if (options.filePath) {
229
+ console.log(`Downloading file from IPFS: ${options.hhash}`);
230
+ const content = await getFromIPFS(options.hhash, options.filePath);
231
+ console.log(`File downloaded. ${options.hhash}`);
232
+ } else if (options.folderPath) {
233
+ console.log(`Downloading folder from IPFS: ${options.hhash}`);
234
+ const content = await downloadFolderFromIPFS(options.hhash, options.folderPath);
235
+ console.log(`Folder downloaded. ${options.hhash}`);
236
+ } else {
237
+ console.error('Please provide a filePath or folderPath for download.');
238
+ }
239
+ } else {
240
+ console.error('Please provide a valid action (upload, download).');
241
+ }
242
+ };
243
+
244
+ main();
Binary file
@@ -0,0 +1,43 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
7
+ <meta name="theme-color" content="#000000" />
8
+ <meta
9
+ name="description"
10
+ content="Web site created using create-react-app"
11
+ />
12
+ <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13
+ <!--
14
+ manifest.json provides metadata used when your web app is installed on a
15
+ user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16
+ -->
17
+ <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
18
+ <!--
19
+ Notice the use of %PUBLIC_URL% in the tags above.
20
+ It will be replaced with the URL of the `public` folder during the build.
21
+ Only files inside the `public` folder can be referenced from the HTML.
22
+
23
+ Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
24
+ work correctly both with client-side routing and a non-root public URL.
25
+ Learn how to configure a non-root public URL by running `npm run build`.
26
+ -->
27
+ <title>React App</title>
28
+ </head>
29
+ <body>
30
+ <noscript>You need to enable JavaScript to run this app.</noscript>
31
+ <div id="root"></div>
32
+ <!--
33
+ This HTML file is a template.
34
+ If you open it directly in the browser, you will see an empty page.
35
+
36
+ You can add webfonts, meta tags, or analytics to this file.
37
+ The build step will place the bundled scripts into the <body> tag.
38
+
39
+ To begin the development, run `npm start` or `yarn start`.
40
+ To create a production bundle, use `npm run build` or `yarn build`.
41
+ -->
42
+ </body>
43
+ </html>
Binary file
Binary file
@@ -0,0 +1,25 @@
1
+ {
2
+ "short_name": "React App",
3
+ "name": "Create React App Sample",
4
+ "icons": [
5
+ {
6
+ "src": "favicon.ico",
7
+ "sizes": "64x64 32x32 24x24 16x16",
8
+ "type": "image/x-icon"
9
+ },
10
+ {
11
+ "src": "logo192.png",
12
+ "type": "image/png",
13
+ "sizes": "192x192"
14
+ },
15
+ {
16
+ "src": "logo512.png",
17
+ "type": "image/png",
18
+ "sizes": "512x512"
19
+ }
20
+ ],
21
+ "start_url": ".",
22
+ "display": "standalone",
23
+ "theme_color": "#000000",
24
+ "background_color": "#ffffff"
25
+ }
@@ -0,0 +1,3 @@
1
+ # https://www.robotstxt.org/robotstxt.html
2
+ User-agent: *
3
+ Disallow:
@@ -0,0 +1,31 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIFazCCA1OgAwIBAgIUc+3Kr4miSMMr08u2/txR4jnxs10wDQYJKoZIhvcNAQEL
3
+ BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
4
+ GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yMjEyMTMxMzMzMjRaFw0yMzAx
5
+ MTIxMzMzMjRaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw
6
+ HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggIiMA0GCSqGSIb3DQEB
7
+ AQUAA4ICDwAwggIKAoICAQCf4lhW6B31F2HTbEat83zA9jlOZPUZzxvu56UOh1T9
8
+ dqGjl7GIaNt0wffulHuQbzMdSVfyarVKV/olAuCRS9WaFyPUpGqbseJdmUyn8i0i
9
+ NETDwleeDN/bSImDPeoBEzKKaE4eHyj9Q0BMVZDAvZeB55VAxg705pUXQvqxpC1p
10
+ elc+py60LdKj/5vn5nfLFVN3+jJeJ6rybUi10MRaD8pqmAfuz6i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P5HaRwtl2okU6mzFnJq
50
+ 0Egj7sWXWlr449Hg50+ccLMGV/kN42nYYW/pduJspjzNz/AfUHQzpeWivhE9nBho
51
+ ocxMvmz7ORffE/j+8ZK2ti/TzfQO
52
+ -----END PRIVATE KEY-----
@@ -0,0 +1,59 @@
1
+ version: '3.2'
2
+ services:
3
+ las:
4
+ container_name: las
5
+ privileged: true
6
+ image: localhost:5000/etny-las
7
+ entrypoint: "/las_entrypoint.sh"
8
+ command: "bash -c '/las_entrypoint.sh && /usr/local/bin/las | tee /var/log/las.log'"
9
+ restart: unless-stopped
10
+ networks:
11
+ - ethernity
12
+ ports:
13
+ - target: 18766
14
+ published: 18766
15
+ protocol: tcp
16
+ mode: host
17
+
18
+ etny-securelock:
19
+ container_name: etny-securelock
20
+ privileged: true
21
+ image: localhost:5000/etny-securelock
22
+ entrypoint: ""
23
+ command: [ "/usr/local/bin/python", "/etny-securelock/securelock.py" ]
24
+ environment:
25
+ - SCONE_CAS_ADDR=scone-cas.cf
26
+ - SCONE_LAS_ADDR=las
27
+ - SCONE_CONFIG_ID=__ENCLAVE_NAME_SECURELOCK__/application
28
+ - SCONE_HEAP=1024M
29
+ - SCONE_LOG=DEBUG
30
+ - SCONE_ALLOW_DLOPEN=1
31
+ - SCONE_EXTENSIONS_PATH=/lib/libbinary-fs.so
32
+ restart: on-failure
33
+ networks:
34
+ - ethernity
35
+ depends_on:
36
+ - las
37
+
38
+ etny-trustedzone:
39
+ container_name: etny-trustedzone
40
+ privileged: true
41
+ image: localhost:5000/etny-trustedzone
42
+ entrypoint: ""
43
+ command: [ "/usr/local/bin/python", "/etny-trustedzone/trustedzone.py" ]
44
+ environment:
45
+ - SCONE_CAS_ADDR=scone-cas.cf
46
+ - SCONE_LAS_ADDR=las
47
+ - SCONE_CONFIG_ID=__ENCLAVE_NAME_TRUSTEDZONE__/application
48
+ - SCONE_HEAP=256M
49
+ - SCONE_LOG=DEBUG
50
+ - SCONE_ALLOW_DLOPEN=1
51
+ - SCONE_EXTENSIONS_PATH=/lib/libbinary-fs.so
52
+ restart: on-failure
53
+ networks:
54
+ - ethernity
55
+ depends_on:
56
+ - las
57
+ networks:
58
+ ethernity:
59
+ external: true