Skip to content

Commit 139f1b9

Browse files
Merge pull request #79 from Acurast/develop
Develop
2 parents 89a41ee + a89a0c6 commit 139f1b9

23 files changed

+460
-25
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dist
22
node_modules
3-
examples
3+
44

55
.env
66
.acurast

acurast.json

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
{
2+
"projects": {
3+
"test-single-onetime": {
4+
"projectName": "test-single-onetime",
5+
"fileUrl": "examples/test.js",
6+
"network": "canary",
7+
"onlyAttestedDevices": true,
8+
"assignmentStrategy": {
9+
"type": "Single"
10+
},
11+
"execution": {
12+
"type": "onetime",
13+
"maxExecutionTimeInMs": 60000
14+
},
15+
"maxAllowedStartDelayInMs": 10000,
16+
"usageLimit": {
17+
"maxMemory": 0,
18+
"maxNetworkRequests": 0,
19+
"maxStorage": 0
20+
},
21+
"numberOfReplicas": 1,
22+
"requiredModules": [],
23+
"minProcessorReputation": 0,
24+
"maxCostPerExecution": 100000000000,
25+
"includeEnvironmentVariables": [],
26+
"processorWhitelist": []
27+
},
28+
"test-single-onetime-with-env": {
29+
"projectName": "test-single-onetime-with-env",
30+
"fileUrl": "examples/test.js",
31+
"network": "canary",
32+
"onlyAttestedDevices": true,
33+
"assignmentStrategy": {
34+
"type": "Single"
35+
},
36+
"execution": {
37+
"type": "onetime",
38+
"maxExecutionTimeInMs": 60000
39+
},
40+
"maxAllowedStartDelayInMs": 10000,
41+
"usageLimit": {
42+
"maxMemory": 0,
43+
"maxNetworkRequests": 0,
44+
"maxStorage": 0
45+
},
46+
"numberOfReplicas": 1,
47+
"requiredModules": [],
48+
"minProcessorReputation": 0,
49+
"maxCostPerExecution": 100000000000,
50+
"includeEnvironmentVariables": ["TEST_ENV_VAR"],
51+
"processorWhitelist": []
52+
},
53+
"test-ipfs": {
54+
"projectName": "test-ipfs",
55+
"fileUrl": "ipfs://QmUCUxqof4MFkvCpsAaangue9njQBudcPaLq7ppp7yvtrL",
56+
"network": "canary",
57+
"onlyAttestedDevices": true,
58+
"assignmentStrategy": {
59+
"type": "Single"
60+
},
61+
"execution": {
62+
"type": "onetime",
63+
"maxExecutionTimeInMs": 60000
64+
},
65+
"maxAllowedStartDelayInMs": 10000,
66+
"usageLimit": {
67+
"maxMemory": 0,
68+
"maxNetworkRequests": 0,
69+
"maxStorage": 0
70+
},
71+
"numberOfReplicas": 1,
72+
"requiredModules": [],
73+
"minProcessorReputation": 0,
74+
"maxCostPerExecution": 100000000000,
75+
"includeEnvironmentVariables": [],
76+
"processorWhitelist": []
77+
},
78+
"test-bundle-file": {
79+
"projectName": "test-bundle-file",
80+
"fileUrl": "examples/nested/file/test.js",
81+
"network": "canary",
82+
"onlyAttestedDevices": true,
83+
"assignmentStrategy": {
84+
"type": "Single"
85+
},
86+
"execution": {
87+
"type": "onetime",
88+
"maxExecutionTimeInMs": 60000
89+
},
90+
"maxAllowedStartDelayInMs": 10000,
91+
"usageLimit": {
92+
"maxMemory": 0,
93+
"maxNetworkRequests": 0,
94+
"maxStorage": 0
95+
},
96+
"numberOfReplicas": 1,
97+
"requiredModules": [],
98+
"minProcessorReputation": 0,
99+
"maxCostPerExecution": 100000000000,
100+
"includeEnvironmentVariables": [],
101+
"processorWhitelist": []
102+
},
103+
"test-bundle-folder": {
104+
"projectName": "test-bundle-folder",
105+
"fileUrl": "examples/folder",
106+
"entrypoint": "index.js",
107+
"network": "canary",
108+
"onlyAttestedDevices": true,
109+
"assignmentStrategy": {
110+
"type": "Single"
111+
},
112+
"execution": {
113+
"type": "onetime",
114+
"maxExecutionTimeInMs": 60000
115+
},
116+
"maxAllowedStartDelayInMs": 10000,
117+
"usageLimit": {
118+
"maxMemory": 0,
119+
"maxNetworkRequests": 0,
120+
"maxStorage": 0
121+
},
122+
"numberOfReplicas": 1,
123+
"requiredModules": [],
124+
"minProcessorReputation": 0,
125+
"maxCostPerExecution": 100000000000,
126+
"includeEnvironmentVariables": [],
127+
"processorWhitelist": []
128+
}
129+
}
130+
}

examples/folder/data/sample.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"test": "json"
3+
}

examples/folder/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const sample = require('./data/sample.json')
2+
console.log(sample)
3+
4+
const { test } = require('./test')
5+
test(JSON.stringify(sample))

examples/folder/test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const test = (text) => {
2+
throw new Error(`CLI test: ${text}`)
3+
}
4+
5+
module.exports = { test }

examples/nested/file/test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
throw new Error(`CLI test with nested file`)

examples/test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
throw new Error(`CLI test. TEST_ENV_VAR: ${_STD_.env.TEST_ENV_VAR}`)

package-lock.json

Lines changed: 21 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@acurast/cli",
3-
"version": "0.2.2",
3+
"version": "0.3.0",
44
"description": "A cli to interact with the Acurast Cloud.",
55
"main": "dist/index.js",
66
"bin": {
@@ -36,6 +36,7 @@
3636
"@polkadot/api": "^11.2.1",
3737
"@polkadot/keyring": "^12.6.2",
3838
"@types/cli-progress": "^3.11.5",
39+
"adm-zip": "^0.5.16",
3940
"ansis": "^3.2.0",
4041
"axios": "^1.7.2",
4142
"bignumber.js": "^9.1.2",
@@ -57,6 +58,7 @@
5758
"zod": "^3.23.8"
5859
},
5960
"devDependencies": {
61+
"@types/adm-zip": "^0.5.7",
6062
"@types/elliptic": "^6.4.18",
6163
"@types/figlet": "^1.5.8",
6264
"@types/inquirer": "^9.0.7",

src/acurast/convertConfigToJob.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
AcurastProjectConfig,
33
AssignmentStrategyVariant,
4+
DeploymentRuntime,
45
JobRegistration,
56
} from '../types.js'
67
import { deviceVersions } from './app-versions.js'
@@ -168,6 +169,7 @@ export const convertConfigToJob = (
168169
reward: rewardPerExecution,
169170
minReputation: processorReputation,
170171
processorVersion: minProcessorVersions,
172+
runtime: config.runtime ?? DeploymentRuntime.NodeJSWithBundle,
171173
},
172174
},
173175
}

0 commit comments

Comments
 (0)