Holochain Programming References
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.
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.
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.)
There are three main binaries. You can run any of these on the command-line with the
--help flag to get detailed documentation.
holochainis the Holochain runtime, or conductor.
hcis an all-purpose developer tool that:
lair-keystoreis Holochain’s keystore for generating and signing with cryptographically secure keys. Use this command for initialization, configuration, and running of a Lair keystore.