Skip to content
This repository was archived by the owner on Jun 10, 2024. It is now read-only.

Repository files navigation

Important

The examples in this repository are WebAssembly modules which consume interfaces defined in Smithy and communicate with providers over the stable ABI. Actors built as WebAssembly components consume interfaces defined using WIT. Examples of actor components can be found in the wasmCloud repo. 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.

ExampleDescriptionOCI Reference
(refer to example for latest version)
animal-image-downloaderAn actor that receives messages and makes HTTP requests, downloading a picture of an animal to a blobstorewasmcloud.azurecr.io/animal-image-downloader
echoAn actor that listens on an HTTP port and returns a JSON payload describing the incoming requestwasmcloud.azurecr.io/echo
echo-messagingAn actor that listens on a message broker topic and replieswasmcloud.azurecr.io/echo-messaging
helloCanonical "hello world" actor that listens on an HTTP port and replies with a greetingwasmcloud.azurecr.io/hello
kvcounterAn actor that uses the key-value store to increment a counter and return a value for every HTTP request it receiveswasmcloud.azurecr.io/kvcounter
loggingAn actor that demonstrates the builtin logging capability providerwasmcloud.azurecr.io/logging
message-pubAn actor that demonstrates receiving HTTP requests and publishing the request body as a messagewasmcloud.azurecr.io/message-pub
randomAn actor that demonstrates the builtin random number generation capability providerwasmcloud.azurecr.io/random
todo-sqlAn todo-application using sql database, https server (with TLS), logging, and numbergen(unpublished)
todoAn todo-application using keyvalue store, http server, and logging(unpublished)
xkcdA application that generates xkcd comicswasmcloud.azurecr.io/xkcd
ifconfigA tinygo actor that will return the external IP address of your http client(unpublished)

Interfaces

The following example interfaces are defined by Smithy models.

ExampleDescriptionCapability contractRust crate
cronA simple interface for invoking an actor at a specific timewasmcloud:example:cronwasmcloud-interface-cron
paymentsA simple interface for a payments capability provider (used in the Creating an Interface tutorial)wasmcloud:example:paymentswasmcloud-examples-payments
runnerA simple interface with a single 'Run' methodwasmcloud:example:runnerwasmcloud-examples-runner
timingA simple interface for retrieving the current timestamp from the hostwasmcloud:timingwasmcloud-interface-timing

Capability providers

Providers of capabilities for wasmCloud actors

ExampleDescriptionCapability contractOCI Reference
cronA capability provider that uses cron expressions to invoke actors on a timed intervalwasmcloud:example:cronwasmcloud.azurecr.io/cron
factorialA capability provider that computes factorial of a numberwasmcloud:example:paymentswasmcloud.azurecr.io/factorial
fakepayA simple payment provider, used in the Creating a capability provider tutorialwasmcloud:example:fakepaywasmcloud.azurecr.io/fakepay
timingAn implementation of the wasmcloud:timing capability contractwasmcloud:timing

Applications

ExampleDescription
petclinicA WebAssembly and wasmCloud-based reimagining of the classic Spring Boot microservices Pet Clinic. The wasmCloud Pet Clinic consists of multiple actors, and uses a relational database capability provider and an http server capability provider.
adsbA FlightAware clone that allows users to take an RTL-SDR 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.

About

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.

Topics

Resources

Stars

124 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages