Skip to content

Commit

Permalink
Merge pull request #17 from everywhere-computer/avivash/online-and-of…
Browse files Browse the repository at this point in the history
…fline-mode

Chore: explain running the CLI with/without --config
  • Loading branch information
avivash authored Mar 21, 2024
2 parents 5f4ea41 + 1c8ae62 commit 19c4681
Show file tree
Hide file tree
Showing 6 changed files with 197 additions and 71 deletions.
136 changes: 69 additions & 67 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,75 +1,77 @@
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";

// https://astro.build/config
export default defineConfig({
site: 'https://docs.everywhere.computer',
integrations: [
starlight({
title: 'Everywhere Computer',
components: {
// Override the default `Head` component.
Head: './src/components/Head.astro',
},
logo: {
light: '/src/assets/logo-light.svg',
dark: './src/assets/logo-dark.svg',
replacesTitle: true,
},
customCss: [
// Relative path to your custom CSS file
'./src/styles/custom.css',
],
favicon: './src/assets/favicon.svg',
expressiveCode: {
plugins: [{
name: 'Variable Weight',
baseStyles: `
site: "https://docs.everywhere.computer",
integrations: [
starlight({
title: "Everywhere Computer",
components: {
// Override the default `Head` component.
Head: "./src/components/Head.astro",
},
logo: {
light: "/src/assets/logo-light.svg",
dark: "./src/assets/logo-dark.svg",
replacesTitle: true,
},
customCss: [
// Relative path to your custom CSS file
"./src/styles/custom.css",
],
favicon: "./src/assets/favicon.svg",
expressiveCode: {
plugins: [
{
name: "Variable Weight",
baseStyles: `
pre > code {
font-variation-settings: 'wght' 550;
}
`,
}],
},
social: {
github: 'https://github.com/everywhere-computer',
discord: 'https://discord.gg/yU6y8XMGaY',
'x.com': 'https://x.com/everywherecomp',
},
sidebar: [
{ label: '👋 Welcome', link: '/' },
{ label: '🤔 Why Choose It?', link: '/why-choose' },
{ label: '🤝 Who Participates?', link: '/who-participates' },
{ label: '🐇 Quick Start', link: '/quick-start' },
{
label: '🧑‍💻 Every CLI',
autogenerate: { directory: 'everycli' },
},
{
label: '🏗️ Manual Setup',
autogenerate: { directory: 'manual-setup' },
},
// {
// label: '🎛️ Control Panel',
// autogenerate: { directory: 'control-panel' },
// },
// {
// label: '🪡 Workflows',
// autogenerate: { directory: 'workflows' },
// },
{
label: '💫 Homestar',
autogenerate: { directory: 'homestar' },
},
// {
// label: '🔌 Integrations',
// autogenerate: { directory: 'integrations' },
// },
// {
// label: '👥 Accounts',
// autogenerate: { directory: 'integrations' },
// },
],
}),
],
},
],
},
social: {
github: "https://github.com/everywhere-computer",
discord: "https://discord.gg/yU6y8XMGaY",
"x.com": "https://x.com/everywherecomp",
},
sidebar: [
{ label: "👋 Welcome", link: "/" },
{ label: "🤔 Why Choose It?", link: "/why-choose" },
{ label: "🤝 Who Participates?", link: "/who-participates" },
{ label: "🐇 Quick Start", link: "/quick-start" },
{
label: "🧑‍💻 Every CLI",
autogenerate: { directory: "everycli" },
},
// {
// label: '🏗️ Manual Setup',
// autogenerate: { directory: 'manual-setup' },
// },
// {
// label: '🎛️ Control Panel',
// autogenerate: { directory: 'control-panel' },
// },
// {
// label: '🪡 Workflows',
// autogenerate: { directory: 'workflows' },
// },
{
label: "💫 Homestar",
autogenerate: { directory: "homestar" },
},
// {
// label: '🔌 Integrations',
// autogenerate: { directory: 'integrations' },
// },
// {
// label: '👥 Accounts',
// autogenerate: { directory: 'integrations' },
// },
],
}),
],
});
Binary file added src/content/docs/assets/quickstart-1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/content/docs/assets/quickstart-2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 89 additions & 0 deletions src/content/docs/config/homestar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
title: Default homestar.toml values
---

```toml
[node]
gc_interval = 1800
shutdown_timeout = 20

[node.monitoring]
console_subscriber_port = 6669
process_collector_interval = 5000

[node.network]
events_buffer_len = 1024
poll_cache_interval = 1000

[node.network.libp2p]
announce_addresses = []
idle_connection_timeout = 60
listen_address = "/ip4/0.0.0.0/tcp/0"
max_connected_peers = 32
max_announce_addresses = 10
node_addresses = []
transport_connection_timeout = 60
dial_interval = 30
bootstrap_interval = 30

[node.network.libp2p.dht]
enable_resolve_receipts_in_background = true
p2p_receipt_timeout = 500
p2p_workflow_info_timeout = 500
p2p_provider_timeout = 10000
receipt_quorum = 2
workflow_quorum = 3

[node.network.libp2p.quic]
enable = true

[node.network.libp2p.mdns]
enable = true
enable_ipv6 = false
query_interval = 300
ttl = 540

[node.network.libp2p.pubsub]
enable = true
duplication_cache_time = 1
heartbeat = 60
max_transmit_size = 10485760
mesh_n_low = 1
mesh_n_high = 10
mesh_n = 2
mesh_outbound_min = 1

[node.network.libp2p.rendezvous]
enable_client = true
enable_server = false
registration_ttl = 7200
discovery_interval = 600

[node.network.metrics]
port = 4000

[node.network.rpc]
host = "::1"
max_connections = 10
port = 3030
server_timeout = 120

[node.network.keypair_config.random_seed]
key_type = "ed25519" | "secp256k1"
seed = "<YOUR_SEED>"

[node.network.ipfs]
host = "127.0.0.1"
port = 5001

[node.network.webserver]
v4_host = "127.0.0.1"
v6_host = "[::1]"
port = 1337
timeout = 120
websocket_capacity = 2048
websocket_sender_timeout = 30000

[node.db]
max_pool_size = 100
```
35 changes: 35 additions & 0 deletions src/content/docs/everycli/local-dev.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,38 @@ every cli dev --fn <ABSOLUTE_PATH_TO_YOUR_FUNCTION_DIR>/hello.wasm
By default the [every-cli](https://github.com/everywhere-computer/every-cli) will start a [CloudFlare tunnel](https://www.cloudflare.com/en-gb/products/tunnel/) for you.

If you're familiar with [ngrok](https://ngrok.com/) or [tailscale](https://tailscale.com/), 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](https://github.com/everywhere-computer/every-cli) will use the [default homestar.toml values](../../config/homestar) 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:

```shell
every cli dev --fn <ABSOLUTE_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.

This means, if you only want to specify a different IPFS port, you simply need to create a `toml` file with
```toml
[node.network.ipfs]
port = 5002
```
and the [every-cli](https://github.com/everywhere-computer/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:

```bash
✔ Functions parsed and compiled
✔ Homestar is running at http://127.0.0.1:8020
✔ Control Panel is running at http://127.0.0.1:5178

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

... a QR code ...

➜ Local: http://127.0.0.1:3000/
➜ Tunnel: https://sometimes-comical-word-set.trycloudflare.com
```
8 changes: 4 additions & 4 deletions src/content/docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ 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 http://127.0.0.1:4173
✔ Control Panel is running at https://control.everywhere.computer

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

Expand All @@ -55,9 +55,9 @@ Everything is now ready to run your function:

### Run `hello` From The Control Panel

Visit your local Control Panel at [http://127.0.0.1:4173](http://127.0.0.1:4173). You should see the following interface:
Visit your local Control Panel at [https://control.everywhere.computer](https://control.everywhere.computer). You should see the following interface:

![The Control Panel](./assets/quickstart-1.jpg)
![The Control Panel](./assets/quickstart-1.jpeg)

Enter a name and hit the "Run" button. You should see your first result!

Expand Down Expand Up @@ -87,7 +87,7 @@ Let's construct a two task workflow to test this out. To do this, we'll instruct
every dev --fn src/functions/hello.ts --fn src/functions/concat.ts
```

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

## Next Steps

Expand Down

0 comments on commit 19c4681

Please sign in to comment.