Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs for Holochain 0.3 #462

Merged
merged 14 commits into from
Jul 29, 2024
Merged
5 changes: 4 additions & 1 deletion 11ty-extensions/markdown-it-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ function composeDetailsBlockRenderFunc(blockName = "details") {
const renderDetailsBlock = (blockName, tokens, idx) => {
if(tokens[idx].nesting === 1) {
const summary = tokens[idx].info.trim().match(generateContainerTitleRegex(blockName));
const attrDefaults = blockName ? { class: `details ${blockName}` } : {};
const attrDefaults = { id: slugify(summary[1]) };
if (blockName) {
attrDefaults['class'] = `details ${blockName}`;
}
const attrString = composeAttributeString(tokens[idx], attrDefaults);

const summaryTag = summary ? `<summary>${ summary[1] }</summary>` : '';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/build/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Holochain Build Guide
---

!!! note In progress
This guide is under construction. Expect more content to be rapidly published in the first half of 2024.
This guide is under construction. Expect more content to be rapidly published in the second half of 2024.
!!!

::: intro
Expand Down
476 changes: 236 additions & 240 deletions src/pages/get-started/3-forum-app-tutorial.md

Large diffs are not rendered by default.

23 changes: 9 additions & 14 deletions src/pages/get-started/4-packaging-and-distribution.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
---
title: "Deploying your Holochain application"
tocData:
- text: Packaging
href: packaging
- text: Runtimes
href: runtimes
children:
- text: Launcher
href: launcher-the-multi-app-runtime
- text: Standalone
href: standalone-executable
- text: Next steps
href: next-steps
---

Now that you've built an application, it's time to get it into other people's hands. First an app must be packaged into a distributable bundle format. Then it can be published somewhere a user can access it.
Expand Down Expand Up @@ -77,13 +65,16 @@ Holochain's official end-user runtime is the [Holochain Launcher](https://github

You can try this latter approach with your forum app immediately by downloading and running the Launcher! If you install `workdir/my_forum_app.webhapp`, the hApp _and its UI_ will be installed.

The steps for publishing an app to the Launcher's app store are documented in the Github repository of the Holochain Launcher [here](https://github.com/holochain/launcher#publishing-and-updating-an-app-in-the-devhub).
The steps for publishing an app to the Launcher's app store are documented in the Github repository of the Holochain Launcher [here](https://github.com/holochain/launcher#publish-an-app-to-launchers-app-store).
pdaoust marked this conversation as resolved.
Show resolved Hide resolved

!!!info Launcher uses Electron
If you're developing an app that's meant to be run within Launcher, it's important to know that Launcher uses Electron, which embeds a fairly recent version of Google's [Blink](https://www.chromium.org/blink/) browser engine. The nice thing about this is that your UI can target a consistent browser, which should shorten development time.

### Standalone executable

If you prefer to distribute your app as a full standalone executable, you'll need to bundle the Holochain runtime and your app together and take care of the necessary interactions between them. Because Holochain itself is really just a set of Rust libraries, you can of course build your own application that uses those libraries, but that's a fair amount of work. Currently there are two much simpler paths for doing this: using either the [Electron](https://www.electronjs.org/) or [Tauri](https://tauri.app/) frameworks, both of which can generate cross-platform executables from standard web UIs. These frameworks automatically bundle the necessary binaries, the [`holochain` conductor runtime](https://crates.io/crates/holochain) and the [`lair` keystore](https://crates.io/crates/lair_keystore). Though there is quite a bit of complexity in setting things up for these frameworks, all the hard work has already been done for you:

* **Tauri**: See the officially supported [holochain-kangaroo](https://github.com/holochain-apps/holochain-kangaroo) repo.
* **Tauri**: See the officially supported [holochain-kangaroo](https://github.com/holochain-apps/holochain-kangaroo) repo. Note that Tauri uses the webview engine provided by the user's operating system, so you may need to do extensive cross-OS testing to make sure your UI works properly.
* **Electron**: See the officially supported [holochain-kangaroo-electron](https://github.com/holochain-apps/holochain-kangaroo-electron) repo.

Both of these are GitHub template repos. The Tauri one has detailed instructions on how to clone them and add in your UI and DNA, as well as build and release commands that will create the cross-platform executables that you can then deliver to your end users. The Electron one is a work in progress, although we'll be putting most of our focus on it in the future, as it has fewer cross-platform bugs.
Expand All @@ -94,6 +85,10 @@ The supported Holochain versions of these repos sometimes lags behind the curren
For macOS and Windows, you'll probably also want to go through the process of registering as a developer so that your application can be "code-signed". This is needed so that users don't get the "unsigned code" warnings when launching the applications on those platforms. Both of the above templates include instructions for CI automation to run the code-signing steps on release once you have acquired the necessary certificates.
!!!

### p2p Shipyard

Our friends at [darksoil studio](https://darksoil.studio) have created [p2p Shipyard](https://darksoil.studio/p2p-shipyard/), a tool that uses Tauri and Nix to turn your hApp DNAs and UI into a redistributable runtime for Windows, macOS, Linux, and Android. It's currently Source-Available, so you can audit its codebase if you like, and they're running a [retroactive crowdfund campaign to open-source it](https://darksoil.studio/p2p-shipyard/license/license.html).

## Next steps

Congratulations! You've learned how to create a new Holochain application, understand its layout, work with core concepts, and deploy it.
Expand Down
7 changes: 1 addition & 6 deletions src/pages/get-started/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
---
title: Get Started
tocData:
- text: 1. Introduction to Holochain
href: 1-introduction-to-holochain
- text: 2. Installing Holochain development environment
href: 2-installing-holochain-development-environment
---

Welcome to the Getting Started with Holochain guide! This is a four-page guide which will walk you through the process of installing the Holochain development tools and creating a simple forum application. By the end of this guide, you'll be familiar with the core concepts of Holochain and have a basic understanding of how to develop peer-to-peer applications using the Holochain framework.
Expand Down Expand Up @@ -47,7 +42,7 @@ For Windows users, please note that the Nix package manager, which is used to in

Holochain is supported in WSL2 via the Ubuntu distribution.

You'll also need to install a few packages if you want to run two dev tools, `hc launch` and `hc spin`, which start your app's back end and open its GUI in Tauri or Electron webviews:
You'll also need to install a few packages if you want to run two dev tools, `hc spin` and `hc launch`, which start your app's back end and open its GUI in Electron or Tauri webviews:

```shell
sudo apt install -y libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgtk-3-dev libasound2 adwaita-icon-theme
Expand Down
2 changes: 1 addition & 1 deletion src/pages/get-started/install-advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ Because the template repo `holochain-kangaroo-electron` also bundles Electron's

## Opening your hApp's GUI in Ubuntu on WSL2 (Windows Subsystem for Linux) {#opening-your-happs-gui-in-ubuntu-on-wsl2}

There are two dev tools, `hc launch` and `hc spin`, which start your app's back end and open its GUI in [Tauri](https://tauri.app/) or [Electron](https://www.electronjs.org/) webview containers, respectively. Because the Ubuntu OS installed from the Microsoft Store doesn't come with GUI packages by default, you'll need to install just a few in order to get these tools to work.
There are two dev tools, `hc spin` and `hc launch`, which start your app's back end and open its GUI in [Electron](https://www.electronjs.org/) or [Tauri](https://tauri.app/) webview containers, respectively. Because the Ubuntu OS installed from the Microsoft Store doesn't come with GUI packages by default, you'll need to install just a few in order to get these tools to work.

If you're only using `hc launch`, which uses the Tauri webview, install this package, which resolves a GDK error about cursors:

Expand Down
2 changes: 1 addition & 1 deletion src/pages/resources/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ There are three main developer binaries, and one user-oriented binary. You can r
* runs a local copy of peer discovery and WebRTC signalling services
* see [`holochain_cli` docs](https://docs.rs/holochain_cli/latest/holochain_cli) for more info
* **`lair-keystore`** is Holochain's [keystore](https://github.com/holochain/lair) for generating and signing with cryptographically secure keys. Use this command for initialization, configuration, and running of a Lair keystore. During normal operation, `holochain` will automatically spawn a `lair` process if it doesn't find one running.
* **Holochain Launcher** is an end-user runtime, meant for finding, installing, and running hApps. It runs in a WebView container (currently Tauri, but we're migrating to Electron) which also hosts the UIs of installed hApps. Developers can also turn on 'developer mode' and publish their hApps to a built-in hApp store.
* **Holochain Launcher** is an end-user runtime, meant for finding, installing, and running hApps. It runs in an Electron webview container which also hosts the UIs of installed hApps. Developers can also turn on 'developer mode' and publish their hApps to a built-in hApp store.
* [Download the latest Launcher release from GitHub](https://github.com/holochain/launcher/releases)

## Libraries
Expand Down