This devcontainer is configured to provide you a wasi-sdk 20.0.
Tested with Extism C PDK v1.0.1, Extism CLI v1.5.2.
-
Open this repo in devcontainer, e.g. using Github Codespaces. Type or copy/paste following commands to devcontainer's terminal.
-
Download the
extism-pdk.h
header file, the only required part of Extism C PDK:
wget https://raw.githubusercontent.com/extism/c-pdk/v1.0.1/extism-pdk.h
- Compile the example:
clang -o HTTPRequestingPlugin.wasm -mexec-model=reactor httpget.c
For testing purposes, you can invoke functions from Extism plugins with Extism CLI.
- Install
Extism CLI
from Github releases:
wget https://github.com/extism/cli/releases/download/v1.5.2/extism-v1.5.2-linux-amd64.tar.gz -O /tmp/extism.tar.gz
tar -xzf /tmp/extism.tar.gz -C /tmp ; mv /tmp/extism .
And now you have extism
binary in current folder.
- Run
httpget
function from extism plugin with CLI, allowing outbound connections to all hosts:
./extism call HTTPRequestingPlugin.wasm httpget --allow-host '*' --wasi
Perform your own experiments if desired.
An additional example using low-level API is in deprecated-extismpointer
folder.
This devcontainer is based on ideas from dev-wasm/dev-wasm-c.
Created for (wannabe-awesome) list