Every CLI Usage
Installation
Creating the Everywhere Computer environment
Running the Every CLI will start a Homestar node, API gateway, CloudFlare tunnel and locally running copy of the Everywhere Computer control panel.
To create a single function Homestar workflow
To create a multi-function Homestar workflow
Function development loop
Creating TypeScript functions
Write a TypeScript function with clearly specified argument and return types
Start the CLI and point it to your custom TypeScript function
Creating Wasm components in Rust
Install the latest stable version of Rust. The install should make the cargo
and rustup
commands available for you.
Install cargo-component
and add the wasm32-wasi
target:
Initialize a new component library:
This command generates a wit/world.wit
WIT world:
It also generates Rust code in src/lib.rs
that implements the WIT world:
Running a build generates a set of bindings that produce a Guest
trait that requires us to implement the functions from the WIT world.
Build for the debug target:
Build for release:
The builds target wasm32-wasi
and are compiled to rust/target/wasm32-wasi/debug/math.wasm
and rust/target/wasm32-wasi/release/math.wasm
respectively.
Note that the build generates src/bindings.rs
. Check that the wit-bindgen
version referenced at the top the file matches the wit-bindgen-rt
version in the Cargo manifest if you see errors.
Creating Wasm components in Python
Install the latest version of Python. Python 3.10 is the minimum required version for componentize-py
.
Create a virtual environment, activate the environment, and install componentize-py
:
Write a WIT world in a world.wit
file:
Write an app.py
that implements the WIT world:
Build the Wasm component:
This command will produce a hello.wasm
component.
Start the CLI and point it to your custom Wasm function
Setting up a tunnel
By default the every-cli will start a CloudFlare tunnel for you.
If youβre familiar with ngrok or tailscale, you can also use those to expose your local node server to the public Internet.
Passing your own Homestar config
By default the every-cli will use the default homestar.toml values to specify configuration settings for your Homestar node.
If you would like to specify your own toml
file to be used as the configuration for Homestar, you can use the --config
argument:
You can specify as many or as few values in your toml
file as you like and the every-cli will prioritize the values from your config over the default values.
This means, if you only want to specify a different IPFS port, you simply need to create a toml
file with
and the every-cli will upload your functions to IPFS on port 5002
and configure Homestar to use IPFS port 5002
, as well.
If you have specified your own config file, the control panel will run locally so its .env
file can be overwritten if necessary: