Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wasmCloud/examples

ARCHIVED: This repository contains examples for pre-1.0 versions of wasmCloud. All examples are now located in the main wasmCloud repository https://github.com/wasmCloud/wasmCloud/tree/main/examples.
https://github.com/wasmCloud/examples

examples samples webassembly webassembly-runtime

Last synced: 13 days ago
JSON representation

ARCHIVED: This repository contains examples for pre-1.0 versions of wasmCloud. All examples are now located in the main wasmCloud repository https://github.com/wasmCloud/wasmCloud/tree/main/examples.

Awesome Lists containing this project

README

        

> [!IMPORTANT]
> The examples in this repository are WebAssembly _modules_ which consume interfaces defined in Smithy and communicate with providers over the [stable ABI](https://wasmcloud.com/docs/hosts/abis/wasmbus/). Actors built as WebAssembly _components_ consume interfaces defined using [WIT](https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md). Examples of actor components can be found in the [wasmCloud repo](https://github.com/wasmCloud/wasmCloud/tree/main/examples). Note that support for WIT is considered **experimental** at this time.

# wasmCloud Examples

Example actors, capability providers, and other demonstrations

## Actors

The following actors run as WebAssembly on wasmCloud hosts.

| Example | Description | OCI Reference
(refer to example for latest version) |
| -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| [animal-image-downloader](https://github.com/wasmcloud/examples/tree/main/actor/animal-image-downloader) | An actor that receives messages and makes HTTP requests, downloading a picture of an animal to a blobstore | `wasmcloud.azurecr.io/animal-image-downloader` |
| [echo](https://github.com/wasmcloud/examples/tree/main/actor/echo) | An actor that listens on an HTTP port and returns a JSON payload describing the incoming request | `wasmcloud.azurecr.io/echo` |
| [echo-messaging](https://github.com/wasmcloud/examples/tree/main/actor/echo-messaging) | An actor that listens on a message broker topic and replies | `wasmcloud.azurecr.io/echo-messaging` |
| [hello](https://github.com/wasmcloud/examples/tree/main/actor/hello) | Canonical "hello world" actor that listens on an HTTP port and replies with a greeting | `wasmcloud.azurecr.io/hello` |
| [kvcounter](https://github.com/wasmcloud/examples/tree/main/actor/kvcounter) | An actor that uses the key-value store to increment a counter and return a value for every HTTP request it receives | `wasmcloud.azurecr.io/kvcounter` |
| [logging](https://github.com/wasmcloud/examples/tree/main/actor/logging) | An actor that demonstrates the builtin logging capability provider | `wasmcloud.azurecr.io/logging` |
| [message-pub](https://github.com/wasmcloud/examples/tree/main/actor/message-pub) | An actor that demonstrates receiving HTTP requests and publishing the request body as a message | `wasmcloud.azurecr.io/message-pub` |
| [random](https://github.com/wasmcloud/examples/tree/main/actor/random) | An actor that demonstrates the builtin random number generation capability provider | `wasmcloud.azurecr.io/random` |
| [todo-sql](https://github.com/wasmcloud/examples/tree/main/actor/todo-sql) | An todo-application using sql database, https server (with TLS), logging, and numbergen | (unpublished) |
| [todo](https://github.com/wasmcloud/examples/tree/main/actor/todo) | An todo-application using keyvalue store, http server, and logging | (unpublished) |
| [xkcd](https://github.com/wasmcloud/examples/tree/main/actor/xkcd) | A application that generates xkcd comics | `wasmcloud.azurecr.io/xkcd` |
| [ifconfig](https://github.com/wasmcloud/examples/tree/main/actor/ifconfig) | A tinygo actor that will return the external IP address of your http client | (unpublished) |

## Interfaces

The following example interfaces are defined by [Smithy](https://awslabs.github.io/smithy/) models.

| Example | Description | Capability contract | Rust crate |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------- | ----------------------------- |
| [cron](./cron/interface/) | A simple interface for invoking an actor at a specific time | `wasmcloud:example:cron` | `wasmcloud-interface-cron` |
| [payments](https://github.com/wasmcloud/examples/tree/main/interface/payments) | A simple interface for a payments capability provider (used in the [Creating an Interface](https://wasmcloud.dev/app-dev/create-provider/new-interface/) tutorial) | `wasmcloud:example:payments` | `wasmcloud-examples-payments` |
| [runner](https://github.com/wasmcloud/examples/tree/main/interface/runner) | A simple interface with a single 'Run' method | `wasmcloud:example:runner` | `wasmcloud-examples-runner` |
| [timing](https://github.com/wasmcloud/examples/tree/main/interface/timing) | A simple interface for retrieving the current timestamp from the host | `wasmcloud:timing` | `wasmcloud-interface-timing` |

## Capability providers

Providers of capabilities for wasmCloud actors

| Example | Description | Capability contract | OCI Reference |
| ------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [cron](./cron/provider/) | A capability provider that uses cron expressions to invoke actors on a timed interval | `wasmcloud:example:cron` | `wasmcloud.azurecr.io/cron` |
| [factorial](https://github.com/wasmcloud/examples/tree/main/provider/factorial) | A capability provider that computes factorial of a number | `wasmcloud:example:payments` | `wasmcloud.azurecr.io/factorial` |
| [fakepay](https://github.com/wasmcloud/examples/tree/main/provider/fakepay) | A simple payment provider, used in the [Creating a capability provider](https://wasmcloud.dev/app-dev/create-provider/) tutorial | `wasmcloud:example:fakepay` | `wasmcloud.azurecr.io/fakepay` |
| [timing](https://github.com/wasmcloud/examples/tree/main/provider/timing) | An implementation of the [`wasmcloud:timing`](https://github.com/wasmcloud/examples/tree/main/interface/timing) capability contract | `wasmcloud:timing` | [![](https://ghcr-badge.egpl.dev/jclmnop/wasmcloud-provider-timing/latest_tag?trim=major&label=ghcr.io%2Fjclmnop%2Fwasmcloud-provider-timing)](ghcr.io/jclmnop/wasmcloud-provider-timing:0.1.1) |

## Applications

| Example | Description |
| ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [petclinic](https://github.com/wasmcloud/examples/tree/main/petclinic) | A WebAssembly and wasmCloud-based reimagining of the classic [Spring Boot microservices Pet Clinic](https://github.com/spring-petclinic/spring-petclinic-microservices). The wasmCloud Pet Clinic consists of multiple actors, and uses a relational database capability provider and an http server capability provider. |
| [adsb](https://github.com/wasmcloud/examples/tree/main/adsb) | A FlightAware clone that allows users to take an [RTL-SDR](https://www.rtl-sdr.com/) and plot airplane data on a map. Users can also cluster many RTL-SDRs from all over the country and visualize them together utilizing the power of the wasmCloud lattice. |