Skip to content
This repository was archived by the owner on Feb 26, 2026. It is now read-only.

Commit d017fd2

Browse files
authored
NOISSUE - Update Documentation (#13)
* docs: host runtime * style: fix linter * docs: update docs to match latest deployment
1 parent 7dcf564 commit d017fd2

File tree

2 files changed

+125
-10
lines changed

2 files changed

+125
-10
lines changed

docs/api/postman_collection.json

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,39 @@
1919
"method": "GET",
2020
"header": [],
2121
"url": {
22-
"raw": "{{MANAGER_BASE_URL}}/proplets/{{WORKER_ID}}",
22+
"raw": "{{MANAGER_BASE_URL}}/proplets/{{PROPLET_ID}}",
2323
"host": [
2424
"{{MANAGER_BASE_URL}}"
2525
],
2626
"path": [
2727
"proplets",
28-
"{{WORKER_ID}}"
28+
"{{PROPLET_ID}}"
2929
]
3030
}
3131
},
3232
"response": []
3333
},
3434
{
3535
"name": "List Proplets",
36+
"event": [
37+
{
38+
"listen": "test",
39+
"script": {
40+
"exec": [
41+
"function getID() {",
42+
" var res = pm.response.json();",
43+
" var id = res.proplets[0].id;",
44+
" return id;",
45+
"}",
46+
"",
47+
"pm.collectionVariables.set('PROPLET_ID', getID());",
48+
""
49+
],
50+
"type": "text/javascript",
51+
"packages": {}
52+
}
53+
}
54+
],
3655
"request": {
3756
"method": "GET",
3857
"header": [],
@@ -368,6 +387,13 @@
368387
"type": "text/javascript",
369388
"packages": {}
370389
}
390+
},
391+
{
392+
"listen": "prerequest",
393+
"script": {
394+
"exec": [],
395+
"type": "text/javascript"
396+
}
371397
}
372398
],
373399
"request": {
@@ -762,6 +788,10 @@
762788
{
763789
"key": "TASK_ID",
764790
"value": ""
791+
},
792+
{
793+
"key": "PROPLET_ID",
794+
"value": ""
765795
}
766796
]
767797
}

docs/getting-started.md

Lines changed: 93 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Before proceeding, install the following prerequisites:
88
- [Wasmtime](https://wasmtime.dev/)
99
- [TinyGo](https://tinygo.org/getting-started/install/)
1010
- [Mosquitto Tools](https://mosquitto.org/)
11+
- [rustup](https://rustup.rs/) - This is needed to build the `sample-wasi-http-rust` example.
1112

1213
## Clone the repository
1314

@@ -23,20 +24,27 @@ cd propeller
2324
Build and install the artifacts
2425

2526
```bash
26-
make all
27+
make all -j $(nproc)
2728
make install
2829
```
2930

31+
If you are having issues with the `make install` command, you will need to setup `$GOBIN` and add `$GOBIN` to your `$PATH` environment variable.
32+
33+
```bash
34+
export GOBIN=$HOME/go/bin
35+
export PATH=$PATH:$GOBIN
36+
```
37+
3038
The output of the build command will be something like:
3139

3240
```bash
33-
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X 'github.com/absmach/supermq.BuildTime=2025-06-12T10:57:04Z' -X 'github.com/absmach/supermq.Version=v0.3.0' -X 'github.com/absmach/supermq.Commit=26ef8cb167a4f88359e55eb9916cdca232bde39c'" -o build/manager cmd/manager/main.go
34-
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X 'github.com/absmach/supermq.BuildTime=2025-06-12T10:57:07Z' -X 'github.com/absmach/supermq.Version=v0.3.0' -X 'github.com/absmach/supermq.Commit=26ef8cb167a4f88359e55eb9916cdca232bde39c'" -o build/proplet cmd/proplet/main.go
35-
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X 'github.com/absmach/supermq.BuildTime=2025-06-12T10:57:07Z' -X 'github.com/absmach/supermq.Version=v0.3.0' -X 'github.com/absmach/supermq.Commit=26ef8cb167a4f88359e55eb9916cdca232bde39c'" -o build/cli cmd/cli/main.go
36-
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X 'github.com/absmach/supermq.BuildTime=2025-06-12T10:57:08Z' -X 'github.com/absmach/supermq.Version=v0.3.0' -X 'github.com/absmach/supermq.Commit=26ef8cb167a4f88359e55eb9916cdca232bde39c'" -o build/proxy cmd/proxy/main.go
37-
GOOS=js GOARCH=wasm tinygo build -no-debug -panic=trap -scheduler=none -gc=leaking -o build/addition.wasm -target wasi examples/addition/addition.go
38-
GOOS=js GOARCH=wasm tinygo build -no-debug -panic=trap -scheduler=none -gc=leaking -o build/compute.wasm -target wasi examples/compute/compute.go
39-
GOOS=js GOARCH=wasm tinygo build -no-debug -panic=trap -scheduler=none -gc=leaking -o build/hello-world.wasm -target wasi examples/hello-world/hello-world.go
41+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X 'github.com/absmach/supermq.BuildTime=2025-09-16T08:51:10Z' -X 'github.com/absmach/supermq.Version=v0.3.0' -X 'github.com/absmach/supermq.Commit=1e4e360c2182aa9bd6febb39756e3398fa4139ca'" -o build/manager cmd/manager/main.go
42+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X 'github.com/absmach/supermq.BuildTime=2025-09-16T08:51:10Z' -X 'github.com/absmach/supermq.Version=v0.3.0' -X 'github.com/absmach/supermq.Commit=1e4e360c2182aa9bd6febb39756e3398fa4139ca'" -o build/proplet cmd/proplet/main.go
43+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X 'github.com/absmach/supermq.BuildTime=2025-09-16T08:51:10Z' -X 'github.com/absmach/supermq.Version=v0.3.0' -X 'github.com/absmach/supermq.Commit=1e4e360c2182aa9bd6febb39756e3398fa4139ca'" -o build/cli cmd/cli/main.go
44+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X 'github.com/absmach/supermq.BuildTime=2025-09-16T08:51:10Z' -X 'github.com/absmach/supermq.Version=v0.3.0' -X 'github.com/absmach/supermq.Commit=1e4e360c2182aa9bd6febb39756e3398fa4139ca'" -o build/proxy cmd/proxy/main.go
45+
GOOS=js GOARCH=wasm tinygo build -buildmode=c-shared -o build/addition.wasm -target wasip1 examples/addition/addition.go
46+
GOOS=js GOARCH=wasm tinygo build -buildmode=c-shared -o build/compute.wasm -target wasip1 examples/compute/compute.go
47+
GOOS=js GOARCH=wasm tinygo build -buildmode=c-shared -o build/hello-world.wasm -target wasip1 examples/hello-world/hello-world.go
4048
```
4149

4250
Installing the artifacts will install Propeller to the `GOBIN` directory. That is:
@@ -48,6 +56,14 @@ cp build/proplet $GOBIN/propeller-proplet\
4856
cp build/proxy $GOBIN/propeller-proxy
4957
```
5058

59+
To build the `sample-wasi-http-rust` example, you will follow the [instructions](https://github.com/bytecodealliance/sample-wasi-http-rust#sample-wasihttp-in-rust).
60+
61+
```bash
62+
git submodule update --init
63+
cd examples/sample-wasi-http-rust
64+
cargo b
65+
```
66+
5167
## Start Docker composition
5268

5369
Start docker composition
@@ -88,6 +104,8 @@ This will output a response like the following
88104
Successfully created config.toml file
89105
```
90106

107+
If you are running manager and proplet using docker you will need to copy the `config.toml` file to the `docker/config.toml` file. Then uncomment volume mapping lines in the `docker-compose.yml` file. After that you can run `make start-supermq` to start the SuperMQ docker container.
108+
91109
The `config.toml` file will be created in the current directory. This file contains the credentials for the user, domain, manager client, proplet client, and manager channel. It will look something like this:
92110

93111
```toml
@@ -232,6 +250,26 @@ This will output a response like the following
232250
}
233251
```
234252

253+
To can use the CLI to create a task as follows:
254+
255+
```bash
256+
# propeller-cli tasks create <name>
257+
propeller-cli tasks create demo
258+
```
259+
260+
This will output a response like the following
261+
262+
```json
263+
{
264+
"created_at": "2025-09-16T10:25:31.491528704Z",
265+
"finish_time": "0001-01-01T00:00:00Z",
266+
"id": "2ccb6b7c-3ce8-4c27-be19-01172954d593",
267+
"name": "demo",
268+
"start_time": "0001-01-01T00:00:00Z",
269+
"updated_at": "0001-01-01T00:00:00Z"
270+
}
271+
```
272+
235273
### Get a task
236274

237275
```bash
@@ -254,19 +292,66 @@ This will output a response like the following
254292
}
255293
```
256294

295+
To can use the CLI to get a task as follows:
296+
297+
```bash
298+
# propeller-cli tasks view <id>
299+
propeller-cli tasks view 2ccb6b7c-3ce8-4c27-be19-01172954d593
300+
```
301+
302+
This will output a response like the following
303+
304+
```json
305+
{
306+
"created_at": "2025-09-16T10:25:31.491528704Z",
307+
"finish_time": "0001-01-01T00:00:00Z",
308+
"id": "2ccb6b7c-3ce8-4c27-be19-01172954d593",
309+
"name": "demo",
310+
"start_time": "0001-01-01T00:00:00Z",
311+
"updated_at": "0001-01-01T00:00:00Z"
312+
}
313+
```
314+
257315
### Upload Wasm File
258316

259317
```bash
260318
curl -X PUT "http://localhost:7070/tasks/e9858e56-a1dd-4e5a-9288-130f7be783ed/upload" \
261319
-F 'file=@<propeller_path>/build/addition.wasm'
262320
```
263321

322+
### Update task with base64 encoded Wasm file
323+
324+
```bash
325+
curl --location --request PUT 'http://localhost:7070/tasks/e9858e56-a1dd-4e5a-9288-130f7be783ed' \
326+
--header 'Content-Type: application/json' \
327+
--data '{
328+
"file": "AGFzbQEAAAABBwFgAn9/AX8DAgEABwgBBG1haW4AAAoJAQcAIAAgAWoL"
329+
}'
330+
```
331+
332+
```bash
333+
propeller-cli tasks update e9858e56-a1dd-4e5a-9288-130f7be783ed '{"file": "AGFzbQEAAAABBwFgAn9/AX8DAgEABwgBBG1haW4AAAoJAQcAIAAgAWoL"}'
334+
```
335+
264336
### Start a task
265337

266338
```bash
267339
curl -X POST "http://localhost:7070/tasks/e9858e56-a1dd-4e5a-9288-130f7be783ed/start"
268340
```
269341

342+
You can use the CLI to start a task as follows:
343+
344+
```bash
345+
# propeller-cli tasks start <id>
346+
propeller-cli tasks start 2ccb6b7c-3ce8-4c27-be19-01172954d593
347+
```
348+
349+
This will output a response like the following
350+
351+
```bash
352+
ok
353+
```
354+
270355
### Stop a task
271356

272357
```bash

0 commit comments

Comments
 (0)