Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ grid_navigation:
excerpt: "Jobs where the goal is to analyze Files/Code"
cta: View
url: 'ranges/55xx'
- title: Software Execution
excerpt: "Jobs where the goal is to run code or execute files"
cta: View
url: 'ranges/56xx'
- title: Others
excerpt: "Jobs that don't fit neatly in other categories"
cta: View
Expand Down
45 changes: 45 additions & 0 deletions kinds/5600.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
layout: default
title: Wasm Execution
description: Execute WebAssembly (Wasm) code.
---

# Input

Clients must provide the Wasm code in the `i` tag field. The Wasm code must be directly accessible at the provided URL.
It must also provide the input data and the provided function name to be executed.

The input should be a stringified JSON object with the following fields:

- `url` (string): The URL of the Wasm binary.
- `function` (string): The name of the function to be executed.
- `input` (string): The input data for the function.
- `time` (number): The maximum time in milliseconds to execute the function.
- `checksum` (string): The sha256 hash of the Wasm binary in hex.

# Output

The result of the execution is returned in the `content` field.

# Example

## Count number of vowels in a string.

#### Request

```json
{
"content": "",
"kind": 5600,
"tags": [["i", "{\"url\":\"https://github.com/extism/plugins/releases/download/v0.5.0/count_vowels.wasm\",\"function\":\"count_vowels\",\"input\":\"Hello World\",\"time\": 1000, \"checksum\": \"93898457953d30d016f712ccf4336ce7e9971db5f7f3aff1edd252764f75d5d7\"}", "text"]]
}
```

#### Response

```json
{
"content": "{\"count\":3,\"total\":3,\"vowels\":\"aeiouAEIOU\"}",
"kind": 6600
}
```
24 changes: 24 additions & 0 deletions ranges/56xx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
# Page settings
layout: homepage
keywords: nostr

# Hero section
title: Software Execution
description: "Jobs where the goal is to run code or execute files."
buttons:
- content: Back
url: "/"
external_url: false
# - icon: github
# content: Button with icon
# url: '#'
# external_url: true

# Grid navigation
grid_navigation:
- title: WASM Execution
excerpt: "Kind 5600"
cta: View
url: "/kinds/5600"
---