Skip to content

Commit 1cd2dd7

Browse files
Merge pull request #125 from Acurast/feat/add-instantMatch-example
feat(): add example for instant match case in cli
2 parents 7f855e8 + fcffa41 commit 1cd2dd7

2 files changed

Lines changed: 43 additions & 1 deletion

File tree

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ ACURAST_MNEMONIC=abandon abandon about ...
129129
- `type`: `AssignmentStrategyVariant.Single`: Assigns one set of processors for a deployment. If instantMatch is provided, specifies processors and maximum allowed start delay:
130130
- `processor`: Processor address.
131131
- `maxAllowedStartDelayInMs`: Maximum allowed start delay in milliseconds.
132+
- See [Instant match](#instant-match) for a full example; the repository’s `acurast.json` also defines a `test-instant-match` project you can copy from.
132133
- `type`: `AssignmentStrategyVariant.Competing`: Assigns a new set of processors for each execution.
133134
- `execution`: Specifies the execution details, which can be:
134135
- `type`: 'onetime'`: Run the deployment only once.
@@ -526,6 +527,12 @@ The `reuseKeysFrom` field allows you to reuse keys from a previous deployment. T
526527
}
527528
```
528529

530+
### Instant match
531+
532+
When `assignmentStrategy.type` is `Single`, you can set `assignmentStrategy.instantMatch` to pin planned executions to specific processors (each entry maps to a processor account and a per-entry maximum start delay). Replace the `processor` value with your processor’s SS58 address on the network you deploy to. The example address below is only a placeholder for the correct format.
533+
534+
If `instantMatch` is non-empty, `acurast deploy` skips the market pricing check for that project, since matching is explicit.
535+
529536
### Shell Runtime
530537

531538
The Shell runtime runs your deployment as a native binary inside a Linux distro image on the processor (PRoot-isolated). This unlocks shell scripts, native tooling, and any language you can ship as a Linux binary.
@@ -550,7 +557,11 @@ To use it, set `runtime` to `"Shell"` and provide an `image` (URL + SHA256). The
550557
"assignmentStrategy": { "type": "Single" },
551558
"execution": { "type": "onetime", "maxExecutionTimeInMs": 60000 },
552559
"maxAllowedStartDelayInMs": 10000,
553-
"usageLimit": { "maxMemory": 0, "maxNetworkRequests": 0, "maxStorage": 0 },
560+
"usageLimit": {
561+
"maxMemory": 0,
562+
"maxNetworkRequests": 0,
563+
"maxStorage": 0
564+
},
554565
"numberOfReplicas": 1,
555566
"requiredModules": [],
556567
"minProcessorReputation": 0,

acurast.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,37 @@
263263
"includeEnvironmentVariables": [],
264264
"processorWhitelist": []
265265
},
266+
"test-instant-match": {
267+
"projectName": "test-instant-match",
268+
"fileUrl": "examples/canary-test.js",
269+
"network": "canary",
270+
"onlyAttestedDevices": true,
271+
"assignmentStrategy": {
272+
"type": "Single",
273+
"instantMatch": [
274+
{
275+
"processor": "5CiPPseXPECbkjWCa6MnjNokrgYjMqmKndv2rSnekmSK2DjL",
276+
"maxAllowedStartDelayInMs": 10000
277+
}
278+
]
279+
},
280+
"execution": {
281+
"type": "onetime",
282+
"maxExecutionTimeInMs": 60000
283+
},
284+
"maxAllowedStartDelayInMs": 10000,
285+
"usageLimit": {
286+
"maxMemory": 0,
287+
"maxNetworkRequests": 0,
288+
"maxStorage": 0
289+
},
290+
"numberOfReplicas": 1,
291+
"requiredModules": [],
292+
"minProcessorReputation": 0,
293+
"maxCostPerExecution": 1000000000,
294+
"includeEnvironmentVariables": [],
295+
"processorWhitelist": []
296+
},
266297
"cargo-hello": {
267298
"projectName": "cargo-hello",
268299
"fileUrl": "examples/app",

0 commit comments

Comments
 (0)