https://github.com/second-state/yomo-flow-ssvm-example
Writing a YoMo-flow by SSVM
https://github.com/second-state/yomo-flow-ssvm-example
Last synced: 3 months ago
JSON representation
Writing a YoMo-flow by SSVM
- Host: GitHub
- URL: https://github.com/second-state/yomo-flow-ssvm-example
- Owner: second-state
- License: mit
- Created: 2021-01-26T08:34:32.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-30T02:30:27.000Z (about 5 years ago)
- Last Synced: 2025-10-10T02:42:55.851Z (8 months ago)
- Homepage:
- Size: 19.1 MB
- Stars: 1
- Watchers: 0
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# yomo-flow-ssvm-example
This examples represents how to write a [yomo-flow](https://yomo.run/flow) with [ssvm](https://www.secondstate.io/)
## Compile wasm file
```bash
# Install ssvmup tool
curl https://raw.githubusercontent.com/second-state/ssvmup/master/installer/init.sh -sSf | sh
cd triple
ssvmup build
```
will get the wasm file at `triple/pkg/` directory
```bash
Ξ tmp/triple git:(master) ▶ ssvmup build
[INFO]: 🎯 Checking for the Wasm target...
[INFO]: 🌀 Compiling to Wasm...
Compiling a22 v0.1.0 (/Users/fanweixiao/tmp/triple)
Finished release [optimized] target(s) in 0.29s
⚠️ [WARN]: origin crate has no README
[INFO]: ⬇️ Installing wasm-bindgen...
[INFO]: Optimizing wasm binaries with `wasm-opt`...
[INFO]: Optional fields missing from Cargo.toml: 'description', 'repository', and 'license'. These are not necessary, but recommended
[INFO]: ✨ Done in 1.28s
[INFO]: 📦 Your wasm pkg is ready to publish at /Users/fanweixiao/tmp/triple/pkg.
Ξ tmp/triple git:(master) ▶
```
## Run this flow
1. Run this `yomo-flow`
```bash
go run main.go
```
Then start your [yomo source](https://yomo.run/source) and [yomo zipper](https://yomo.run/zipper)
2. Run `yomo-zipper`
```bash
yomo wf run workflow.yaml
```
3. Run `yomo-source-example`
```bash
gh repo clone yomorun/yomo-source-example
cd yomo-source-example
YOMO_ZIPPER_ENDPOINT=localhost:9999 go run main.go
```
you'll get:
```bash
Ξ _wrk/yomo-sink-ssvm → go run main.go
2021/01/26 00:14:20 Starting sink server...
2021/01/26 00:14:20 ✅ Listening on 0.0.0.0:4141
+6.913980e+015
+9.036794e+015
^Csignal: interrupt
```