Holochain Programming References
Rust HDK
When you write a Holochain application, the part that lives in Holochain is called a DNA. It runs in a WebAssembly sandbox and talks to the host, or conductor, through the host API. The Rust HDK (Holochain Development Kit) makes it easy for you to write your DNAs in the Rust programming language.
Conductor APIs
The conductor exposes two RPC APIs over WebSocket interfaces:
- The admin API lets application front-ends control the conductor to install DNAs, create agent IDs, combine a DNA and an agent ID into a running cell, and activate application RPC interfaces.
- The app API lets front-ends call a running cell’s functions and get information on the DNA bundle that the cell belongs to.
For both of these APIs, you make an RPC call sending a MessagePack-serialized request to the conductor over WebSocket and listening for a response. On the interface that exposes the app API, you can also listen for signals broadcast by cells.
For ergonomic interaction with those two API’s there are two client implementations: One in JavaScript and one in Rust. If you intend to develop Holochain Apps with a web-based UI, it is likely that all you’ll ever need is the JavaScript client.
Conductor configuration
The conductor has a few settings that can (and should) be configured via a YAML config file. We’ve provided documentation of the internal structures that hold this config; if you can picture how to serialize this to YAML in your mind, you can write a config file! (We promise we’ll produce a more readable config file guide soon.)
Binaries
There are three main binaries. You can run any of these on the command-line with the --help
flag to get detailed documentation.
holochain
is the Holochain runtime, or conductor.hc
is an all-purpose developer tool that:- packages a DNA manifest file and one or more zomes (in WASM bytecode) into a DNA bundle
- packages one or more DNAs into a hApp
- manages sandboxed Holochain conductors
- see holochain_cli docs for more info
lair-keystore
is Holochain’s keystore for generating and signing with cryptographically secure keys. Use this command for initialization, configuration, and running of a Lair keystore.