@ethernity-cloud/sdk-js 1.7.8 → 1.7.9

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.
@@ -23,7 +23,11 @@ function App() {
23
23
  if (UNSAFE_NETWORK) {
24
24
  await runner.setNetwork(...UNSAFE_NETWORK);
25
25
  }
26
- runner.initializeStorage(IPFS_ENDPOINT);
26
+ // An IPFS API of the dApp's own carries the task's artefacts; without
27
+ // one they go through the bootnode's payload intake (the public API's
28
+ // add is closed to callers without a token).
29
+ if (IPFS_ENDPOINT && !IPFS_ENDPOINT.includes("ipfs.ethernity.cloud")) runner.initializeStorage(IPFS_ENDPOINT);
30
+ else runner.initializePublicIntake();
27
31
 
28
32
  // Events are named by task status; detail is { message, status, progress }.
29
33
  runner.addEventListener(ECStatus.DEFAULT, (e) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethernity-cloud/sdk-js",
3
- "version": "1.7.8",
3
+ "version": "1.7.9",
4
4
  "description": "A package to run ethernity cloud build scripts",
5
5
  "scripts": {
6
6
  "test": "node --test \"test/**/*.test.js\"",
@@ -39,7 +39,7 @@
39
39
  "!**/*.pyc"
40
40
  ],
41
41
  "dependencies": {
42
- "@ethernity-cloud/runner": "^0.6.3",
42
+ "@ethernity-cloud/runner": "^0.6.4",
43
43
  "acorn": "^8.11.0",
44
44
  "adm-zip": "^0.5.14",
45
45
  "axios": "^1.7.2",
@@ -23,7 +23,11 @@ function App() {
23
23
  if (UNSAFE_NETWORK) {
24
24
  await runner.setNetwork(...UNSAFE_NETWORK);
25
25
  }
26
- runner.initializeStorage(IPFS_ENDPOINT);
26
+ // An IPFS API of the dApp's own carries the task's artefacts; without
27
+ // one they go through the bootnode's payload intake (the public API's
28
+ // add is closed to callers without a token).
29
+ if (IPFS_ENDPOINT && !IPFS_ENDPOINT.includes("ipfs.ethernity.cloud")) runner.initializeStorage(IPFS_ENDPOINT);
30
+ else runner.initializePublicIntake();
27
31
 
28
32
  // Events are named by task status; detail is { message, status, progress }.
29
33
  runner.addEventListener(ECStatus.DEFAULT, (e) => {
package/run.js CHANGED
@@ -42,7 +42,12 @@ try { require('dotenv').config(); } catch (e) { /* dotenv optional */ }
42
42
  const casConfig = require('./cas/config.js');
43
43
  const { networkFor, unsafeVariant } = require('./network.js');
44
44
 
45
- const DEFAULT_IPFS = 'https://ipfs.ethernity.cloud/api/v0';
45
+ // `--ipfs intake` (the default): the artefacts' CIDs are computed locally and
46
+ // the bytes delivered to the bootnode's payload intake once the DO request is
47
+ // on chain (runner initializePublicIntake); `--ipfs <url>` uploads and reads
48
+ // through that Kubo RPC API instead. The public API's add is closed to callers
49
+ // without a token.
50
+ const DEFAULT_IPFS = 'intake';
46
51
 
47
52
  function parseArgs(argv) {
48
53
  const opts = { ipfs: DEFAULT_IPFS, timeout: 600, taskPrice: 3, cpu: 1, memory: 1, storage: 10, bandwidth: 1, duration: 1, validators: 1, node: '' };
@@ -86,7 +91,8 @@ enclaves: --securelock <name> (default PROJECT_NAME), --trustedzone <name> (def
86
91
  on an -unsafe network the default is each one's -unsafe variant
87
92
  key: PRIVATE_KEY (a funded 0x key) from .env / env, or ECLD_PRIVATE_KEY
88
93
  resources: --task-price 3 --cpu 1 --memory 1 --storage 10 --bandwidth 1 --duration 1 --validators 1
89
- other: --node <addr> --ipfs <url> --timeout <sec> --json`;
94
+ other: --node <addr> --ipfs intake|<kubo api url> (default intake: the bootnode's payload intake)
95
+ --timeout <sec> --json`;
90
96
 
91
97
  async function main() {
92
98
  const { opts, positional } = parseArgs(process.argv.slice(2));
@@ -173,7 +179,8 @@ async function main() {
173
179
  console.error('ecld-run: could not initialise the runner: ' + e.message);
174
180
  process.exit(1);
175
181
  }
176
- runner.initializeStorage(opts.ipfs);
182
+ if (opts.ipfs === 'intake') runner.initializePublicIntake();
183
+ else runner.initializeStorage(opts.ipfs);
177
184
 
178
185
  let lastPhase = null;
179
186
  const onProgress = (e) => {