Skip to content

arkologystudio/holochain-stencil-template

Repository files navigation

Holochain Stencil Template

Starter template for a Holochain + Stencil app

N.B Network config needs updating for HC 0.2.4

Environment Setup

PREREQUISITE: set up the holochain development environment.

Note: this repository uses Holochain V1. To upgrade, see the HC upgrade guide

Enter the nix shell by running this in the root folder of the repository:

nix develop

Note: Run all the other instructions in this README from inside this nix-shell.

Install project dependencies across all workspaces/sub-directories

npm install

Note: For the app to run, you'll have to have at least one Holochain DNA with corresponding integrity and coordinator zome pairs. The holochain scaffold tool can be used to create them (see below). This template comes with a basic HelloWorld DNA and Zomes for reference.

Holochain scaffold commands

Note: The scaffold tool may ask you to choose a UI framework. Currently, none exist for Stencil so you may simply delete the generated components and develop your own.

Scaffold DNA

hc scaffold dna
hc scaffold zome
hc scaffold entry-type
hc scaffold collection

... etc

Running 2 agents

npm start

This will create a network of 2 nodes connected to each other and their respective UIs. It will also bring up the Holochain Playground for advanced introspection of the conductors.

Running the backend tests

npm test

Bootstrapping a network

Create a custom network of nodes connected to each other and their respective UIs with:

AGENTS=3 npm run network

Substitute the "3" for the number of nodes that you want to bootstrap in your network. This will also bring up the Holochain Playground for advanced introspection of the conductors.

Packaging

To package the web happ:

npm run package

You'll have the holochain-stencil-template.webhapp in workdir. This is what you should distribute so that the Holochain Launcher can install it. You will also have its subcomponent holochain-stencil-template.happ in the same folder`.

Documentation

This repository is using these tools: