Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lreimer/golem-cloud-demos
Demo repository for different Golem Cloud WASI applications in different languages.
https://github.com/lreimer/golem-cloud-demos
cloud golang golem rust-lang wasi wasm web-assembly
Last synced: 14 days ago
JSON representation
Demo repository for different Golem Cloud WASI applications in different languages.
- Host: GitHub
- URL: https://github.com/lreimer/golem-cloud-demos
- Owner: lreimer
- License: mit
- Created: 2023-08-10T11:37:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-10T12:48:52.000Z (over 1 year ago)
- Last Synced: 2024-11-06T11:50:00.585Z (2 months ago)
- Topics: cloud, golang, golem, rust-lang, wasi, wasm, web-assembly
- Language: Go
- Homepage:
- Size: 37.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Golem Cloud Demos
Demo repository for different Golem Cloud WASI applications in different languages.
## Rust Shopping Cart Demo
```bash
# make sure you have setup your Rust environment as described in
# - https://www.golem.cloud/learn/common-tooling
# - https://www.golem.cloud/learn/rustgolem new --template rust-shopping-cart --component-name shopping-cart
cd shopping-cart# build and install WASI component
cargo component build --release
cd target/wasm32-wasi/release/
golem component add --component-name shopping-cart lib.wasm
golem instance add --instance-name shopping-cart-1 --component-name shopping-cart# invoke the instance and its API functions
golem instance invoke-and-await \
--component-name=shopping-cart \
--instance-name=shopping-cart-1 \
--function=golem:component/api/initialize-cart \
--parameters='["test-user"]'golem instance invoke-and-await \
--component-name=shopping-cart \
--instance-name=shopping-cart-1 \
--function=golem:component/api/get-cart-contents \
--parameters='[]'golem instance invoke-and-await \
--component-name=shopping-cart \
--instance-name=shopping-cart-1 \
--function=golem:component/api/add-item \
--parameters='[{"product-id": "1234abc", "name": "test-item", "price": 9.99, "quantity": 42}]'golem instance invoke-and-await \
--component-name=shopping-cart \
--instance-name=shopping-cart-1 \
--function=golem:component/api/get-cart-contents \
--parameters='[]'
```## Go HTTP Demo
```bash
# make sure you have setup your Tiny Go environment as described in
# - https://www.golem.cloud/learn/common-tooling
# - https://www.golem.cloud/learn/gogolem new --template go-actor-full --component-name go-golem-demo
cd go-golem-demo# build and install WASI component
make build
golem component add --component-name go-golem-demo go_golem_demo.wasm
golem instance add --instance-name go-golem-demo-1 --component-name go-golem-demo# repeat the following two commands to add numbers and get results
golem instance invoke-and-await \
--component-name=go-golem-demo \
--instance-name=go-golem-demo-1 \
--function=golem:component/api/add \
--parameters='[42]'golem instance invoke-and-await \
--component-name=go-golem-demo \
--instance-name=go-golem-demo-1 \
--function=golem:component/api/get \
--parameters='[]'```
## Maintainer
M.-Leander Reimer (@lreimer),## License
This software is provided under the MIT open source license, read
the `LICENSE` file for details.