wasm-nats-producer-client/README.md

58 lines
1.5 KiB
Markdown
Raw Permalink Normal View History

2024-12-16 19:34:52 +00:00
# Prerequisites
2024-12-14 01:15:08 +00:00
- `go` 1.23
- `tinygo` 0.33
- [`wash`](https://wasmcloud.com/docs/installation) 0.35.0
- `wasmtime` 25.0.0 (if running with wasmtime)
## Building
```bash
wash build
```
## Push OCI Artifact to Gitea
```bash
wash push gitea.rebus.ninja/lore/go-nats-client:1.x.x build/go_nats_client_s.wasm
```
2024-12-16 19:34:52 +00:00
## Build and push to the registry using the dockerfile
### Build the cointainer
```bash
docker build -t wash-image-build .
```
### Build the component and push to the registry
First setup your credentials
```bash
export REG_USER=user && export REG_PASS=pass
```
Build and push
```bash
docker run --rm -e REGISTRY=gitea.rebus.ninja/lore/wasm-nats-producer-client:1.0.x -e WASH_REG_USER=$REG_USER -e WASH_REG_PASSWORD=$REG_PASS -v "$(pwd):/app" wash-image-build
```
2024-12-14 01:15:08 +00:00
## Running with wasmtime
You must have wasmtime 25.0.0 for this to work. Make sure to follow the build step above first.
```bash
wasmtime serve -Scommon ./build/http_hello_world_s.wasm
```
## Running with wasmCloud
Make sure to follow the build steps above, and replace the file path in [the wadm manifest](./wadm.yaml) with the absolute path to your local built component.
```shell
wash up -d
wash app deploy ./wadm.yaml
curl http://localhost:8000
```
## Adding Capabilities
To learn how to extend this example with additional capabilities, see the [Adding Capabilities](https://wasmcloud.com/docs/tour/adding-capabilities?lang=tinygo) section of the wasmCloud documentation.