Quick Start

Last updated: January 21, 2019

Overview

Welcome to the Quick Start guide for getting started with Holochain development. It will guide you through installation. Once you've got things installed, or regardless, read on into a tutorial, the Holochain guidebook, and the API Reference to get going!

Prerequisites

Step One - Nodejs

Testing of Holochain apps is done in Javascript, executed by Nodejs. To run tests, you'll need Nodejs installed. Nodejs must be version 8 or higher to work. If you don't have it installed already, you can find great installation instructions here: https://nodejs.org

Step Two - Rust

In the future, you will be able to use a variety of languages to write Holochain applications. While the WebAssembly API is still being defined the only "HDK" library available, which simplifies Holochain development, is for Rust. Rust must be installed to your computer to develop with Holochain, and it must be the "nightly" toolchain. Platform specific instructions for installation follow:

Step Three - WebAssembly

Since Holochain code needs to be in WebAssembly, the Rust compilation "target" for WebAssembly is required. This just means that the Rust toolchain knows how to compile Rust code to WebAssembly. You will likely need to restart your terminal, or open a new one, before being able to run the following command. In a terminal, run:

rustup target add wasm32-unknown-unknown

Step Four - ZeroMQ

Being a P2P networking framework, Holochain utilizes a "distributed messaging" library internally called ZeroMQ. For the time being (it is hoped to change this in the future), this must be installed on your computer as well before Holochain can run. The version number that you install must be 4.1 or higher.

Networking Tools

The networking capabilities for Holochain have been developed as a library decoupled from the Rust core. At this time they are written in nodejs (another reason nodejs is a dependency above) and communicate with Holochain via IPC (inter process communication). There is a mock networking implementation in Holochain meaning that technically development of apps can happen without this library, but if you wish to use actual networking this library will be required.

The networking library is called "n3h".

To install it, download it from GitHub, and unzip it: https://github.com/holochain/n3h/releases/tag/v0.0.3

In a terminal, change directories to the downloaded and unzipped repository. Run:

npm install

npm run bootstrap

This means all the dependencies are installed. Finally, for now, just take note of the full path to the n3h folder on your computer, because you will be needing it later.

Development Tools Installation

If you wish to develop Holochain apps, you will want to install the Holochain developer command line tools.

Step One

When you go to Github, look for one of the downloads that starts with "cmd". Go to GitHub and download the appropriate release for your system.

Once you've downloaded it, unpack it, RENAME it "hc" and move the resulting folder to a directory on your computer where you'd like to keep these files long term. As a default, lets assume that it can be this folder called "hc", right under your $HOME or %USERPROFILE% (your user) directory. Now we will have to add this directory to your PATH variable, so that the binary becomes available within your command line. The instructions for this differ, depending on your platform. If you need help with this, read the relevant Help with PATHs section at the bottom of this page.

Windows Note

For the ZMQ dependency to work, move the file "libzmq-v140-mt-4_2_0.dll" that you downloaded into the same "hc" folder as the other files.

If you encounter issues with this, please discuss here.

Step Two

Once the steps for your platform are complete, to confirm that you have the Holochain developer command line tools installed, try running the following command:

hc --version

To read about the commands, and how to get started using them, check out the README for the "hc" command line tools.

Production Tools Installation

If you wish to have a way to run Holochain apps, beyond the simple way available in the development tools, you can do that with the holochain_container, which is capable of mounting configuration files that start up Holochain app instances.

Step One

When you go to Github, look for one of the downloads that starts with "container". Go to GitHub and download the appropriate release for your system.

Once you've downloaded it, unpack it, RENAME it "holochain_container" and move the resulting folder to a directory on your computer where you'd like to keep these files long term. As a default, lets assume that it can be this folder called "holochain_container", right under your $HOME or %USERPROFILE% (your user) directory. Now we will have to add this directory to your PATH variable, so that the binary becomes available within your command line. The instructions for this differ, depending on your platform. If you need help with this, read the relevant Help with PATHs section at the bottom of this page.

Windows Note

For the ZMQ dependency to work, move a copy of the file "libzmq-v140-mt-4_2_0.dll" that you downloaded into the same "holochain_container" folder as the other files.

If you encounter issues with this, please discuss here.

Step Two

To confirm that you have the Holochain container installed, try running the following command:

holochain_container --version

To read about the container, and how to get started using it, check out the README for the holochain_container.

Help With PATHs