Skip to content

Commit

Permalink
Update websocket relay example app (#448)
Browse files Browse the repository at this point in the history
# Description

This PR implements the following changes:

- [x] Update example to use Homestar client:
https://www.npmjs.com/package/@fission-codes/homestar
- [x] Remove emulation mode

## Link to issue

Implements #390

## Type of change

- [x] Refactor (non-breaking change that updates existing functionality)

## Test plan (required)

The example should be tested manually to verify it works.

---------

Signed-off-by: Brian Ginsburg <[email protected]>
Co-authored-by: Hugo Dias <[email protected]>
  • Loading branch information
bgins and hugomrdias authored Nov 28, 2023
1 parent ac30ac2 commit 1c823b8
Show file tree
Hide file tree
Showing 10 changed files with 1,377 additions and 665 deletions.
19 changes: 10 additions & 9 deletions examples/websocket-relay/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ processing workflows that chain inputs and outputs using

This application demonstrates:

* workflows built using the
[@fission-codes/homestar][@fission-codes/homestar] client library
* websocket notifications of [UCAN Invocation Receipts][spec-receipts] sent
between a web client and a `homestar` runner
between a web client and a `homestar` runner using [@fission-codes/homestar][@fission-codes/homestar]
* instantaneous replay of previously run, cached executions
* fetching content (the original static image) over [IPFS][ipfs]
through a local blockstore
* the [WIT][wit] + [IPLD][ipld] interpreter for
[Wasm(time)][wasmtime] embedded execution within a `homestar` runner.
[Wasm(time)][wasmtime] embedded execution within a `homestar` runner

## Install

Expand All @@ -33,9 +35,8 @@ To get started, please install:

## Usage

1. Run `cargo run -- start -c config/settings.toml` to start the runtime and
an IPFS daemon as a background process. This runtime includes
ANSI-coded logging by default.
1. Run `cargo run -- start` to start the runtime and an IPFS daemon as a
background process. This runtime includes ANSI-coded logging by default.

2. In a separate terminal window, run `npm install --prefix relay-app` to
install dependencies and `npm run --prefix relay-app dev` to start the
Expand Down Expand Up @@ -65,25 +66,25 @@ need: `brew install rust npm ipfs`

We have packaged homestar binaries using brew, so
`brew install fission-codes/fission/homestar` will install everything you need,
including `ipfs`. You will still need `npm` to run this example. From this folder,
you can then run the example like this:
including `ipfs`. You will still need `npm` to run this example. From this folder, you can then run the example like this:

```
homestar start --config ./config/settings.toml --db homestar.db`
homestar start --db homestar.db`
```

Running `homestar` via `cargo run` requires a minimum Rust version of
`1.70.0`. If you've got an older install of rust, update it with
`rustup update`.

You do not have to start-up Kubo (IPFS) on your own. The example will do this
You do not have to start Kubo (IPFS) on your own. The example will do this
for you, and use `examples/websocket-relay/tmp/.ipfs` as a local blockstore.
Feel free to discard it when you don't need it.

If you're already running an IPFS instance however, e.g. [IPFS Desktop][ipfs-desktop],
the example will check for an already running instance and not start a new,
local one.

[@fission-codes/homestar]: https://www.npmjs.com/package/@fission-codes/homestar
[install-ipfs]: https://docs.ipfs.tech/install/
[install-npm]: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
[install-rust]: https://www.rust-lang.org/tools/install
Expand Down
5 changes: 0 additions & 5 deletions examples/websocket-relay/config/settings.toml

This file was deleted.

1 change: 0 additions & 1 deletion examples/websocket-relay/relay-app/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
VITE_WEBSOCKET_ENDPOINT="ws://localhost:1337"
VITE_PING_INTERVAL=8000
VITE_MAX_PING_RETRIES=3
VITE_EMULATION_MODE=false
Loading

0 comments on commit 1c823b8

Please sign in to comment.