Skip to content

Commit

Permalink
Chore: use positional args and remove IPFS section from quick start
Browse files Browse the repository at this point in the history
  • Loading branch information
avivash committed Mar 26, 2024
1 parent 09bb6e7 commit d11d31f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
10 changes: 5 additions & 5 deletions src/content/docs/everycli/local-dev.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ Running the Every CLI will start a [Homestar](/homestar/what-is-homestar/) node,
#### To create a single function Homestar workflow

```shell
every dev --fn <PATH_TO_FUNCTION_FILE>
every dev <PATH_TO_FUNCTION_FILE>
```

#### To create a multi-function Homestar workflow

```shell
every dev --fn <PATH_TO_FUNCTION_FILE> --fn <PATH_TO_OTHER_FUNCTION_FILE>
every dev <PATH_TO_FUNCTION_FILE> <PATH_TO_OTHER_FUNCTION_FILE>
```

## Function development loop
Expand Down Expand Up @@ -57,7 +57,7 @@ export function hello(name: string): string {
Start the CLI and point it to your custom TypeScript function

```shell
every cli dev --fn <PATH_TO_YOUR_FUNCTION_DIR>/hello.ts
every cli dev <PATH_TO_YOUR_FUNCTION_DIR>/hello.ts
```

</TabItem>
Expand Down Expand Up @@ -177,7 +177,7 @@ This command will produce a `hello.wasm` component.
Start the CLI and point it to your custom Wasm function

```shell
every cli dev --fn <PATH_TO_YOUR_FUNCTION_DIR>/hello.wasm
every cli dev <PATH_TO_YOUR_FUNCTION_DIR>/hello.wasm
```

## Setting up a tunnel
Expand All @@ -193,7 +193,7 @@ By default the [every-cli](https://github.com/everywhere-computer/every-cli) wil
If you would like to specify your own `toml` file to be used as the configuration for Homestar, you can use the `--config` argument:

```shell
every cli dev --fn <PATH_TO_YOUR_FUNCTION_DIR>/hello.wasm --config ../<YOUR_CONFIG_FILE_NAME>.toml
every cli dev <PATH_TO_YOUR_FUNCTION_DIR>/hello.wasm --config ../<YOUR_CONFIG_FILE_NAME>.toml
```

You can specify as many or as few values in your `toml` file as you like and the [every-cli](https://github.com/everywhere-computer/every-cli) will prioritize the values from your config over the default values.
Expand Down
21 changes: 8 additions & 13 deletions src/content/docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,10 @@ Get introduced to the Everywhere Computer's core concepts while using the `every
npm i -g @everywhere-computer/every-cli
```

## Setup & Run a Local IPFS Node

The Everywhere Computer is both portable and durable. These two traits are made possible by [IPFS’ content addressing](https://fission.codes/blog/content-addressing-what-it-is-and-how-it-works/) and WebAssembly's ability to execute in _any_ environment — including browsers.

If you are not already running an IPFS Kubo node on your local machine:
1. Download & install the [IPFS Desktop](https://docs.ipfs.tech/install/ipfs-desktop/) client.
2. Launch the IPFS Desktop client — this will ensure an IPFS node is running on your local machine.

## Run Your First Function

Clone down our [custom TypeScript functions repo](https://github.com/everywhere-computer/custom-homestar-functions-ts). In the `src/functions` directory you'll find four *very* basic functions:
Clone down our [custom TypeScript functions repo](https://github.com/everywhere-computer/custom-homestar-functions-ts). In the `src/functions` directory you'll find four _very_ basic functions:

1. `add.ts` - adds two numbers together
2. `concat.ts` - concatenates two strings
3. `hello.ts` - a simple `hello ${world}`
Expand All @@ -30,16 +23,17 @@ Clone down our [custom TypeScript functions repo](https://github.com/everywhere-
Let's begin with `hello.ts`. From the root directory of the repository run:

```shell
every dev --fn src/functions/hello.ts
every dev src/functions/hello.ts
```

This should produce an output like the following in your terminal:

```bash
✔ Functions parsed and compiled
✔ Homestar is running at http://127.0.0.1:8020
✔ Control Panel is running at https://control.everywhere.computer

◐ Starting cloudflared tunnel to http://127.0.0.1:3000/
◐ Starting cloudflared tunnel to http://127.0.0.1:3000/

... a QR code ...

Expand All @@ -48,6 +42,7 @@ This should produce an output like the following in your terminal:
```

Everything is now ready to run your function:

1. **The function has been compiled to WebAssembly (Wasm)** which is the Everywhere Computer's native format.
2. **A local Homestar node** is running — these are what power the Everything Computer.
3. **A local instance of the Control Panel** is running so that we can interact with our local Homestar node.
Expand Down Expand Up @@ -84,11 +79,11 @@ Workflows can be big. They can be small. They can run in isolation. They can be
Let's construct a two task workflow to test this out. To do this, we'll instruct the cli to compile both the `hello` and `concat` functions:

```shell
every dev --fn src/functions/hello.ts --fn src/functions/concat.ts
every dev src/functions/hello.ts src/functions/concat.ts
```

![A Multi-Function Workflow](./assets/quickstart-2.jpeg)

## Next Steps

For additional instructions on local development with the `every cli` — including writing custom functions in TypeScript and Rust — check out [Every CLI Usage](/everycli/local-dev).
For additional instructions on local development with the `every cli` — including writing custom functions in TypeScript and Rust — check out [Every CLI Usage](/everycli/local-dev).

0 comments on commit d11d31f

Please sign in to comment.